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.
Port bit test during a time delay
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Steve
- Matrix Staff
- Posts: 3433
- Joined: Tue Jan 03, 2006 3:59 pm
- Has thanked: 114 times
- Been thanked: 422 times
You could use the timer interrupt with a count variable to create the appropriate time delay - this would free up the processor to look at the i/o line.
Alternatively, use a count variable with a loop and a small delay (10 ms?) to generate your large delay times, and look at the input within this loop.
Alternatively, use a count variable with a loop and a small delay (10 ms?) to generate your large delay times, and look at the input within this loop.