I have also been in a situation where I needed to read a pot with modest requirements... something like reading a brightness pot and dimming a display using the color lookup table palette on a pc104 app. I actually have a program that will read a pot charging a cap on a regular old input pin. The cap charges thru the variable resistor. I assume it goes hi at the logic threshold voltage. Then you change it to an output and discharge the cap. I used log and exp and a bunch of fp because it was on a pc. I guess you could use fp on a big avr to prove the concept, the make a table of time to charge cap vs resistance. Something like vcap = 5v*(1-exp(t/tau) where tau is the pot R and the cap value. Need to solve for R given t. This is doable in c no prob. Lets keep working on it. Do you need more than 6 bits? -----Original Message----- From: Marc R.J. Brevoort <mrjb@dnd.utwente.nl> To: AVR-Chat@yahoogroups.com Sent: Fri, Nov 27, 2009 4:26 pm Subject: Re: [AVR-Chat] C version of AVR400? On Mon, 23 Nov 2009, BobGardner@aol.com wrote: > Thats a really minimal a/d converter... its only 6 bits, doesnt have much range. If you had an 8 bit spi d/a converter you could use the analog comparator and have a nice accuate 8 bit successive approximation a/d with a real 0-5V range. That would mean ordering in DAC chips. But the olution feels 'chunky'. Using a DAC chip just o that I can do ADC using the analog comparator? 'd rather just buy an ADC chip then. But if 'm going to get additional components anyway, t would make more sense to me to choose a ifferent AVR- one that already has an ADC or several) built-in. Thanks for the suggestion, though. Best, arc ----------------------------------- Yahoo! Groups Links Individual Email | Traditional http://docs.yahoo.com/info/terms/ [Non-text portions of this message have been removed]
Message
Re: [AVR-Chat] C version of AVR400?
2009-11-27 by BobGardner@aol.com
Attachments
- No local attachments were found for this message.