Upload
others
View
4
Download
0
Embed Size (px)
Citation preview
Institut fürTechnische Informatik undKommunikationsnetze
3G Datalink for Wireless GPSSensorsSemester Thesis
Schnetzler Christoph
Computer Engineering and Networks Laboratory
Department of Information Technology and Electrical Engineering
ETH Zurich
Supervisors:
Dr. Jan BeutelTonio Gsell
Prof. Dr. Lothar Thiele
June 11, 2018
Acknowledgements
I thank Jan Beutel, Tonio Gsell and Akos Pasztor for their support and theirhelpful inputs. I thank Thomas Kleier helping me vapor phase soldering theu-blox SARA-U270 modules.
i
Abstract
This semester thesis aims to extend the existing wireless GPS rev2 sensor sys-tem with a software interface for the cellular module. The goal is to exchangedata directly and reliably between the sensor system and the PermaSense databackend system. The result is a working, well-documented parser which handlesthe communication between the cellular module and the GPS sensor system. Itis able to establish an internet connection and can send and receive data over it.It is though not yet integrated in the existing wireless GPS sensor code.
ii
Contents
Acknowledgements i
Abstract ii
1 Introduction 1
2 Objectives 2
3 Overview 3
3.1 PermaSense . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
3.2 Wireless GPS rev2 sensor system . . . . . . . . . . . . . . . . . . 4
3.2.1 System overview . . . . . . . . . . . . . . . . . . . . . . . 4
3.2.2 Operating modes . . . . . . . . . . . . . . . . . . . . . . . 5
3.2.3 FreeRTOS . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
4 Cellular module 7
4.1 Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
4.2 AT commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
4.2.1 Operating modes . . . . . . . . . . . . . . . . . . . . . . . 8
4.2.2 Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.2.3 Response time . . . . . . . . . . . . . . . . . . . . . . . . 11
4.3 URC - Unsolicited Result Code . . . . . . . . . . . . . . . . . . . 11
4.4 Boot phase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
5 Code implementation 13
5.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
5.2 Development environment . . . . . . . . . . . . . . . . . . . . . . 13
5.3 FreeRTOS primitives . . . . . . . . . . . . . . . . . . . . . . . . . 13
5.3.1 Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
iii
Contents iv
5.3.2 Software timer . . . . . . . . . . . . . . . . . . . . . . . . 14
5.3.3 Event groups . . . . . . . . . . . . . . . . . . . . . . . . . 15
5.4 Cellular module software interface . . . . . . . . . . . . . . . . . 15
5.4.1 The AtCommand struct and the GSM struct . . . . . . . 15
5.4.2 UART and pin initialization . . . . . . . . . . . . . . . . . 16
5.4.3 AT command parser . . . . . . . . . . . . . . . . . . . . . 17
5.4.4 GSM task . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
5.5 Datalink . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
5.5.1 GPRS system architecture overview . . . . . . . . . . . . 25
5.5.2 Cellular network registration . . . . . . . . . . . . . . . . 25
5.5.3 Internal PDP context activation . . . . . . . . . . . . . . 27
5.5.4 Data connection . . . . . . . . . . . . . . . . . . . . . . . 27
6 Further work 29
6.1 Achieved goals . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
6.2 Follow-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
7 Conclusion 31
Bibliography 32
List of figures 33
A WGPS Schematics 1
Chapter 1
Introduction
Avalanches, rockfalls and receding permafrost boundaries are just a few examplesof what is going on in the mountains. This leads us to the question if these eventsare predictable at all.
The PermaSense project has been working for years to record data suchas temperature, humidity, brightness, rock movements, etc., to create a betterunderstanding of the processes in the high alpine locations and to react early topossible natural hazards.
In order to collect data, sensors have been installed at some chosen locationsin the Alps which take measurements at regular intervals.
One of these sensors is the wireless GPS rev2 sensor. It collects groundmotion data and stores it either locally or sends it via a cellular module to thePermaSense data backend system. Up to now, these sensors can only store theirdata locally as the software interface for the cellular module is not implemented.
Therefore, the goal of this work is to implement an interface which is ableto establish a direct 3G datalink between sensor and PermaSense data backendsystem to exchange data.
1
Chapter 2
Objectives
• Extend the wireless GPS rev2 sensor system with a dedicated 3G datalink.
• Design an integration concept which guarantees
– efficient operation and monitoring of the system.
– reliable data transfer into the PermaSense data backend system.
• Implement and evaluate a prototype system based on the ARM/FreeRTOSsoftware framework of the wireless GPS rev2 sensor system.
• Document the work in a manner that follow-up projects can be built upon.
2
Chapter 3
Overview
3.1 PermaSense
The PermaSense project aims to observe and to understand the phenomena inhigh-alpine environments better. This can be, for instance, rockfalls, recedingpermafrost boundaries or slope instabilities. For a reliable observation of thephenomena, a sensing network has been developed. This network consists ofultra-low power wireless sensor nodes which are sensing a diverse range of pa-rameters, such as temperature, humidity, light, ground motion, etc. The nodesallow long term autonomous operations in range of multiple years. Therefore,the devices are strictly duty cycled and gather data in low rate (e.g. 1/120sec).Figure 3.1 shows the basic system architecture consisting of a Wireless SensorNetwork, Core Stations and the Data Backend.
Figure 3.1: PermaSense System Architecture [19]
3
3. Overview 4
3.2 Wireless GPS rev2 sensor system
The wireless GPS rev2 sensor system (WGPS) has been developed to measureground motion in high-alpine regions. Tracking ground motion helps to observerockfall and debris flow critical regions as well as the movement of boulders atsteep mountainsides. Having long time data over critical regions allows to detectsuspicious behaviors, such as accelerating motion or sudden movements. Forinstance, with such information, mountain villages located in danger zones canbe warned or evacuated at an early stage.
3.2.1 System overview
The WGPS device is driven by an ultra-low power STM32L496VG microcon-troller [2], based on an FPU ARM Cortex-M4 MCU. Its equipped with GPS,GSM, Radio (TinyNode), an electronic compass, a tilt, a temperature and ahumidity sensor (figure 3.2). The cellular module (called GSM) and the TinyN-ode are connected over a plug connection. Therefore, they can be plugged in ifneeded. It’s powered over a solar panel and needs between 11 and 20 voltageinput. The WGPS device is able to track ground motion with high precision inrange of millimeters. This precision is achieved by using a reference GPS sensormounted as closly as possible to the other sensors but at a position which isknown to be static (e.g. solid rock). If the other ones move, we can calculatethe relative movement which is much more precise than just the GPS data itself.The GPS data is recorded in raw format and no data processing is performedon the WGPS devices itself. The postprocessing is done in the PermaSense databackend system.
GPSCompass GSM
TiltSensor
HumiditySensor
Temp.Sensor
Buzzer Reed USB
Sense
DC/DC
Flash
TinyNode
MCU
Sense & Process Communication
Interfaces
Power Storage
Figure 3.2: WGPS System overview [14]
3. Overview 5
3.2.2 Operating modes
Compared to the basic system architecture (figure 3.1), the WGPS devices donot need any core stations, they directly connect to the PermaSense data back-end. This allows a simpler installation in the mountains. The WGPS has threedifferent operating modes.
StandaloneLogger
StandaloneCellular
GSM
Radio
Radio
GSM
NetworkMode
Radio
Radio
Figure 3.3: WGPS operating modes [14]
Standalone Logger Mode
In this operating mode, the WGPS device has no GSM and Radio module at-tached. Therefore, the device is not able to communicate with the PermaSensebackend system. It stores the measurements on its internal storage. The datahas to be extracted during on-site maintenance. This configuration is for areaswhich do not have cellular coverage or which are not intended to be observedonline.
Standalone Cellular Mode
The WGPS device is equipped with a cellular module but has no radio moduleattached. With the cellular module, the device is capable of communicatingwith the backend system. It can send the recorded measurements and receivecommands from the backend system.
Wireless Network Mode
This is the full configuration which uses radio and GSM. With the radio thedevice is able to communicate between multiple WGPS devices. One deviceacts as sink and collects all the date. This device is equipped with GSM andcan therefore forward all data to the backend system. The sink can also receivecommands from the backend which are forwarded over radio to the other devices.
3. Overview 6
Priorityx6
Priorityx5
Priorityx4
Priorityx3
Priorityx1
Priorityx2
Priorityx7
Priorityx0
InterruptsxrunningxatxthesexprioritiesxwillxneverxbexdelayedxfromxexecutingxbecausxofxanythingxthexFreeRTOSxkernelxisxdoing.
ISRsxthatxcallxAPIxfunctionsxendingxinxFFromISRFxcanxusexthesexinterruptxpriorities,xandxwillxnest.
Interruptsxthatxdoxnotx
callxanyxFreeRTOSx
APIxfunctionsxcanxusexallx
interruptxpriorities,x
andxwillxnest.
Figure 3.4: Example interrupt priority configuration [16]
3.2.3 FreeRTOS
The WGPS device needs to take measurements in periodic time steps. But notall measurements have to be done in the same periodic interval. Sometimes, ameasurement takes some time and we would like to do other work until it hasfinished and we can continue. We also want to be able to shut off the peripheralsindependently to save energy. We need something which organizes this largeamount of work for us. Therefore, the WGPS system uses FreeRTOS.
FreeRTOS is a real time operating system which is small enough to run onmicrocontrollers. It provides real time scheduling functionality, inter-task com-munication, timing and synchronization primitives. It allows us to write codein a set of independent tasks. Tasks reduce the dependencies between softwaremodules and increase the code maintainability. Each task and interrupt is as-signed to a priority which allows the scheduler to decide which task or interruptneeds to be executed first. As interrupts need to response very fast to events,they have always the higher priority than tasks. Means, the lowest interruptpriority is still higher than the highest task priority. Figure 3.4 shows a possibleinterrupt priority configuration where the maximal system call interrupt priorityis set to four and the kernel interrupt priority is set to zero. FreeRTOS has spe-cial API functions for interrupts, ending with ”FromISR”. These functions arelocated in the interrupt code, but not executed inside an ISR because FreeRTOSclaims to be deterministic and therefore doesn’t allow to call functions whichcould cause non-deterministic behavior.
The FreeRTOS primitives used in this project are introduced in section 5.3.
Chapter 4
Cellular module
The used cellular module is the SARA-U270 from u-blox [4].
Memory
V_BCKPl2RTC-
V_INTl2IxO-
RFtransceiver
PowerManagement
CellularBaseBandProcessor
ANT
VCCl2Supply-
USB
DDCl2IkC-
SIMlcardldetection
SIM
UART
PowerHOn
Reset
Digitallaudiol2IkS-
GPIO
Antennaldetection
3GlPA
k6lMHz
Duplexer
Filter
Switch
kGlPA
LNA
3klkHz
Figure 4.1: SARA-U270 block diagram [7]
4.1 Interface
The used serial communication interface is UART. The module features the com-plete functionality conforming to the ITU-T V.24 recommendation [5]. In theproject, only the data lines (Rx, Tx) and the hardware control lines (CTS, RTS)are used. The modem status and control lines (DTR, DSR, DCD, RI) are pro-vided but unused. By default, the HW flow control is enabled, the DSR line isset to ON in data mode and OFF in command mode and the module enters theonline command mode after an ON-to-OFF transition of the DTR line, issuingan ”OK” result code. Result codes are discussed in chapter 4.2.
The used frame format is 8N1 (8 data bits, no parity, 1 stop bit). 8N1 is alreadythe default frame configuration and doesn’t need to be changed.
7
4. Cellular module 8
4.2 AT commands
This section gives a short overview about AT commands. All information aboutu-blox AT commands can be found in the document “u-blox Cellular Modules -AT Commands Manual” [6].
4.2.1 Operating modes
The SARA-U270 module has three different operating modes:
• Command mode
• Data mode
• Online command mode
Command mode
In the command mode, the module interprets every received character as a com-mand to execute. Any communication in the command mode is terminated withthe command line termination character <s3 character>. By default, this is thecarriage return ’\r’ character. Every command has the following generic syntax:
"AT"<command_name><string><s3_character>
For instance,
"AT+IPR=9600\r"
but <string>can also be empty,
"AT+CGMM\r"
The AT command response comprises of an echo, an optional informationtext response string (ITR) and a final result code (FRC).
4. Cellular module 9
AT command
Echo
Information Text Response
Final Result Code
wait > 20 ms
next AT command
MCU Cellular Module
Figure 4.2: AT command response flow chart [17]
The echo is an exact copy of the command which has been sent. The ITRcontains intermediate outputs as well as descriptive outputs. This can be themanufacturer’s name, the firmware version, stored settings, etc. An ITR disposesof the following syntax:
<text><s3_character><s4_character>
The <s4 character>is by default the linefeed character ’\n’.
The FRC completes the response and informs about the result of the command.It has the following syntax:
<numerical_code><s3_character>
The most common FRC’s are “OK” and “ERROR”. All allowed result codesare listed in table 4.1. A possible response is, for instance:
AT+URAT?\r +URAT: 1,2\r\n 0\r
The module supports verbose or numeric responses. By default, the verboseresponse mode is enabled, but parsing text instead of numbers is inefficient.Therefore, we use the numeric response mode. After reception of the FRC oneshould wait for at least 20ms before issuing a new AT command. This allowsthe module to transmit buffered URC’s, otherwise collisions between URC’s andAT commands are possible. URC’s are introduced in section 4.3.
4. Cellular module 10
Verbose Numeric Description
OK 0 Command executed correctlyCONNECT 1 Data connection establishedRING 2 Incoming call signal from the networkNO CARRIER 3 Connection terminated from the remote
part or attempt to establish a connectionfailed
ERROR 4 General failureNO DIALTONE 5 No dialtone detectedBUSY 6 Called number is busyNO ANSWER 7 No hang up detected after a fixed network
timeoutCommand aborted 18 Command execution aborted
Table 4.1: Allowed result codes
Data mode
The Data mode is entered as soon as a connection to a remote host is establishedor the result code ”CONNECT” has been received, respectively. In this mode,the module doesn’t interpret characters to be commands. Instead, every charac-ter received from the serial interface is being forwarded to the remote host. Everycharacter received from the remote host is being forwarded to the serial interface.To exit the data mode, one needs to send +++. This triggers the module tosend ”OK”. Only after this message, the data mode is left successfully.
Online command mode
The online command mode is if the module is in data mode but can read andprocess AT commands. This mode can be entered over a ON-to-OFF transitionon the DTR line. An ”OK” result code indicates that the online command modehas been entered.
4.2.2 Errors
Every AT command has an error response type. The most common error typeis the ”+CME ERROR”. This error occurs if the issued command couldn’t beprocessed successfully by the cellular module. If an error occurs, the modulesends the echo followed by the FRC. By default, the FRC ”ERROR” is dis-played without information about what caused the failure exactly. The numericresponse for an error is 4. To enable the entire error message, one needs to sendthe AT command ”+CMEE” after the module has booted.
4. Cellular module 11
Next there is an example of an error response with +CMEE disabled,
AT+CPIN?\r ERROR\r
and with +CMEE enabled,
AT+CPIN?\r +CME ERROR: SIM NOT INSERTED\r
For a better understanding the example shows the verbose and not the numericresponse. In the numeric response ”ERROR” would be replaced with 4 and”SIM NOT INSERTED” with 10. All possible errors can be found in the ”ATCommands Manual, Appendix A” [6].
4.2.3 Response time
The cellular module usually replies immediately to an AT command. This meansthat in average it takes 10ms and in any case less than one second to respond.However, there are commands which will need more time to answer. For instance,the network registration can take up to three minutes until a response is issued.
4.3 URC - Unsolicited Result Code
Beside the normal response message, the module can as well send unsolicitedresult codes - URC’s (figure 4.3). URC’s are string messages which are completelyuncorrelated to an AT command execution. The module uses URC’s to informif a status changes or a specific event has occurred. This happens when, forinstance, the module has lost its network coverage and needs some time to registeragain to the network. URC’s can occur at any time except if the module is indata mode or if the module is already executing an AT command. URC’s needto be enabled with AT commands. Most of the URC’s have the same name asthe command that enables it. For instance,
AT+CREG=1
enables the network registration URC with the following appearance,
+CREG: 1
The One is just one possible value of CREG and indicates that the module isnow registered to the home network.
4. Cellular module 12
Unsolicited Result Code 1
Unsolicited Result Code 2
Unsolicited Result Code N
next AT command
Final Result Code
MCU Cellular Module
Figure 4.3: URC flow chart [17]
4.4 Boot phase
The boot phase of the module can take several seconds. In order to signal thesuccessful end of the boot phase, the module sends a greeting text. The modulewill not response to any AT commands before the greeting text has been sent.By default, the empty string is sent. The greeting text can be set to any stringwith a maximal length of 49 characters.If the greeting text is used, one needs to consider that the module has an au-tobauding feature which is enabled by default and allows the module to detectthe baudrate automatically as soon as the first characters have been received.Therefore, as long as the module hasn’t received anything, it won’t send any-thing. This means that if the greeting text is used to detect the end of thebooting phase, one needs to set a fix baudrate. Otherwise both sides wait for anevent that will never happen.In this project, the greeting text has been changed to “ready\r”.
Chapter 5
Code implementation
5.1 Overview
If the wireless GPS sensor system is not exactly operating in datalogger mode,it needs the cellular module to transfer the data to the PermaSense data back-end system. Up to now, the entire hardware is provided and also the softwareis complete except for the software interface between the cellular module andthe WGPS device. This means that actually the WGPS device if fully workingbut only in data logger mode. In this project we aim to close this gap and toimplement the interface. As mentioned in the objectives, the interface shouldallow efficient operation and give the opportunity to monitor the system.This chapter is split up in three major parts. In the first one, the developmentenvironment and the FreeRTOS primitives used in the implementation are in-troduced. In the second part, the interface will be explained more explicitly.And finally, in the third part, we consider how to establish a reliable connectionbetween cellular module and the PermaSense backend data system.
5.2 Development environment
The used development and debugging IDE is the Atollic R© TrueSTUDIO R© [1]for STM32 microcontrollers, based on Eclipse, CDT, GCC and GDB. It supportsversion control such as Git and the SEGGER J-Link [3] which has been used asdebugger. The entire project is version controlled using Git and the repositoryis stored on GitLab.
5.3 FreeRTOS primitives
As the rest of the already existing software relies on FreeRTOS, we need to imple-ment our interface within this framework. Our implementation uses FreeRTOS
13
5. Code implementation 14
tasks, software timers and event groups which are now introduced briefly. Moredetails can be found in the FreeRTOS reference manual [12].
5.3.1 Tasks
Tasks are the basic elements, handled by the scheduler. Each task can be in oneof four states (running, ready, blocked or suspend) as shown in figure 5.1. If atask is in blocking state, then he is not ready to run and waits for an event tohappen. If the event happens, the task is put in ready state by the scheduler. Ifit is the only task in ready state and no task is in running state, then the taskis immediately put in running state. Only in the running state, CPU time isconsumed. If more than one task is in ready state, the priority decides whichtask is put in running state first. If a task is suspended, it cannot resume byitself, instead, another task needs to do that. In our implementation we neveruse suspend as we always wait for some events to happen and therefore wait inblocked state.
vTaskSuspend()called
Ready
Event
Running
Blocked
Blocking APIfunction called
SuspendvTaskResume()
called
vTaskSuspend()called
vTaskSuspend()called
Figure 5.1: Valid task state transitions [15]
5.3.2 Software timer
FreeRTOS software timers are used to trigger an event in a certain time in thefuture. If one creates a timer, then one also needs to create a callback function.The callback function is called after the timer has fired and the code within thisfunction is executed. Timers can be used for various occasions. For instance, ifone starts to execute a measurement, but one does not know if the execution isdeterministic. A timer can be started before starting the execution and specifythe maximum allowed time the task has. If the task exceeds the specified time,the timer fires and can abort the execution.
5. Code implementation 15
5.3.3 Event groups
Event groups belong to the synchronization primitives and are used to commu-nicate events to tasks. They allow a task to stay in the blocked state until acombination of events has occurred. For instance, if we send an AT command,we need to wait for a response. This can be either the event “OK” or the event“ERROR”. Event groups allow us now to block the task until one of them oc-curs. In order to indicate if a certain event has occurred, event ‘flags’ are used.A set of events ‘flags’ is called event ‘group’. Setting an event flag or a certaincombination of them, unblocks the task.
5.4 Cellular module software interface
In the second step, we will now step through our implementation. First, weexplain two important control structures which are used in the entire code. Sec-ondly, we show how we initialized the serial interface between cellular module andMCU. Thirdly, we consider the command parser and explain how it is thoughtto be used. Finally, we introduce our task.
5.4.1 The AtCommand struct and the GSM struct
AtCommand struct
AT commands have different error types, response types, response times, sizesand names. This means that we need to handle the AT commands differentlyaccordingly to the given parameters. For instance, some take longer to respondthan others, some have only a FRC as response, some have an ITR followed bya FRC and there are also special cases where only an ITR is sent. In order tokeep track of all of these different characteristics, we created the AtCommandstruct. This struct stores the error type, the response type, the response time,the name and its size. Before sending an AT command, this struct has to befilled such that the parser (see section 5.4.3) is aware of what to expect and toreact accordingly.
GSM struct
This struct is the heart of our implementation. It contains the PARSER REGvariable. This variable is used as a register as every bit indicates a different parserstate. Table 5.1 lists all used flags. This register keeps track of the actual systemstate. At the very beginning, no bit is set. If we start to listen on the serialinterface, we activate the interrupt and then the first bit GSM IT ENABLED isset. Next, if we power on the cellular module, the second bit GSM RUNNING
5. Code implementation 16
Bit Name Description
0 GSM IT ENABLED Set if parser is started, interrupts enabled1 GSM RUNNING Set if module is activated2 GSM GREETING Set if greeting text has been received3 GSM COMMAND Set if response of a command is expected4 GSM URC Set if a URC is being received5 GSM ECHO OK Set if command echo from GSM Module is ok6 GSM FIRST AFTER ECHO Cleared if first character after echo is received7 GSM ERROR Set if error in the parser pipeline occurred
Table 5.1: PARSER Register
is set to indicate that from now on characters can be received. As we use thegreeting text to indicate a successful startup, we first need to wait for it to bereceived. The third bit GSM GREETING is set if we have received it. If thefirst three bits are set, we are ready to start sending AT commands.
During transmission and reception of an AT command, several errors canoccur. For instance, there can be an UART error, an error in the parser oran error response from the cellular module. Therefore, we store the error typeand its corresponding error code in the GSM struct. If an error is present, theGSM ERROR bit in the PARSER REG is set, also. This bit is set as long asthe error is not handled, and an error handling is pending.
The AT command responses and URC’s need to be stored somewhere. This isalso done in the GSM struct by using two pointers. One points to the beginningof the ITR string and the other one to the beginning of the URC string. Theyboth have stored their string size, too. The URC and the ITR pointer are usedin the URC Handler and in the Command Handler.
5.4.2 UART and pin initialization
All information about the STM32L496VG relies upon the information providedby the STM32L496 datasheet [8], the STM32L496 Reference Manual [9] and theSTM32 HAL driver [10] .
According to the wireless GPS rev2 sensor schematics, see Appendix, the cellu-lar module is connected over USART2. Therefore, Tx and Rx are on pin PA2and PA3 respectively. To initialize these pins, we use the UART HandleTypeDefstruct from the STM32 HAL driver. Because USART2 belongs to the alternatefunctions of a pin, we need to change its mode to AF7. In the next step, we needto initialize the UART itself. As mentioned in chapter 4.1, the cellular moduleuses the 8N1 frame format and therefore we set it accordingly to this. Table 5.2shows the entire setup. The baudrate has been set to 9600 bps but 115200 bps
5. Code implementation 17
UartHandle->Instance = USART2;UartHandle->Init.BaudRate = 9600;UartHandle->Init.WordLength = UART WORDLENGTH 8B;UartHandle->Init.StopBits = UART STOPBITS 1;UartHandle->Init.Parity = UART PARITY NONE;UartHandle->Init.HwFlowCtl = UART HWCONTROL RTS CTS;UartHandle->Init.Mode = UART MODE TX RX;UartHandle->Init.OverSampling = UART OVERSAMPLING 16;
Table 5.2: UART initialization
works as well.
Further, we need to select the clock source and enable the peripheral clockfor the USART2. Four different clocks can be used for USART2, PCLK, HSI16,LSE or the system clock SYSCLK. The clock source is set in the “Peripheralsindependent clock configuration register (RCC CCIPR)” and enabled with the“APB1 peripheral clock enable register (RCC APB1ENR1)”. In fact, one doesnot have to deal with these registers directly. The clock can be enabled with theHAL macro, HAL RCC USART2 CLK ENABLE() and the clock source canbe selected with the RCC PeriphCLKInitTypeDef struct. In the last step weset the interrupt priority of the USART2. This priority has to be chosen verycarefully to ensure that the entire system still works. The interrupt priority isset with HAL NVIC SetPriority() and enabled with HAL NVIC EnableIRQ().
5.4.3 AT command parser
The AT command parser (from now on called parser) is actually only an interrupthandler. Every time the USART2 interrupt is triggered, the parser is called.Figure 5.2 shows the entire structure. It can be split up in four parts as coloredin the figure. Every part will be explained briefly starting with the white section.
Entering interrupt handler
If the interrupt is triggered, we check if an UART error has occurred. If an erroris detected, we check if the cellular module (in figure 5.2 referred as GSM) isalready running. The GSM RUNNING flag indicates if the module is running.The flag is set as soon as the SW GSM pin (PE10) is set HIGH. This enables thevoltage supply for the cellular module. If the module is not running, this errorcan be ignored. If it is running, we call the UART error callback function. Theway how this error is handled needs to be adapted to the already existing code ofthe wireless GPS sensor system. For now, the callback function just restarts themodule. Without an UART error, we check if the cellular module is running andif there are unhandled errors from the parser or from the cellular module itself.
5. Code implementation 18
Interrupt Handler
UART Error?
GSM Running andno Unhandled Errors?
GSM Running?
Rx interrupt flags set?
UART Error Callback function
Error No Clear interrupt flag
YesNo Error
Yes
No
Read char from Register
Greeting message from GSMmodule received?
AT command response expected and no URC ongoing?
Echo ok?
Yes
Yes
No
Yes
No
Already charactersreceived?
NoNoStart timer, set URC flag
URC buffer full?
Command buffer full?
Yes
No
Clearbuffer
URC messagecomplete?
Yes
Match
No match
Yes
No
No match
Greeting text ok,Unblock GSM task
compare char with greeting text
compare char with echo
Parser Error,Unblock GSM task
echo ok,Unblock GSM taskMatch
Not finished
Not finishedYes
Not finished
URC complete,Unblock GSM task
Switch state
Wait for s3_character Info text response Final result code
Check if error has been received
Error,Unblock GSM task
Yes
No
No
Command ok,Unblock GSM task
Change state to ITR
No
s4_character received?
No
change state to FRC
No
length of FRC correct?
Yes
Yes
No
Is command type == FRC?
s3_character received?
Command ok,Unblock GSM task
Parser Error,Unblock GSM task
store char in buffer
Store char in buffer
No
Yes
Is command type== CONNECT?
Yes
s3_character received?
No
Yes
Yes
change state to ITR
Yes
Exit ISR
Stop timer, clear URC flag
URC
Command
GreetingText
Figure 5.2: AT command parser
5. Code implementation 19
Unhandled errors are indicated by the GSM ERROR flag. We only proceed ifthe module is running and no errors are pending. In the next step we check theRx interrupt flag to be sure that a new character has been received. If the flagis set, we read the character from the RDR register.
Now we have to decide where we need to compare this char. If the greetingtext of the cellular module hasn’t been received, then we enter the greeting textsection. If we have sent an AT command, then we expect the cellular moduleto response to it and the command section is entered. If no command responseis expected, we have an unsolicited result code (URC) from the module and theURC section is entered.
Greeting text
We use the greeting text to signal a successful boot (see chapter 4.4). It is sentas soon as the module is ready to receive AT commands. Why do we not handleit in the URC section as the greeting text is an URC? The reason why, is thatthe greeting text is the very first string we receive and therefore we check it atthe very beginning. This avoids sending AT commands before the greeting texthas been received.
In this part, we compare the received character with the corresponding char-acter from the greeting text. That means, if we receive, for instance, the 5thcharacter, then we compare it with the 5th character of our greeting text string.If it is correct and we are not at the end of our string, we leave and wait forthe next character to be received. If it doesn’t match, we set the GSM ERRORevent flag to unblock our GSM task. We also set the GSM ERROR flag in ourPARSER register to signal an unhandled error. If the last character of the greet-ing text has been received successfully, we set the GSM GREETING event flagto unblock the GSM task as well as the GSM GREETING flag in our PARSERregister. This flag is set as long as the module is not powered off or reset. If oneof these events take place, this flag needs to be cleared.
URC
URC’s have been explained in chapter 4.3. If no command response is expected,we enter this part of the implementation. First, we check if this is the firstcharacter we have received for the coming message. If this is true, we start aFree RTOS software timer and set the GSM URC flag in our PARSER registerto indicate that an URC is ongoing. The timer is set to ensure that the URCwill finish after some time and not hang up the parser. If the flag is already set,we don’t need to do it again and can continue. Before we store the character inour buffer, we check if it’s full or not. If so, we just clear the buffer and continue.Why are we doing this? URC’s are short messages with a length of about 7 to
5. Code implementation 20
15 characters and therefore predictable and an overflow should never happen.If it happens, then an overflow is avoided. Every URC message ends with the<s3 character>and until we haven’t received this we leave the ISR. After wereceived it we stop the timer, clear the GSM URC flag and unblock the GSMtask by setting the GSM URC event flag.
Important note: If the cellular module is in data mode, all sent charactersfrom the remote host are directly forwarded to the serial interface. This means,these characters are considered to belong to an URC and need to be handled inthe URC handler of the GSM task. The maximal length of data which can bereceived, depends on the buffer size. If this limit is exceeded, then the buffer issilently cleared, as mentioned above. Every message sent from a remote host tothe cellular module, needs to end with the <s3 character>, otherwise the parserwon’t be able to recognize a finished message.
Command
Every issued AT command has by default an echo which is sent first, followed bythe optional ITR and ends with the FRC. Therefore, we compare the receivedcharacter with our corresponding command character. It’s the same procedureas with the greeting text. If one character doesn’t match, we raise an error andunblock the GSM task. If it’s not finished, we wait for the next character. If it fin-ishes successfully, we set the GSM ECHO flag and the GSM FIRST AFTER ECHOflag in the PARSER register. The GSM FIRST AFTER ECHO flag is used toset the switch statement to its initial state. After the echo we check if the bufferis full or not. If it’s full, we set the error and unblock the GSM task with theGSM ERROR flag. To avoid such an overflow, one needs to adjust the buffersize to the largest possible output of the used AT commands. But for the sakeof completeness, the overflow is handled. In the normal case, when it is not fullwe store the character in the buffer.
The next state is more complicated as the possible answers of the cellularmodule are quite different. Normally, the response is composed of an ITR fol-lowed by a FRC or the response contains only a FRC. But if the cellular moduleresponses an error then the ITR and FRC are dropped and only the error issent. There is also a special case where only an ITR is sent without any FRC’s.This happens when the module changes from command mode to data mode byissuing a ”CONNECT”. This would not be a problem but ”CONNECT” is sendin verbose format and therefore with full header and footer:
<s3_character><s4_character> CONNECT <s3_character><s4_character>.
Finally, there are also responses which have more than one ITR line. Means, the<s3 character>is sent multiple times inside the ITR instead of only one time atthe end.
5. Code implementation 21
All these cases need to be handled correctly and in order to this a switchstatement is used. The first state which is entered is always the “wait fors3 character”. As long as this character hasn’t been received, we leave the ISR.After reception, we know that one part is fully received. This can either be aFRC, an error, an entire ITR or one part of a multiline ITR. If the receivedresponse matches one of the possible errors, then we raise an error and unblockthe GSM task by setting the GSM ERROR flag. If the expected response sim-ply consists of an FRC, we read out the value and unblock the GSM task bysetting the GSM COMMAND event flag. To signal that the AT command isfinished and URC’s are accepted again we clear the GSM COMMAND flag inthe PARSER register. The FRC value is stored in the GSM struct in the ”fi-nal result” parameter. If we expect an ITR, we change the state to ITR. Asmentioned in chapter 4.2 the ITR ends with <s3 character><s4 character>,therefore we need to wait for the s4 character to be received. This should be theconsecutive character of the s3 character. If the expected response is the specialcase ”CONNECT”, as mentioned above, we simply stay in the ITR state andwait for the next s4 character to be received. If it is not a special case, then wechange the state to FRC. Here we wait again until the s3 character is receivedas the FRC ends with this character. After reception, we check how long theresponse is. The maximal length of an FRC is three. If it’s longer than three,we have an ITR with multiple lines and therefore we change the state back toITR. If the length is within the accepted boundaries, we read out the value,unblock the GSM task by setting the GSM COMMAND event flag and clear theGSM COMMAND PARSER register flag.
5.4.4 GSM task
In this chapter, we consider the used FreeRTOS task called GSM task. Thegoal of this task is to establish an TCP/IP connection to the PermaSense databackend system, sending all pending data, listen if someone is sending anythinghe has to react to, tear down the connection and shut down the cellular module.
This task is thought to be used in the following manner: After a certain timeperiod, another task calls GSM powerOn(), leading the GSM task to enter theready state. The GSM task then performs all the steps mentioned in the goal ofthis task. After he has done everything, he enters the blocking state and waitsuntil he is set in ready state again.
Figure 5.3 shows the GSM task flow graph. If the cellular module (called GSM)is not running, the task enters the block state and waits to be unblocked by theevent flag GSM RUNNING. If it’s running, then we check if the greeting text hasalready been received or not. If not, we block and wait for the GSM GREETINGevent flag to be received. If the flag hasn’t been received within a certain time,the task is unblocked due to a timeout and we enter the error handler which
5. Code implementation 22
RTOS GSM-Task
GSM Running?
Greeting text already received?
Enter block state untill GSM is running
Enter block state until greeting text is
received or timeout
Enter block state until URC, ERROR or
TIMEOUT occurs
URC Handler Command Handler
ERROR Handler
No
Yes
Yes
No
Timeout
URC
Error
Timeout
Figure 5.3: GSM task
then needs to take a decision what to do. For now, we restart the module. Ifthe task is unblocked by the GSM GREETING event flag, we continue. Accord-ing to the AT command manual, one should wait at least 20ms before issuinga new AT command. Therefore, we enter the blocking state for at least 20msand wait if an URC or an error is responded by the parser. If the GSM ERRORevent flag unblocks the task we enter the error handler. If we are unblocked bya GSM URC event flag, we enter the URC handler instead. If a timeout occurs,then nothing is pending, and we can continue sending AT commands.
In the following the three used handlers will be introduced:
Error handler
All errors are stored in the GSM struct. The variable Error type holds the in-formation about the kind of error (UART error, Parser error or GSM error)which has occurred and the variable Error code contains more precise informa-tion about it. All errors need to be handled and this is thought to be done inthe error handler. For instance, one can log the error and then continue or resetthe parser and restart or one can just ignore the error. What is done is stronglydepending on the already existing error handling in the WGPS device code.
5. Code implementation 23
URC handler
If an URC has been received, this handler is entered. The URC message is storedin the aRxURCBuffer. The GSM struct contains a pointer on this buffer andstores its length. A possible URC is for instance
+CREG: 1
First, one needs to decide which URC’s has been received. The URC handlerchecks the length of the URC to already exclude URC’s with the wrong length.Then, we compare all possible URC’s with the received one and if we find theright one, we read out the value and decide what action needs to be done.
The URC handler is also entered if the cellular module is in data mode and theserver sends data to the module. This can be a command or similar. Note thateverything sent to the module needs to end with the <s3 character>, otherwisethe parser will fail to detect the end of the message.
Command handler
Switch stateEnter
GSM_SendAtCommand()function
Fill AtCommand struct with command name,
size, type, error type and response time
Error
Command Handler
Set GSM_COMMAND flag
Transmit AT command to cellular module
Enter blocked state until GSM_COMMAND,
GSM_ERROR event flags or timeout
GSM_COMMAND
Increment switch statestate += 1
ERROR Handler
Exit Command Handler
Timeout
Figure 5.4: Command handler flow graph
In the GSM CommandHandler() all AT commands are send and handled. To beable to leave the function after a finished command and to guarantee that URC’sare handled in time we use a struct statement. This allows us to jump to thecommand we want to send. Up to now the switch is split into six sections (Ini-tialization, Cellular network registration, Internal PDP context activation, Dataconnection, Data mode, Close data connection and End). The initialization isused to enable the numeric error response such that more precise error responsesare send by the module. The cellular network registration, the internal PDPcontext activation and the data connection are explained in a separate section,see chapter 5.5. In the data mode we send our data to the remote host we haveestablished a connection with. If we have send and received everything we needto enter the close data connection part, where we exit the direct link mode and
5. Code implementation 24
close the used socket. Entering the ”End” state turns off the cellular moduleand the UART interface.
To send an AT command we use the GSM SendAtCommand() function whichtakes the command name, it’s size, type, error type and maximal response time asinput. These parameters can differ between AT commands. In the function thesevalues are stored in the AtCommand struct and we set the GSM COMMANDflag to indicate that a response is expected. Next, we use the HAL driver functionHAL UART Transmit() to send the command to the cellular module. If this wassuccessful we enter the block state and wait to be unblocked. This can be throughthe GSM ERROR event flag, the GSM COMMAND event flag or by a timeout.If we get a timeout or an error, we enter the error handler, else we increment theswitch state and leave the function. The switch state can be set or read with theGSM CommandHandlerState() function.
5.5 Datalink
In this part, we derive a solution how we can establish a reliable datalink betweencellular module and a remote host. To test the datalink, YAT has been used asdummy remote host. YAT is a terminal which can listen and send data to adefined port and therefore acts as a simple server.
There are two possible ways how the cellular module could be used on thewireless GPS rev2 sensor system. Either it’s always on or its duty cycled. Ob-viously, duty cycling will be much more energy efficient. The problem is thereachability. The server won’t be able to send commands to the wireless GPSsensor system if the cellular module is in sleep mode or turned off. How doesthe server know when to send commands if needed? One possible solution isthat after the cellular module established a connection it sends all data and thensends a special preamble to indicate that it now waits a certain time to receivecommands from the server. The server can now send any commands it wantsto. After a certain command or time, the cellular module disconnects and turnsoff. This way it’s like a receiver indicated communication between server andcellular module.
What can be done if its’ kept always on? The nice way would be if the servercould establish a TCP/IP connection with the cellular module. The problemis that normally the network operator allows connectivity only in one direction.Means, only the module can establish a TCP/IP connection not the other wayaround. If there are special contracts or the possibility at all providing bothdirection hasn’t been investigated due to lack of time. A possible solution is thatthe module uses its keep alive mode which keeps the TCP connection open suchthat both can send any time they want. Disadvantage is that the server hasoccupied sockets and the module wastes lot of energy to keep it open. Another
5. Code implementation 25
way could be to call the module or send a SMS to it to inform that it shouldestablish a connection to the server.
5.5.1 GPRS system architecture overview
Before we talk about establishing a TCP/IP connection we first need to under-stand how the mobile network works and what is different to the normal IP basedinternet. Figure 5.5 gives an overview of the mobile network which is interposedbetween the cellular module and the IP based internet network.
Cellular module
BTS
MSC/VLR
BSC
SMS-MSC
HLR/AuC
EIR
BG
GGSN
GPRS NETWORK
FW
GPRSbackbone
SGSN
Other GPRSoperators
PLMN
ISDN
PSTN
SS7network
Data NetworkInternet
Data NetworkX.25
FW
FW
Figure 5.5: GSM and GPRS system architecture [18]
The cellular module needs to connect to a Base Transceiver Station (BTS).The BTS forwards the received signals to the Base Station Controller (BSC).Depending if the received signal is circuit switched traffic or packet switcheddata the BSC forwards it to the Mobile Switching Center (MSC) respectivelythe Serving GPRS Support Node (SGSN). The BSC is responsible for setting upand disconnecting Circuit Switched (CS) and Packet Switched (PS) connectionsto MSC respectively SGSN. The SGSN handles the packet data protocol (PDP)contexts. The GPRS backbone is now connected to other GPRS operators orvia a Gateway GPRS Support Node (GGSN) to an external data network. Forinstance, the IP based internet data network. The GGSN assigns IP addressesto mobile devices as the cellular module. This allows now to communicate overthe internet and to establish a TCP/IP connection.
5.5.2 Cellular network registration
This section provides an overview about the GSM/UMTS network registrationon the cellular module. First, we need to decide which Radio Access technology(RAT) we want to use. This can either be GSM, UMTS or GSM/UMTS in
5. Code implementation 26
dual mode. By default, it’s in dual mode and we let it like this as it switchesautomatically between the best available. Next, we can choose which operatingbands we want to use (800, 900, 1900, 2100 MHz etc.). The cellular modulecan store the network settings in its non-volatile memory (NVM) and thereforeonly needs to be changed once. The module is able to perform the networkregistration automatically based on the stored settings. Automatic registrationis enabled if the command “AT+COPS=0” is send. The automatic registrationis stored in the NVM. If the module is registered in GSM either GPRS or EDGEis available depending on the signal quality. If in UMTS then WCDMA, HSDPA,HSUPA or HSDPA/HSUPA can be available.
In our implementation we have the automatic registration enabled. There-fore, if the module is switched on it tries to establish a network registrationeither in GSM or in UMTS mode. If both are available, UMTS is preferred. Weenable the “+CREG” URC which informs us if the registration was successful.If we have received the corresponding URC, we continue with the Internal PDPcontext activation. Figure 5.6 shows how the network registration should beperformed and how the +CREG URC’s need to be handled.
Module.power.on
AT)CREG=g
AT)COPS?
Is.COPS≠h
NOYES
AT)COPS=Kor
AT)COPS=gyccc
Wait.for.URC)CREG
Read.)CREG
Is.)CREG=K DTE.is.requested.tointervene
YES
qgv.Everytime.a.URC)CREG.is.receivedytake.a.decision
Is.)CREG=gOKymodule.is.registered
for.CS.on.the.HPLMN
YES
NO
Is.)CREG=h Waity.module.issearching.for.a.network
YES
Is.)CREG=H
Registration.deniedc
Intervention.may.be
required
YES
NO
Is.)CREG=L WaitYES
Is.)CREG=3OKymodule.is.registred
for.CS.on.a.VPLMN
YES
NO
qgv
NO
NO
Figure 5.6: CS and PS network registration flow chart [17]
5. Code implementation 27
5.5.3 Internal PDP context activation
Before we can use TCP/IP we need to create a packet switched data (PSD)profile. This profile is used to set PDP context parameters for an internal context.This is, the protocol type (IPv4, IPv6), the APN together with username andpassword, the DNS address, the authentication, the IP address (dynamic, static)and the Quality of Service parameters (precedence, delay, reliability, peak rate,mean rate, delivery order, etc.). The profile can be stored in the NVM. Onceconfigured one can activate the PDP context with the specified profile.
In our implementation we first register the cellular module to the generalpacket radio service (GPRS). GPRS allows 2G and 3G networks to transmit IPpackets to networks such as the internet. Next, we load our PSD profile andactivate the PDP context. After the activation we have an IP address assignedto our module.
5.5.4 Data connection
In order to transfer data reliable, we use TCP/IP. Therefore, we create a socketon the cellular module. For the next step we need the IP address and the portfrom the remote host we want to connect to. We can do that with a DNSlookup or we hardcode the IP address and the port. As we used YAT as dummyserver to test the connection we hardcoded the IP and the port and establishedthe connection. If the connection is successful we get an OK as response. Inthe next step we enter the direct link mode. This pushes the module in datamode (see chapter 4.2.1). After “CONNECT” is received everything send to themodule is forwarded to the server. If we want to close the connection, we send+++ to exit the data mode and then we close the socket. Figure 5.7 shows howthe cellular module boots and establishes a TCP/IP connection with YAT.
5. Code implementation 28
============= START ============= Cellular Module Running - AT command: AT+CGMM Response: SARA-U270 0 - - AT command: AT+CGMI Response: u-blox 0 - - AT command: AT+CMEE=1 Response: 0 - - AT command: AT+CREG=1 Response: 0 - - AT command: AT+CREG? Response: +CREG: 1,0 0 - URC: +CREG: 1 - AT command: AT+CREG? Response: +CREG: 1,1 0 - - AT command: AT+COPS? Response: +COPS: 0,0,"Swisscom",0 0 -
- AT command: AT+UREG? Response: +UREG: 0,2 0 - - AT command: AT+URAT? Response: +URAT: 1,2 0 - - AT command: AT+CGATT? Response: +CGATT: 1 0 - - AT command: AT+UPSND=0,8 Response: +UPSND: 0,8,0 0 - - AT command: AT+UPSDA=0,2 Response: 0 - - AT command: AT+UPSDA=0,3 Response: 0 - - AT command: AT+UPSND=0,8 Response: +UPSND: 0,8,1 0 - - AT command: AT+UPSND=0,0 Response: +UPSND: 0,0,"10.185.2.127" 0 -
- AT command: AT+USOCR=6 Response: +USOCR: 0 0 - - AT command: AT+USOCO=0,"82.130.102.220",10000 Response: 0 - - AT command: AT+USODL=0 Response: CONNECT - URC: COMMAND FROM REMOTE HOST - AT command: +++ Response: - URC: 0 - AT command: AT+USOCL=0 Response: 0 - --------------------- Cellular Module OFF ---------------------
Figure 5.7: Boot, network registration, PDP context activation, socket creationand connection
Chapter 6
Further work
In this chapter we will briefly summarize what has been done and what hasn’t,as well as hints how to proceed with this work.
6.1 Achieved goals
The software interface between cellular module and MCU has been implemented.The interface is able to transmit all kind of AT commands and to react to thenecessary requirements. It is able to detect URC’s and provides an interfacewhich allows an easy handling of them. The interface is also able to detect datatransmitted by the remote host. Up to now there are no action taken if suchdata is received. The interface just outputs the received message and continues.All kind of errors are caught and are forwarded to an error handler. This errorhandler takes decisions how to handle the specific error.
As the goal was to implement and to include the interface in the already ex-isting WGPS software we only managed to implement the interface. It’s notincluded yet although everything is prepared such that the integration is thenext logical step.
6.2 Follow-up
According to the objectives, this work is designed in a way that follow-up projectscan be built upon. Therefore, special care has been taken such that everythingis implemented in a structured and generic way so that modification can be doneas simply as possible.
29
6. Further work 30
Defines
The code uses no hard-coded values for AT command settings which can bechanged. All of these values are mapped with defines. Therefore, if one changesfor instance, the s3 character, the only thing needed to adapt to is the corre-sponding define. All defines are located in the header file “gsm.h”.
TODO’s
If one wants to integrate the provided code into the wireless GPS sensor systemcode, there are several places where one needs to adapt the code. For sake ofsimplicity, the TODO’s mark these places. Every TODO contains also a shorttext which explains what is thought to be adapted.
README’s
The repository on Gitlab contains README’s which explains what needs to bedone in more details.
Code comments
The code contains comments everywhere where it could cause understandingproblems.
Inclusion into the wireless GPS rev2 sensor system code
This part will give a short summary of what needs to be done in order to integratethe code into the GPS sensor system code. The code is already implementedwith FreeRTOS. The most difficult part will be to adjust the interrupt and taskpriority so that it harmonizes with the other interrupts and tasks. Then, oneneeds to select the appropriate clock source for the USART2.
As the wireless GPS sensor system can enter the sleep mode, one needs toconsider that some variables may need to be volatile such that the value is storedbefore entering sleep mode. Next, one needs to define how the data is providedto the task and how it needs to be sent such that the PermaSense data backendsystem is able to process the data.
Chapter 7
Conclusion
In this work we proposed an integration concept which allows efficient commu-nication with the cellular module. Also, we proposed an efficient monitoringbased on the FreeRTOS task which allows us to monitor unsolicited result codes(URC’s), all kind of errors and the result of sent AT commands. Although nevertested with the PermaSense data backend system itself, we were able to establisha reliable TCP/IP connection with a dummy server, hosted on a computer andto exchange data in both directions. As this work is thought to be continued, theentire code is designed in a manner that follow-up projects can be easily buildupon. Comments and TODO’s help to understand what needs to be done andhow the code should be understood. No hard-coded values are used for valueswhich can be changed on the cellular module. Defines are used instead, to applythe changes globally.
The proposed code is completely embedded in the ARM/FreeRTOS softwareframework and has been developed and tested on the wireless GPS rev2 sensorsystem. Therefore, the integration in the already existing wireless GPS rev2sensor system code is straight forward.
31
Bibliography
[1] Atollic TrueStudio, http://www.st.com/en/development-tools/
truestudio.html
[2] STM32L496VG microcontroller, http://www.st.com/en/
microcontrollers/stm32l496vg.html
[3] SEGGER J-Link EDU, https://www.segger.com/products/
debug-probes/j-link/models/j-link-edu/
[4] U-blox SARA-U270 GSM Module,https://www.u-blox.com/de/product/sara-u2-series
[5] ITU-T Recommendation V24, 02-2000. List of definitions for interchangecircuits between Data Terminal Equipment (DTE) and Data ConnectionEquipment (DCE)
[6] u-blox Cellular Modules, Data and Voice Modules, AT Commands Manual,Document number: UBX-13002752, Revision R56, 22-Nov-2017
[7] SARA-U2 series, HSPA modules with 2G fallback, Data Sheet. Documentnumber: UBX-13005287, Revision R19, 26-Feb-2018
[8] STM32L496xx Datasheet. Document number: DS11585, Revision 8, May2018
[9] STM32L496 Refrence Manual. Document number: RM0351, Revision 6,April 2018
[10] Description of STM32L4/L4+ HAL and low-layer drivers. User manual.Document number: UM1884, Revision 7, September 2017
[11] Mastering the FreeRTOS Real Time Kernel, A Hands-On Tutorial Guide.Richard Barry, 2016
[12] The FreeRTOS Refrence Manual, API Functions and Configuration Op-tions. Version 10. Amazon Web Services, 2017
[13] Shockfish SA. Tinynode 184. http://www.tinynode.com/?q=product/tinynode184/tn-184-868
[14] Functional Specification of the next-gen WGPS device, wgps rev2 fs.pdf.Akos Pasztor, ETH Zurich TIK, 2016
32
Bibliography 33
[15] https://www.freertos.org/RTOS-task-states.html, online, 08.06.2018
[16] https://www.freertos.org/a00110.html, online, 08.06.2018
[17] AT Commands Examples, Examples for u-blox cellular modules, Applica-tion Note. Document number: UBX-13001820, Revision R11, 22-Sep-2016
[18] http://www.telecom.tuc.gr/~perak/speech/DSR-issues/
report-html/, online, 10.06.2018
[19] PermaSense Data Management: System documentation and tutorial for on-line data access. Samuel Weber, Jan Beutel, Christoph Walser, 2014
List of Figures
3.1 PermaSense System Architecture [19] . . . . . . . . . . . . . . . . 3
3.2 WGPS System overview [14] . . . . . . . . . . . . . . . . . . . . . 4
3.3 WGPS operating modes [14] . . . . . . . . . . . . . . . . . . . . . 5
3.4 Example interrupt priority configuration [16] . . . . . . . . . . . 6
4.1 SARA-U270 block diagram [7] . . . . . . . . . . . . . . . . . . . . 7
4.2 AT command response flow chart [17] . . . . . . . . . . . . . . . 9
4.3 URC flow chart [17] . . . . . . . . . . . . . . . . . . . . . . . . . 12
5.1 Valid task state transitions [15] . . . . . . . . . . . . . . . . . . . 14
5.2 AT command parser . . . . . . . . . . . . . . . . . . . . . . . . . 18
5.3 GSM task . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
5.4 Command handler flow graph . . . . . . . . . . . . . . . . . . . . 23
5.5 GSM and GPRS system architecture [18] . . . . . . . . . . . . . 25
5.6 CS and PS network registration flow chart [17] . . . . . . . . . . 26
5.7 Boot, network registration, PDP context activation, socket cre-ation and connection . . . . . . . . . . . . . . . . . . . . . . . . . 28
34
Appendix A
WGPS Schematics
1
Proj
ect:
Perm
asen
se W
irele
ss G
PS 2
.0
File
:
Dat
e:
Dra
win
g nu
mbe
r:W
GPS
-REV
2
13.1
0.20
17
C:\U
sers
\ako
s\D
ocum
ents
\Per
mas
ense
\eng
inee
ring\
pcb\
proj
ects
\001
7_w
irele
ss_g
ps_r
ev2\
SCH
-Con
nect
ivity
.Sch
Doc
15:1
7:37
Form
at:
A4 Q
1.05
Rev
:
Dra
wn
by:
Labo
rato
ry:
ETH
TIK
Page
of1
7
Shee
t:
Akos
Pas
ztor
SCH
-Con
nect
ivity
.Sch
Doc
12
34
12
34
A B C D
A B C D
SW_G
PSG
PS_R
xG
PS_T
xG
PS_T
puls
e
GSM
_Tx
GSM
_Rx
GSM
_CTS
GSM
_RTS
PWR
_STA
T
USB
_DM
USB
_DP
SW_G
SM
GSM
_DTR
GSM
_DSR
GSM
_DC
D
SEN
SE_I
Tilt_
MO
SITi
lt_C
S_X
Tilt_
MIS
OTi
lt_SC
K
Tilt_
CS_
YSW
_Tilt
TN_B
OLT
_IN
DTN
_GPI
O
RES
ET
TN_E
VR
EF
SEN
SE_V
BA
T
Det
ect_
GSM
SEN
SE_3
V
TN_S
PI_S
CK
TN_S
PI_M
OSI
TN_S
PI_M
ISO
TN_B
OLT
_REQ
TN_B
OLT
_AC
KTN
_BO
LT_M
OD
E Com
pass
_XL_
IRQ
Com
pass
_XL_
CS
Com
pass
_MA
G_I
RQ
Com
pass
_MA
G_C
S
MC
USC
H-M
CU
.Sch
Doc
GPS
_Tpu
lse
GPS
_Tx
GPS
_Rx
SW_G
PS
Tilt_
SCK
Tilt_
MO
SIC
ompa
ss_X
L_C
S
Com
pass
_MA
G_I
RQ
Com
pass
_MA
G_C
SC
ompa
ss_X
L_IR
Q
GPS
SCH
-GPS
.Sch
Doc
GSM
_Tx
GSM
_Rx
GSM
_CTS
GSM
_RTS
GSM
_DTR
GSM
_DSR
GSM
_DC
DSW
_GSM
Det
ect_
GSM
GSM
SCH
-GSM
.Sch
Doc
PWR
_STA
TSE
NSE
_ISE
NSE
_VB
AT
SEN
SE_3
V
PWR
SCH
-PW
R.S
chD
oc TN_B
OLT
_IN
DTN
_GPI
O
TG_R
ESET
TN_E
VR
EF
GPS
_Tpu
lse
TN_S
PI_S
CK
TN_S
PI_M
OSI
TN_S
PI_M
ISO
TN_B
OLT
_REQ
TN_B
OLT
_AC
KTN
_BO
LT_M
OD
E
Tiny
Nod
eSC
H-T
inyN
ode.
SchD
oc
PV_B
AT
Pow
eran
d U
SBco
nnec
tor
1 2 3 4 5 6
S5
Mic
roFi
t 3x2
P5V
_USB
PV_I
NPV
_IN
_GSM
Tilt_
MO
SITi
lt_C
S_X
Tilt_
MIS
OTi
lt_SC
K
Tilt_
CS_
YSW
_Tilt
Tilt
SCH
-Tilt
.Sch
Doc
1 2 3 4 5 6 7 8 9 10S4
SIP-
5x2-
90de
g
1 2 3 4 5 6 7 8 9 10
S3 SIP-
5x2-
90de
g
P3V
P3V
_TIL
T
SW1
MD
CG
-4
Jum
per f
or
Ree
d SW
re
set
Ove
rvie
w
1 2 3
J1 Jum
per
12
34
56
78
910
1112
1314
1516
1718
1920
2122
2324
2526
S1 Mol
ex26
Fem
ale
12
34
56
78
910
1112
1314
1516
1718
1920
2122
2324
2526
S2 Mol
ex26
Mal
e
PV_I
NPV
_IN
_GSM
H1
H2
H3
H4
Perm
asen
se L
ogo
ETH
Züric
hET
HET
HET
H
PIH101
COH1
PIH201
COH2
PIH301
COH3
PIH401
COH4
PIJ1
01
PIJ102
PIJ103
COJ1
COLOGO1
COLO
GO2
COLO
GO3
COLO
GO4
COLO
GO5
PIS1
01
PIS1
02
PIS1
03
PIS1
04
PIS1
05
PIS1
06
PIS107
PIS108
PIS1
09
PIS1
010
PIS1
011
PIS1
012
PIS1
013
PIS1
014
PIS101
5 PIS
1016
PIS101
7 PIS
1018
PIS1
019
PIS1
020
PIS1
021
PIS1
022
PIS1
023
PIS1
024
PIS102
5 PIS
1026 COS
1 PIS201
PIS2
02
PIS203
PIS2
04
PIS205
PIS2
06
PIS207
PIS208
PIS209
PIS2
010
PIS2
011
PIS2
012
PIS2
013
PIS2
014
PIS2
015
PIS201
6 PI
S2017
PIS201
8 PI
S2019
PIS2
020
PIS2
021
PIS2
022
PIS2
023
PIS2
024
PIS2
025
PIS202
6
COS2
PIS3
01
PIS3
02
PIS3
03
PIS3
04
PIS305
PIS3
06
PIS3
07
PIS3
08
PIS309
PIS301
0 COS3
PIS4
01
PIS4
02
PIS4
03
PIS4
04
PIS405
PIS4
06
PIS4
07
PIS4
08
PIS409
PIS401
0
COS4
PIS5
01
PIS502
PIS503
PIS5
04
PIS5
05
PIS506
COS5
PISW101 PISW102 CO
SW1
PIH101 PIH201
PIH301 PIH401
PIS1
023
PIS1
024
PIS102
5 PIS
1026
PIS2
023
PIS2
024
PIS2
025
PIS202
6
PIS309
PIS301
0 PIS409
PIS401
0
PIS503
PIS5
04
PISW101
PIJ1
01
PIJ102
PISW102 PIJ103
PIS1
05
PIS1
06
PIS107
PIS108
PIS1
09
PIS1
010
PIS1
011
PIS1
012
PIS1
013
PIS1
014
PIS101
5 PIS
1016
PIS101
7 PIS
1018
PIS1
019
PIS1
020
PIS1
021
PIS1
022
PIS205
PIS2
06
PIS207
PIS208
PIS209
PIS2
010
PIS2
011
PIS2
012
PIS2
013
PIS2
014
PIS2
015
PIS201
6 PI
S2017
PIS201
8 PI
S2019
PIS2
020
PIS2
021
PIS2
022
PIS3
03
PIS3
04
PIS305
PIS3
06
PIS3
07
PIS3
08
PIS4
03
PIS4
04
PIS405
PIS4
06
PIS4
07
PIS4
08
PIS5
05
PIS506
PIS3
01
PIS3
02
PIS4
01
PIS4
02
PIS5
01
PIS502
PIS1
01
PIS1
02
PIS1
03
PIS1
04
PIS201
PIS2
02
PIS203
PIS2
04
Proj
ect:
Perm
asen
se W
irele
ss G
PS 2
.0
File
:
Dat
e:
Dra
win
g nu
mbe
r:W
GPS
-REV
2
13.1
0.20
17
C:\U
sers
\ako
s\D
ocum
ents
\Per
mas
ense
\eng
inee
ring\
pcb\
proj
ects
\001
7_w
irele
ss_g
ps_r
ev2\
SCH
-MC
U.S
chD
oc
15:1
7:37
Form
at:
A4 Q
1.05
Rev
:
Dra
wn
by:
Labo
rato
ry:
ETH
TIK
Page
of2
7
Shee
t:
Akos
Pas
ztor
SCH
-MC
U.S
chD
oc
12
34
12
34
A B C D
A B C D
P3V
GPS
_Rx
GPS
_Tx
SW_G
PSG
PS_T
puls
e
The
GSM
mod
ule
has d
iffer
ent p
inou
t for
UA
RT.
(S
ee IT
U-T
V.2
4 sp
ecifi
catio
n an
d u-
blox
har
dwar
e in
tegr
atio
n m
anua
l at p
age
130.
)
Tilt_
MIS
OTi
lt_M
OSI
Tilt_
CS_
XTi
lt_SC
K
GSM
_Tx
GSM
_Rx
GSM
_CTS
GSM
_RTS
SDA
1
Addr
2
Aler
t3
SCL
4VD
D
5
RES
ET6
R7
GN
D
8
U2
SHT3
x
P3V
Nea
r-C
hip
Cap
acito
rs
P3V
P3V
P3V
P3V
P3V
SD_D
0SD
_D1
SD_D
2SD
_D3
uSD
Bus
SD_D
0SD
_D1
SD_D
2SD
_D3
SD_C
LK
SD_C
LK
SD_C
MD
SD_C
MD
SWO
RES
ET
PWR
_STA
T
USB
_DM
USB
_DP
SW_G
SM
GSM
_DTR
GSM
_DSR
GSM
_DC
D
SEN
SE_I
Tilt_
CS_
YSW
_Tilt
P5V
_USB
1 2 3 4 5 6S7
SIP-
6-M
INI
SWD
for
Prg.
& D
ebug
P3V
SWC
LK
SWD
IO
SWO
RES
ET
SWD
IOSW
CLK
USB
_DM
USB
_DP
USB
ESD
Pr
otec
tion
TN_B
OLT
_IN
DTN
_GPI
O
RES
ET
TN_E
VR
EF
SW4
AD
TSM
62R
VTR
Use
r BTN
SEN
SE_V
BA
T
MC
U P
ower
Pin
sTe
mpe
ratu
re &
Hum
idity
Sen
sor
Mic
roco
ntro
ller
SW3
MD
CG
-4
Use
r REE
D
Det
ect_
GSM
U4
F/U
CW
3
Q1
IRLM
L280
3
P3V
Piez
o B
uzze
r
SEN
SE_3
VR
A1
270R
D1
Red
D3
Gre
en
D2
Yel
low
Use
r LED
s for
Deb
ug
Led_
YLe
d_R
Led_
RLe
d_Y
Led_
G
Com
pass
_XL_
IRQ
Com
pass
_XL_
CS
TN_S
PI_M
OSI
TN_S
PI_M
ISO
TN_S
PI_S
CK
TN_B
OLT
_REQ
C6
10uF
C3
27pF
C5
27pF
TN_B
OLT
_AC
KTN
_BO
LT_M
OD
E
PH3-
BOO
T094
NR
ST14
PA0
23
PA1
24
PA10
69
PA11
70
PA12
71
PA13
(JTM
S-SW
DIO
)72
PA14
(JTC
K-SW
CLK
)76
PA15
(JTD
I)77
PA2
25
PA3
26
PA4
29
PA5
30
PA6
31
PA7
32
PA8
67
PA9
68
PB0
35
PB1
36
PB10
47
PB11
48
PB12
51
PB13
52
PB14
53
PB15
54
PB2
37
PB3(
JTD
O-T
RAC
ESW
O)
89
PB4(
NJT
RST
)90
PB5
91
PB6
92
PB7
93
PB8
95
PB9
96
PC0
15
PC1
16
PC10
78
PC11
79
PC12
80
PC13
7
PC14
-OSC
32_I
N(P
C14
)8
PC15
-OSC
32_O
UT(
PC15
)9
PC2
17
PC3
18
PC4
33
PC5
34
PC6
63
PC7
64
PC8
65
PC9
66
PD0
81
PD1
82
PD10
57
PD11
58
PD12
59
PD13
60
PD14
61
PD15
62
PD2
83
PD3
84
PD4
85
PD5
86
PD6
87
PD7
88
PD8
55
PD9
56
PE0
97
PE1
98
PE10
41
PE11
42
PE12
43
PE13
44
PE14
45
PE15
46
PE2
1
PE3
2
PE4
3
PE5
4
PE6
5
PE7
38
PE8
39
PE9
40
PH0-
OSC
_IN
(PH
0)12
PH1-
OSC
_OU
T(PH
1)13
U1A
STM
32L4
96V
GT6
VBAT
6
VDD
50
VDD
11
VDD
75
VDD
100
VDD
28
VDD
A22
VDD
USB
73
VREF
-20
VREF
+21
VSS
74VS
S49
VSS
27VS
S10
VSS
99
VSSA
19
U1B
STM
32L4
96V
GT6
P5V
_USB
Led_
G
Com
pass
_MA
G_I
RQ
Com
pass
_MA
G_C
S
100u
C16
C1
100n
F
C8
100n
FC
910
0nF
C10
100n
FC
1110
0nF
C14
100n
FC
71u
F
SD_Detect
SD_D
etec
tR
2847
kR
2747
kR
2647
kR
2547
kR
2447
k
P3V
_USD
SD_D
21
SD_D
3/C
S2
SD_C
MD
/MO
SI3
VDD
4
CLK
/SC
LK5
VSS
6
SD_D
0/M
ISO
7
SD_D
18
CD
9
CD
_VSS
10
Shie
ld
J4M
icro
SD h
olde
r
C13
10nF
R1
47k
R2
47k
R3
100k
1 2
Y2
32.7
68kH
z
C2
15pF
C4
15pF
OSC
32_I
N
OSC
32_O
UT
OSC
32_I
NO
SC32
_OU
T
SW2
AD
TSM
62R
VTR
IO11 IO22
GND 3
IO34
VCC5
U3
TPD
3E00
1DR
LR
13
Y1A
8 M
hz
GND 2GND 4
Y1B
8 M
hz
R4
100k
Q4
FDC
638P
SW_U
SD
SW_U
SD
P3V
_USD
C74
10nF
C76
1uF
PIC101 PIC102 COC
1
PIC2
01
PIC2
02 COC2
PIC301
PIC302
COC3 PI
C401
PI
C402
COC4
PIC501
PIC502
COC5
PIC601 PIC602 COC
6 PIC701 PIC702
COC7
PIC801 PIC802 COC
8 PIC901 PIC902
COC9
PIC1001 PIC1002 CO
C10
PIC1101 PIC1102 COC
11
PIC1301 PIC1302 COC
13
PIC1401 PIC1402 CO
C14
PIC1601 PIC1602 CO
C16
PIC7
401
PIC7
402
COC74
PIC7601 PIC7602 CO
C76
PID1
01
PID1
02
COD1
PID2
01
PID2
02
COD2
PID3
01
PID3
02
COD3
PIJ401
PIJ402
PIJ403
PIJ404
PIJ405
PIJ406
PIJ407
PIJ408
PIJ409
PIJ4
010
PIJ40Shield
COJ4
PIQ101
PIQ102 PIQ103 COQ
1
PIQ401
PIQ402
PIQ403 PIQ404
PIQ405
PIQ406
COQ4
PIR101 PIR102 COR1
PIR201 PIR202 COR2
PIR301 PIR302 COR3
PIR4
01
PIR402
COR4
PIR2401 PIR2402 COR24
PIR2501 PIR2502 COR25 PIR2601 PIR2602 CO
R26 PIR2701 PIR2702 COR
27 PIR2801 PIR2802 COR28
PIRA
101
PIRA
102
PIRA
103
PIRA
104
PIRA10
5 PIR
A106
PIRA
107
PIRA
108
CORA
1
PIS701
PIS7
02
PIS7
03
PIS7
04
PIS705
PIS706 COS
7
PISW20
1 PIS
W203
COSW
2
PISW
301
PISW
302
COSW
3
PISW401 PISW403 CO
SW4
PIU101
PIU102
PIU103
PIU104
PIU105
PIU107
PIU108
PIU109
PIU1
012
PIU1013
PIU1
014
PIU1015
PIU1016
PIU1
017
PIU1018
PIU1
023
PIU1024
PIU1025
PIU1026
PIU1029
PIU1
030
PIU1031
PIU1032
PIU1033
PIU1034
PIU1
035
PIU1036
PIU1037
PIU1038
PIU1039
PIU1
040
PIU1
041
PIU1042
PIU1043
PIU1044
PIU1
045
PIU1
046
PIU1
047
PIU1048
PIU1051
PIU1052
PIU1
053
PIU1
054
PIU1055
PIU1056
PIU1057
PIU1058
PIU1
059
PIU1060
PIU1061
PIU1062
PIU1063
PIU1
064
PIU1065
PIU1066
PIU1067
PIU1
068
PIU1
069
PIU1070
PIU1071
PIU1072
PIU1
076
PIU1
077
PIU1078
PIU1079
PIU1
080
PIU1081
PIU1082
PIU1
083
PIU1084
PIU1085
PIU1086
PIU1087
PIU1
088
PIU1089
PIU1090
PIU1
091
PIU1092
PIU1093
PIU1094
PIU1095
PIU1
096
PIU1
097
PIU1098 COU1
A
PIU106
PIU1010
PIU1011
PIU1019
PIU1020
PIU1021
PIU1022
PIU1
027
PIU1
028
PIU1
049
PIU1
050
PIU1073
PIU1074
PIU1075
PIU1099
PIU1
0100
COU1
B
PIU201
PIU202
PIU2
03
PIU2
04
PIU205
PIU2
06
PIU2
07
PIU208
COU2
PIU301 PIU302
PIU303
PIU304 PIU305
COU3
PIU4
01
PIU402
COU4
PIY101 PIY103 CO
Y1A
PIY102 PIY104 CO
Y1B PIY201 PIY202
COY2
PIC7602
PIS7
03
PISW403
PIU1
014
NL\R
ESET
PO\RESET
PIC101
PIC2
01
PIC302
PIC4
01
PIC502
PIC601 PIC701
PIC801 PIC901
PIC1001 PIC1101
PIC1301
PIC1401
PIC1601 PI
C740
1
PIC7601
PID1
02
PID2
02
PID3
02
PIJ406
PIJ4
010
PIJ40Shield
PIQ102 PIR301
PIS705
PISW20
1
PISW
301
PISW401
PIU1010
PIU1019
PIU1020
PIU1
027
PIU1
049
PIU1074
PIU1094
PIU1099
PIU202
PIU2
07
PIU208 PIU209
PIU303
PIY102 PIY104
PIRA10
5
PIU101
NLLe
d0G
PIRA
101
PIU103
NLLed0R
PIRA
103
PIU102
NLLe
d0Y
PIC301
PIU1
012
PIY103
PIC501
PIU1013
PIY101
PID1
01
PIRA
102
PID2
01
PIRA
104
PID3
01
PIRA10
6
PIQ101
PIR302
PIU1
059
PIQ103 PIU402
PIR101 PIU1095
PIU2
04
PIR201
PIU1
096
PIU201
PIRA
107
PIRA
108
PISW20
3 PI
U109
7
PISW
302
PIU1058
PIU104
PIU105
PIU107
PIU1015
POSENSE0I
PIU1016
POSENSE0VBAT
PIU1
017
PIU1018
POSENSE03V
PIU1
023
POGSM0CTS
PIU1024
POGSM0RTS
PIU1025
POGSM0Tx
PIU1026
POGSM0Rx
PIU1029
POTilt0CS0X
PIU1
030
POTilt0SCK
PIU1031
POTilt0MISO
PIU1032
POTi
lt0M
OSI
PIU1033
POCo
mpas
s0XL
0CS
PIU1034
POCo
mpas
s0MA
G0CS
PIU1
035 PO
Tilt
0CS0
Y PIU1036 PO
\SW0
Tilt
PIU1037
PIU1038
POGSM0DTR
PIU1039
POGSM0DSR
PIU1
040
POGSM0DCD
PIU1
041
POSW0GSM
PIU1042
PODetect0GSM
PIU1043
PIU1044
POTN0EVREF
PIU1
045
POTN
0GPI
O PI
U104
6 POTN0BOLT0IND
PIU1
047
PIU1048
PIU1051 POTN0BOLT0REQ
PIU1052 POTN0SPI0SCK
PIU1
053 POTN0SPI0MISO
PIU1
054 POTN0SPI0MOSI
PIU1055
PIU1056 PO
Comp
ass0
XL0I
RQ
PIU1057 PO
Comp
ass0
MAG0
IRQ
PIU1060
PIU1062 POPWR0STAT
PIU1063
PIU1
064
PIU1067
PIU1
069
PIU1
077
PIU1082
PIU1084 POTN0BOLT0MODE
PIU1085 POTN0BOLT0ACK
PIU1086
PIU1087
PIU1
088
PIU1090 PO\SW0GPS
PIU1
091 POGPS0Tpulse
PIU1092 POGPS0Rx
PIU1093 PO
GPS0
Tx
PIU1098
PIU2
03
PIU304
PIC2
02
PIU108
PIY201 NL
OSC3
20IN
PIC4
02
PIU109
PIY202 NLOSC320OUT
PIC602 PIC702
PIC802 PIC902
PIC1002 PIC1102
PIC1402
PIC1602
PIQ404
PIR102 PIR202
PIR4
01
PIS7
04
PIU106
PIU1011
PIU1021
PIU1022
PIU1
028
PIU1
050
PIU1073
PIU1075
PIU1
0100
PIU205
PIU2
06
PIU4
01
PIC1302 PIJ404
PIQ401
PIQ402
PIQ405
PIQ406
PIR2402 PIR2502
PIR2602 PIR2702
PIR2802
NLP3
V0US
D
PIC102
PIU1
068
PIU305
NLP5V0USB
PIJ405
PIU1
080
NLSD
0CLK
PIJ403
PIR2401
PIU1
083
NLSD
0CMD
PIJ407
PIR2501
PIU1065
NLSD0D0
PIJ408
PIR2601
PIU1066
NLSD0D1
PIJ401
PIR2701
PIU1078
NLSD0D2
PIJ402
PIR2801
PIU1079
NLSD0D3
PIJ409
PIU1061
NLSD0Detect
PIC7
402
PIQ403 PIR402
PIU1081 NL
SW0U
SD
PIS701
PIU1
076
NLSW
CLK
PIS706
PIU1072
NLSWDIO
PIS7
02
PIU1089 NL
SWO
PIU1070
PIU302
NLUS
B0DM
POUSB0DM
PIU1071
PIU301 NL
USB0
DP
POUS
B0DP
PO\RESET
PO\SW0GPS
PO\S
W0Ti
lt
POCo
mpas
s0MA
G0CS
POCo
mpas
s0MA
G0IR
Q
POCo
mpas
s0XL
0CS
POCo
mpas
s0XL
0IRQ
PODetect0GSM
POGPS0Rx
POGPS0Tpulse
POGP
S0Tx
POGSM0CTS
POGSM0DCD
POGSM0DSR
POGSM0DTR
POGSM0RTS
POGSM0Rx
POGSM0Tx
POPWR0STAT
POSENSE03V
POSENSE0I
POSENSE0VBAT
POSW0GSM
POTilt0CS0X
POTi
lt0C
S0Y
POTilt0MISO
POTi
lt0M
OSI
POTilt0SCK
POTN0BOLT0ACK
POTN0BOLT0IND
POTN0BOLT0MODE
POTN0BOLT0REQ
POTN0EVREF
POTN
0GPI
O
POTN0SPI0MISO
POTN0SPI0MOSI
POTN0SPI0SCK
POUSB0DM
POUS
B0DP
Proj
ect:
Perm
asen
se W
irele
ss G
PS 2
.0
File
:
Dat
e:
Dra
win
g nu
mbe
r:W
GPS
-REV
2
13.1
0.20
17
C:\U
sers
\ako
s\D
ocum
ents
\Per
mas
ense
\eng
inee
ring\
pcb\
proj
ects
\001
7_w
irele
ss_g
ps_r
ev2\
SCH
-PW
R.S
chD
oc
15:1
7:37
Form
at:
A4 Q
1.05
Rev
:
Dra
wn
by:
Labo
rato
ry:
ETH
TIK
Page
of3
7
Shee
t:
Akos
Pas
ztor
SCH
-PW
R.S
chD
oc
12
34
12
34
A B C D
A B C D
P5V
_USB
STAT
1
D0
2
D1
3IL
IM4
GN
D
5
IN2
6O
UT
7IN
18
U7
TPS2
115A
PWPW
R_S
TAT
P3V
OU
T1
NR
/FB
3
GN
D
4
EN5
IN8
U9
TPS7
3530
QD
RB
220u
F6.
3V
C28
PV_I
N
PV_B
AT
PV_I
N
SEN
SE_I
SEN
SE_V
BA
T
Pow
er S
uppl
y
Cur
rent
Mea
sure
men
t of S
yste
m V
olta
geB
atte
ry In
put:
11V
- 20
V
Prot
ecte
d In
put f
rom
Bat
tery
USB
5V
Inpu
t
Inpu
t Sou
rce
Pow
er M
ultip
lexe
r
Vol
tage
Mea
sure
men
t of B
atte
ry
P3V
SEN
SE_3
V
Syst
em V
olta
ge M
easu
rem
ent
D4
SMC
J26A
D6
SMC
J12A
D5
SS24
F1 1.1A
F2 500m
A
GND 1
GND 2
OUT 3
RS-4 RS+5
U8
MA
X96
10H
EXK
+T
220u
F6.
3V
C61
35 V
C20
4.7u
F
50 V
C27
100n
FC
2910
nF
C17
10nF
1 %
R9
33K
2
1 %
R10
12K
1 %
R11
430R
1 %
R6
1M 1 %
R7
140K
R5
47k
L110
0uH
C68
6.8n
F
R20
287K
R23
40K
2
C70
11pF
C71
15nF
50 V
C67
100n
F
6.3
V
C69
47uF
10V
C26
220u
F
6.3V
C22
330u
F
6.3V
C21
330u
FC
2310
0nF
C24
100n
FC
2510
0nF
C18
1uF
25V
100u
F
C19
BOO
T1
VIN
2
EN3
SS/T
R4
RT/
CLK
5PW
RG
D6
VSEN
SE7
CO
MP
8G
ND
9
PH10
PP11
U6
TPS5
4040
DG
Q
0.25
W1%R
80.
15R
R15
100k
PIC1701 PIC1702 CO
C17
PIC1801 PIC1802 COC
18
PIC1901 PIC1902 CO
C19
PIC2001 PIC2002 COC
20
PIC2101 PIC2102
COC21
PIC2201 PIC2202
COC22
PIC2301 PIC2302 COC
23 PIC2401 PIC2402
COC24
PIC2501 PIC2502 COC
25
PIC2601 PIC2602
COC2
6
PIC2701 PIC2702 CO
C27
PIC280N PIC280P COC
28
PIC2901 PIC2902 COC
29
PIC610N PIC610P COC
61
PIC6
701
PIC6
702
COC67
PIC6
801
PIC6
802
COC68
PIC6901 PIC6902 COC
69
PIC7001 PIC7002 COC
70 PIC7101 PIC7102
COC71
PID401 PID402 COD
4
PID501 PID502 COD
5
PID601 PID602 COD
6
PIF1
01
PIF1
02
COF1
PIF201
PIF202
COF2
PIL1
01
PIL1
02
COL1
PIR501 PIR502 COR5
PIR601 PIR602 COR6
PIR701 PIR702 COR7
PIR8
01
PIR8
02
COR8
PIR901
PIR902 COR
9
PIR1001 PIR1002 COR10
PIR1101 PIR1102 COR11
PIR1
501
PIR1
502
COR15
PIR2
001
PIR2
002
COR20
PIR230
1 PIR
2302
COR23
PIU601
PIU602
PIU603
PIU604
PIU605
PIU606
PIU607
PIU608
PIU609
PIU6010
PIU6
011
COU6
PIU7
01
PIU702
PIU7
03
PIU704
PIU705
PIU7
06
PIU7
07
PIU7
08 COU
7
PIU801 PIU802
PIU803 PIU804 PIU805 COU
8
PIU901
PIU9
03
PIU904
PIU9
05
PIU908 COU
9
PIC1701 PIC1801
PIC1902 PIC2001
PIC2102
PIC2202
PIC2301 PIC2401
PIC2501
PIC2602 PIC2701
PIC280N PIC2901
PIC610N
PIC6
802
PIC6901
PIC7001 PIC7101
PID401
PID501
PID601
PIR701
PIR1001 PIR1101
PIR2
002
PIU609
PIU6
011
PIU702
PIU705
PIU801 PIU802
PIU904 PIU909
PIC1702 PIR601 PIR702
POSENSE0VBAT
PIC1802 PIR501 POSENSE03V
PIC2101 PIC2502
PIR8
01
PIU7
07
PIU805
PIC2201
PIC2402
PIC6902
PIL1
02
PIR901
PIU7
03
PIU7
08
PIC2302
PIC280P
PIU7
06
PIU901
PIC2601 PIC2702
PID602 PIF202
PIU9
05
PIU908
PIC2902 PI
U903
PIC6
701
PID502
PIL1
01
PIU6010 PI
C670
2 PIU601
PIC6
801
PIU604
PIC7002 PIR230
2
PIC7102 PIR
2301
PIU608
PIR902
PIR1002
PIU607
PIR1102 PIU704
PIR1
501
PIU603
PIR2
001
PIU605
PIU606
PIU7
01 POPWR0STAT
PIU803 PO
SENS
E0I
PIC610P
PIR502 PI
R802
PIU804
PIF201
PIF1
01
PIC1901 PIC2002
PID402
PIF1
02
PIR602 PIR1
502
PIU602
POPWR0STAT
POSENSE03V
POSE
NSE0
I
POSENSE0VBAT
Proj
ect:
Perm
asen
se W
irele
ss G
PS 2
.0
File
:
Dat
e:
Dra
win
g nu
mbe
r:W
GPS
-REV
2
13.1
0.20
17
C:\U
sers
\ako
s\D
ocum
ents
\Per
mas
ense
\eng
inee
ring\
pcb\
proj
ects
\001
7_w
irele
ss_g
ps_r
ev2\
SCH
-GPS
.Sch
Doc
15:1
7:37
Form
at:
A4 Q
1.05
Rev
:
Dra
wn
by:
Labo
rato
ry:
ETH
TIK
Page
of4
7
Shee
t:
Akos
Pas
ztor
SCH
-GPS
.Sch
Doc
12
34
12
34
A B C D
A B C D
NC
1
NC
2
TxD
3
RxD
4
D_S
EL5
VCC
6 7
VCC
_OU
T8
NC
9
RES
ET10
V_BC
KP
11
Tim
epul
se2
12
13GN
D1415
RF_
IN16
17
VCC
_RF
18
V_AN
T19
ExtIn
t1/A
ADET
20
NC
21
NC
22
NC
23
VDD
_USB
24
USB
_DM
25
USB
_DP
26
ExtIn
t027
Tim
epul
se1
28
U10
LEA
-M8T
P3V
1 %
R13
10R
GPS
_Tpu
lse
GPS
_Rx
GPS
_Tx
SW_G
PS
GPS
Mod
ule
S1
S8 SMA
GPS
& C
ompa
ss
P3V
E-C
ompa
ss 3
D a
ccel
erom
eter
& 3
D m
agne
tom
eter
Tilt_
MO
SI
Tilt_
SCK
Com
pass
_XL_
CS
Com
pass
_XL_
IRQ
GPS
VC
C:
Low
indu
ctan
ce &
resi
stan
ce,
accu
rate
, te
mpe
ratu
re-c
ompe
nsat
ing
caps
,1u
+ 1
00n
+ 1n
+ 1
0p
R12
100k
C34
10uF
C30
10pF
C0G
C31
1nF
C0G
C32
100n
F
Q2
FDC
638P
P3V
_GSM
_SW
Switc
habl
e 3V
Sup
ply
for G
PS
Supp
ly fo
r Ultr
a-Lo
w P
ower
E-C
ompa
ss is
not
nee
ded
to b
e sw
itcha
ble;
alw
ays O
N
iG
PS A
nten
na
SMA
Con
nect
or P
CB
Des
ign:
- stra
ight
rout
ing
- cop
per p
our c
lear
ance
: >16
mil
- wire
wid
th: >
30m
il- n
o po
ur o
n ro
utin
g la
yer u
nder
SM
A
SPL/
SPC
1
CS_
XL2
CS_
MAG
3
SDA/
SDI/S
DO
4C
15
GN
D
6
INT_
MAG
7
GN
D
8
VDD
9
VDD
_IO
10
DR
DY_
MAG
11
INT_
XL12
U11
LSM
303C
TR
Com
pass
_MA
G_I
RQ
Com
pass
_MA
G_C
S
220u
F6.
3V
C37
C35
100n
F
C36
100n
F
C33
1uF
P3V
C57
10nF
C65
100n
F
R30
0R
R31
0R
Not
fitte
d
PIC3001 PIC3002 CO
C30
PIC3101 PIC3102 COC
31
PIC3201 PIC3202 COC
32
PIC3301 PIC3302 CO
C33
PIC3401 PIC3402 COC
34 PIC3501 PIC3502
COC35
PIC3601 PIC3602 COC
36
PIC370N PIC370P CO
C37
PIC5701 PIC5702 CO
C57
PIC650
1 PIC
6502
COC65
PIQ201 PIQ202 PIQ203
PIQ204 PIQ205 PIQ206 COQ
2 PIR1201 PIR1202 COR
12
PIR1301 PIR1302
COR13
PIR3001 PIR3002
COR30
PIR3
101
PIR3
102 COR
31
PIS801
PIS802 PIS803 PIS804 PIS805 COS8
PIU1
001
PIU1
002
PIU1
003
PIU1
004
PIU1
005
PIU1006 PIU1007
PIU1
008
PIU100
9
PIU1
0010
PIU10011
PIU1
0012
PIU10013 PIU10014
PIU10015
PIU1
0016
PIU10017
PIU1
0018
PIU1
0019
PIU100
20 PIU
10021
PIU1
0022
PIU1
0023
PIU1
0024
PIU100
25 PI
U100
26
PIU1
0027
PIU1
0028
COU10
PIU1101
PIU1
102
PIU1103
PIU1104
PIU1105
PIU1106
PIU1107
PIU1108
PIU1109 PIU11010
PIU1
1011
PIU1
1012
COU11
PIC3001 PIC3101
PIC3201 PIC3301
PIC3401 PIC3501 PIC3601
PIC370N PIC5701
PIC650
1
PIS802 PIS803 PIS804 PIS805
PIU1007 PIU10013
PIU10014 PIU10015
PIU10017
PIU1
0024
PIU1106 PIU1108
PIC3602
PIU1105
PIC5702
PIQ203
PIR1201 PO\SW0GPS
PIC650
2
PIR3002
PIR3
101 PIU10011
PIR1301 PI
U100
18
PIR1302 PI
U100
19
PIS801
PIU1
0016
PIU1
001
PIU1
002
PIU1
003
POGPS0Tx
PIU1
004
POGPS0Rx
PIU1
005
PIU1
008
PIU100
9
PIU1
0010
PIU1
0012
PIU100
20 PIU
10021
PIU1
0022
PIU1
0023
PIU100
25 PI
U100
26
PIU1
0027
PIU1
0028
POGPS0Tpulse
PIU1101 POTilt0SCK
PIU1
102
POCompass0XL0CS
PIU1103 PO
Comp
ass0
MAG0
CS
PIU1104 POTilt0MOSI
PIU1107
POCompass0MAG0IRQ
PIU1
1011
PIU1
1012
PO
Comp
ass0
XL0I
RQ
PIC3402 PIC3502
PIC370P
PIQ204 PIR1202
PIR3001
PIU1109 PIU11010
PIC3002 PIC3102
PIC3202 PIC3302
PIQ201 PIQ202 PIQ205 PIQ206 PI
R310
2
PIU1006
NLP3V0
GSM0SW
PO\SW0GPS
POCo
mpas
s0MA
G0CS
POCompass0MAG0IRQ
POCompass0XL0CS
POCo
mpas
s0XL
0IRQ
POGPS0Rx
POGPS0Tpulse
POGPS0Tx
POTilt0MOSI
POTilt0SCK
Proj
ect:
Perm
asen
se W
irele
ss G
PS 2
.0
File
:
Dat
e:
Dra
win
g nu
mbe
r:W
GPS
-REV
2
13.1
0.20
17
C:\U
sers
\ako
s\D
ocum
ents
\Per
mas
ense
\eng
inee
ring\
pcb\
proj
ects
\001
7_w
irele
ss_g
ps_r
ev2\
SCH
-Tilt
.Sch
Doc
15:1
7:37
Form
at:
A4 Q
1.05
Rev
:
Dra
wn
by:
Labo
rato
ry:
ETH
TIK
Page
of5
7
Shee
t:
Akos
Pas
ztor
SCH
-Tilt.
SchD
oc
12
34
12
34
A B C D
A B C D
Tilt
Sen
sors
Tilt_
MIS
OTi
lt_M
OSI
Tilt_
CS_
XTi
lt_C
S_Y
Tilt_
SCK
P3V
_TIL
T
SW_T
ilt
FB1
BLM
18H
G10
2SN
1D
Rsv
d.1
Rsv
d.2
AVSS 3
AVD
D
4
CS
5
MIS
O6
SCK
7
MO
SI8
PWM
9D
VDD
10
DVS
S
11EGN
D12
U12
SCA
830
P3V
_TIL
T_SW
P3V
_TIL
T_SW
Rsv
d.1
Rsv
d.2
AVSS 3
AVD
D
4
CS
5
MIS
O6
SCK
7
MO
SI8
PWM
9D
VDD
10
DVS
S
11EGN
D12
U13
SCA
830
P3V
_TIL
T_SW
Plac
e Ti
lt Se
nsor
s with
90°
diff
eren
t alig
nmen
t
Tilt_
SCK
Tilt_
MIS
OTi
lt_M
OSI
Tilt_
CS_
X
Tilt_
SCK
Tilt_
MIS
OTi
lt_M
OSI
Tilt_
CS_
Y
Tilt_
SCK
Tilt_
MIS
OTi
lt_M
OSI
Tilt_
CS_
XTi
lt_C
S_Y
Tilt
Sen
sors
R14
100k
Q3
FDC
638P
Switc
habl
e 3V
Sup
ply
Vol
tage
for T
ilt S
enso
rs
3V re
ceiv
ed fr
om m
ain
PCB
via
con
nect
or
C39
100n
FC
4010
0nF
C41
100n
FC
4210
0nF
6.3
V
C72
47uF
P3V
Plac
e C
AP
near
con
nect
or
100u
C38
PIC3801 PIC3802 COC
38 PIC3901 PIC3902
COC39
PIC4001 PIC4002 COC
40 PIC4101 PIC4102
COC41
PIC4201 PIC4202 CO
C42
PIC7201 PIC7202 COC
72
PIFB10
1 PIF
B102
COFB1
PIQ301 PIQ302 PIQ303
PIQ304 PIQ305 PIQ306 COQ
3 PIR1401 PIR1402
COR1
4
PIU1
201
PIU120
2
PIU1203 PIU1204
PIU1
205
PIU1
206
PIU1
207
PIU120
8
PIU1
209
PIU12010 PIU12011
PIU1
2012
COU1
2
PIU1
301
PIU130
2
PIU1303 PIU1304
PIU1
305
PIU1
306
PIU1
307
PIU130
8
PIU1
309
PIU13010 PIU13011
PIU1
3012
COU1
3
PIC3801 PIC3901
PIC4001 PIC4101
PIC4201 PIC7201
PIU1
201
PIU120
2
PIU1203 PIU12011
PIU1
2012
PIU1
301
PIU130
2
PIU1303 PIU13011
PIU1
3012
PIFB10
1
PIQ301 PIQ302 PIQ305 PIQ306 PIQ303
PIR1401 PO
\SW0
Tilt
PIU1
209
PIU1
309
PIC7202
PIQ304 PIR1402
PIC3802 PIC3902
PIC4002 PIC4102
PIC4202
PIFB10
2
PIU1204 PIU12010
PIU1304 PIU13010
PIU1
205
NLTilt0CS0X
POTilt0CS0X
PIU1
305
NLTilt0CS0Y
POTilt0CS0Y
PIU1
206
PIU1
306
NLTilt0MISO
POTilt0MISO
PIU120
8 PIU
1308
NLTilt0MOSI
POTilt0MOSI
PIU1
207
PIU1
307
NLTi
lt0S
CK
POTi
lt0S
CK
PO\S
W0Ti
lt
POTilt0CS0X
POTilt0CS0Y
POTilt0MISO
POTilt0MOSI
POTi
lt0S
CK
Proj
ect:
Perm
asen
se W
irele
ss G
PS 2
.0
File
:
Dat
e:
Dra
win
g nu
mbe
r:W
GPS
-REV
2
13.1
0.20
17
C:\U
sers
\ako
s\D
ocum
ents
\Per
mas
ense
\eng
inee
ring\
pcb\
proj
ects
\001
7_w
irele
ss_g
ps_r
ev2\
SCH
-GSM
.Sch
Doc
15:1
7:37
Form
at:
A4 Q
1.05
Rev
:
Dra
wn
by:
Labo
rato
ry:
ETH
TIK
Page
of6
7
Shee
t:
Akos
Pas
ztor
SCH
-GSM
.Sch
Doc
12
34
12
34
A B C D
A B C D
DSR
6
RI
7
DC
D8
DTR
9
RTS
10
CTS
11
TXD
12
RXD
13
PWR
_ON
15
GPI
O1
16
VUSB
_DET
17
RES
ET_N
18
CO
DEC
_CLK
19
GPI
O2
23
GPI
O3
24
GPI
O4
25
SDA
26SC
L27
USB
_D-
28
USB
_D+
29
I2S_
WA
34
I2S_
TXD
35
I2S_
CLK
36I2
S_R
XD37
SIM
_CLK
38SI
M_I
O39
SIM
_RST
40
VSIM
41SI
M_D
ET42
ANT
56
ANT_
DET
62
U15
A
SAR
A-U
270-
00S
GN
D1
GN
D3
GN
D5
GN
D14
GN
D20
GN
D21
GN
D22
GN
D30
GN
D32
GN
D43
GN
D50
GN
D54
GN
D55
GN
D57
GN
D58
GN
D59
GN
D60
GN
D61
GN
D63
GN
D64
GN
D65
GN
D66
GN
D67
GN
D68
GN
D69
GN
D70
GN
D71
GN
D72
GN
D73
GN
D74
GN
D75
GN
D76
GN
D77
GN
D78
GN
D79
GN
D80
GN
D81
GN
D82
GN
D83
GN
D84
GN
D85
GN
D86
GN
D87
GN
D88
GN
D89
GN
D90
GN
D91
GN
D92
GN
D93
GN
D94
GN
D95
GN
D96
V_BC
KP2
V_IN
T4
RSV
D31
RSV
D33
RSV
D44
RSV
D45
RSV
D46
RSV
D47
RSV
D48
RSV
D49
VCC
51
VCC
52
VCC
53
U15
B
SAR
A-U
270-
00S
GSM
_Rx
GSM
_Tx
GSM
_RTS
GSM
_CTS
GSM
_DSR
GSM
_DTR
GSM
_DC
D
Leve
l-mat
chin
g: 3
V to
1V
8
P3V
8
BOO
ST1
VIN
2
VSW
3
4
SHD
N5
FB6
VC7
SYN
C8
GN
D
U14
LT17
65ES
8#PB
F
D7
SD10
3CW
S-7-
FP3
V8
PV_I
N_G
SM
SW_G
SM
GSM
Pow
er S
uppl
y
P1V
8
P1V
8
P1V
8
P3V
_GSM
P3V
_GSM
1%
RA
2
3k9
1%RA
35k
6
Leve
l-mat
chin
g: 1
V8
to 3
V
S1
S10
SMA
Cel
lula
r
Det
ect_
GSM
GSM
PC
B d
etec
tion
D8
SS24
L23.
3uH
Nea
r-C
hip
Cap
acito
rs
P3V
_GSM
P1V
8
R19
100k
C55
47pF
C58
47pF
C59
47pF
C47
56pF
C0G
C46
10nF
1 %
R16
33k
1 %
R18
15k
50 V
C43
180n
F
C50
2.2n
F
Shie
ld
VCC
C1
RST
C2
CLK
C3
GN
DC
5
VPP
C6
I/OC
7
Nano_SIM
J3 Nan
oSIM
-hol
der
Supp
ly V
olta
ge fr
om B
atte
ry re
ceiv
ed fr
om m
ain
PCB
via
con
nect
or
1V8
Vol
tage
is p
rodu
ced
by G
SM M
odul
e
SMA
Con
nect
or P
CB
Des
ign:
- stra
ight
rout
ing
- cop
per p
our c
lear
ance
: >16
mil
- wire
wid
th: >
30m
il- n
o po
ur o
n ro
utin
g la
yer u
nder
SM
A
iG
SM A
nten
na
GN
D4
B26
B17
DIR
5
A12
A23
VCC
A1
VCC
B8
U17
SN74
LVC
2T45
DC
UR
GN
D4
B26
B17
DIR
5
A12
A23
VCC
A1
VCC
B8
U16
SN74
LVC
2T45
DC
UR
6.3V
C44
470u
F6.
3V
C63
470u
FC
4810
pFC
0G
C45
100n
FC
5110
0nF
C52
100n
FC
5310
0nF
C54
100n
F
C60
100n
F
25V
100u
F
C49
25V
100u
F
C62
IN1
OU
T5
EN3
2
4
GN
D
U5
TPS7
8230
DD
CR
P3V
_GSM C
1210
uF
R17 4k
7
R32
100k
PIC1201 PIC1202 COC
12
PIC4301 PIC4302 CO
C43
PIC4401 PIC4402
COC4
4
PIC4501 PIC4502 COC
45 PIC4601 PIC4602
COC46
PIC4701 PIC4702 CO
C47
PIC4801 PIC4802 CO
C48
PIC4901 PIC4902 COC
49
PIC5001 PIC5002 CO
C50
PIC5101 PIC5102 COC
51 PIC5201 PIC5202
COC52
PIC5301 PIC5302 COC
53 PIC5401 PIC5402
COC54
PIC5501 PIC5502 COC
55 PIC5801 PIC5802
COC58
PIC5901 PIC5902 COC
59 PIC6001 PIC6002
COC60
PIC6201 PIC6202 COC
62 PIC6301 PIC6302
COC63
PID701
PID702 COD7
PID801 PID802 COD
8
PIJ30C1
PIJ3
0C2
PIJ30C3
PIJ3
0C5
PIJ3
0C6
PIJ30C7
PIJ3
0Shi
eld COJ
3
PIL201
PIL202
COL2
PIR1
601
PIR1
602
COR16
PIR1701 PIR1702 COR1
7
PIR1801 PIR1802 COR18
PIR1901 PIR1902 COR1
9
PIR3201 PIR3202 COR3
2
PIRA20
1 PIR
A202
PIRA
203
PIRA
204
PIRA
205
PIRA
206
PIRA
207
PIRA
208
CORA
2
PIRA301 PIRA302
PIRA303 PIRA304
PIRA305 PIRA306
PIRA307 PIRA308 CO
RA3
PIS1001
PIS1002 PIS1003 PIS1004 PIS1005
COS10
PIU501
PIU502 PIU503
PIU504
PIU505
COU5
PIU1401
PIU1402
PIU1
403
PIU1404
PIU1
405
PIU1406
PIU1407
PIU1408 COU1
4
PIU1506
PIU1507
PIU1
508
PIU1509
PIU1
5010
PI
U150
11
PIU1
5012
PIU1
5013
PIU1
5015
PIU1
5016
PIU1
5017
PIU1
5018
PIU1
5019
PIU1
5023
PI
U150
24
PIU1
5025
PIU1
5026
PIU1
5027
PIU1
5028
PIU1
5029
PIU1
5034
PIU1
5035
PIU1
5036
PIU1
5037
PIU1
5038
PIU1
5039
PIU1
5040
PIU1
5041
PIU1
5042
PIU1
5056
PIU1
5062
COU15A
PIU1501
PIU1
502
PIU1503
PIU1504
PIU1505
PIU1
5014
PI
U150
20
PIU1
5021
PIU1
5022
PIU1
5030
PIU1
5031
PIU1
5032
PIU1
5033
PIU1
5043
PIU1
5044
PIU1
5045
PIU1
5046
PIU1
5047
PIU1
5048
PI
U150
49
PIU1
5050
PIU1
5051
PIU1
5052
PIU1
5053
PIU1
5054
PIU1
5055
PIU1
5057
PI
U150
58
PIU1
5059
PIU1
5060
PIU1
5061
PIU1
5063
PI
U150
64
PIU1
5065
PIU1
5066
PIU1
5067
PI
U150
68
PIU1
5069
PIU1
5070
PIU1
5071
PIU1
5072
PIU1
5073
PI
U150
74
PIU1
5075
PIU1
5076
PIU1
5077
PIU1
5078
PI
U150
79
PIU1
5080
PIU1
5081
PIU1
5082
PIU1
5083
PI
U150
84
PIU1
5085
PIU1
5086
PIU1
5087
PIU1
5088
PI
U150
89
PIU1
5090
PIU1
5091
PIU1
5092
PI
U150
93
PIU1
5094
PIU1
5095
PIU1
5096
COU15B
PIU1
601
PIU1602
PIU1603
PIU1
604
PIU1605
PIU1606
PIU1607
PIU1
608 CO
U16
PIU1701
PIU1
702
PIU1
703
PIU1704
PIU1705
PIU1
706
PIU1
707
PIU1708 COU1
7
PIC1201 PIC4402
PIC4501 PIC4601
PIC4701 PIC4801
PIC4902 PIC5001
PIC5101 PIC5201
PIC5301 PIC5401
PIC5501 PIC5801
PIC5901 PIC6001
PIC6202 PIC6302
PID801
PIJ3
0C5
PIJ3
0Shi
eld
PIR1701
PIR1801 PIR3201
PIRA301 PIRA303
PIRA305
PIS1002 PIS1003 PIS1004 PIS1005
PIU502 PIU504
PIU1404
PIU1408
PIU1501
PIU1503
PIU1505
PIU1
5014
PI
U150
20
PIU1
5021
PIU1
5022
PIU1
5030
PIU1
5032
PIU1
5033
PIU1
5043
PI
U150
50
PIU1
5054
PIU1
5055
PIU1
5057
PI
U150
58
PIU1
5059
PIU1
5060
PIU1
5061
PIU1
5063
PI
U150
64
PIU1
5065
PIU1
5066
PIU1
5067
PI
U150
68
PIU1
5069
PIU1
5070
PIU1
5071
PIU1
5072
PIU1
5073
PI
U150
74
PIU1
5075
PIU1
5076
PIU1
5077
PIU1
5078
PI
U150
79
PIU1
5080
PIU1
5081
PIU1
5082
PIU1
5083
PI
U150
84
PIU1
5085
PIU1
5086
PIU1
5087
PIU1
5088
PI
U150
89
PIU1
5090
PIU1
5091
PIU1
5092
PI
U150
93
PIU1
5094
PIU1
5095
PIU1
5096
PIU1
604
PIU1605
PIU1704
PIU1705 PIC4301 PID802
PIL201
PIU1
403
PIC4302 PID702
PIU1401
PIC5002 PIU1407
PIC5502
PIJ3
0C2
PIU1
5040
PIC5802
PIJ30C3
PIU1
5038
PIC5902
PIJ30C7
PIU1
5039
PIC6002
PIJ30C1
PIU1
5041
PIJ3
0C6
PIR1
601
PIR1802 PIU1406
PIR1702 PODetect0GSM
PIR1901 PI
U150
15
PIR1902 PI
U150
2
PIR3202
PIU1
405
POSW0GSM
PIRA20
1 POGSM0Tx
PIRA20
2
PIRA306 PI
U150
12
PIRA
203
POGSM0RTS
PIRA
204
PIRA304 PI
U150
10
PIRA
205
POGS
M0DT
R PI
RA20
6
PIRA302
PIU1509
PIRA
207
PIRA
208
PIRA307 PIRA308
PIS1001
PIU1
5056
PIU1506
PIU1
707
PIU1507
PIU1
508
PIU1
706
PIU1
5011
PIU1606
PIU1
5013
PIU1607
PIU1
5016
PIU1
5017
PIU1
5018
PIU1
5019
PIU1
5023
PI
U150
24
PIU1
5025
PIU1
5026
PIU1
5027
PIU1
5028
PIU1
5029
PIU1
5031
PIU1
5034
PIU1
5035
PIU1
5036
PIU1
5037
PIU1
5042
PIU1
5044
PIU1
5045
PIU1
5046
PIU1
5047
PIU1
5048
PI
U150
49
PIU1
5062
PIU1602
POGSM0Rx
PIU1603
POGSM0CTS
PIU1
702
POGSM0DSR
PIU1
703
POGSM0DCD
PIC5302 PIC5402
PIU1504
PIU1
608
PIU1708
PIC4401 PIC4502
PIC4602 PIC4702
PIC4802 PIC6301
PID701
PIL202
PIR1
602
PIU501
PIU503
PIU1
5051
PIU1
5052
PIU1
5053
PIC1202 PIC5102
PIC5202
PIU505
PIU1
601
PIU1701
PIC4901 PIC6201
PIU1402
PODetect0GSM
POGSM0CTS
POGSM0DCD
POGSM0DSR
POGS
M0DT
R POGSM0RTS
POGSM0Rx
POGSM0Tx
POSW0GSM
Proj
ect:
Perm
asen
se W
irele
ss G
PS 2
.0
File
:
Dat
e:
Dra
win
g nu
mbe
r:W
GPS
-REV
2
13.1
0.20
17
C:\U
sers
\ako
s\D
ocum
ents
\Per
mas
ense
\eng
inee
ring\
pcb\
proj
ects
\001
7_w
irele
ss_g
ps_r
ev2\
SCH
-Tin
yNod
e.Sc
hDoc
15:1
7:37
Form
at:
A4 Q
1.05
Rev
:
Dra
wn
by:
Labo
rato
ry:
ETH
TIK
Page
of7
7
Shee
t:
Akos
Pas
ztor
SCH
-Tin
yNod
e.Sc
hDoc
12
34
12
34
A B C D
A B C D
1 2 3
S11
SIP-
3
Har
ting
0918
-514
-632
4
1 2 3 4 5 6 7 8 9 10 11 12 13 14
S13
SIP-
7x2
TDO
1VC
C2
TDI
3VR
eg4
TMS
5G
ND
6
TCK
7nR
ST8
UR
XD1
9nR
EGE
10
UTX
D11
P5.0
/STE
112
P1.2
/TA1
13P5
.1/S
IMO
114
P1.3
/TA2
15P5
.2/S
OM
I116
E_EV
REF
17P5
.3/U
CLK
118
P6.7
/AD
C7/
DAC
119
P1.6
/TA1
20
P6.6
/AD
C6/
DAC
021
P2.3
/CA0
/TA1
22
P6.5
/AD
C5
23P2
.4/C
A1/T
A224
P6.4
/AD
C4
25P4
.0/T
B026
P6.3
/AD
C3
27T4
.1/T
B128
P6.2
/AD
C2
29E_
IVR
EF30
Scre
w
J2Ti
nyN
ode1
84TN
_TD
O
TN_T
DI
TN_T
MS
TG_P
RO
G
P3V
VC
C_T
AR
GET
VC
C_T
OO
L
TG_R
ESET
TG_R
ESET
P3V
Nea
r-ch
ip c
apac
itors
for T
N &
per
iphe
ry
GN
D1
DQ
2
NC
3N
C5
NC
6N
C4
U18
DS2
401P
P3V
_TN
_PER
IPH
TN_S
PI_M
OSI
TN_S
PI_M
ISO
TN_S
PI_S
CK
TN_S
PI_M
OSI
TN_S
PI_M
ISO
TN_S
PI_S
CK
P3V
TN_S
PI_C
S_SD
TN_S
PI_C
S_SD
TN_B
OLT
_IN
DTN
_GPI
O
TG_R
ESET
RST
1
VDD
2
VSS
3
U19
MC
P130
T-27
0I/T
T
P3V
TN_E
VR
EF
SW5
AD
TSM
62R
VTR
Tin
yNod
e
GPS
_Tpu
lse
P3V
TG_R
ESET
TG_P
RO
G
TG_U
AR
T_TX
DTG
_UA
RT_
RX
D
TN_S
PI_S
CK
TN_S
PI_M
OSI
TN_S
PI_M
ISO
TN_S
PI_S
CK
TN_S
PI_M
ISO
TN_S
PI_M
OSI
TN_B
OLT
_REQ
Har
ting
0918
-510
-632
4
1 2 3 4 5 6 7 8 9 10
S14
SIP-
5x2
R21 4k
7TN
_BO
LT_A
CK
TN_B
OLT
_MO
DE
100u
C66
C56
100n
FC
6410
0nF
R29
100k
P3V
C73
10uF
P3V
SD_D
21
SD_D
3/C
S2
SD_C
MD
/MO
SI3
VDD
4
CLK
/SC
LK5
VSS
6
SD_D
0/M
ISO
7
SD_D
18
CD
9
CD
_VSS
10
Shie
ld
J5M
icro
SD h
olde
r
C15
10nF
R22
100k
Q5
FDC
638P
P3V
_TN
_PER
IPH
SW_T
N_P
ERIP
H
SW_T
N_P
ERIP
H
C75
10nF
Not
fitte
d
Not
fitte
d
Not
fitte
d
PIC1501 PIC1502 CO
C15
PIC5601 PIC5602 CO
C56
PIC6401 PIC6402 CO
C64
PIC6601 PIC6602 CO
C66
PIC7301 PIC7302 CO
C73
PIC7
501
PIC7
502
COC75
PIJ2
01
PIJ202
PIJ2
03
PIJ204
PIJ2
05
PIJ206
PIJ207
PIJ208
PIJ209
PIJ2
010
PIJ2
011
PIJ2
012
PIJ2
013
PIJ2
014
PIJ2
015
PIJ2
016
PIJ201
7 PI
J201
8 PI
J201
9 PI
J202
0
PIJ2
021
PIJ2
022
PIJ2
023
PIJ2
024
PIJ2
025
PIJ2
026
PIJ202
7 PI
J202
8 PI
J202
9 PI
J203
0
PIJ20Screw
COJ2
PIJ501
PIJ502
PIJ503
PIJ504
PIJ505
PIJ506
PIJ507
PIJ508
PIJ509
PIJ5010
PIJ50Shield
COJ5
PIQ501
PIQ502
PIQ503 PIQ504
PIQ505
PIQ506
COQ5
PIR2101 PIR2102 COR21
PIR220
1 PIR
2202
COR22
PIR2901 PIR2902 COR2
9
PIS1
101
PIS1
102
PIS110
3
COS11
PIS1
301
PIS1
302
PIS1
303
PIS130
4 PIS
1305
PIS1
306
PIS1
307
PIS1
308
PIS130
9 PI
S130
10
PIS1
3011
PIS1
3012
PIS1
3013
PIS130
14
COS13
PIS1
401
PIS1
402
PIS140
3 PIS
1404
PIS1
405
PIS1
406
PIS1
407
PIS140
8 PI
S140
9
PIS1
4010
COS14
PISW501 PISW503 COSW
5
PIU1801
PIU1802
PIU1
803
PIU1804
PIU1
805
PIU1806 COU1
8
PIU1
901
PIU1902
PIU1903 COU1
9
PIC1501
PIC5601 PIC6401
PIC6601
PIC7301
PIC7
502
PIJ206
PIJ20Screw
PIJ506
PIJ50Shield
PIS130
9
PIS1
4010
PISW501
PIU1801
PIU1903
PIJ204
PIJ2
010
PIJ2
012
PIJ2
013
POGP
S0Tp
ulse
PI
J201
5
PIJ201
7 PI
J201
9 PI
J202
0
PIR2101 PIU1802
PIJ2
022
POTN
0BOL
T0IN
D PI
J202
3
POTN0BOLT0REQ
PIJ2
024
POTN0GPIO
PIJ2
026
PIJ202
7 POTN0BOLT0ACK
PIJ2
028
PIJ2
029
POTN0BOLT0MODE
PIJ2
030
POTN0EVREF
PIJ501
PIJ508
PIJ509
PIJ5010
PIS1
306
PIS1
308
PIS1
3010
PIS1
3012
PIS1
3013
PIS130
14
PIS1
406
PIS1
407
PIS140
8 PI
S140
9
PIU1
803
PIU1804
PIU1
805
PIU1806
PIC5602 PIC6402
PIC6602
PIC7302
PIJ202
PIQ504
PIR220
2
PIR2902
PIS1
102
PIS1
401
PIU1902
PIC1502 PIJ504
PIQ501
PIQ502
PIQ505
PIQ506
PIR2102
NLP3V0TN0PERIPH
PIC7
501
PIJ2
021
PIQ503 PIR
2201
NLSW0TN0PERIPH
PIJ207
PIS1
307
PIS1
405
NLTG
0PRO
G
PIJ208
PIS1
3011
PIS140
4
PISW503 PI
U190
1
NLTG
0RES
ET
POTG
0RES
ET
PIJ2
011
PIS140
3 NLTG0UART0RXD
PIJ209
PIS1
402
NLTG
0UAR
T0TX
D
PIJ2
025
PIJ502
NLTN0SPI0CS0SD
PIJ2
016
PIJ507
PIR2901
NLTN0SPI0MISO
POTN0SPI0MISO
PIJ2
014
PIJ503
NLTN0SPI0MOSI
POTN0SPI0MOSI
PIJ2
018
PIJ505
NLTN
0SPI
0SCK
POTN0SPI0SCK
PIJ2
03
PIS1
303
NLTN
0TDI
PIJ2
01
PIS1
301
NLTN
0TDO
PIJ2
05
PIS130
5 NL
TN0T
MS
PIS1
101
PIS130
4 NLVCC0TARGET
PIS110
3
PIS1
302
NLVC
C0TO
OL
POGP
S0Tp
ulse
POTG
0RES
ET
POTN0BOLT0ACK
POTN
0BOL
T0IN
D
POTN0BOLT0MODE
POTN0BOLT0REQ
POTN0EVREF
POTN0GPIO
POTN0SPI0MISO
POTN0SPI0MOSI
POTN0SPI0SCK