SparkFun Forums 

Where electronics enthusiasts find answers.

Tips and questions relating to the GPS modules from SFE
By rdub
#146037
I am trying to change the baudrate to 4800. My C code is below.
After sending messages to the Venus I don't get any ACKs or NACKs. I get a lot of jibberish.

What is wrong with my code? Thanks in advance for any suggestions.

Quick summary of my code:
Initialize UART to 9600 baud;
Reset Venus;
Send "Config message type to binary";
Delay;
Send "Config baudrate to 4800";
Delay;
Send "Config message type to NMEA";
Delay;
Initialize UART to 4800;
Reset Venus;

My C code:
// UART1 communicates with the Venus638FLPx-L GPS module.
// Initialize UART1
initUART1(BAUD_9600);
// Reset the Venus GPS module
RESET_GPS = 0; for (i=0;i<10000;i++); RESET_GPS = 1;
// Configure the GPS module to send and receive binary messages
putchar(0xA0);
putchar(0xA1);
putchar(0x00);
putchar(0x03);
putchar(0x09); // Config message type
putchar(0x02); // Binary message type
putchar(0x00); // Update to SRAM
putchar(0x0B); // Checksum
// putchar(0x0D); // ***** My logic analyzer shows that
putchar(0x0A); // ***** putchar(0x0A) outputs 0x0D and 0x0A !!!
// Delay
for (i=0;i<60000;i++);
// Configure the GPS module for 4800 baud
putchar(0xA0);
putchar(0xA1);
putchar(0x00);
putchar(0x04);
putchar(0x05); // Config Serial Port
putchar(0x00); // COM1
putchar(0x00); // 4800 baud
putchar(0x01); // Update to both SRAM and FLASH
putchar(0x04); // Checksum
// putchar(0x0D);
putchar(0x0A);
// Delay
for (i=0;i<60000;i++);
// Configure the GPS module to send and receive NMEA messages
putchar(0xA0);
putchar(0xA1);
putchar(0x00);
putchar(0x03);
putchar(0x09); // Config message type
putchar(0x01); // NMEA message type
putchar(0x01); // Update to both SRAM and FLASH
putchar(0x09); // Checksum
// putchar(0x0D);
putchar(0x0A);
// Delay
for (i=0;i<60000;i++);
// Initialize UART1 to run at 4800 buad
initUART1(BAUD_4800);
// Reset the Venus GPS module
RESET_GPS = 0; for (i=0;i<10000;i++); RESET_GPS = 1;