Sep 18, 2014 #1 H Harshal Dalal Newbie level 3 Joined Jul 23, 2014 Messages 4 Helped 0 Reputation 0 Reaction score 0 Trophy points 1 Activity points 23 I'm trying to communicate PIC18F4550 with biomed module. I'm very new to embeded My Module send a packet of 5 byte information continuously at 4800 baud, 1 stop, ODD parity. I've set my baud rate perfectly BRGH=1, BRG16=1. my main is Code: void main() { INTCON=0xC0; RCSTA=0x80; TXSTA=0x24; BAUDCON=0x08; PIE1bits.RCIE=1; IPR1bits.RCIP=1; SPBRGH=0x09; SPBRG=0xC3; RCSTAbits.CREN=1; } my isr is as Code: void uart_isr(void) { if(PIR1bits.RCIF=1) for(i=0;i<32;i++) { PORTD=RCREG; if(RCSTAbits.OERR) { PORTBbits.RB6=~PORTBbits.RB6; do{ temp = RCREG; temp = RCREG; temp = RCREG; RCSTAbits.CREN = 0; RCSTAbits.CREN = 1; }while(RCSTAbits.OERR); } PORTD=PORTD-32; buff[i]=PORTD; myMsDelay(15); } } } i'm getting lots of overrun. please suggest me some method to stop these error THANK YOU
I'm trying to communicate PIC18F4550 with biomed module. I'm very new to embeded My Module send a packet of 5 byte information continuously at 4800 baud, 1 stop, ODD parity. I've set my baud rate perfectly BRGH=1, BRG16=1. my main is Code: void main() { INTCON=0xC0; RCSTA=0x80; TXSTA=0x24; BAUDCON=0x08; PIE1bits.RCIE=1; IPR1bits.RCIP=1; SPBRGH=0x09; SPBRG=0xC3; RCSTAbits.CREN=1; } my isr is as Code: void uart_isr(void) { if(PIR1bits.RCIF=1) for(i=0;i<32;i++) { PORTD=RCREG; if(RCSTAbits.OERR) { PORTBbits.RB6=~PORTBbits.RB6; do{ temp = RCREG; temp = RCREG; temp = RCREG; RCSTAbits.CREN = 0; RCSTAbits.CREN = 1; }while(RCSTAbits.OERR); } PORTD=PORTD-32; buff[i]=PORTD; myMsDelay(15); } } } i'm getting lots of overrun. please suggest me some method to stop these error THANK YOU