Port bit test during a time delay
Posted: Sat May 05, 2007 2:58 pm
Running Flowcode V3 with 12F675.
I have the following working routine:
Read ADC channel 0 (0 to 255)
Convert ADC to time delay (1 to 10 Min's)
Run macro A
Start again.
I would like to know how to do bitwise test of a port (it Could be a port without an interrupt) during timing period, and if port is high then immediately stop timing and call a macro.
This is what I would like:
Read ADC channel 0 (0 to 255) e.g. 127
Convert ADC to time delay (1 to 10 Min's) e.g 5 Min's
Run macro A if port a2 has just gone high but still got 2 Min's delay left.
Run macro B if full delay ran since port a2 has stayed low e.g After 5 Min's
Start again.
Thank you.
I have the following working routine:
Read ADC channel 0 (0 to 255)
Convert ADC to time delay (1 to 10 Min's)
Run macro A
Start again.
I would like to know how to do bitwise test of a port (it Could be a port without an interrupt) during timing period, and if port is high then immediately stop timing and call a macro.
This is what I would like:
Read ADC channel 0 (0 to 255) e.g. 127
Convert ADC to time delay (1 to 10 Min's) e.g 5 Min's
Run macro A if port a2 has just gone high but still got 2 Min's delay left.
Run macro B if full delay ran since port a2 has stayed low e.g After 5 Min's
Start again.
Thank you.