Shop OBEX P1 Docs P2 Docs Learn Events
SX/B interrupt disable — Parallax Forums

SX/B interrupt disable

RsadeikaRsadeika Posts: 3,837
edited 2006-10-18 17:49 in General Discussion
I have attached a program that can be used as a starting point. My question, after reading through the SX/B help file I did not notice a command or an instruction that disables the interrupt after an option = $xx has been implemented. So, for example, in my program, how would I disable the interrupt while the pulsin subroutine runs, and then how would I turn the interrupt back on.

thanks

Ray

Comments

  • BeanBean Posts: 8,129
    edited 2006-10-18 17:31
    Ray,
    If you using OPTION=$88 to enable interrupts then OPTION=$C8 will disable interrupts.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap used 4-digit LED display with driver IC·www.hc4led.com

    Low power SD Data Logger www.sddatalogger.com
    SX-Video Display Modules www.sxvm.com

    "People who are willing to trade their freedom for·security deserve neither and will lose both." Benjamin Franklin
    ·
  • Sparks-R-FunSparks-R-Fun Posts: 388
    edited 2006-10-18 17:49
    Ray,

    Do you have Gunther's book? As others can testify, it is a very handy reference. On page 225 of the second edition he makes clear that bit 6 of the Option register is the "main switch" to turn interrupts on or off. (0 = Enabled, 1 = Disabled) For your code, this is the Option bit that you need to change.

    To turn interrupts on use:
    OPTION = %10001000

    To turn interrupts off use:
    OPTION = %11001000

    Those are the same as the hex values given by Bean. I wanted to explain a little how they were obtained. Obviously the other bits in the Option register have meaning as well, so be sure to check those out if they are of interest.

    - Sparks
Sign In or Register to comment.