34
© 2011 Microchip Technology Inc. DS01373A-page 1 INTRODUCTION Technologies that allow both wireless and wired systems to communicate with other devices of the same ability are referred to as Machine-to-Machine (M2M). M2M uses a device to capture an event, which is then relayed through a network to an application that translates the event into meaningful information. A common application of M2M is fleet management, where vehicle tracking is wirelessly transmitted to a central monitoring office over cellular networks. There are many popular M2M applications, one of which is a utility meter. One of the major benefits of a M2M-based utility meter over a traditional one, is immediate operational efficiency from reading and programming meters remotely, which eliminates the need to physically visit the meter. Another application becoming more popular with M2M technology is in-car GPS navigation. With this technology, consumers now have a complete GPS navigation system in their vehicles. This technology can be used to track a driver’s current location, or provide a map for directions. Also, the consumer can make an emergency call from the same device that is doing the tracking. Businesses can use this technology for parking lots to know how long a vehicle has been parked and to charge it accordingly. The Microchip M2M PICtail™ Plus Daughter Board (referred to as the M2M Board) developed by u-blox AG, was designed to connect directly to the PICtail™ interface of the Multimedia Expansion Board (MEB), but can also be used with any PIC32 microcontroller. This application note describes a reference design that enables the implementation of GSM/GPRS/GPS connectivity using a PIC32 microcontroller (MCU), the M2M Board, and the MEB. Feature Overview The M2M PICtail Plus Daughter Board contains many features, including GSM, GPRS, and GPS. Global System for Mobile Communication (GSM) GSM is a popular world-wide standard for mobile telephone systems. GSM includes technologies in both signaling and speech channels, which are digital; therefore, GSM is considered a Second Generation (i.e., 2G) mobile phone system. This facilitates the wide-spread implementation of data communication applications into the system. GSM also implements a Short Message Service (SMS), called text messaging. General Packet Radio Service (GPRS) GPRS is a service on 2G and 3G cellular communication systems (GSM). GPRS provides data rates of 56-114 kbps, which provides users with the capability to connect to the Internet. Global Positioning System (GPS) GPS is a space-based navigation system that pro- vides reliable location and time information in all weather conditions and at all times, and anywhere on or near the Earth when and where there is an unobstructed line of sight to four or more GPS sat- ellites. It is freely accessible by anyone with a GPS receiver. Functionality The main functionality of the M2M Board is accomplished using two communications modules from u-blox A, which is a company that specializes in GSM/ GPS ICs. For more information, visit www.u-blox.com. The M2M Board was designed to connect to Microchip’s MEB. The MEB uses Microchip’s PIC32 starter kit collection as the primary controller source. This suite makes it easy to start and implement embedded controller projects due to its: Built-in debugger USB power source On-board header for easy attachment to PCBs PIC32 device with high-speed performance and no peripheral loss Authors: Adam Folts Microchip Technology Inc., with contributions from u-blox AG AN1373 Using PIC32 MCUs to Develop GSM/GPRS/GPS Solutions

Using PIC32 MCUs to Develop GSM/GPRS/GPS Solutions ... · enables the implementation of GSM/GPRS/GPS connectivity using a PIC32 microcontroller (MCU), the M2M Board, and the MEB

  • Upload
    others

  • View
    6

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Using PIC32 MCUs to Develop GSM/GPRS/GPS Solutions ... · enables the implementation of GSM/GPRS/GPS connectivity using a PIC32 microcontroller (MCU), the M2M Board, and the MEB

AN1373Using PIC32 MCUs to Develop GSM/GPRS/GPS Solutions

INTRODUCTIONTechnologies that allow both wireless and wiredsystems to communicate with other devices of thesame ability are referred to as Machine-to-Machine(M2M). M2M uses a device to capture an event, whichis then relayed through a network to an application thattranslates the event into meaningful information. Acommon application of M2M is fleet management,where vehicle tracking is wirelessly transmitted to acentral monitoring office over cellular networks.

There are many popular M2M applications, one ofwhich is a utility meter. One of the major benefits of aM2M-based utility meter over a traditional one, isimmediate operational efficiency from reading andprogramming meters remotely, which eliminates theneed to physically visit the meter.

Another application becoming more popular with M2Mtechnology is in-car GPS navigation. With thistechnology, consumers now have a complete GPSnavigation system in their vehicles. This technologycan be used to track a driver’s current location, orprovide a map for directions. Also, the consumer canmake an emergency call from the same device that isdoing the tracking. Businesses can use this technologyfor parking lots to know how long a vehicle has beenparked and to charge it accordingly.

The Microchip M2M PICtail™ Plus Daughter Board(referred to as the M2M Board) developed by u-bloxAG, was designed to connect directly to the PICtail™interface of the Multimedia Expansion Board (MEB),but can also be used with any PIC32 microcontroller.

This application note describes a reference design thatenables the implementation of GSM/GPRS/GPSconnectivity using a PIC32 microcontroller (MCU), theM2M Board, and the MEB.

Feature OverviewThe M2M PICtail Plus Daughter Board contains manyfeatures, including GSM, GPRS, and GPS.

• Global System for Mobile Communication (GSM)

GSM is a popular world-wide standard for mobiletelephone systems. GSM includes technologies inboth signaling and speech channels, which aredigital; therefore, GSM is considered a SecondGeneration (i.e., 2G) mobile phone system. Thisfacilitates the wide-spread implementation of datacommunication applications into the system. GSMalso implements a Short Message Service (SMS),called text messaging.

• General Packet Radio Service (GPRS)

GPRS is a service on 2G and 3G cellularcommunication systems (GSM). GPRS providesdata rates of 56-114 kbps, which provides userswith the capability to connect to the Internet.

• Global Positioning System (GPS)

GPS is a space-based navigation system that pro-vides reliable location and time information in allweather conditions and at all times, and anywhereon or near the Earth when and where there is anunobstructed line of sight to four or more GPS sat-ellites. It is freely accessible by anyone with a GPSreceiver.

FunctionalityThe main functionality of the M2M Board isaccomplished using two communications modules fromu-blox A, which is a company that specializes in GSM/GPS ICs. For more information, visit www.u-blox.com.

The M2M Board was designed to connect toMicrochip’s MEB. The MEB uses Microchip’s PIC32starter kit collection as the primary controller source.This suite makes it easy to start and implementembedded controller projects due to its:

• Built-in debugger• USB power source• On-board header for easy attachment to PCBs• PIC32 device with high-speed performance and

no peripheral loss

Authors: Adam FoltsMicrochip Technology Inc.,with contributions from u-blox AG

© 2011 Microchip Technology Inc. DS01373A-page 1

Page 2: Using PIC32 MCUs to Develop GSM/GPRS/GPS Solutions ... · enables the implementation of GSM/GPRS/GPS connectivity using a PIC32 microcontroller (MCU), the M2M Board, and the MEB

AN1373

HARDWARE DESCRIPTIONAs previously mentioned, the M2M Board is builtaround two controller modules, the LEON-G200 andthe NEO-6Q, which are available from u-blox AG.

The LEON-G200 is a Quad Band GSM/GPRS dataand voice module. Communications to the moduleare through AT commands. The UART module onthe PIC32 device handles the AT commands. TheLEON-G200 handles the GPS communications tothe NEO-6Q module. The module also contains1 MB of non-volatile memory that can be used forstoring local or Internet files.

The NEO-6Q GPS module uses the u-blox six-positioning engine for its GPS positions support. Inthis hardware setup, it acts as a slave to the LEON-G200, but can be a stand-alone module with its ownset of AT commands. For more information on thesetwo modules and a list of AT commands, visitwww.u-blox.com.

A block diagram of the reference design is provided inFigure 1.

