pic interrupt question

Discussion in 'The Projects Forum' started by RobbJohnson, May 28, 2013.

  1. RobbJohnson

    Thread Starter Active Member

    Dec 15, 2009
    76
    0
    I am receiving rs232 data on a 16f873 via max232 on port RC7which does not have interupt.
    i only get data sometimes once a month sometimes 1 a second.

    Can I tie port RB4 which has intrupt-on-change to RC7 so i can use sleep?
     
  2. JohnInTX

    Moderator

    Jun 26, 2012
    2,338
    1,019
    Personally, I'd use the external interrupt pin to make it easier but RBIF would work as well as long as other RBx inputs won't interfere with the interrupt on change while you are sleeping.

    Pay attention to how to sleep the processor as described in Sec 14 of the datasheet. Clear the interrupt flag(s) and clear the WDT before sleeping. After waking, disable the interrupt and service it. Keep in mind that it takes 1024 oscillator cycles to begin processing after waking up and the UART will not be able to receive characters while sleeping / waking up. You will not be able to use the serial data that woke up the processor. Consider sending some dummy data or a BREAK to wake it up. Check the UART flags and clear any OERR/FERR after waking up.

    Have fun.
     
    RobbJohnson likes this.
  3. RobbJohnson

    Thread Starter Active Member

    Dec 15, 2009
    76
    0
    Thanks That's what i wanted to hear.
     
Loading...