Shop OBEX P1 Docs P2 Docs Learn Events
RTCC Interrupts — Parallax Forums

RTCC Interrupts

Vertex78Vertex78 Posts: 51
edited 2006-02-24 20:51 in General Discussion
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

Comments

  • KiwiKiwi Posts: 85
    edited 2006-02-24 13:15
    you can use one of the manuals on the parallax website, it is named ExploringTheSx+Basic.pdf, very good book.
  • Vertex78Vertex78 Posts: 51
    edited 2006-02-24 13:53
    Yeah I have read the section on rtcc in it and what I have done should work but it does not. So obviously I am doing something wrong. Hopefully someone here can point it out to me.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-02-24 15:40
    Vertex78,

    ·· Are you trying to monitor the ISR while debugging?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • Vertex78Vertex78 Posts: 51
    edited 2006-02-24 15:55
    Yes I am. Is that a no go while debugging? If so, then this should work just fine if I am running it without the debugger?
  • BeanBean Posts: 8,129
    edited 2006-02-24 16:22
    Vertex78,
    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."
    ·
  • Vertex78Vertex78 Posts: 51
    edited 2006-02-24 17:14
    Bean (Hitt Consulting) said...
    Vertex78,
    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.

    1) First of all you need to specify OPTIONX on the device line or else you won't get any interrupts.
    ···· 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.
  • Vertex78Vertex78 Posts: 51
    edited 2006-02-24 20:51
    ok, thanks guys I have it working now!
Sign In or Register to comment.