-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GPS automatic baud rate detection #4
Comments
Could use one of following algorithms: STM32 boot loader baud rate detection"Bootloader measures the signal length between rising edge of first 1 bit in 0x7F to the falling edge of the last 1 bit in 0x7F to deduce the baudrate value" Source: STM32 microcontroller system memory boot mode First character received by the STM32 boot loader: First NMEA sentence sended by the GPS
The pattern to measure could be
Detect a pattern sended at differents speed// s is the first string received at 115200
switch (s) {
case 'OGN':
baudrate = 115200;
break;
case '`b#�':
baudrate = 57600;
break;
case '`sÌrÈ':
baudrate = 38400;
break;
…
}
If the GPS don't start with the same string, "simply" use a repeating pattern i.e. ( GPS Autobaud algorithm on Arduinohttps://github.com/rob42/FreeboardPLC_v1_2/blob/master/Gps.cpp#L89-L148 |
could be done by switching between several standard rates as long as no valid NMEA frames are detected. Once the NMEA frames start arriving the speed should stay.
Algorithm is easy and should achieve correct speed within 10-20 seconds.
It can be very convenient, as one needs not to check eveyr time if the GPS speed matched the configured tracker speed.
The text was updated successfully, but these errors were encountered: