[C.CC USERS] Precision monitoring of interrupts?

Matt Jadud matt at jadud.com
Sun Sep 30 16:26:31 BST 2012


Hi all,

I'm looking at a low-cost particle counter; here's a page written by
someone who has played with it on the Arduino:

http://www.howmuchsnow.com/arduino/airquality/grovedust/

The specific concern is that I need to monitor the amount of time the
sensor spends LOW during a 30 second window. The pulses are going to
be in the 10-90ms range. Does anyone have any thoughts as to how we
might best integrate this kind of measurement into the runtime (if we
should at all)?

At some level, this is the limitation of a VM on a 16MHz device. Using
digital.intput() I can get LEVELs on a channel, but the amount of time
it takes to come up from the interrupt handler, generate the message,
and send it through the scheduler is way too long. I could write an
FFI and compile it in... but, that leaves me with a rather specialized
TVM.

I've ordered two Teensy 3.0s, which are cheap (around $28), and run
at... 48MHz. That, and they have 128K of flash, meaning we could be
really gross, and include lots of FFIs for fast, low-level
interactions, and still not bloat out to the point that we would be
limiting the user.

Anyway, thoughts are appreciated. I can extend the VM if need be (a
"measure low" FFI), but I'd rather not.

Cheers,
Matt



More information about the users mailing list