Dear all,
I know interrupts are not the most favorite topic around here . Anyway, I have debugged things as far as I could and it still does not work as I expect it to (maybe wrongly), so here is the question.
I'm trying to count pulses on C.0 on 40X2 and interrupt on certain number of them counted. I can see pulses happening on the scope, I can measure them to the same as on the scope with pulsin and I can see the timer variable increment as expected, but no interrupt ever happens. The pulses are about 1.1ms long, code below.
What did I do wrong?
Thank you for your time,
Edmunds
I know interrupts are not the most favorite topic around here . Anyway, I have debugged things as far as I could and it still does not work as I expect it to (maybe wrongly), so here is the question.
I'm trying to count pulses on C.0 on 40X2 and interrupt on certain number of them counted. I can see pulses happening on the scope, I can measure them to the same as on the scope with pulsin and I can see the timer variable increment as expected, but no interrupt ever happens. The pulses are about 1.1ms long, code below.
Code:
[color=Blue]setfreq em64
setintflags [/color][color=Navy]%10000000[/color][color=Black], [/color][color=Navy]%10000000[/color]
[color=Blue]settimer count [/color][color=Navy]65000 [/color][color=Green]'Timer in count mode, preload to increment on every x pulse[/color]
[color=Blue]high C.2
low D.5[/color]
[color=Black]main:[/color]
[color=Green]; pulsin C.0,1,w0
; sertxd(#w0,LF,CR)
[/color][color=Blue]pause [/color][color=Navy]200[/color]
[color=Blue]goto [/color][color=Black]main[/color]
[color=Blue]interrupt:
[/color][color=Purple]toflag [/color][color=DarkCyan]= [/color][color=Navy]0
[/color][color=Blue]inc [/color][color=Purple]b0
[/color][color=Blue]sertxd ([/color][color=Black]#[/color][color=Purple]b0[/color][color=Black],[/color][color=Red]"."[/color][color=Black],#[/color][color=Purple]timer[/color][color=Black], [/color][color=Blue]LF[/color][color=Black], [/color][color=Blue]CR)
setintflags [/color][color=Navy]%10000000[/color][color=Black], [/color][color=Navy]%10000000[/color]
[color=Blue]return[/color]
What did I do wrong?
Thank you for your time,
Edmunds