The M2M Board connects to expansion slot header J5of the MEB. Figure 1 illustrates the connector pins.Descriptions of each pin are listed in Table 1.

FIGURE 1: SCHEMATIC OF CONNECTOR TO MEB

FIGURE 2: REFERENCE DESIGN BLOCK DIAGRAM

+3.3V suppliedfrom the MEB

J2

R64.7k

R74.7k

VIN

SDA3

SCL3

PWR_ON

RESET_N

+3.3V 1

3

5

7

9

11

13

15

17

19

21

23

25

27

2

4

6

8

10

12

14

16

18

20

22

24

26

28

HD

R-T

H_0

.1-2

X14

RI

DTR

DSR

RXD

TXD

RTS

CTS

DCD

PIC32 MCU UART

M2M PICtail™ Plus Daughter Board

LEON-G200 (u-blox) NEO-6Q (u-blox)

GSM/GPRS ModuleGPS Module

DS01373A-page 2 © 2011 Microchip Technology Inc.

Page 3: Using PIC32 MCUs to Develop GSM/GPRS/GPS Solutions ... · enables the implementation of GSM/GPRS/GPS connectivity using a PIC32 microcontroller (MCU), the M2M Board, and the MEB

AN1373

The M2M board also implements the following:

• SAW filter

The filter is located in front of the LNA to improvethe GPS interference immunity (outband interfer-ence from collocation of near field Wireless com-munication). The SAW-LNA-SAW chain isimplemented for best immunity and performance.

• SIM holder

The holder is used for the SIM card, which enablesGPRS/GSM communication evaluation.

• RF SMA Connector

The connector is located in front of antenna detec-tion and switch circuitry, which allows automatichardware detection and connection onto a GPSexternal antenna. Using an external GPS externalantenna is optional and allows for better GPSperformance under poor GPS conditions.

Figure 3 provides a detailed diagram of the M2MBoard.

FIGURE 3: M2M PICtail™ PLUS DAUGHTER BOARD BLOCK DIAGRM

GSMAntenna

GPSAntenna

LDOSAW-LNA-SAW

SIMHolder

LEON-G200GPRS/GSM

Module

NEO-6QGPS

Module

RF Connector

UART VCC

© 2011 Microchip Technology Inc. DS01373A-page 3

Page 4: Using PIC32 MCUs to Develop GSM/GPRS/GPS Solutions ... · enables the implementation of GSM/GPRS/GPS connectivity using a PIC32 microcontroller (MCU), the M2M Board, and the MEB

AN1373

TABLE 1: MEB CONNECTOR PIN

DESCRIPTIONS

As seen in Table 1, most of the communication to theLEON-G200 is handled through the UART.

The MEB communicates to the M2M Board through theUART. The baud rate can be an auto baud rate, andmost of the common baud rates are acceptable.

The PIC32 family of devices offer the same peripheralsas seen on previous Microchip devices.

See “References” for links to information on thehardware and the PIC32 device used in this referencedesign.

DEMONSTRATION DESCRIPTIONThis section describes in detail what is contained in theGSM/GPRS/GPS demonstration. Some of the imagesmay contain different graphics than those shown in thisapplication note, but the basic functionality of thedemonstration is still present.

The MEB contains a 3.2" QVGA touch screen display,making the demonstration easy to follow, and showshow each service is set up. The Debug output of thePIC32 Starter Kit can be used to see which u-bloxcommands are being used throughout thedemonstration.

The demonstration starts with the initialization of allGSM/GPS/GPRS services. Notice in Figure 4 thatmost buttons seem disabled except for HELP andNEXT. Selecting NEXT initializes the M2M Boardsetup. The M2M Board requires a SIM card with a dataplan to be inserted into the back of it in order for theGSM/GPRS demonstrations to function. Theinitialization step has three screens that initialize GPS,GPRS, and GPS technologies, one at a time. Sometechnologies require some time (10-30 seconds) fortheir service provider to respond.

FIGURE 4: MAIN DEMO SCREEN

The GSM demonstration shows the current signalstrength and the service provider. With thisdemonstration, the user can also send a text messageby selecting the SMS button, as shown in Figure 5.Once SMS is selected, the user will be taken to ascreen where they can enter a phone number. Oncethe number is entered and a SIM card is inserted intothe M2M Board, a message from the M2M Board willbe sent to that phone number.

By default, the M2M demonstration has SMS receivingturned ON. This means that if a text message is sent tothe board, the demo will pause and show the numberand message received, and then return to the demo.

Connector Pin Name

MEB Pin Name Description

RI WIFI_SDO UART ring indicator

DTR WIFI_SDI UART data terminal ready

DSR WIFI_SCK UART data set ready

RXD SDI3A UART receive data

TXD SDO3A UART transmit data

RTS SCK3A UART ready to send

CTS SS3A/RF12 UART clear to send

DCD WIFI_CS UART data carrier detect

PWR_ON C2OUT/AN9 Turns the device on/off

RESET_N RA10 Holds the device in reset

DS01373A-page 4 © 2011 Microchip Technology Inc.

Page 5: Using PIC32 MCUs to Develop GSM/GPRS/GPS Solutions ... · enables the implementation of GSM/GPRS/GPS connectivity using a PIC32 microcontroller (MCU), the M2M Board, and the MEB

AN1373

FIGURE 5: GSM DEMO SCREEN

The GPRS demo (see Figure 6) shows to which IPaddress the device is connected. This screen initiatesthe basic Internet connection needed to createdemonstrations, such as an e-mail service, simple Webbrowsing, and any other 2G phone feature involving anInternet connection.

FIGURE 6: GPRS DEMO SCREEN

The GPS demonstration shows the current longitudeand latitude coordinates, as shown in Figure 7.

The Email button will become enabled when an activeSIM card is present with data services available. Byselecting the Email button, the user will be sent to ascreen where an e-mail address can be entered, and ifan e-mail server has been set up correctly, an e-mailcan be sent. Refer to the BYTE acdEmailSetup()function to change the email server name. The M2Mboard does not support SSL-based SMTP servers. TheMap button will remain enabled until GPS data isavailable.

FIGURE 7: GPS DEMO SCREEN

The map demo uses HTTP requests and the on-board1 MB of memory to receive and store an image fromthe Internet. The image is from Google Maps andshows the current GPS location of the M2M Board. Thedemo only shows a static image of the current location,and is not configured for navigation. GSM, GPRS, andGPS capabilities need to be active for this demo to beenabled. Make sure the SIM card attached is activeand that data services are available.

FIGURE 8: MAP DEMO SCREEN

Note: GPS data is not ready until the LEDlabeled TIMEPULSE on the M2M Board isblinking green.

© 2011 Microchip Technology Inc. DS01373A-page 5

Page 6: Using PIC32 MCUs to Develop GSM/GPRS/GPS Solutions ... · enables the implementation of GSM/GPRS/GPS connectivity using a PIC32 microcontroller (MCU), the M2M Board, and the MEB

AN1373

GSM/GPRS/GPS STACK DESCRIPTIONThe GSM/GPRS/GPS stack was built around u-bloxcommunication commands. The basic commands canbe found on the u-blox AG website at: www.u-blox.com.

This section describes in detail the high-levelcommands listed in Table 2, which are needed tointerface with the GSM/GPRS/GPS stack. Detaileddescriptions of each function are provided following thetable.

TABLE 2: ENUMERATOR AND FUNCTION DESCRIPTIONSStructure Enumerator Description

