Shop OBEX P1 Docs P2 Docs Learn Events
Interrupt OPTION — Parallax Forums

Interrupt OPTION

SamTheManSamTheMan Posts: 43
edited 2007-06-22 17:23 in General Discussion
I'm using "INTERRUPT 1000" so the SX will perform a task every 1ms and compiler sets the·OPTION for me
Now I need to disable the INTERRUPT·to initialize·other devices then I want to re-enable·the interrupt·again

I used this commands to disable the interrupt

·· temp=option
···temp=temp ^ %01000000
···option=temp
'
'
'

and I used this to re-enable it:

·· temp=option
·· temp=temp & %10111111
·· option=temp

when I use this commands set after the "Start:" label and before "Main:" label, the SX, hangs and does not work and I cannot even debug it!!
the debug freeze and never gives me the options to run of walk,.... (even-if I used the break command)

confused.gif

·How can I disable the INTERRUPT then re-enable it?


▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

Comments

  • BeanBean Posts: 8,129
    edited 2007-06-22 17:23
    The "temp = option" is not valid because the OPTION register is write only.

    Okay there IS a secret instruction that will read the option registers.
    Try replacing "temp = option" like this:

    \ DW $001 ' Put OPTION register into W "secret instruction"
    \ MOV temp,W
    temp=temp ^ %01000000
    option=temp


    \ DW $001 ' Put OPTION register into W "secret instruction"
    \ MOV temp,W
    temp=temp & %10111111
    option=temp


    I don't know if this will work, but in theory it should.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    “The United States is a nation of laws -· poorly written and randomly enforced.” - Frank Zappa

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    www.hittconsulting.com
    ·
Sign In or Register to comment.