Shop OBEX P1 Docs P2 Docs Learn Events
prescaler syntax ok? — Parallax Forums

prescaler syntax ok?

BebopALotBebopALot Posts: 79
edited 2006-02-14 03:02 in General Discussion
Hey folks I was trying to set the prescaler of my IRC to 1:2 but its not interrupting in the SX Sim when the RTCC is rolling over. Here is a code snippet:

IRC

:RTCCPSA Mov w, #%0000_0001
Mov RTCC, w ; initialize RTCC to 1
Mov w, #%1000_0001 ; reconfigure RTCC with PSA 1:4
Mov !option, w
Mov w, #%0000_0001
Reti ; configuration complete

Main
Jmp Main

Comments

  • BeanBean Posts: 8,129
    edited 2006-02-13 23:23
    The syntax is okay, but don't put the code to setup !option "IN" the interrupt routine...
    Only put the code you want executed at each interrupt in the interrupt routines.

    Put the setup code after "Main".

    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."
    ·
  • BebopALotBebopALot Posts: 79
    edited 2006-02-14 03:02
    The program dynamically reconfigures its interupts after a certain number of interupts. I guess I should move the reconfig part back out to the main body...its been working for part of the program.

    BBAL
Sign In or Register to comment.