This example establishes a transparent link between the mbed seial port and the gps on the C027. You can use it to use the standard u-blox tools such as u-center. These tools can then connect to the serial port and talk directly to the GPS receiver. Baudrate should be set to 9600 baud and is fixed. u-center can be downloaded from u-blox website following this link: http://www.u-blox.com/en/evaluation-tools-a-software/u-center/u-center.html

Dependencies:   mbed

Install mbed Windows Drivers

Make sure you installed the drivers on your windows PC to get the virtual serial port. A installation guideline and the drivers can be found in the following wiki page. /handbook/Windows-serial-configuration

Committer:
mazgch
Date:
Tue Oct 22 21:21:46 2013 +0000
Revision:
0:7f124c0a351a
Child:
1:0d32baf4a645
Simple transparent serial port to the gps receiver,

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mazgch 0:7f124c0a351a 1 #include "mbed.h"
mazgch 0:7f124c0a351a 2 #include "C027_PinNames.h"
mazgch 0:7f124c0a351a 3
mazgch 0:7f124c0a351a 4 int main()
mazgch 0:7f124c0a351a 5 {
mazgch 0:7f124c0a351a 6 // open the gps serial port
mazgch 0:7f124c0a351a 7 Serial gps(GPSTXD, GPSRXD);
mazgch 0:7f124c0a351a 8 gps.baud(GPSBAUD);
mazgch 0:7f124c0a351a 9
mazgch 0:7f124c0a351a 10 // open the PC serial port and (use the same baudrate)
mazgch 0:7f124c0a351a 11 Serial pc(USBTX, USBRX);
mazgch 0:7f124c0a351a 12 pc.baud(GPSBAUD);
mazgch 0:7f124c0a351a 13
mazgch 0:7f124c0a351a 14 while (1)
mazgch 0:7f124c0a351a 15 {
mazgch 0:7f124c0a351a 16 // transfer data from pc to gps
mazgch 0:7f124c0a351a 17 if (pc.readable() && gps.writeable())
mazgch 0:7f124c0a351a 18 gps.putc(pc.getc());
mazgch 0:7f124c0a351a 19 // transfer data from gps to pc
mazgch 0:7f124c0a351a 20 if (gps.readable() && pc.writeable())
mazgch 0:7f124c0a351a 21 pc.putc(gps.getc());
mazgch 0:7f124c0a351a 22 }
mazgch 0:7f124c0a351a 23 }