UBX_STATUS UBX_S_SYSTEM_CONFIGURED u-blox high-level interface is configured.UBX_S_SYSTEM_NOT_CONFIGURED u-blox high-level interface is not configured.UBX_S_BOARD_POWERED C16-G26Q plug-in board is powered-on.UBX_S_BOARD_NOT_POWERED C16-G26Q plug-in board is powered-off.UBX_S_BOARD_PRESENT_LEONG200 C16-G26Q plug-in recognized as LEON-G200.UBX_S_BOARD_PRESENT C16-G26Q plug-in board is present.UBX_S_BOARD_NOT_PRESENT C16-G26Q plug-in board is not present.UBX_S_SIM_PRESENT SIM card is present.UBX_S_SIM_NOT_PRESENT SIM card is not present.UBX_S_PIN_ENABLED PIN on SIM card is enabled.UBX_S_PIN_NOT_ENABLED PIN on SIM card is not enabled.UBX_S_GSM_CONFIGURED GSM module is configured.UBX_S_GSM_NOT_CONFIGURED GSM module is not configured.UBX_S_GSM_NETWORK_REGISTRED GSM network is registered.UBX_S_GSM_NETWORK_NOT_REGISTRED GSM network is not registered.UBX_S_PDP_CONFIGURED GPRS is configured.UBX_S_PDP_NOT_CONFIGURED GPRS is not configured.UBX_S_PDP_SERVICE_REGISTRED GPRS service is available.UBX_S_PDP_SERVICE_NOT_REGISTRED GPRS service is not available.UBX_S_GPS_CONFIGURED GPS is configured.UBX_S_GPS_NOT_CONFIGURED GPS is not configured.UBX_S_GPS_POWERED GPS is powered on.UBX_S_GPS_NOT_POWERED GPS is powered off.UBX_S_GPS_ASSIST_LOCAL GPS with local aiding.UBX_S_GPS_ASSIST_NONE GPS without local aiding.UBX_S_GPS_ASSIST_OFFLINE GPS AssistNow is off-line.UBX_S_GPS_ASSIST_ONLINE GPS AssistNow is on-line.

UBX_ERROR UBX_E_OK Success.UBX_E_ERROR Error, handling is required.UBX_E_WARNING Warning, can be ignored.

UBX_GPS_ASSIST_MODE UBX_GPS_ASSIST_LOCAL Power-on GPS with local aiding (use GSM cell info where possible).

UBX_GPS_ASSIST_OFFLINE Power-on GPS with AssistNow off-line (use 14 days almanac).

UBX_GPS_ASSIST_ONLINE Power-on GPS with AssistNow on-line.HTTP_REQUESTS HEAD Head command.

GET Get command.DELETE Delete command.PUT Put command.POST_FILE Post file command.POST_DATA Post data command.

DS01373A-page 6 © 2011 Microchip Technology Inc.

Page 7: Using PIC32 MCUs to Develop GSM/GPRS/GPS Solutions ... · enables the implementation of GSM/GPRS/GPS connectivity using a PIC32 microcontroller (MCU), the M2M Board, and the MEB

AN1373

Stack API Functions

UBX_ERROR ubxConfigureBoard(void)

DescriptionThis function configures the C16-G26Q plug-in board.

Returns• UBX_E_OK• UBX_E_ERROR• UBX_E_WARNING

ExampleSee Example 1.

UBX_ERROR ubxConfigureGps(void)

DescriptionThis function configures the GPS module.

Returns• UBX_E_OK• UBX_E_ERROR• UBX_E_WARNING

ExampleSee Example 3.

UBX_ERROR ubxConfigureGsm(void)

DescriptionThis function configures the GSM network.

Returns• UBX_E_OK• UBX_E_ERROR• UBX_E_WARNING

ExampleSee Example 2.

© 2011 Microchip Technology Inc. DS01373A-page 7

Page 8: Using PIC32 MCUs to Develop GSM/GPRS/GPS Solutions ... · enables the implementation of GSM/GPRS/GPS connectivity using a PIC32 microcontroller (MCU), the M2M Board, and the MEB

AN1373

UBX_ERROR ubxConfigurePdp(char *apn)

DescriptionThis function configures the GPRS service depending on the operator’s access point name.

Parameters[in] apn Operator’s Access Point Name (APN)

Returns• UBX_E_OK• UBX_E_ERROR• UBX_E_WARNING

ExampleSee Example 4.

UBX_ERROR ubxConfigureSystem(UINT32 freq)

DescriptionThis function configures the u-blox high-level interface.

Preconditionu-blox high-level interface should not be already configured

Parameters[in] freq System (core) frequency

Returns• UBX_E_OK• UBX_E_ERROR• UBX_E_WARNING

Example #include <plib.h> #include "libubx.h" #include "libp32.h"

UBX_ERROR rc;

rc = ubxConfigureSystem(SYSTEM_FREQ); if (rc != UBX_E_OK) { return; }

DBPRINTF("System core is running at %d Hz\n", p32GetSystemClock()); DBPRINTF("Peripheral bus is running at %d Hz\n", p32GetPeripheralBusClock());

DS01373A-page 8 © 2011 Microchip Technology Inc.

Page 9: Using PIC32 MCUs to Develop GSM/GPRS/GPS Solutions ... · enables the implementation of GSM/GPRS/GPS connectivity using a PIC32 microcontroller (MCU), the M2M Board, and the MEB

AN1373

UBX_ERROR ubxGetBoardPowerStatus(void)

DescriptionThis function returns the status of the C16-G26Q plug-in board power.

Returns• UBX_S_BOARD_POWERED• UBX_S_BOARD_NOT_POWERED

UBX_STATUS ubxGetBoardStatus(void)

DescriptionThis function returns the status of the C16-G26Q plug-in board.

Returns• UBX_S_BOARD_PRESENT_LEONG200• UBX_S_BOARD_PRESENT• UBX_S_BOARD_NOT_PRESENT

UBX_STATUS ubxGetGpsAssistStatus(void)

DescriptionThis function returns the current aiding mode of the GPS module.

Returns• UBX_S_GPS_ASSIST_LOCAL• UBX_S_GPS_ASSIST_NONE• UBX_S_GPS_ASSIST_OFFLINE• UBX_S_GPS_ASSIST_ONLINE

UBX_STATUS ubxGetGpsPowerStatus(void)

DescriptionThis function returns the power status of the GPS module.

Returns• UBX_S_GPS_POWERED• UBX_S_GPS_NOT_POWERED

© 2011 Microchip Technology Inc. DS01373A-page 9

Page 10: Using PIC32 MCUs to Develop GSM/GPRS/GPS Solutions ... · enables the implementation of GSM/GPRS/GPS connectivity using a PIC32 microcontroller (MCU), the M2M Board, and the MEB

AN1373

UBX_STATUS ubxGetGpsStatus(void)

DescriptionThis function returns the status of the GPS module.

Returns• UBX_S_GPS_CONFIGURED• UBX_S_GPS_NOT_CONFIGURED

UBX_ERROR ubxGetGsmNetworkOperator(char* netop)

DescriptionThis function returns the name of the GSM network operator.

Parameters[out] netop GSM network operator, null-terminated string

Returns• UBX_E_OK• UBX_E_ERROR• UBX_E_WARNING

UBX_ERROR ubxGetGsmNetworkSignal(UINT32 *netss, char *netss_text)

DescriptionThis function returns the signal strength of the GSM network.

Parameters[out] netss GSM network signal strength, integer [0...5]

[out] netss GSM network signal strength, null-terminated string

Returns• UBX_E_OK• UBX_E_ERROR• UBX_E_WARNING

DS01373A-page 10 © 2011 Microchip Technology Inc.

Page 11: Using PIC32 MCUs to Develop GSM/GPRS/GPS Solutions ... · enables the implementation of GSM/GPRS/GPS connectivity using a PIC32 microcontroller (MCU), the M2M Board, and the MEB

AN1373

UBX_STATUS ubxGetGsmNetworkStatus(void)

