Hi, I have a requirement as follows;

Wait for response on an ADC input; the trigger signal expected is around 1 volt, width of 2 ms. The moment it arrives, output a 500 ms pulse on another pin. Kind of a pulse stretcher (was thinking of using a CMOS 555, but want to avoid components and make it flexible). Very weak power supply available, so maximum consumption to be limited to 40 uA or so.

I tried this code, and it works perfect, except of course the consumption (no load) is around 800 uA.

TEST:;NAP 0
ADCIN 2, LEVEL
IF LEVEL > 5 THEN
DEBUG #LEVEL,13,10
HIGH LED
PAUSE 500
LOW LED
ENDIF
GOTO TEST

I snicked in a NAP 0 command, and it stops working; triggers once in a few events.

The NAP 0 works fine if I manually feed a wider pulse to the input trigger and consumption drops to 30 uA), so I guess its the narrow pulse that doesnt like the NAP command. Since the input transition is way less than 5 volts, I am using the pin as an ADC input.

So my question is, how can this be done best? I'd like to avoid using any extra passive components if I can.

Thanks and Regards,

Anand Dhuru