|
View:
New views
4 Messages
—
Rating Filter:
Alert me
|
|
|
Using an ADC input instead of jumpers?I know that you can use a ADC input and a series of resistors in place of
jumpers (if you are short on input pins). My questions are * how many "jumpers" can you reliable read with a 10-bit ADC? * can you use arbitrary bit patterns? * suggestions for resistor values? Thanks, Bil -- Psst... Hey, you... Buddy... Want a kitten? straycatblues.petfinder.org -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist |
|
|
Re: Using an ADC input instead of jumpers?William Couture wrote:
> I know that you can use a ADC input and a series of resistors in place of > jumpers (if you are short on input pins). > > My questions are > * how many "jumpers" can you reliable read with a 10-bit ADC? LOTS. Depends on the precision of your resistors and the contact resistance. 8 if you can get 0.1% precision Rs. (256 states) > * can you use arbitrary bit patterns? Yes. You basically build an R-2R DAC out of discrete Rs. Or use a real DAC with the jumpers being your DAC input word. Then 10 bits is theoretically possible. 9 pins is probably doable. 8 is no problem. > * suggestions for resistor values? Depends on what your power management needs are. Strobing it a good way to save power. You could also try using a shift register to read as many bits as you like. It's doabale with just 2 pins. You use an RC network off the clock out to strobe in the current data (74HC595 for example). There is also a way to do it (shift register reading) with just ONE pin, but that's one for a 'design ideas' submission. Robert -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist |
|
|
Re: Using an ADC input instead of jumpers?> I know that you can use a ADC input and a series of resistors in place of > jumpers (if you are short on input pins). > > My questions are > * how many "jumpers" can you reliable read with a 10-bit ADC? > * can you use arbitrary bit patterns? > * suggestions for resistor values? > > Thanks, > Bil I've used a voltage divider driving momentary switches in to an ADC input to read switches. The signal was "looped through" the normally closed contacts of switches higher in the chain so closing more than one switch would not short stuff out (the switches were prioritized by their wiring). I've done this with 15 switches. Since this is one of 15 (plus none), it corresponds to 4 bits. I believe you could go a ways beyond this, though tolerances could cause problems. Use of a resistor network instead of individual resistors helps. For binary coding, you could use an R-2R network and have jumpers select between ground and Vref. I like for my designs to be able to report the board revision number. Now and then there's a firmware decision based on board revision, but it's usually just a "notify the user" thing so support knows what the customer has. I've done this with 0 ohm resistors setting a bit pattern on input pins. In my latest design, though, I just have a 10k pull up on an ADC input with room for various pull down resistors. As the board is revised, I'll put in different pull-down resistors and be able do determine the board revision by reading the ADC voltage. Harold -- FCC Rules Updated Daily at http://www.hallikainen.com - Advertising opportunities available! -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist |
|
|
Re: Using an ADC input instead of jumpers?On 10/13/09, Robert Rolf <Robert.Rolf@...> wrote:
> William Couture wrote: > > > I know that you can use a ADC input and a series of resistors in place of > > jumpers (if you are short on input pins). > > > > My questions are > > * how many "jumpers" can you reliable read with a 10-bit ADC? > > LOTS. Depends on the precision of your resistors and the contact > resistance. 8 if you can get 0.1% precision Rs. (256 states) Depends by the noise on your board (AKA driving motors, relays, triacs or other noisy stuff). I've seen situations when 8 bit AD (from a 10 bit converter) can't be safetly used unless everything driven is OFF. Vasile -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist |
| Free embeddable forum powered by Nabble | Forum Help |