DescriptionThis function returns the status of the GSM network registration.

Returns• UBX_S_GSM_NETWORK_REGISTRED• UBX_S_GSM_NETWORK_NOT_REGISTRED

ExampleSee Example 2.

UBX_STATUS ubxGetGsmStatus(void)

DescriptionThis function returns the status of the GSM network.

Returns• UBX_S_GSM_CONFIGURED• UBX_S_GSM_NOT_CONFIGURED

ExampleSee Example 2.

UBX_ERROR ubxGetPdpServiceAddress(char *ipadd)

DescriptionThis function returns the IP address from GPRS service (current context).

Parameters[out] ipadd GPRS service address, null-terminated string

Returns• UBX_E_OK• UBX_E_ERROR• UBX_E_WARNING

© 2011 Microchip Technology Inc. DS01373A-page 11

Page 12: Using PIC32 MCUs to Develop GSM/GPRS/GPS Solutions ... · enables the implementation of GSM/GPRS/GPS connectivity using a PIC32 microcontroller (MCU), the M2M Board, and the MEB

AN1373

UBX_STATUS ubxGetPdpServiceStatus(void)

DescriptionThis function returns the status of the GPRS services.

Returns• UBX_S_PDP_SERVICE_REGISTRED• UBX_S_PDP_SERVICE_NOT_REGISTRED

UBX_STATUS ubxGetPdpStatus(void)

DescriptionThis function returns the status of the GPRS module configuration.

Returns• UBX_S_PDP_CONFIGURED• UBX_S_PDP_NOT_CONFIGURED

UBX_STATUS ubxGetPinStatus(void)

DescriptionThis function returns the status of the PIN code.

Returns• UBX_S_PIN_ENABLED• UBX_S_PIN_NOT_ENABLED

UBX_STATUS ubxGetSimStatus(void)

DescriptionThis function returns the status of the SIM card.

Returns• UBX_S_SIM_PRESENT• UBX_S_SIM_NOT_PRESENT

DS01373A-page 12 © 2011 Microchip Technology Inc.

Page 13: Using PIC32 MCUs to Develop GSM/GPRS/GPS Solutions ... · enables the implementation of GSM/GPRS/GPS connectivity using a PIC32 microcontroller (MCU), the M2M Board, and the MEB

AN1373

UBX_STATUS ubxGetSystemStatus(void)

DescriptionThis function returns the status of the u-blox high-level interface.

Returns• UBX_S_SYSTEM_CONFIGURED• UBX_S_SYSTEM_NOT_CONFIGURED

Example #include <plib.h> #include "libubx.h"

UBX_ERROR rc;

rc = ubxConfigureSystem(SYSTEM_FREQ);

if (ubxGetSystemStatus() != UBX_S_SYSTEM_CONFIGURED) { return; }

DBPRINTF("\nSystem configured\n");

UBX_ERROR ubxPowerOffBoard(void)

DescriptionThis function turns off power to the C16-G26Q plug-in board.

Returns• UBX_E_OK• UBX_E_ERROR• UBX_E_WARNING

UBX_ERROR ubxPowerOffGps(void)

DescriptionThis function turns off power to the GPS module.

Returns• UBX_E_OK• UBX_E_ERROR• UBX_E_WARNING

© 2011 Microchip Technology Inc. DS01373A-page 13

Page 14: Using PIC32 MCUs to Develop GSM/GPRS/GPS Solutions ... · enables the implementation of GSM/GPRS/GPS connectivity using a PIC32 microcontroller (MCU), the M2M Board, and the MEB

AN1373

UBX_ERROR ubxPowerOnBoard(void)

DescriptionThis function turns on power to the C16-G26Q plug-in board.

Returns• UBX_E_OK• UBX_E_ERROR• UBX_E_WARNING

UBX_ERROR ubxPowerOnGps(UBX_GPS_ASSIST_MODE mode)

DescriptionThis function turns on power to the GPS module.

Parameters[in] mode GPS aiding mode

Returns• UBX_E_OK• UBX_E_ERROR• UBX_E_WARNING

ExampleSee Example 3.

UBX_ERROR ubxRegisterGsmNetwork(void)

DescriptionThis function registers to the GSM network.

Returns• UBX_E_OK• UBX_E_ERROR• UBX_E_WARNING

ExampleSee Example 2.

DS01373A-page 14 © 2011 Microchip Technology Inc.

Page 15: Using PIC32 MCUs to Develop GSM/GPRS/GPS Solutions ... · enables the implementation of GSM/GPRS/GPS connectivity using a PIC32 microcontroller (MCU), the M2M Board, and the MEB

AN1373

UBX_ERROR ubxRegisterPdpService(void)

DescriptionThis function registers to GPRS services.

Returns• UBX_E_OK• UBX_E_ERROR• UBX_E_WARNING

ExampleSee Example 4.

UBX_ERROR ubxSendGsmShortMessage(char *gsmsn, char *sms)

DescriptionThis function sends an SMS (text message) via the GSM network.

Parameters[in] gsmsn GSM subscriber number

[in] sms Short message (160 character maximum)

Returns• UBX_E_OK• UBX_E_ERROR• UBX_E_WARNING

UBX_ERROR ubxUnregisterGsmNetwork(void)

DescriptionThis function unregisters from the GSM network.

Returns• UBX_E_OK• UBX_E_ERROR• UBX_E_WARNING

© 2011 Microchip Technology Inc. DS01373A-page 15

Page 16: Using PIC32 MCUs to Develop GSM/GPRS/GPS Solutions ... · enables the implementation of GSM/GPRS/GPS connectivity using a PIC32 microcontroller (MCU), the M2M Board, and the MEB

AN1373

UBX_ERROR ubxUnregisterPdpService(void)

DescriptionThis function unregisters from the GPRS services.

Returns• UBX_E_OK• UBX_E_ERROR• UBX_E_WARNING

UBX_ERROR ubxUpdateGpsContext(GPS_CONTEXT context)

DescriptionThis function updates a GPS data context (read only selected message).

Parameters[in] context GPS data context to update

Returns• UBX_E_OK• UBX_E_ERROR• UBX_E_WARNING

Example#include <stdlib.h>#include <plib.h>

#include "libubx.h"#include "libgps.h" UBX_ERROR rc; GPS_DATA_GGA *gga;

rc = ubxUpdateGpsContext(GPS_C_GGA); gga = gpsGetGGA();

DBPRINTF("Altitude: %i m/sl\n", atoi(gga->alt)); DBPRINTF("Latitude: %f %s\n", atof(rmc->lat), rmc->lat_ns); DBPRINTF("Longitude: %f %s\n", atof(rmc->lon), rmc->lon_ew);

DS01373A-page 16 © 2011 Microchip Technology Inc.

Page 17: Using PIC32 MCUs to Develop GSM/GPRS/GPS Solutions ... · enables the implementation of GSM/GPRS/GPS connectivity using a PIC32 microcontroller (MCU), the M2M Board, and the MEB

AN1373

UBX_ERROR ubxUpdateGpsFullContext(void)

DescriptionThis function updates all GPS data context (read all messages).

Returns• UBX_E_OK• UBX_E_ERROR• UBX_E_WARNING

Example #include <stdlib.h> #include <plib.h>

#include "libubx.h" #include "libgps.h"

UBX_ERROR rc; GPS_DATA_GSV *gsv; GPS_DATA_RMC *rmc;

rc = ubxUpdateGpsFullContext(); gsv = gpsGetGSV(); rmc = gpsGetRMC(); DBPRINTF("Number of satellites used for tracking: %d\n", atoi(gsv->nst)); DBPRINTF("Latitude: %f %s\n", atof(rmc->lat), rmc->lat_ns); DBPRINTF("Longitude: %f %s\n", atof(rmc->lon), rmc->lon_ew);

