prescaler syntax ok?
BebopALot
Posts: 79
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
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
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."
·
BBAL