Ping Pong Product Manual Rev .
1 Contents 1 Contents ................................................................................................................................................ 2 1- Product Description.............................................................................................................................. 3 2- Key Benefits .......................................................................................................................................... 3 3- Product Features ........
1- Product Description The Round Solutions PingPong is an embedded IoT/M2M hardware platform made for Software Developers. The platform supports extension boards that add unlimited capabilities. It can be used to easily make physical devices that connect to the web. It’s literally plug, push and play. PingPong comes with both wired and wireless connectivity. The device is available in two opensource SW versions.
o o 32 MB Flash memory 128 MB RAM 4- Interfaces Connectors for unlimited stackable extension boards Ethernet interface USB interface USB interface directly with the Telit Cellular module 1 x CAN interface 2 x Frequency inputs 2 x Analog inputs 4 x Three state logic inputs 4 x NMOSFET outputs 2 x Current measurement inputs (24 bits resolution with galvanic isolation) 1 x 1-Wire interface Antenna Connectors o GSM: U.FL Connector o GNSS: U.
6- Downloading Firmware to the PingPong board: a- PIC Programmer: The PingPong board has 5 SMD pins for downloading a firmware to the microcontroller on board. The pins are referenced in the picture below and are from right to left: Master clear (MCLR), VDD, GND, PGD, and PGC. A non-expensive programmer is Microchip PicKit3 programmer which can be used to download the firmware. Pinouts are shown below.
“app_p32MZ.ld” added to the linker folder before compilation. Each project has its own linker script inside the src folder. 7- PIN Outs: The picture on the right shows the pinout of the PingPong board. The table below provides a description about each pin. Fig (c) Pin Number 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 Pin Name VIN GND 1WD 1W-GND 1W-PWR DO4 DO2 DO1 DO3 AI2 DI1 DI2 DI4 DI3 AI1 IGND CI1+ Pin Description Input voltage to the board.
18 19 20 21 22 23 24 CI1CI2+ CI2CANH CANL FI1 FI2 Current input 1 Current input 2 + (4-20mA current measurement with isolation) Current input 2 CAN High CAN Low Frequency counter input 1 Frequency counter input 1 8- RF Connectors: The PingPong board has three UFL connectors on board as shown in the picture below. Fig (d) The GNSS connector has a 3V DC voltage to power the active antenna connected to it.
10- Firmware Development: Before starting the development, we recommend that you make yourself familiar with Microchip MPLABX IDE and MPLAB Harmony. Note that MPLAB Harmony has to be added as a plugin to the All the examples we provide have been setup using MPLAB Harmony. We provide examples of source code that show how to develop a code for the Ping Pong in addition to how to establish communications between the microcontroller and interconnected module.
#pragma config FSLEEP = OFF #pragma config DBGPER = PG_ALL #pragma config EJTAGBEN = NORMAL #pragma config CP = OFF /*** DEVCFG1 ***/ #pragma config FNOSC = SPLL #pragma config DMTINTV = WIN_127_128 #pragma config FSOSCEN = OFF #pragma config IESO = OFF #pragma config POSCMOD = EC #pragma config OSCIOFNC = OFF #pragma config FCKSM = CSDCMD #pragma config WDTPS = PS1048576 #pragma config WDTSPGM = STOP #pragma config FWDTEN = OFF #pragma config WINDIS = NORMAL #pragma config FWDTWINSZ = WINSZ_25 #pragma conf
Freescale as accelerometer and magnetometer. Please refer to the datasheet of these ICs for more details information on their utilization in the board if needed. There are 5 different MPLABX demo projects that can be downloaded from Round Solutions website. These projects demonstrate the use of FreeRTOS and state machine code. They include examples about the use of TCPIP, USB CDC, communication with Telit modules, reading GPS NMEA messages, and reading and writing to IOs.
The demonstration application contains six tasks. A description of these tasks is as follows: • The FrameworkTasks task is created in the SYS_Tasks function. This task calls the USB Device Layer Tasks function (USB_DEVICE_Tasks). The priority of this task is designed to be the lowest when compared to the priorities of other tasks. Hence this tasks runs when all other tasks are either in blocked state or not ready to run. • The APP_USB_DEVICE_Open task is created in the APP_Tasks function.
To build this project, you must copy the project to the following location: /apps/rtos/freertos/ and then open the PPR_tcpip_client_server.X project in MPLAB X IDE. if not changed by the user is: C:\microchip\harmony\vxxxxx Where vxxxxx depends on which version of MPLAB Harmony is installed. This demonstration runs IPv4 only on the Ethernet interface.
• On the remote host side (PC, etc.) open a TCP server that listens for incoming connections on port 9761. Use any network tools (netcat, etc.) or special applications, scripts (TCL, Python, etc.) to receive (and transmit) data files. • Set the PIC32 client side address and port for the server to connect to, for example: tsrv4_c1 192.168.100.101 9761 • Start the PIC32 TCP client socket by issuing the console command: topen_c1 3.
This task uses a TCP server socket that listens by default on port 9760 to implement a simple relay server. Any message that is received on that TCP port will be relayed back to the originating socket. The following table lists and describes the available commands Command Description: topen_s1 Opens the listening TCP server socket. tmsg_s1 Sends a short message using this socket to the remote client. tabort_s1 Sends an abort/RST to the remote client and stops the communication.
This task uses a UDP server socket that listens by default on port 32323 to implement a simple relay server. Any message that is received on that UDP port will be relayed back to the originating socket. The following table lists and describes the available commands. Command Description uopen_s1 Opens the listening UDP server socket. uclose_s1 Closes the socket and stops the communication.
utxsize_c1 Sets the TX buffer size of the server socket. The larger the buffer the more memory is used by the socket and the more efficient is the transfer. Default value is 1024 bytes. Note that this value should not be made larger than 1460 for an Ethernet network (to avoid packets larger than the link MTU). For more information about TCPIP stack, please refer to Framework Help/TCP/IP Stack Libraries Help in MPLAB Harmony documentation.
4 PP_cdc_com_port_single[4]: This demonstration application creates a USB CDC Device that enumerates as a single COM port on the host personal computer. The application demonstrates two-way communication between the USB device and the personal computer host. Description: To build this project, you must copy the project to the following location /apps/usb/device/. and then open the PP_cdc_com_port_single.X project in MPLAB X IDE.
- Creates a USB CDC Device that enumerates as a single COM port on the host personal computer.
Several other functions are available to send the Telit Cellular module response and the GPS NMEA messages over USB. These functions are XE910_SendUART2USB() and GPS_SendUART2USB() . The state machine is maintained using the function APP_Tasks_USB(). Please refer to it for more details on the implementation. 5.2 USART Driver for XE910 Telit Cellular module: The PIC microcontroller uses UART1 with flow control to send data to and receive data from the XE910 module.
5.3 USART Driver for GPS module: The PIC microcontroller uses UART2 to read NMEA messages from the GPS module on board. We have developed a parser for NMEA messages to extract the necessary information from the message. First the RMC and GGA messages are isolated in a buffer and then parsed separately using the funtions ParseGGA() and ParseRMC().
5.5 I2C Driver for the Accelerometer/Magnetometer FXOS8700CQ: The PIC microcontroller uses I2C driver (I2C_ID_2) to communicate with the Accelerometer Magnetometer on board. The state machine configures the accelerometer at first as it is recommended by the datasheet of the IC. Then it continuously reads the accelerometer and magnetometer data and stores the readings in the structs: ACCELDATA accelData; MAGDATA magData; Where these structs contain the X,Y,Z, and magnitude data.
Function GetIOStatus(uint8_t PortNumber) checks the state of the digital input number passed as a parameter returns the state of that input as one of three states: FLOATING, LOGIC_HIGH, or LOGIC_LOW 5.9 Frequency Counter inputs: The variable FrequencyIn1 and FrequencyIn2 contain the value frequency of the signal applied to Frequency counter inputs 1 and 2 respectively. The code counts the pulses fed into the inputs and computes the frequency every 0.1 second. 5.
12- CE Declaration: 23