hi This may have been posted earlier sry.
I have a digital input on input 0 of 18X. I would like to trigger an interrupt when a '1' arrives. (I've managed to do that bit.) And then count the number of subsequent ones. there are several possible 8 bit sequences coming through.
1
01
011
0111
01111
011111
0111111
1111111
(yes variable lengths)
I tried putting in pulsin in the Interrupt sub routine but when simulating there was nothing stored in the variable b0 i used. i also tried w0. but nothing stored.
The following is my test program:
'**********************************************
Init:
let b0 = 0
let pins = %00000000
setint %00000001,%00000001
Main:
goto Main
Interrupt:
let pins = %00000001
pulsin 0,1,w0
setint %00000001,%00000001
return
'**********************************************
i think i'm using it wrong. not sure
THanks for the help in advance
I have a digital input on input 0 of 18X. I would like to trigger an interrupt when a '1' arrives. (I've managed to do that bit.) And then count the number of subsequent ones. there are several possible 8 bit sequences coming through.
1
01
011
0111
01111
011111
0111111
1111111
(yes variable lengths)
I tried putting in pulsin in the Interrupt sub routine but when simulating there was nothing stored in the variable b0 i used. i also tried w0. but nothing stored.
The following is my test program:
'**********************************************
Init:
let b0 = 0
let pins = %00000000
setint %00000001,%00000001
Main:
goto Main
Interrupt:
let pins = %00000001
pulsin 0,1,w0
setint %00000001,%00000001
return
'**********************************************
i think i'm using it wrong. not sure
THanks for the help in advance