CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Resistors

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
delene



Joined: 13 Oct 2003
Posts: 32

View user's profile Send private message Send e-mail

Resistors
PostPosted: Thu Nov 10, 2011 6:13 am     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Nov 10, 2011 1:28 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Nov 10, 2011 4:30 pm     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group