So I’ve never used GPS chips and have limited experience with serial/UART, and am having limited success. It’s an interesting setup some of you may enjoy tring to help me problem-solve… Thanks in advance.
So eventually the LPS-2138 will read the GPS via UART1, and parse the data. Parsed data will then be used by the LPC-2138. In addition the LPC-2138 will have a serial link to a PC on UART0.
The PC ↔ LPC serial link works great, and I can change baud-rates, etc on both PC and LPC. With mix-matched baud-rates you get a repeatable gibberish.
Now I have a software relay on the LPC-2138 for sending the GPS output to the PC’s serial port… to learn to interact with the GPS via serial before programming the LPC to do the same. This software relay / character encoding must be my problem, as no matter what baud rate I tell the LPC to talk to the GPS with, I get gibberish. Repeatable gibberish at a baud-rate of 4800 as the GPS puts out by default.
EM-408 GPS module connected to LPC-2138 on UART1 at 4800.
I’m using the UART headers from the Winarm examples. If you have them, my code is based on their LPC2138 uart example.
This works to send test from LPC to PC:
uart0Puts(“\r\nHello World! (UART0)\r\n”);
I feel like this should, but doesn’t work to relay GPS characters to the PC:
int ch;
while(1){
if ((ch = uart1Getch()) >= 0) {
- uart0Putch(ch);*
}
}
//it relays a bunch of characters in what seems to be bursts of ~50 but it’s all gibberish with generally a lot of braces and N’s, as well as a filled oval with a cutout “?” in the center.
further investigation shows that uart0Putch(“h”) and uart0Puts(“h”) both display the wrong character on the PC… hmm… I feel so close, but can’t figure out the (character encoding?) problem.
Thanks for any help or suggestions on how to track this problem down!