Re: reading analog signals on a MCU with only digital I/O



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
.



Relevant Pages

  • Re: Seaforth Tools
    ... Yes, and although we still don't have proper documentation of the chip, ... Well, presuming the simulator matches ... Also Jeff does read here, ...
    (comp.lang.forth)
  • Re: Seaforth Tools
    ... Yes, and although we still don't have proper documentation of the chip, ... at least looking at the simulator code ... Well, presuming the simulator matches ...
    (comp.lang.forth)
  • Re: iomapping a big endian area
    ... documentation: a chip that's documented as BE on BE has no remapping ... the same chip on LE would need this). ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)
  • Re: [PATCH] check_/request_region fixes & request for enlightenment
    ... You pass the same address and size you used to request the region. ... chip, so, I am not quite sure if it is safe here to just blindly configure ... > I've been digging for a while looking for some documentation on this, ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)