RTCC Interrupts
Vertex78
Posts: 51
I am having trouble getting interrupts to work when the rtcc register rolls over. I am using the sx28, and the sx-key to debug.
Here is my code, it's nothing fancy, it's to help me learn how to use interrupts on rtcc.
DEVICE sx28
DEVICE oschs3
IRC_CAL IRC_SLOW
reset init
freq 50000000 ; 50 MHz
org 0
;
isr
xor rb,rb
reti
;
init
mov !rb, #%00000000
mov rb, #%01010101
mov !option, #%10000000
main
mov RTCC, #$00
loop
;do nothing
jmp loop
Here is my code, it's nothing fancy, it's to help me learn how to use interrupts on rtcc.
DEVICE sx28
DEVICE oschs3
IRC_CAL IRC_SLOW
reset init
freq 50000000 ; 50 MHz
org 0
;
isr
xor rb,rb
reti
;
init
mov !rb, #%00000000
mov rb, #%01010101
mov !option, #%10000000
main
mov RTCC, #$00
loop
;do nothing
jmp loop
Comments
·· Are you trying to monitor the ISR while debugging?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
A couple points.
1) First of all you need to specify OPTIONX on the device line or else you won't get any interrupts.
2) Do you realize that XOR rb,rb is the same as CLR rb ? I think maybe you want XOR rb,#$FF.
3) Your !OPTION setting is for 1:2 prescaler.
4) When single stepping, the debugger will NOT execute the interrupt. But you can put a breakpoint in the interrupt and the debugger will stop at it.
I hope this helps...
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"SX-Video·Module" Now available from Parallax for only $28.95
http://www.parallax.com/detail.asp?product_id=30012
"SX-Video OSD module" Now available from Parallax for only·$49.95
http://www.parallax.com/detail.asp?product_id=30015
Product web site: www.sxvm.com
"Ability may get you to the top, but it takes character to keep you there."
·
···· ok, i missed this, why is it that this needs to be specified there?
2) Do you realize that XOR rb,rb is the same as CLR rb ? I think maybe you want XOR rb,#$FF.
···
···· Yeah thats what I meant to do, oops.
3) Your !OPTION setting is for 1:2 prescaler.
···· Yep, thats what I wanted to select, so that it would increment rtcc the quickest while debugging.
4) When single stepping, the debugger will NOT execute the interrupt. But you can put a breakpoint in the interrupt and the debugger will stop at it.
··· I did not realize this. So if I put a break in my interrupt routine then it will execute the break statement.
Thanks, when I get home from class today I will try these changes out and see what I get.