If the voltage threshold is a single fixed value, I would use an comparator interrupt with some basic filtering on the Voltage comparator input. This way you can do whatever you want during the time an Low-Voltage Alarm occur.
Still possible to use a Timer Based ADC reading... but you need to consider the ADC sampling time + Timer interrupt time in your latency.. so maybe not as this "almost instantly"
Another possible solution... use a zero-cross interrupt and read the voltage at ~0.707Vmax... not yet "almost instantly" either.
Last edited by mister_e; - 31st January 2009 at 23:48.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks