I was using timer2 with the following code-
On interrupt Timer2Match call showtimex Inittimer2 6, 2 StartTimer 2
and everything works perfectly. I wanted to change to timer4 so I changed the code to
On interrupt Timer4Match call showtimex Inittimer4 6, 2 StartTimer 4
but it never triggers the interrupt. Is there something special you need to do for timer4?
I tried on both a 16F1938 and 16F18856 with the same results.
GCB version: ;Program compiled by Great Cow BASIC (0.98.06 2019-06-12 (Windows 32 bit))
My guess... you have optimsed the code and not enabled those timers.
#option Explicit #chip 16F18856, 32 On interrupt Timer4Match call showtimex Inittimer4 6, 2 StartTimer 4 sub showtimex end sub 'Optimise code #define USE_Timer0 false #define USE_Timer1 false #define USE_Timer2 true #define USE_Timer3 false #define USE_Timer4 true #define USE_Timer5 false #define USE_Timer6 false
Seems to work in the simulator.
Duh.
I was definately doing too many things at the same time yesterday.
I haven't said it enough, but
THANK YOU EVAN,
for all your patience and expertise.
I got my crystal ball out and guessed what you did... from another unrelated post!
@Jim. I was making a joke! :-)
?? Everything you said seemed okay to me. You were the one that told me about the "use_timerx false", I just forgot it was there at the end!
Log in to post a comment.
I was using timer2 with the following code-
and everything works perfectly. I wanted to change to timer4 so I changed the code to
but it never triggers the interrupt. Is there something special you need to do for timer4?
I tried on both a 16F1938 and 16F18856 with the same results.
GCB version:
;Program compiled by Great Cow BASIC (0.98.06 2019-06-12 (Windows 32 bit))
My guess... you have optimsed the code and not enabled those timers.
Seems to work in the simulator.
Duh.
I was definately doing too many things at the same time yesterday.
I haven't said it enough, but
THANK YOU EVAN,
for all your patience and expertise.
I got my crystal ball out and guessed what you did... from another unrelated post!
@Jim. I was making a joke! :-)
?? Everything you said seemed okay to me. You were the one that told me about the "use_timerx false", I just forgot it was there at the end!