Do you have a question? Post it now! No Registration Necessary
- Posted on
January 23, 2008, 11:25 am
rate this thread
5 out of 5
5 out of 5
Microchip PIC 18f8722 USART2 Interrupt is not working - I have USART1
working fine with interrupts but cannot get interrupt on usart2 - the
RC2IF interrupt flag never gets set although data is coming into the
rcreg2 register and i can read from it.
Is there any special considerations I need to take into account?
Global INT flag is enabled as well as all INTs on High priority. Code
is exactly the same as that of usart1 but usart2 INT flag never gets
Any help greatly appreciated!
Re: Microchip PIC 18f8722 USART2 Interrupt Problem
How do you know that the interrupt flag is not being set? Generally
speaking, on PICs the interrupt flags are set regardless of whether the
interrupt is enabled. IOW, RC2IF should get set when data arrives because
there is nothing that you can configure to prevent it from happening. Do
you have the RC2IE flag set? You have to have the peripheral interrupts
enabled as well, but you must have or the other USART wouldn't be working.
How about the priority level assignment in IPR3?
IMO, the PIC is not seeing any data or you don't actually have the interrupt
enabled. Generally speaking again, PICs will refuse to receive data on a
USART if there is an error flag set such as "receive overrun" or "framing
error". Either that or your problem lies in PIR3, PIE3, or IPR3.
- » IWOMP 2017 - 13th International Workshop on OpenMP - Extended submission deadline
- — The site's Last Updated Thread. Posted in » Embedded Programming