So I decided to jump in to serial communication. Why not? I have a ublox LEA-5H-0-009 GPS Receiver and a GS407 break out board from sparkfun.com. I connected the red (3.3v) and the black (gnd) from the GPS to the netduino. There is a TXO and RXI pin and a GPIO pin on the GPS break out board (BOB). I admit, I had to google a lot.. I mean a LOT to figure this one out. Eventually I found a great article from blog.bobcravens.com with 99.9999% of the solution.

I learned a lot about serial communication from reading Bob’s article. In summary, what I learned is that I can use D0 and D1 on my netduino as a serial port COM1. D0 is COM1 IN or RX and D1 is COM1 OUT or TX. The last piece of the puzzle was the GPIO pin on the GPS. Clueless me had no idea what to do with the GPIO pin. After reading his blog, it seems that is used to turn on and off the power.
Here are a few better views of the connections. Ignore the IC chip and the three axis sensor on the project board.


When I first connected the device I was getting nothing from it because the TX and RX were flipped. Then, I started getting bytes from the serial port but they were poorly formatted and I could not convert them to UTF. This caused errors when using the System.Text.UTF8Encoding.UTF8.GetChars(buffer); code. As it turns out the baud rate needed to be 9600 and I had it at 4800. After that fix I was set and I was getting NEMA messages.
$GPRMC,,V,,,,,,,,,,N*53
$GPVTG,,,,,,,,,N*30
$GPGGA,,,,,,0,00,99.99,,,,,,*48
$GPGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*3
0
$GPGSV,1,1,00*79
$GPGLL,,,,,,V,N*64
$GPRMC,,V,,,,,,,,,,N*53
$GPVTG,,,
,,,,,,N*30
$GPGGA,,,,,,0,00,99.99,,,,,,*48
$GPGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*30
$GPGSV,1
,1,00*79
$GPGLL,,,,,,V,N*64
It does not look like it is picking up a signal yet but that is my next step. Get the messages decoded and get the device to lock on a few satellites.
Here is the code I used which I got from Bob’s post and tweaked a bit as I was running into issues decoding the bytes because of the baud rate issue.
public static void Main()
{
SerialPort serialPort = new SerialPort("COM1", 9600, Parity.None, 8, StopBits.One);
serialPort.Open();
// pin D2 off = gps module turned on
OutputPort powerPin = new OutputPort(Pins.GPIO_PIN_D2, false);
char[] str = null;
while (true)
{
int bytesToRead = serialPort.BytesToRead;
if (bytesToRead > 0)
{
// get the waiting data
byte[] buffer = new byte[bytesToRead];
serialPort.Read(buffer, 0, buffer.Length);
// print out our received data
try
{
str = System.Text.UTF8Encoding.UTF8.GetChars(buffer);
}
catch { }
if ( str != null )
Debug.Print(new String(str));
}
Thread.Sleep(100); // wait a bit so we get a few bytes at a time...
}
}
}