UBX_ERROR ubxVerifyPin(char *pin)

DescriptionThis function verifies the Pin code.

Parameters[in] pin Pin code (null-terminated string)

Returns• UBX_E_OK• UBX_E_ERROR• UBX_E_WARNING

© 2011 Microchip Technology Inc. DS01373A-page 17

Page 18: Using PIC32 MCUs to Develop GSM/GPRS/GPS Solutions ... · enables the implementation of GSM/GPRS/GPS connectivity using a PIC32 microcontroller (MCU), the M2M Board, and the MEB

AN1373

BYTE acdEmailSetup()

DescriptionThis function sets up initial communications with an SMTP server. The M2M Board does not have SSL capabilities. Thesender of the e-mail is also setup here.

ReturnsBYTE showing return value of SMTP request. Value is 0 if no error.

BYTE acdSendEmail(char *Recipient, char *Subject, char *Message)

DescriptionThis function sends an e-mail.

Parameters[in] Recipient character string of the e-mail to send the e-mail to

[in] Subject character string of the subject of the e-mail

[in] Message character string of the message of the e-mail

ReturnsBYTE value showing return value of SMTP request, value is 0 if no error.

BYTE acdHTTPRequest(BYTE requesttype, char *Servername, char *FileLocation, char *Filename)

DescriptionThis function sends an e-mail.

Parameters[in] requesttype BYTE defining HTTP request type (HEAD, GET, DELETE, PUT, POST_FILE, POST_DATA)

[in] Servername Character string of server name

[in] FileLocation Character string of server file location

[in] Filename Character string of M2M file to save the file from HTTP server to LEON-G200 memory

ReturnsBYTE value showing return value of HTTP request. Value is 0 if no error.

DS01373A-page 18 © 2011 Microchip Technology Inc.

Page 19: Using PIC32 MCUs to Develop GSM/GPRS/GPS Solutions ... · enables the implementation of GSM/GPRS/GPS connectivity using a PIC32 microcontroller (MCU), the M2M Board, and the MEB

AN1373

int acdReadM2MFile(char *Filename, unsigned char *File)

DescriptionThis function sends an e-mail.

Parameters[in] FileName Character string of Filename of local file

[in] File Character string of File in PIC memory

ReturnsInteger value showing BYTE length of file read from M2M memory.

© 2011 Microchip Technology Inc. DS01373A-page 19

Page 20: Using PIC32 MCUs to Develop GSM/GPRS/GPS Solutions ... · enables the implementation of GSM/GPRS/GPS connectivity using a PIC32 microcontroller (MCU), the M2M Board, and the MEB

AN1373

Stack API Usage Examples

EXAMPLE 1: INITIALIZING THE M2M PICtail™ PLUS DAUGHTER BOARD

EXAMPLE 2: INITIALIZING GSM

EXAMPLE 3: INITIALIZING GPS

EXAMPLE 4: INITIALIZING GPRS

EXAMPLE 5: USING SMTP (SENDING AN E-MAIL)

EXAMPLE 6: USING HTTP

EXAMPLE 7: READING FROM MEMORY

ubxConfigureBoard();

ubxConfigureGsm();

if (ubxGetSimStatus() == UBX_S_SIM_PRESENT) //Check to see SIM card is present{

ubxRegisterGsmNetwork();break;

}

