View previous topic :: View next topic |
Author |
Message |
delene
Joined: 13 Oct 2003 Posts: 32
|
Resistors |
Posted: Thu Nov 10, 2011 6:13 am |
|
|
If I have one load cell connected to my board I want to use this resistor value and enable pin_a0.
If I have two load cells connected to my board, I want to this resistor value and enable pin_a1.
And the same if I have 3, 4, 6 or 8 load cells connected.
Is it possible to use io lines to determine which resistors are enable/used?
If not, what can I use to do this? |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Nov 10, 2011 1:28 pm |
|
|
Why can't you just record the information in a variable ? You could
have a bitmask variable (one byte) that is a copy of PortA. When you
set Pin A0 high, then set bit 0 in the variable to 1. When you set Pin A0
low, then set bit 0 in the variable to 0.
What PIC are you using ? (Always post your PIC, because the answer
can be different, depending on your PIC). |
|
|
SherpaDoug
Joined: 07 Sep 2003 Posts: 1640 Location: Cape Cod Mass USA
|
|
Posted: Thu Nov 10, 2011 4:30 pm |
|
|
I am not sure I understand your problem, but this may help. If you want to pick one of several resistors to connect from a node to either PIC VDD or VSS, you can connect all the resistors to PIC I/O pins. Then set all the pins to Hi-Z except the pin for the resistor you want which you set to 1 or 0. The other resistors will be floating at the PIC end and effectively out of the circuit. Just make sure the unused resistor voltages are OK for the PIC pins. _________________ The search for better is endless. Instead simply find very good and get the job done. |
|
|
|