*3.3. Microcontroller*

The signals obtained from input stages are directly connected to two analog inputs of a STM32F407V MCU. This microcontroller is based on an ARM Cortex-M4 32 bit core with Floating Point Unit (FPU), it reaches 210 Dhrystone Mega Instructions Per Second (DMIPS) running at 168 MHz clock. It carries 512 kB of Flash and 192 kB of Static Random Access Memory (SRAM). It integrates several peripheral: Universal Serial Bus On-The-Go (USB OTG) HS/FS, Ethernet, 17 timers, three ADCs, 15 communication interfaces and camera interface. For this project, different features of MCU are used: two different 12-bit ADCs to acquire input signals, two internal 16-bit timers running at 168 MHz for timing and synchronization management, a Universal Asynchronous Receiver Transmitter (UART) to communicate with GPS receiver, an external input interrupt to receive the PPS signal and the Ethernet Media Access Control (MAC) interface to implement communication.

#### *3.4. GPS Receiver*

It is worthwhile to underline that, for cost reasons, only simple GPS receivers without disciplined oscillator output have been considered and an external Original Equipment Manufacturer (OEM) GPS receiver module Linx-rxm-GPS-FM has been chosen. It is a self-contained receiver based on the MediaTek MT3339 chipset, it can simultaneously acquire on 66 channels and track on up to 22 channels. This gives the module fast lock times even at low signal levels. The module outputs standard National Marine Electronics Association (NMEA) data messages through a UART interface.

#### **4. Firmware Implementation**

The firmware is fully developed in C language; Keil Microcontroller Development Kit (MDK) ARM development environment has been chosen for its high performance toolchain. The presented work has been developed on a low cost microcontroller, with relatively poor hardware features; consequently, grea<sup>t</sup> challenges are constituted by the firmware optimization and the accurate metrological characterization to evaluate and compensate the systematic errors. In particular, the main challenges have been related to: (1) the lack of specific synchronization hardware, (2) the lack of high resolution 32-bit timer at 168 MHz, (3) the poor Digital Signal Processing (DSP) performance of the floating-point unit (it does not implement 64 bit double-precision calculations) and (4) the low RAM size. In this section, some details on the main parts of firmware will be described, along with the techniques adopted to overcome the hardware limitations.
