Shop OBEX P1 Docs P2 Docs Learn Events
Interrupt Generation throught Output bits in the B-byte — Parallax Forums

Interrupt Generation throught Output bits in the B-byte

Matthias1Matthias1 Posts: 2
edited 2009-05-06 22:47 in General Discussion
Dear Users,

I am working with an SX 28 and using the interrupt feature on byte B. As you know, you only can set the whole byte for interrupts. I have only one input bit, that should trigger this interrupt. However, due to the limited amount of ports of the SX, I also use four pins as Output ports in the B byte. Could these Output pins also trigger an interrupt, as soon as they are set high?

Thanks a lot. I appreciate any help.

Matthias

Comments

  • JonnyMacJonnyMac Posts: 9,213
    edited 2009-05-06 19:03
    You are able to individually "arm" which bits on port B will trigger an interrupt with the WKEN_B register; a "1" bit in the register will disable the associated port B pin -- this will prevent an output pin from causing an interrupt.
  • Matthias1Matthias1 Posts: 2
    edited 2009-05-06 19:39
    [noparse]:)[/noparse] Thanks a lot.

    Can I then still use interrupt disabled pins as regular Input pins?
    Right now I have enabled Pin 0 as Interrupt Pin, and want to read Pin1. However, I cannot read any values (it is always 0).

    Also: somehow my interrupt now starts on both rising and falling edges. I have set the register to falling edge in the start of the program: WKED_B = %11111111 .
    What is wrong with that? It seems, this has changed, since I changed the encoder. I now use an US Digital E5 Kit with two Channel output and trigger Channel A on falling edge. Then I read Channel B and can find out in which direction the motor turns.

    Sincerely,

    Matthias

    Post Edited (Matthias1) : 5/6/2009 8:22:36 PM GMT
  • JonnyMacJonnyMac Posts: 9,213
    edited 2009-05-06 22:47
    You will help others help you by posting your actual code.
Sign In or Register to comment.