Connecting an I2C GPS Module to the RM1xx

Connecting an I2C GPS Module to the RM1xx
A
Connecting an I2C GPS Module to the RM1xx
RM1xx Series
Application Note
v1.0
INTRODUCTION
In this application note, we connect a GPS module to the RM1xx and use a smartBASIC script to process the GPS
data. We have chosen to use the NEO-6 GPS receiver with an I2C-GPS NAV module. Most GPS receivers like this
one communicate via UART. Since the RM1xx device has only a single UART, we use the I2C-GPS NAV module to
communicate with the GPS receiver using I2C. This module parses the UART output from the GPS receiver and
stores the data to be retrieved by the RM1xx using the I2C bus.
REQUIREMENTS






Arduino IDE (for programming the I2C-GPS NAV module)
I2C GPS NAV Source Code
DVK-RM186 or DVK-RM191 development board
FTDI USB to RS232 cable (more information may be found at FTDI’s website)
UwTerminalX, available from Laird (v1.03 or later recommended)
smartBASIC sample applications gps.sb and regdef.gps.net6.i2c.sb, available at:
https://github.com/LairdCP/RM1xx-Applications
INITIAL SETUP
Programming the I2C-GPS NAV Module
The GPS receiver comes preprogrammed and configured. The I2C-GPS NAV module must be programmed using
the Arduino IDE and the following source code:
https://code.google.com/p/i2c-gps-nav/
You must modify the config.h file to specify the format of data coming from the GPS receiver, the UART baud rate,
and I2C address for the slave device. In this case, we are using NMEA data coming from the GPS receiver at 9600
baud and the I2C address of 0x20. Do this by changing the values of #define I2C_ADDRESS and #define
GPS_SERIAL_SPEED as shown in Figure 1.
Embedded Wireless Solutions Support Center:
http://ews-support.lairdtech.com
www.lairdtech.com/wireless
1
© Copyright 2015 Laird. All Rights Reserved
Americas: +1-800-492-2320
Europe: +44-1628-858-940
Hong Kong: +852 2923 0600
Connecting a GPS module to the RM1xx
Application Note
Figure 1: Modified Config.h file
Connect the FTDI USB to RS232 cable from the USB port of your PC to the I2C-GPS NAV module (wiring shown in
Figure 2). Then select the Arduino Pro Mini in the Arduino IDE and upload the I2C-GPS NAV source code to the
I2C-GPS NAV module.
Figure 2: FTDI USB-to-RS232 cable
Optionally, the RS232 cable can be used to verify the settings on the GPS receiver as well. Connect the Tx, Rx, Vcc
and Gnd lines as shown in Figure 3.
Figure 3: Connected Tx, Rx, Vcc, and Gnd lines
Embedded Wireless Solutions Support Center:
http://ews-support.lairdtech.com
www.lairdtech.com/wireless
2
© Copyright 2016 Laird. All Rights Reserved
Americas: +1-800-492-2320
Europe: +44-1628-858-940
Hong Kong: +852 2923 0610
Connecting a GPS module to the RM1xx
Application Note
Hardware Setup
In order to use the GPS with the RM1xx Development kit, you must connect the GPS to the I2C-GPS NAV module
and then connect the I2C-GPS NAV module to the development kit board as shown in Figure 4 and Figure 5.
Figure 4: Connecting the GPS to the I2C-GPS NAV module
Figure 5: Connecting the I2C-GPS NAV module to the BT900 Development Kit
Embedded Wireless Solutions Support Center:
http://ews-support.lairdtech.com
www.lairdtech.com/wireless
3
© Copyright 2016 Laird. All Rights Reserved
Americas: +1-800-492-2320
Europe: +44-1628-858-940
Hong Kong: +852 2923 0610
Connecting a GPS module to the RM1xx
Application Note
MONITORING GPS DATA
To monitor the serial data, we use the sample RM1xx I2C-GPS smartBASIC script included in the appendix of this
application note. Once the script is running on the RM1xx, the application continues to search for GPS signals and
acquires GPS data in an automated loop.
To do so, complete the following steps:
1. Download gps.sb and regdef.gps.net6.i2c.sb from https://github.com/LairdCP/RM1xx-Applications to a
directory on your PC. They must be saved in the same directory.
2. Connect the RM1xx development board to your PC via the included USB micro cable.
3. Power your development board.
4. Launch UwTerminalX.
5. On the Update tab within the UwTerminalX pane, click Check for Updates to ensure you’re using the
latest version of UwTerminalX with support for the RM1xx Series.
6. In the Config tab from the Device drop-down menu, select either RM186 or RM191 based on your setup.
7. Select the correct port to which your development board is connected.
8. Click OK to proceed to the Terminal tab.
9. Hit Enter on your keyboard. If you see the return 00, you are successfully connected.
10. Right-click in the terminal window; in the context menu, click XCompile + Load.
11. In the file selector window, select gps.sb and click Open.
12. When the terminal displays 00, the compiler is successfully finished.
13. Type at+dir and press Enter. You should see gps in the file list.
14. To run the GPS script, type gps and press Enter.
Output from the GPS receiver should look as is shown in Figure 6:
Figure 6: Output of GPS data
Embedded Wireless Solutions Support Center:
http://ews-support.lairdtech.com
www.lairdtech.com/wireless
4
© Copyright 2016 Laird. All Rights Reserved
Americas: +1-800-492-2320
Europe: +44-1628-858-940
Hong Kong: +852 2923 0610
Connecting a GPS module to the RM1xx
Application Note
REVISION HISTORY
Version
1.0
Date
20 May 2016
Notes
Initial Release
Approver
Tim Carney
© Copyright 2016 Laird. All Rights Reserved. Patent pending. Any information furnished by Laird and its agents is believed to be accurate and reliable. All
specifications are subject to change without notice. Responsibility for the use and application of Laird materials or products rests with the end user since
Laird and its agents cannot be aware of all potential uses. Laird makes no warranties as to non-infringement nor as to the fitness, merchantability, or
sustainability of any Laird materials or products for any specific or general uses. Laird, Laird Technologies, Inc., or any of its affiliates or agents shall not be
liable for incidental or consequential damages of any kind. All Laird products are sold pursuant to the Laird Terms and Conditions of Sale in effect from time
to time, a copy of which will be furnished upon request. When used as a tradename herein, Laird means Laird PLC or one or more subsidiaries of Laird PLC.
Laird™, Laird Technologies™, corresponding logos, and other marks are trademarks or registered trademarks of Laird. Other marks may be the property of
third parties. Nothing herein provides a license under any Laird or any third party intellectual property right.
Embedded Wireless Solutions Support Center:
http://ews-support.lairdtech.com
www.lairdtech.com/wireless
5
© Copyright 2016 Laird. All Rights Reserved
Americas: +1-800-492-2320
Europe: +44-1628-858-940
Hong Kong: +852 2923 0610
Was this manual useful for you? yes no
Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Download PDF

advertising