if (ubxGetGsmNetworkStatus() == UBX_S_GSM_NETWORK_REGISTRED) {

acdSMSSetup(); //Setup SMS Reading}

ubxConfigureGps();ubxPowerOnGps(UBX_GPS_ASSIST_OFFLINE);

if (ubxGetGsmNetworkStatus() != UBX_S_GSM_NETWORK_REGISTRED){

ubxConfigurePdp(UBX_CONFIG_APN);break;

}

acdEmailSetup(); //Sets up the SMTP server (generic is Yahoo server)acdSendEmail(EmailAddress,"Microchip M2M Board Message","This is a message from Microchip's

M2M Board.");

acdHTTPRequest(GET, //Type of HTTP request"maps.google.com", //HTTP servertemp, //file location on server"Map"); //Read Google Maps JPEG

“fileLength =”acdReadM2MFile("Map", &PIC32MapMemoryLocation[0]) //Reads file from M2M Board//to PIC32 memory

DS01373A-page 20 © 2011 Microchip Technology Inc.

Page 21: Using PIC32 MCUs to Develop GSM/GPRS/GPS Solutions ... · enables the implementation of GSM/GPRS/GPS connectivity using a PIC32 microcontroller (MCU), the M2M Board, and the MEB

AN1373

GRAPHICS LIBRARY DESCRIPTIONThe demonstration uses the Microchip GraphicsLibrary, version 2.11, which is a powerful library thatmakes creating a Graphical User Interface (GUI) suchas this one fast and easy. The Microchip GraphicsLibrary is free and available for download from:www.microchip.com/MAL.

REFERENCESLEON-G200 and NEO-6Q Communications Modules(www.u-blox.com)

LEON-G100 G200 “2G GPS/GPRS AT CommandsManual” GSM.G1-SW-09002 (www.u-blox.com)

M2M PICtail™ Plus Daughter Board (www.microchip.com)

Multimedia Expansion Board (MEB) (www.microchip.com/meb)

PIC32 device family (www.microchip.com/PIC32)

© 2011 Microchip Technology Inc. DS01373A-page 21

Page 22: Using PIC32 MCUs to Develop GSM/GPRS/GPS Solutions ... · enables the implementation of GSM/GPRS/GPS connectivity using a PIC32 microcontroller (MCU), the M2M Board, and the MEB

AN1373

APPENDIX A: SOURCE CODE

All of the software covered in this application note isavailable as a single WinZip archive file. This archivecan be downloaded from the Microchip corporate Website at:

www.microchip.com

Software License AgreementThe software supplied herewith by Microchip Technology Incorporated (the “Company”) is intended and supplied to you, theCompany’s customer, for use solely and exclusively with products manufactured by the Company.The software is owned by the Company and/or its supplier, and is protected under applicable copyright laws. All rights are reserved.Any use in violation of the foregoing restrictions may subject the user to criminal sanctions under applicable laws, as well as to civilliability for the breach of the terms and conditions of this license.THIS SOFTWARE IS PROVIDED IN AN “AS IS” CONDITION. NO WARRANTIES, WHETHER EXPRESS, IMPLIED ORSTATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR APARTICULAR PURPOSE APPLY TO THIS SOFTWARE. THE COMPANY SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLEFOR SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.

DS01373A-page 22 © 2011 Microchip Technology Inc.

Page 23: Using PIC32 MCUs to Develop GSM/GPRS/GPS Solutions ... · enables the implementation of GSM/GPRS/GPS connectivity using a PIC32 microcontroller (MCU), the M2M Board, and the MEB

© 2011 M

icrochip Technology Inc.D

S01373A

-page 23

AN

1373

AP

FIG

(I2

ANTENNA

SPI_MRST

SPI_CLK

SPI_CSn

SPI_MTSR

1-G9

TP102

1-F9

L103

coil0

402_

nm

R105

0Ohm_5%

C11

2

10nF

_10%

C11

1

39pF

_5%

2-E2

R104

0Ohm_5%

1

2

PA-25 FLEX

ANT100

TP104

C11

310

pF_5

%

C11

010

0nF_

10%

L100

1-F9

10nH

_3%

TP103

1-G9

10nH

_3%

L101

100

hm_5%

TP105

2-D2

TP106

SCL

SDA

SIM_IO

SIM_VCC

SIM_RST

SIM_CLK

PENDIX B: SCHEMATICS

URE B-1: LEON-G200 MODULE AND ANTENNA

C_DATA_READY)

SPI_IRQn

(TIME_AIDING)

0Ohm_5%

R103

1-F4

1-E8

R120 res0402_nm

1-F4,1-G5

1-F4

R11

0

res0

402_

nm

TP100

TP101

Nom

ount

R11

9

100K

Ohm

_5%

2-G8

res0402_nm

R109

BLM15HD182SN1_0402L102

1800ohm_25%

C10

0ca

p040

2_nm

1-F4

4V_CHARGE_RESERVED

SCL

31SDA

32SIM_CLK

33SIM_IO

34SIM_RST

39SPK_N

SPK_P 38

15TxD

50VCC

35VSIM

2 V_BCKP

MIC_GND143

MIC_GND2 42

19PW R_ON

RESERVED123

24 RESERVED2

40RESERVED3

22 RESET_N

10 RI

13 RTS

16RxD

30

GND9 45

20GPIO1

21 GPIO2

18 HS_DET

HS_P 37

28I2S_CLK_RESERVED

I2S_RXD_RESERVED 29

I2S_TXD_RESERVED 27

26I2S_WA_RESERVED

MIC_BIAS1 44

41MIC_BIAS2

GND1

GND1046

48GND11

49GND12

3 GND2

6 GND3

7 GND4

8GND5

17 GND6

GND725

GND836

LEON G100 G200

U101

ANT47

5CHARGE_SENSE_ADC1

14 CTS

11 DCD

9 DSR

12 DTR

1

VBAT

1-F4

V_CHARGE

1-G4,1-G5

2-F6

R

0O

1-F4

1-E4

1-F4

100K

Ohm

_5%

R11

8N

omou

nt

R117

1-F4

1-G4

res0402_nm

VBAT

2-E6EXTINT0

DATAREADY

RESET_N

DSR

RI

DCD

GPIO2

GPIO1

PWR_ON

V_BCKP

CHARGE_SENSE

TxD

RxD

RTS

CTS

DTR

Page 24: Using PIC32 MCUs to Develop GSM/GPRS/GPS Solutions ... · enables the implementation of GSM/GPRS/GPS connectivity using a PIC32 microcontroller (MCU), the M2M Board, and the MEB

AN

1373

DS

01373A-page 24

© 2011 M

icrochip Technology Inc.

1-B3

1-C3

2-G8

S

1-C3

U10

4 CA0

5P4S

14TH

SG

2-E2

2-E2

1-C3

1-C3

1-D3,1-G5

1-C3

1-C3

1-B3

47pF

_5%

C10

8

1-C3

1-C3,1-G5

DTR

RTS

CTS

TxD

RxD

PWR_ON

RESET_N

CHARGE_SENSE

DSR

RI

DCD

GPS_TxD

GPS_RxD

V_GPS_EN

FIGURE B-2: POWER BOARD HEADER

CA0

5P4S

14TH

SGU

105

12

34

56

78

V_GP

CA0

5P4S

14TH

SGU

103

12

34

56

78 8

12

34

56

7

VBATV_CHARGE

78 U10

2 CA0

5P4S

14TH

SG

12

34

56

C10

6

20

3

4

5

6

7

8

9

330u

F 6.

3V

10

11

12

13

14

15

16

17

18

19

2

20 PIN 2,54STRIP MALE RIGHTANGLE

J1011

Page 25: Using PIC32 MCUs to Develop GSM/GPRS/GPS Solutions ... · enables the implementation of GSM/GPRS/GPS connectivity using a PIC32 microcontroller (MCU), the M2M Board, and the MEB

© 2011 M

icrochip Technology Inc.D

S01373A

-page 25

AN

1373

FIG

4 GND

C707_10M006_136_2

J100

3 CCCLK

6 CCIO

CCRST2

CCVCC1

5 CCVPP

U100

CLK

GN

D

1 9

GN

D_T

AB

IO_0

IO_1

RST

VDD

SLM76CF3201P VQFN-8-1

URE B-3: SIM CARD HOLDER

C10

510

0nF_

10%

C10

347

pF_5

%1-C10

100n

F_10

%C

107

0Ohm_5%

R108

C10

147

pF_5

%

res0402_nm

R101

1-C10

R107

0Ohm_5%

0Ohm_5%

R106

1

2

3

4

R102

0Ohm_5%

USB0002

D100

1-C10

1-C10

47pF

_5%

C10

2

6

2

3

7

8

47pF

_5%

C10

4

1

2

3

4

D101

USB0002

SIM_RST

SIM_CLK

SIM_IO

SIM_VCC

Page 26: Using PIC32 MCUs to Develop GSM/GPRS/GPS Solutions ... · enables the implementation of GSM/GPRS/GPS connectivity using a PIC32 microcontroller (MCU), the M2M Board, and the MEB

AN

1373

DS

01373A-page 26

© 2011 M

icrochip Technology Inc.

RINGINDICATOR

ND3

CC5

Y 4

D10

2

0603

RE

D12

BAT

1-C3

1.2K

Ohm

_5%

R11

2

100nF_10%

C109

GPIO1

FIGURE B-4: AMPLIFIER CIRCUIT

INDICATORNETWORKVBAT

330KOhm_5%

R114R

111

22K

Ohm

_5%

A1

B2

G

V

NC7SZ02P5X

IC100

V

D103

0603ORANGE1 2

R115

0Ohm_5%

R116

10KOhm_5%

1-D3,1-G4

5B

2

6C

1

C2

3 1E

1

4E

2B

C84

7S

T100

B1

2

R113

820Ohm_5%

1-C3,1-F4

VBAT

RESET_N

RI

Page 27: Using PIC32 MCUs to Develop GSM/GPRS/GPS Solutions ... · enables the implementation of GSM/GPRS/GPS connectivity using a PIC32 microcontroller (MCU), the M2M Board, and the MEB

© 2011 M

icrochip Technology Inc.D

S01373A

-page 27

AN

1373

FIG

ANTENNAGPS

B7839

U2031575.42MHz

2

G1

3

G2G3

5

4IN1 OUT

B7839

Nomount

PA1575MZ50I4G_INPAQANT200

C219

100nF_10%

SGP1575254D02_TAOGLAS

Nomount

C21615pF_5%

ANT201

V_LNA

1.8

pF_

+-.

1pF

C21

0

0Ohm_5%

R200

5pF

L20

3

47n

H_5

%

4

7

PAD

1

SHDN_n

6

V+

V-

5

R22

1

560

Oh

m_5

%1

00K

Ohm

_5%

R2

22 U201

VAL

LT6000IDCB

3

2

2-C5

RF_SWITCH_CTRL

URE B-5: NEO-6Q GPS MODULE AND ANTENNA

(TIME_AIDING)

(I2C_DATA_READY)

TIMEPULSE

V_LNA

2-B12

1-D3

47pF_5%

C212

V_LNA

C206

1uF_10%

C220

100nF_10%

U210NFL18ST207X1C3

V_LNA

4.7KOhm_5%

L20

2

100n

H_

5%

C223

R209

TP202

C20815pF_5% 15pF_5%

27n

H_

5%

L20

4

ES

D9L

5,O

ST

5G

U20

92

V_GPS

V_GPS

R201

470Ohm_5%

15pF_5%

B7839

U2051575.42MHz

B7839

2

G1

3

G2G3

5

4IN1 OUT

D200

0603GREEN

12

1-D3

C209

RFC5

U206

NFL18ST207X1C3

1-C10

U202

PE4259

4 CTRL

6 CTRLn_VDD

2GND

RF1 1

RF2 3

C205

27pF_5%

4.7

KO

hm_

5%

R2

07

23VCC

9VCC_RF

VDDUSB7

V_BCKP22

17RESERVED3

11RF_IN

RXD121

19SCL2

SDA218

SS_N2

TIMEPULSE3

20 TXD1 5USB_DM

6USB_DP

CFG_GPS0_SCK16

4EXTINT0

10GND1

GND21213

GND3

GND424

15MISO_CFG_COM1

MOSI_CFG_COM014

1RESERVED1

8RESERVED2

NEO-6Q GPS MODULE

U200

C202

1uF_10%

NFL18ST207X1C3 U212

TP200

1.8pF_+-.2

C204

1-G4

1-G4

C20

7

15p

F_5

%

TP201

4.7K

Ohm

_5%

R20

6

L20

1

4.7n

H_

+-0

.2n

H

2BIAS

3

GND

IN1

OUT6

4PON

5

VCC

VSS

7

1-D10

R2

08

4.7

KO

hm_

5%

ML-

621

S/D

N

B2

00

BGA715L7

TR200

V_GPS

NFL18ST207X1C3

NFL18ST207X1C3 U208

1uF

_10

%

C2

17

U211

R22

4

10O

hm_5

%

V_GPS

10nF_10%

C224

4 5

NF

L18S

T2

07X

1C3

U20

7

V_GPS

V_LNA

J200

MCX50OHMCONNECTOR

73415-16911

2 3

2 1

15pF_5%

C222

GPS_TxD

SDA

SCL

GPS_RxD EXTINT0

RF_SWITCH_CTRL

DATAREADY

D202

BAT62-02W

Page 28: Using PIC32 MCUs to Develop GSM/GPRS/GPS Solutions ... · enables the implementation of GSM/GPRS/GPS connectivity using a PIC32 microcontroller (MCU), the M2M Board, and the MEB

AN

1373

DS

01373A-page 28

© 2011 M

icrochip Technology Inc.

91K

Ohm

_1%

R20

4C20

3

10nF

_10%

V_GPS

R21

0

56K

Ohm

_1%

10uF

_20%

C20

0

FIGURE B-6: VOLTAGE REGULATOR CIRCUIT

VBAT

1-D3

R202

res0402_nm

LT1962EMS8 ADJ

BYP 3

4

GND

IN8 1OUT

2SENSE_ADJSHDNn5

U204

1-G4

C20

1

10uF

_20%

R21

3

100K

Ohm

_5%

Nom

ount

100K

Ohm

_5%

R20

5

R215

0Ohm_5%

GPIO2

V_GPS_EN

Page 29: Using PIC32 MCUs to Develop GSM/GPRS/GPS Solutions ... · enables the implementation of GSM/GPRS/GPS connectivity using a PIC32 microcontroller (MCU), the M2M Board, and the MEB

© 2011 M

icrochip Technology Inc.D

S01373A

-page 29

AN

1373

FIG

D +3.8V

C5

100uF

C11

100uF

4K

0K5

100uF

C10

URE B-7: GSM/GPS POWER SUPPLY DAUGHTER BOARD

GND

+VIN

3.9nFC2

R312.7K

CHARGER+

1uFC4

GN

R64.7K

R2953R

4.7uFC7

D2

13 14

7 8

1 2

11 12

15 16

5 6

9

3

10

4

HD

R-T

H_0

.1-2

X8

J3

D1

C3

6.8nF

100nFC6

R37.4

22uFC1

4.7KR7

69.8KR1

6

VIN

9

GN

D

11

GN

D

10

GN

D

21

PE

5

VIN

16

VIN

15

VIN

4 COMP

3PGOOD

2FB

13SW20 RT

19 EN 14SW8SW 7SW

17BOOT

18VCC12 AGND

1 SS/TRK

LM20

343

U122uF

C94.7uFC8

1R

25 26

19 20

13 14

7 8

1 2

23

27

24

28

11 12

17

21

15 16

18

22

5 6

9

3

10

4

J2

HD

R-T

H_0

.1-2

X14

L1

10uH

Page 30: Using PIC32 MCUs to Develop GSM/GPRS/GPS Solutions ... · enables the implementation of GSM/GPRS/GPS connectivity using a PIC32 microcontroller (MCU), the M2M Board, and the MEB

AN

1373

DS

01373A-page 30

© 2011 M

icrochip Technology Inc.

ANT

100

L103R104

R105

L101

TP102

OPT100

R100

C10

0

L100

TP106

TP100

TP101

TP103

TP104

TP105

112

113

APPENDIX C: LAYOUT

FIGURE C-1: M2M BOARD LAYOUT (TOP ASSEMBLY)

25 26

501

ANT201

R20

2

C106

J101

R11

3

U104

R116

R111

C109

R11

9

R120

R10

7

U100

ANT200U2

00

C216

C204

C210J200

C

C110

C111

C

R205

U105

R21

3

R215

C20

1

U102

U204

U101

U103

C20

3

R20

4

R210

D10

3

C200

R11

2R

114

IC10

0

R118

R11

0

C108

T100

D10

2

R10

3R

109

R117

L102

R11

5B

20

0

R10

6

R10

8

C10

7

R10

2

C21

7

TP200

R209

TP201

TP202

R207

R208 R10

1

R201 D202

C202

C212

U212

U208

U210

U211

U207

D200

L203

R200

U20

3

U20

6

L201

R20

6 C207

TR200

L202

U20

1

C20

5C

206

L204

C20

9

U20

9

C22

2

U202C219

C22

0

R22

4

C22

3

C22

4

C208

U20

5

R221

R222

LEON-G200

Rin

g

Net

wor

k

External AntennaConnector

NEO-6Q

Timepulse

Page 31: Using PIC32 MCUs to Develop GSM/GPRS/GPS Solutions ... · enables the implementation of GSM/GPRS/GPS connectivity using a PIC32 microcontroller (MCU), the M2M Board, and the MEB

© 2011 M

icrochip Technology Inc.D

S01373A

-page 31

AN

1373

FIG

URE C-2: M2M BOARD LAYOUT (BOTTOM ASSEMBLY)

C103

J100

C102

OPT101

D100C104

C101 D101

C105

Page 32: Using PIC32 MCUs to Develop GSM/GPRS/GPS Solutions ... · enables the implementation of GSM/GPRS/GPS connectivity using a PIC32 microcontroller (MCU), the M2M Board, and the MEB

AN

1373

DS

01373A-page 32

© 2011 M

icrochip Technology Inc.

FIGURE C-3: GSM/GPS POWER SUPPLY DAUGHTER BOARD LAYOUT

M

Page 33: Using PIC32 MCUs to Develop GSM/GPRS/GPS Solutions ... · enables the implementation of GSM/GPRS/GPS connectivity using a PIC32 microcontroller (MCU), the M2M Board, and the MEB

Note the following details of the code protection feature on Microchip devices:• Microchip products meet the specification contained in their particular Microchip Data Sheet.

• Microchip believes that its family of products is one of the most secure families of its kind on the market today, when used in the intended manner and under normal conditions.

• There are dishonest and possibly illegal methods used to breach the code protection feature. All of these methods, to our knowledge, require using the Microchip products in a manner outside the operating specifications contained in Microchip’s Data Sheets. Most likely, the person doing so is engaged in theft of intellectual property.

• Microchip is willing to work with the customer who is concerned about the integrity of their code.

• Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code. Code protection does not mean that we are guaranteeing the product as “unbreakable.”

Code protection is constantly evolving. We at Microchip are committed to continuously improving the code protection features of ourproducts. Attempts to break Microchip’s code protection feature may be a violation of the Digital Millennium Copyright Act. If such actsallow unauthorized access to your software or other copyrighted work, you may have a right to sue for relief under that Act.

Information contained in this publication regarding deviceapplications and the like is provided only for your convenienceand may be superseded by updates. It is your responsibility toensure that your application meets with your specifications.MICROCHIP MAKES NO REPRESENTATIONS ORWARRANTIES OF ANY KIND WHETHER EXPRESS ORIMPLIED, WRITTEN OR ORAL, STATUTORY OROTHERWISE, RELATED TO THE INFORMATION,INCLUDING BUT NOT LIMITED TO ITS CONDITION,QUALITY, PERFORMANCE, MERCHANTABILITY ORFITNESS FOR PURPOSE. Microchip disclaims all liabilityarising from this information and its use. Use of Microchipdevices in life support and/or safety applications is entirely atthe buyer’s risk, and the buyer agrees to defend, indemnify andhold harmless Microchip from any and all damages, claims,suits, or expenses resulting from such use. No licenses areconveyed, implicitly or otherwise, under any Microchipintellectual property rights.

© 2011 Microchip Technology Inc.

Trademarks

The Microchip name and logo, the Microchip logo, dsPIC, KEELOQ, KEELOQ logo, MPLAB, PIC, PICmicro, PICSTART, PIC32 logo, rfPIC and UNI/O are registered trademarks of Microchip Technology Incorporated in the U.S.A. and other countries.

FilterLab, Hampshire, HI-TECH C, Linear Active Thermistor, MXDEV, MXLAB, SEEVAL and The Embedded Control Solutions Company are registered trademarks of Microchip Technology Incorporated in the U.S.A.

Analog-for-the-Digital Age, Application Maestro, CodeGuard, dsPICDEM, dsPICDEM.net, dsPICworks, dsSPEAK, ECAN, ECONOMONITOR, FanSense, HI-TIDE, In-Circuit Serial Programming, ICSP, Mindi, MiWi, MPASM, MPLAB Certified logo, MPLIB, MPLINK, mTouch, Omniscient Code Generation, PICC, PICC-18, PICDEM, PICDEM.net, PICkit, PICtail, REAL ICE, rfLAB, Select Mode, Total Endurance, TSHARC, UniWinDriver, WiperLock and ZENA are trademarks of Microchip Technology Incorporated in the U.S.A. and other countries.

SQTP is a service mark of Microchip Technology Incorporated in the U.S.A.

All other trademarks mentioned herein are property of their respective companies.

© 2011, Microchip Technology Incorporated, Printed in the U.S.A., All Rights Reserved.

Printed on recycled paper.

ISBN: 978-1-60932-923-5

DS01373A-page 33

Microchip received ISO/TS-16949:2002 certification for its worldwide headquarters, design and wafer fabrication facilities in Chandler and Tempe, Arizona; Gresham, Oregon and design centers in California and India. The Company’s quality system processes and procedures are for its PIC® MCUs and dsPIC® DSCs, KEELOQ® code hopping devices, Serial EEPROMs, microperipherals, nonvolatile memory and analog products. In addition, Microchip’s quality system for the design and manufacture of development systems is ISO 9001:2000 certified.

Page 34: Using PIC32 MCUs to Develop GSM/GPRS/GPS Solutions ... · enables the implementation of GSM/GPRS/GPS connectivity using a PIC32 microcontroller (MCU), the M2M Board, and the MEB

DS01373A-page 34 © 2011 Microchip Technology Inc.

AMERICASCorporate Office2355 West Chandler Blvd.Chandler, AZ 85224-6199Tel: 480-792-7200 Fax: 480-792-7277Technical Support: http://www.microchip.com/supportWeb Address: www.microchip.comAtlantaDuluth, GA Tel: 678-957-9614 Fax: 678-957-1455BostonWestborough, MA Tel: 774-760-0087 Fax: 774-760-0088ChicagoItasca, IL Tel: 630-285-0071 Fax: 630-285-0075ClevelandIndependence, OH Tel: 216-447-0464 Fax: 216-447-0643DallasAddison, TX Tel: 972-818-7423 Fax: 972-818-2924DetroitFarmington Hills, MI Tel: 248-538-2250Fax: 248-538-2260IndianapolisNoblesville, IN Tel: 317-773-8323Fax: 317-773-5453Los AngelesMission Viejo, CA Tel: 949-462-9523 Fax: 949-462-9608Santa ClaraSanta Clara, CA Tel: 408-961-6444Fax: 408-961-6445TorontoMississauga, Ontario, CanadaTel: 905-673-0699 Fax: 905-673-6509

ASIA/PACIFICAsia Pacific OfficeSuites 3707-14, 37th FloorTower 6, The GatewayHarbour City, KowloonHong KongTel: 852-2401-1200Fax: 852-2401-3431Australia - SydneyTel: 61-2-9868-6733Fax: 61-2-9868-6755China - BeijingTel: 86-10-8528-2100 Fax: 86-10-8528-2104China - ChengduTel: 86-28-8665-5511Fax: 86-28-8665-7889China - ChongqingTel: 86-23-8980-9588Fax: 86-23-8980-9500China - Hong Kong SARTel: 852-2401-1200 Fax: 852-2401-3431China - NanjingTel: 86-25-8473-2460Fax: 86-25-8473-2470China - QingdaoTel: 86-532-8502-7355Fax: 86-532-8502-7205China - ShanghaiTel: 86-21-5407-5533 Fax: 86-21-5407-5066China - ShenyangTel: 86-24-2334-2829Fax: 86-24-2334-2393China - ShenzhenTel: 86-755-8203-2660 Fax: 86-755-8203-1760China - WuhanTel: 86-27-5980-5300Fax: 86-27-5980-5118China - XianTel: 86-29-8833-7252Fax: 86-29-8833-7256China - XiamenTel: 86-592-2388138 Fax: 86-592-2388130China - ZhuhaiTel: 86-756-3210040 Fax: 86-756-3210049

ASIA/PACIFICIndia - BangaloreTel: 91-80-3090-4444 Fax: 91-80-3090-4123India - New DelhiTel: 91-11-4160-8631Fax: 91-11-4160-8632India - PuneTel: 91-20-2566-1512Fax: 91-20-2566-1513Japan - YokohamaTel: 81-45-471- 6166 Fax: 81-45-471-6122Korea - DaeguTel: 82-53-744-4301Fax: 82-53-744-4302Korea - SeoulTel: 82-2-554-7200Fax: 82-2-558-5932 or 82-2-558-5934Malaysia - Kuala LumpurTel: 60-3-6201-9857Fax: 60-3-6201-9859Malaysia - PenangTel: 60-4-227-8870Fax: 60-4-227-4068Philippines - ManilaTel: 63-2-634-9065Fax: 63-2-634-9069SingaporeTel: 65-6334-8870Fax: 65-6334-8850Taiwan - Hsin ChuTel: 886-3-6578-300Fax: 886-3-6578-370Taiwan - KaohsiungTel: 886-7-213-7830Fax: 886-7-330-9305Taiwan - TaipeiTel: 886-2-2500-6610 Fax: 886-2-2508-0102Thailand - BangkokTel: 66-2-694-1351Fax: 66-2-694-1350

EUROPEAustria - WelsTel: 43-7242-2244-39Fax: 43-7242-2244-393Denmark - CopenhagenTel: 45-4450-2828 Fax: 45-4485-2829France - ParisTel: 33-1-69-53-63-20 Fax: 33-1-69-30-90-79Germany - MunichTel: 49-89-627-144-0 Fax: 49-89-627-144-44Italy - Milan Tel: 39-0331-742611 Fax: 39-0331-466781Netherlands - DrunenTel: 31-416-690399 Fax: 31-416-690340Spain - MadridTel: 34-91-708-08-90Fax: 34-91-708-08-91UK - WokinghamTel: 44-118-921-5869Fax: 44-118-921-5820

Worldwide Sales and Service

02/18/11