Naumanpak
Member level 2
Experts,
I am receiving serial data from a GPS module that is NMEA streams. Then displaying on LCD.
Streams are received but the error rate is significantly high, almost 2-3 dummy values per line..
I have done this on 8051 with no errors but struggling with PIC.
Here is my code, please suggest.
thanks!!
I am receiving serial data from a GPS module that is NMEA streams. Then displaying on LCD.
Streams are received but the error rate is significantly high, almost 2-3 dummy values per line..
I have done this on 8051 with no errors but struggling with PIC.
Here is my code, please suggest.
Code:
void main()
{
unsigned int i=0,j=0;
TRISB = 0;
TRISC.RC7=1;
Lcd_Init(&PORTB);
Lcd_Cmd(Lcd_CLEAR);
Lcd_Cmd(Lcd_CURSOR_OFF);
[b]SPBRG=0x26;[/b]
TXSTA.SYNC=0;
RCSTA.SPEN=1;
PIE1.RCIE=0;
RCSTA.RX9=0;
RCSTA.CREN=1;
RCSTA.RX9=0;
while (1)
{
while(!PIR1.RCIF){;}
ch=RCREG;
PIR1.RCIF=0;
Lcd_Chr_Cp(ch);
}
}
thanks!!