Re: reading analog signals on a MCU with only digital I/O
- From: Joe Strout <joe@xxxxxxxxxx>
- Date: Sat, 10 Mar 2007 14:06:07 -0700
In article <45F2545F.26C@xxxxxxxxxxxxxxxxxx>,
Gordon McComb <NOSPAMgort@xxxxxxxxxxxxxxxxxx> wrote:
Since the ARMexpress is something of a BASIC Stamp "compatible" device
you may want to read up on the documentation for the chip before
spending much more time on this. I think you'll find that like the BASIC
Stamp it supports an RCTIME statement that does exactly what the BASIC
Stamp does with the resistor/capacitor (hence "RC") measurement.
There's not a lot of accuracy with this approach, but it's not bad for
many tasks. For most anything else there are plenty of ADC chips out
there. This is a well-travelled road.
Seemed like it must be. I did indeed see RCTIME in the documentation,
but it didn't sound relevant. It says "Measure the time which pin
remains at *level*, returning the value to variable." It sounds the
same as PULSIN, except that it applies when the pin is already at the
specified level (low or high), whereas PULSIN waits for the next
transition to that level before starting its measurement.
But both RCTIME and PULSIN seem to measure the time at which a digital
input remains in a given state. How does that help me with analog
sensors?
An attempt to answer this very question myself (adding RCTIME to my
search terms) did turn up these, which look helpful:
<http://www.emesystems.com/BS2index.htm>
<http://www.emesystems.com/BS2rct.htm>
I think I see now -- this doesn't have its own resistor/capacitor
circuit inside the chip; instead you set up your own R/C circuit in such
a way that you can pull the pin low (discharging the capacitor?), and
then let it charge up again in a way that the charging time depends on
the voltage or resistance you're trying to measure. The RCTIME function
will then return how long this took to cross a threshold indicating a
digital "high" state. Clever!
I'll have to play with this a bit, but it sounds like a promising
approach when minimizing the component count is desired. Thanks again!
Best,
- Joe
.
- References:
- reading analog signals on a MCU with only digital I/O
- From: Joe Strout
- Re: reading analog signals on a MCU with only digital I/O
- From: Gordon McComb
- Re: reading analog signals on a MCU with only digital I/O
- From: Joe Strout
- Re: reading analog signals on a MCU with only digital I/O
- From: Gordon McComb
- reading analog signals on a MCU with only digital I/O
- Prev by Date: Re: pic microcontrollers and output
- Next by Date: Re: How to locate/track a high intensity laser pointer spot on a live video?
- Previous by thread: Re: reading analog signals on a MCU with only digital I/O
- Next by thread: Speech & Other Delays
- Index(es):
Relevant Pages
|