Serial interrupt in pic16f877a

Status
Not open for further replies.

coolvasanth07

Member level 1
Joined
Sep 25, 2012
Messages
37
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Visit site
Activity points
1,506
Hi, i need help for serial interrupt coding....am using hi-tech c and pic16f877a...

>>thanks in advance....
 

If you mean SPI or I2C:
Set GIE/GIEH (bit 7 of INTCON register). Set PEIE/GIEL (bit 6 of INTCON register). Clear SSPIF (bit 3 of PIR1 register). Set SSPIE (bit 3 of PIE1 register). That's the setting for interrupt. Set up the MSSP module for required operation. Do the necessary actions in the ISR (Interrupt Service Routine).

If you mean UART:
Set GIE/GIEH (bit 7 of INTCON register). Set PEIE/GIEL (bit 6 of INTCON register). Clear TXIF (bit 4 of PIR1 register). Clear RCIF (bit 5 of PIR1 register). Set TXIE (bit 4 of PIE1 register) for transmission interrupt. Set RCIE (bit 5 of PIE1 register) for reception interrupt. Set up the USART module for required operation. Do the necessary actions in the ISR (Interrupt Service Routine).
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…