Will a comparator interrupt a pause on the 28x2, or is it a case of it being polled after the pause. not worried about the pause after the interrupt has been called.
this is the section of code I am thinking about using this on a 28x2 @16mhz - although I am not 100% happy with the double loop exit, seems a little clunky but should work, in theory at least
if the general consensus is that it will work I will test it when I get home later, else I will go to an incrementing loop of small pauses similar to this (this runs on a 08m2@16mhz), just without the extra sense variable.
this is the section of code I am thinking about using this on a 28x2 @16mhz - although I am not 100% happy with the double loop exit, seems a little clunky but should work, in theory at least
Code:
[color=Blue]do
let [/color][color=Purple]tempbyte [/color][color=DarkCyan]= [/color][color=Navy]0
[/color][color=Blue]do while [/color][color=Purple]tempbyte [/color][color=DarkCyan]< [/color][color=Navy]128
[/color][color=Blue]readadc [/color][color=Navy]0[/color][color=Black], [/color][color=Purple]tempbyte
[/color][color=Blue]if [/color][color=Purple]row1 [/color][color=DarkCyan]= [/color][color=Navy]1 [/color][color=Blue]then exit
loop
if [/color][color=Purple]row1 [/color][color=DarkCyan]= [/color][color=Navy]1 [/color][color=Blue]then exit
high focus
setintflags [/color][color=Navy]%00010000[/color][color=Black], [/color][color=Navy]%00010000 [/color][color=Green]'set comparator interrupt flag
[/color][color=Blue]pause [/color][color=Purple]time_out
[/color][color=Blue]setintflags off
low focus
loop[/color]
Code:
[color=Blue]do while [/color][color=Purple]loopnumber [/color][color=DarkCyan]< [/color][color=Purple]time_out [/color][color=DarkCyan]and [/color][color=Purple]sense [/color][color=DarkCyan]= [/color][color=Navy]0
[/color][color=Blue]inc [/color][color=Purple]loopnumber
[/color][color=Blue]pauseus [/color][color=Navy]102
[/color][color=Blue]loop[/color]