2019-11-04 02:07 AM
Hello everyone, I have got a problem but I can't resolve it.
I made a project read NMEA string from UART and show it to OLED 128x64 (I2C interface) with STM8s003F3P6. everything is OK when I tried to get GPS strings from UART and store them variable , with OLED also ok and I can show everything on it . But when I combine 2 libs(GPS parsing and OLED disp) I got very strange thing!. After power on, the circuit show all GPS data I need , it run few seconds and auto reset STM chip, all is restart and repeated same way?
I can't find where error, maybe stack overflow?
the code flow follow:
UART_ISR()
{
newdata = get_GPS_data(); //get NMEA string , when get all, newdata = 1
}
main()
{
while(1)
{
if(newdata)
{
newdata = 0;
pro = GPS_parse(); //parsing GPS data and storge into variable
If(pro) //handled afer 2 sec (the UART received NMEA 2s period)
{
//pro = 0;
_disable_interrupt();
OLED_show(); //show data on OLED
_enable_interrupt();
}
}
}
please help!