I'm obviously missing something here but I would expect W1 in the following code to = 0 until it sees 8 pulses within a period of 5 seconds. I'm simulating the pulses by click toggling C.1 in the simulator. For some odd reason W1 = 32000 immediately after starting the simulator, whether or not I've toggled C.1 or not. What have I missed here?
Thanks,
Chris
Thanks,
Chris
Code:
main:
Count C.1, 5000, W1 ; count pulses in 5secs (at 4MHz)
If W1 > 8 Then
High C.2
Else
; Low C.2
End If
goto main ; loop back to start