ST STEVAL-IHP007V1 User Manual

Page 1
December 2016 DocID026935 Rev 3 1/47
47
UM1818
User manual
Street lighting power line modem evaluation board based on
ST7580 PLM and STM32 microcontroller
Introduction
The system is based to the ST7580 data link protocol firmware, data link protocol described in the application note AN4018. ST7580 data link protocol firmware is organized in a layer structure. A dedicated layer allows the user to design its own application interfacing to the evaluation board features with very simple and easy to use APIs.
Dedicated software graphic user interface (GUI) allows the user to use all the embedded features interfacing the PLM evaluation board with the PC via an RS232 communication port.
This firmware is developed using STM32F10x standard peripherals library Rel.3.5.0 and IAR Embedded Workbench® IDE for STM32 microcontrollers Rel. 6.50x
The STEVAL-IHP007V1 hardware evaluation board embeds an ARM 32-bit Cortex™-M3 core-based STM32F103xB and an ST7580 PSK multi mode power line networking system­on-chip.
Figure 1. STEVAL-IHP007V1 evaluation board
www.st.com
Page 2
Contents UM1818
2/47 DocID026935 Rev 3
Contents
1 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2 Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
3 Hardware installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
4 Firmware description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
4.2 Remote firmware update (RFU) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
4.3 Firmware download . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.4 Firmware architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11
4.5 Firmware data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
4.6 Firmware frame types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.6.1 Communication frames types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.6.2 Ping frames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
4.6.3 Error frames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
4.6.4 Service frames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Appendix A HID commands. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Appendix B Schematic diagrams and bill of material. . . . . . . . . . . . . . . . . . . . . 35
B.1 Schematic diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
B.2 Bill of material (BOM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Appendix C CRC 16 calculation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
5 Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
6 Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Page 3
DocID026935 Rev 3 3/47
UM1818 Features
47
1 Features
Configurable PSK power line modem interface with an embedded firmware stack for a complete power line communication management
8 user configurable general purpose input/output pins
USART communication channel for evaluation board interfacing
Internal configurable RTC evaluation board with lithium backup battery
Programmable user data and PLM parameters Flash memory area
Remote firmware update
Embedded AES 128 encryption evaluation board with programmable AES Key
Page 4
Description UM1818
4/47 DocID026935 Rev 3
2 Description
The STEVAL-IHP007V1 block diagram is shown in Figure 2. The general purpose power line modem evaluation board is based on an ST7580 x-PSK power line modem device and an ARM 32-bit Cortex™-M3 core based STM32F103xB microcontroller. The PLM evaluation board is a fully functional communication evaluation board, with 8 programmable I/Os, a real time clock and a Flash memory area for modem parameters and user data storage. The firmware structure is made up of several layers, each dealing with a different feature. The application layer engine is the general interface between the user program and all the parts of the evaluation board. It manages the communication ports, the evaluation board peripherals such as SCI, RTC, I/Os, LEDs and timing management. It is also the interface between the PLM communication protocol and the user application layer. The PLM communication protocol, itself made up of several layers, implements and manages the power line communication, manages the conflicts, timing and repetitions, the addressing, and so on. Please refer to AN4018 for details on the ST7580 communication protocol features and application services provided. Some features are managed directly by the application engine, and are transparent to the user, such as the RTC management or the board parameter update, as well as the board programming and configuration, which is done by particular programming or service commands managed and acknowledged directly by the application engine. Even the remote firmware update is managed by the application engine and allows the firmware being update remotely by power line modem.
The STEVAL-IHP007V1 is powered by a dual regulated DC power source, +12VDC (pin 1) and +3.3 VDC (pin 2) from the power supply connector (J2). The pin 3 is the ground.
The communication is done via power line, which is applied to the board using the J1 connector, where the pin 1 must be connected to the neutral wire while the pin 3 to the phase wires (refer to the Appendix A).
Figure 2. STEVAL-IHP007V1 block diagram
It is possible to connect the evaluation board in a three phase line (in case of communication modules are connected in all three phases), in this case an external
Page 5
DocID026935 Rev 3 5/47
UM1818 Description
47
capacitor of 220 nF X1 must be connected to any additional phase, and then the other side of capacitors together with the common pin 5 of the J2 connector, following the schematic shown in the Figure 3, and the 0 resistor R1 must be mounted.
Figure 3. Three phase connection
The GP PLM module is provided of a user interface (J3) shown in Figure 4 where there are connected the SPI interface pins (MOSI, MISO, SCK and NSS), the RS232 interface pins (Tx and Rx), the USB interface pins (D+ and D-) and the user programmable general purpose I/O pins. Remark that those pins are directly connected to the microcontroller, so be careful to provide the correct insulation and
protection depending on the use those pins are addressed. It is possible to power the PLM using the +3.3 VDC (pin 19), +12 VDC (pin 20 or 22) and
GND (pins 17, 23, 20 and 24) of this connector instead of the connector J2, using only a single connector for power supply and control signals.
A lithium backup battery mounted on the board and 32 kHz quartz allows the use of the full functionality of the internal RTC of the microcontroller, allowing precise time-based operations.
Page 6
Description UM1818
6/47 DocID026935 Rev 3
Figure 4. User interface connector
A two color LED allows the signaling the board operations, data transmission and reception. Finally, a programming connector allows the firmware download and debug, even if it is
possible to use the remote firmware update feature to remotely update the firmware using the PLM, as described further in this user manual. If the IAR - JLINK/JTRACE is used for the firmware downloading, a simple JTAG adapter is necessary. The Figure 5 shows the adapter schematics.
Figure 5. Programming connector JTAG adapter
PLM_GPIO0
PLM_GPIO1
PLM_GPIO2
PLM_GPIO3
PLM_GPIO4
PLM_GPIO5
PLM_GPIO6
PLM_GPIO7
BOOT0
SPI_MOSI
SPI_MISO
SPI_SCK
SPI_NSS
USB_ DM
USB_ DP
USART_TX
USART_RX
VDDIOVCC
12
34
56
78
910
1112
1314
1516
1718
1920
2122
2324
J3
TSW-112-08-L-D- RA
GSPG23072015DI1045
Page 7
DocID026935 Rev 3 7/47
UM1818 Hardware installation
47
3 Hardware installation
Connect a regulated dual DC power supply to the power source pins of the connector J3 as described previously and power the board.
In order to download the firmware, plug the programmer adapter (Figure 5) in the programming connector J1 and the IAR J-Link programmer in the JTAG connector of the adapter.
Refer to the chapter firmware description (paragraph 6.3 for the firmware download procedure). As soon as the application is launched, the LEDs should quickly switch on indicating that the board has to be configured.
Page 8
Firmware description UM1818
8/47 DocID026935 Rev 3
4 Firmware description
4.1 Introduction
The firmware structure is constituted of several layers each of it taking care of a different feature. The application layer engine is the general interface between the user program and all the parts of the module. It takes care of the communication ports, the board peripherals as RTC and I/Os, and timing management. It is also the interface between the PLM communication protocol and the user program. The PLM communication protocol, itself constituted by several layers, implements and manages the power line communication, manages the conflicts, timing and repetitions, the addressing and so on.
Some features are managed directly by the application engine, and are transparent to the user, as well as the board programming and configuration, which is done by particular programming or service commands managed and acknowledged directly by the application engine, the RTC management, the board parameter or the firmware update.
The user application can be interfaced to the application engine by simples APIs used for the data transfer and the evaluation board interface. The Figure 6 shows the firmware structure.
Figure 6. Firmware structure
The file user.c/h and application.c/h are the owner of application management, this manage the data flow from/to the PLM physical and from/to the UART side.
4.2 Remote firmware update (RFU)
The remote firmware update (RFU) uses the power line modem as external communication channel for receiving a new firmware dump. The firmware dump is placed in the internal Flash memory of the microcontroller. Hence, the total memory size of the microcontroller must be at least the double of the estimated maximum size of the firmware application (in this application is set to 60 kbytes), plus 4 Kb of additional memory for a bootloader. The
Figure 7 shows the microcontroller memory organization.
The bootloader is loaded at the startup and checks the active segment containing the actual firmware. The implemented mechanism uses three partitions of the microcontroller’s Flash
Page 9
DocID026935 Rev 3 9/47
UM1818 Firmware description
47
memory, one containing the bootloader and two containing the actual running firmware (active image) and the new firmware as soon as a RFU is needed.
As soon as the firmware transfer is completed, a “swap” command sent from the remote PLM causes the target PLM to check first the integrity of the firmware dump (actually a checksum is calculated and compared with the one sent by the remote PLM), and after the reset vector address of the new firmware is written in a dedicated Flash segment of the bootloader. Last the microcontroller is self reset, and the new firmware executed.
Figure 7. Memory organization
The RFU protocol manages the RFU “start”, “get new firmware segment” (with the segment address) and “swap” commands. The protocol is not embedded in the bootloader, hence it can be updated with the new firmware, bust the user must be careful in the modifications as any bugs can compromise the RFU mechanism.
As soon as a new firmware segment is received, the RFU manager checks if the address is within the firmware interrupt vector table. If it is the case, an offset depending on the free firmware image (1 or 2) allocation is added to each interrupt vector before being written in the free image Flash area.
In the Figure 8 is shown the RFU flowchart.
Page 10
Firmware description UM1818
10/47 DocID026935 Rev 3
Figure 8. RFU flowchart (1of 2)
Figure 9. RFU flowchart (2 of 2)
4.3 Firmware download
In the setup directory there are different workspaces stored in different directories. In order to implement the remote firmware update feature it is necessary to download the project located in the workspace “Firmware - Application and Bootloader”. This workspace contains two different projects, one is the bootloader and the other one is the application itself. If the board has never been programmed, this workspace must be downloaded before.
Open the IAR Embedded Workbench® IDE for STM32 microcontrollers Rel. 6.50 (or a more recent release). Click File\Open\Workspace and load the following workspace placed in the directory selected during the setup file installation: “Firmware - Application and Bootloader\EWARM\Project.eww”. Verify that the application project is the active project (the project name must be in bold), otherwise select the active project in the list below the workspace (Figure 10).
Page 11
DocID026935 Rev 3 11/47
UM1818 Firmware description
47
Figure 10. Active project selection
Click "Project - Batch Build" or press the key F8 in order to compile at the mean time the bootloader and the application.
After the compiling is completed, press "Project - Download and Debug" or press the keys CTRL+D. The both firmware download starts. As soon as the download is completed, press F5 in order to run the application (or exit from the debug mode pressing the keys CTRL+SHIFT+D and unplug the programmer).
If the procedure is done correctly, the orange LED should be on, indicating the board has never been set up before. If it is not the case, try first to erase the memory by clicking Project\Download\Erase Memory and download again the firmware as described before.
Use the GUI interface in order to setup the board and connect it to the power line as described in the dedicated paragraph.
As soon as bootloader has been installed in the evaluation board is possible to remotely (via power line) update the firmware using the RFU feature. Each new firmware version has to be programmed using the workspace “Firmware - Application standalone\EWARM\Project.eww”. The bin file produced by this workspace that is located in the folder “Firmware - Application standalone\ EWARM\PLM_HID_STANDALONE.bin” can be directly loaded using the GUI interface. The difference of this application with the one contained in the workspace with the bootloader is mainly in the stm32f10x_flash.icf linker file and some workspace parameters that are not used in the application without the bootloader (as multiple build, simultaneous debug mode, etc.).
The setup folder contains also the Firmware - Bootloader folder, where inside there is the bootloader firmware; and the folder Firmware - Sniffer which contains the sniffer workspace to download in a PLM module useful if the data sniffing feature of the interface is used. In this case the PLM module will work only as a sniffer.
4.4 Firmware architecture
The structure of the workspace is divided in different sections as shown in the Figure 11.
Page 12
Firmware description UM1818
12/47 DocID026935 Rev 3
Figure 11. Workspace structure
At this level, all the communication APIs and all the APIs for the application engine interface are available. In the main file, the following code is implemented for running the state machine engines:
while(1){ DL_FSM();//PLM Main Loop
APP_StackUpdate();// USART State machine
USER_Program();// PLM State machine
#ifdef USE_WDG //STM32 Window Watchdog IWDG_ReloadCounter(); #endif
#ifdef KEEP_ALIVE //PLM Keep Alive systems Check_KA_Timeout(); #endif }
After the initialization the infinite loop calls three main functions: the DL_FSM(), USER_Program() and the APP_StackUpdate() routine.
Page 13
DocID026935 Rev 3 13/47
UM1818 Firmware description
47
The DL_FSM() is the PLM stack main loop, this manage the PLM low level communication. The application engine “APP_StackUpdate()” is the state machine which runs inside the PLM application state machine; this uses the data link service provided from DL_Service layer.
The user program implemented in this user manual realizes a bridge between the power line communication and the COM port: all data arriving from the COM port addressed to another PLM module is sent via PLM, and in turn all data received from PLM is sent back to the COM port. It is necessary that the user program does not stop the core operations (looping instructions) without calling the application engine.
All the hardware configurations are contained in the board support package file, and the file DL_SimpleNodeConf contains the data link configuration parameters and the PLM modem configuration value (frequency, modulation zero crossing delay, etc.).
The next paragraph lists all the data types and the APIs used in the application engine that can be modified by the user if different needs arise.
4.5 Firmware data types
The data type found in the wrapper.h module, are listed hereafter:
/* USER FRAME STRUCTURE */
typedef struct { APP_ftype_t type; bool broadcast; u8 address[6]; u8 len; u8 data[USER_PAYLOAD_SIZE]; /* MAX PAYLOAD SIZE: 100 bytes */ bool EnableTX }APP_frame_t;
/* APPLICATION FRAME TYPE */
typedef enum { APP_DATA_FRAME = 0x00, APP_SERVICE_FRAME = 0x01, APP_PING_FRAME = 0x02, APP_ERROR_FRAME = 0x03, APP_PROGRAMMING_FRAME = 0x04, APP_ACK_FRAME = 0x05, APP_MIB_FRAME = 0x06 }APP_ftype_t;
Page 14
Firmware description UM1818
14/47 DocID026935 Rev 3
/* APPLICATION ERRORS */
typedef enum { APP_ERROR_NONE = 0x00, // No error APP_ERROR_GENERIC = 0x01, // Generic communication error APP_ERROR_COMM_TIMEOUT = 0x02, // Communication timeout error APP_ERROR_SERVICE_GRP_UNKNOWN = 0x03, // Service group unknown error APP_ERROR_SERVICE_CMD_ERROR = 0x04, // Service command error APP_ERROR_COMMUNICATION = 0x05, // Communication error APP_ERROR_ISOLATED_NODE = 0x06, // Node unreachable error APP_ERROR_HARDWARE = 0x07, // Hardware error APP_ERROR_WRONG_PROG_COMMAND = 0x08, // Wrong programming command
error APP_ERROR_WRONG_PROG_GROUP = 0x09, // Wrong programming group error APP_ERROR_DEVICE_BLANK = 0x0a, // Device blank APP_ERROR_RTC_ERROR = 0x0b, // Error setting the system time APP_ERROR_WATCHDOG_DISABLED = 0x0c, // Hardware reset impossible APP_ERROR_NODE_INIT_FAILED = 0x0d, // Node initialization failure APP_ERROR_RTC_DISABLED = 0x0e // Internal RTC disabled }APP_ERROR_t;
/* PROGRAMMING GROUPS */ typedef enum { PROG_GRP_DEVICE_DATA = 0x00, // Device Data PROG_GRP_LL_STACK_PARAM = 0x01, // Link layer stack parameters PROG_GRP_USER_DATA = 0x02 // User program }APP_PROG_GROUP_t;
/* SERVICE COMMANDS */
typedef enum { /* NATIVE SERVICE COMMANDS */ SERVICE_SOFTWARE_RESET = 0x00,// Reset internal state machines SERVICE_HARDWARE_RESET = 0x01,// Module hardware reset SERVICE_PARAM_SET = 0x02,// Set service parameters SERVICE_PARAM_GET = 0x03,// Get service parameters SERVICE_INPUTS_GET = 0x04,// Get general purpose inputs pin status SERVICE_OUTPUTS_SET = 0x05,// Set general purpose outputs pins
value SERVICE_FW_REL_GET = 0x06,// Get the stack and the module firmware
release SERVICE_PLM_CLOCK_SET = 0x07,// Set the internal time clock value
Page 15
DocID026935 Rev 3 15/47
UM1818 Firmware description
47
SERVICE_PLM_CLOCK_GET = 0x08,// Get the internal time clock value SERVICE_IO_CONFIG_SET = 0x09,// Set the general purpose input and
output pins SERVICE_IO_CONFIG_GET = 0x0a,// Get the general purpose input and
output pins SERVICE_NET_DISCOVER_REQ = 0x0b, SERVICE_RFU_SET_IMG_HEADER = 0x0c, SERVICE_RFU_SET_IMG_DATA = 0x0d, SERVICE_RFU_SWAP_IMG = 0x0e, SERVICE_SN_SET = 0x0f, SERVICE_SN_GET = 0x10 /* USER DEFINED SERVICE COMANDS */ // SERVICE_USER_CMD_xx = 0x.., // User defined service commands
(0x0b to 0x7f) }APP_SER_CMD_t;
4.6 Firmware frame types
This paragraph describes all the frame types that are implemented in this firmware. In each field there is also the description.
4.6.1 Communication frames types
Frames exchanged between two PLM modules or between a PLM module and an external device connected to the COMM interface.
From the COMM interface module (USART)
/* BROADCAST_FLAG = 0x80 -> data sent in broadcast - BROADCAST_FLAG = 0x00
-> data sent in unicast */
From / to communication interface (PLM, USART)
buffer[0] = n + 10; buffer[1] = DATA_FRAME_TYPE | BROADCAST_FLAG; buffer[2,..7] = target_module.address; buffer[8,..8+n-1] = user_data[n]; buffer[8+n,8+n+1] = CRC16;
// Data frame payload length (n + 10) // Data frame type // Target device address (6 bytes) // User data (n bytes, at least 1) // CRC-16
frame.type = DATA_FRAME_TYPE; frame.len = n; frame.broadcast = TRUE / FALSE; frame.address = target_module.address; frame.data[n] = service_data[n];
// Data frame type // Data frame payload length // TRUE = broadcast, FALSE = unicast // Target device address (6 bytes) // User data (n bytes)
Page 16
Firmware description UM1818
16/47 DocID026935 Rev 3
4.6.2 Ping frames
This particular frame is used to ping a remote (via PLM interface) or a local (via COMM interface) module. When the ping frame is received, this is managed directly at the data link layer and is not notified at the application and consequently the user levels.
From the COMM interface module (USART).
From / to communication interface (PLM, USART)
4.6.3 Error frames
Can be considered as data frames; they are user error frames from user application level addressed to a target PLM module.
From / to communication interface (PLM, USART)
Error code list
0x0000 = APP_ERROR_NONE 0x0001 = APP_ERROR_GENERIC 0x0002 = APP_ERROR_COMM_TIMEOUT 0x0003 = APP_ERROR_SERVICE_GRP_UNKNOWN 0x0004 = APP_ERROR_SERVICE_CMD_ERROR 0x0005 = APP_ERROR_COMMUNICATION 0x0006 = APP_ERROR_ISOLATED_NODE 0x0007 = APP_ERROR_HARDWARE 0x0008 = APP_ERROR_WRONG_PROG_COMMAND 0x0009 = APP_ERROR_WRONG_PROG_GROUP 0x000a = APP_ERROR_DEVICE_BLANK 0x000b = APP_ERROR_RTC_ERROR 0x000c = APP_ERROR_WATCHDOG_DISABLED 0x000d = APP_ERROR_NODE_INIT_FAILED 0x000e = APP_ERROR_RTC_DISABLED
buffer[0] = 10; buffer[1] = APP_PING_FRAME; buffer[2,..7] = target_module.address; buffer[8,9] = CRC16;
// Ping frame payload length // Ping frame type // Target device address (6 bytes) // CRC-16
buffer[0] = 12; buffer[1] = APP_ACK_FRAME; buffer[2,..7] = target_module.address; buffer[8]= APP_PING_FRAME; buffer[9]= command_echo; buffer[10,11] = CRC16;
// Frame payload length // ACK frame type // Target device address (6 bytes) // Ping frame type // Echo // CRC-16
buffer[0] = 12; buffer[1] APP_ERROR_FRAME; buffer[2,..7] = target_module.address; buffer[8,9]= user_error_code; buffer[10,11] = CRC16;
// Error frame payload length // Target device address (6 bytes) // Ping frame type // Echo // CRC-16
Page 17
DocID026935 Rev 3 17/47
UM1818 Firmware description
47
user_error_code = (APP_ERROR_t)(buffer[8]<<8)| buffer[9]);
4.6.4 Service frames
Frames containing service commands concerning both some native module features (internal clock, general purpose inputs and outputs, etc.) and user defined service frames. Native frames are managed directly by the application engine.
From the COMM interface module (USART)
/* BROADCAST_FLAG = 0x80 -> data sent in broadcast - BROADCAST_FLAG = 0x00
-> data sent in unicast */
From / to communication interface (PLM, USART)
buffer[0] = n + 11; buffer[1] = APP_SERVICE_FRAME | BROADCAST_FLAG;
buffer[2,..7] = target_module.address;
buffer[8] = (APP_SER_CMD_t)command; buffer[9,..9+n-1] = service_data[n]; buffer[9+n, 9+n+1] = CRC16;
// Service frame payload length (n + 11) // Service frame type // Target device address (6 bytes) // Service command // Service data // CRC-16
buffer[0] = n + 11; buffer[1] = DATA_FRAME_TYPE; buffer[2,..7] = target_module.address; buffer[8] = (APP_SER_CMD_t)command/APP_ACK_FRAME; buffer[9,..n] = service_data[n]/Command_Echo; buffer[n+1,n+2] = CRC16;
// length // Service or ACK frame type // Target device address (6 bytes) // Service command/ACK // Service data or Command echo(n=1)
Page 18
Firmware description UM1818
18/47 DocID026935 Rev 3
Service command list
PLM reset: software, hardware
From the COMM interface (USART)
Note: Any response from PLM module
/* NATIVE SERVICE COMMANDS */ SERVICE_SOFTWARE_RESET = 0x00, SERVICE_HARDWARE_RESET = 0x01, SERVICE_PARAM_SET = 0x02, SERVICE_PARAM_GET = 0x03, SERVICE_INPUTS_GET = 0x04, SERVICE_OUTPUTS_SET = 0x05, SERVICE_FW_REL_GET = 0x06, SERVICE_PLM_CLOCK_SET = 0x07, SERVICE_PLM_CLOCK_GET = 0x08, SERVICE_IO_CONFIG_SET = 0x09, SERVICE_IO_CONFIG_GET = 0x0a, SERVICE_NET_DISCOVER_REQ = 0x0b, SERVICE_RFU_SET_IMG_HEADER = 0x0c, SERVICE_RFU_SET_IMG_DATA = 0x0d, SERVICE_RFU_SWAP_IMG = 0x0e, SERVICE_SN_SET = 0x0f, SERVICE_SN_GET = 0x10 /* USER DEFINED SERVICE COMANDS */ 0x.. = SERVICE_USER_CMD_xx
// Reset internal state machines // Module hardware reset // Set service parameters // Get service parameters // Get general purpose inputs pin status // Set general purpose outputs pins value // Get the stack and the module firmware release // Set the internal time clock value // Get the internal time clock value // Set the general purpose input and output pins // Get the general purpose input and output pins
buffer[0] = 11; buffer[1] = APP_SERVICE_FRAME; buffer[2,..7] = target_module.address; /* FOR SOFTWARE RESET */ buffer[8] = SERVICE_SOFTWARE_RESET; /* FOR HARDWARE RESET */ buffer[8] = SERVICE_HARDWARE_RESET; buffer[9,10] = CRC16;
// Service frame payload length // Service frame type // Target device address (6 bytes)
// CRC-16
Page 19
DocID026935 Rev 3 19/47
UM1818 Firmware description
47
Set module parameters: programming user parameters
From the COMM interface (USART)
From / to communication interface (PLM, USART)
Get module parameters: programming user parameters
From the COMM interface (USART)
From / to communication interface (PLM, USART)
buffer[0] = 44 buffer[1] = APP_SERVICE_FRAME | BROADCAST_FLAG; buffer[2,..7] = target_module.address; buffer[8] = SERVICE_PARAM_SET; buffer[9] = PROG_GRP_USER_DATA; buffer[10 -> 41] = *user_data_buffer; buffer[42,43] = CRC16;
// Service frame payload length // Service frame type // Target device address (6 bytes) // Service command // Type command // Program data // CRC-16
buffer[0] = 12; buffer[1] = APP_ACK_FRAME; buffer[2,..7] = target_module.address; buffer[8]= APP_SERVICE_FRAME; buffer[9]= command_echo; buffer[10,11] = CRC16;
// Service frame payload length // ACK frame type // Target device address (6 bytes) // Service frame type // Echo // CRC-16
buffer[0] = 12; buffer[1] = APP_SERVICE_FRAME; buffer[2,..7] = target_module.address; buffer[8] = SERVICE_PARAM_GET; buffer[9] = PROG_GRP_USER_DATA; buffer[10,11] = CRC16;
// Service frame payload length // Service frame type // Target device address (6 bytes) // Service command // Type command // CRC-16
buffer[0] = 44; buffer[1] = APP_SERVICE_FRAME; buffer[2,..7] = target_module.address; buffer[8] = SERVICE_PARAM_GET; buffer[9] = PROG_GRP_USER_DATA; buffer[10 -> 41] = *user_data_buffer; buffer[42,43] = CRC16;
// Service frame payload length // Service frame type // Target device address (6 bytes) // Service command // Type command // Program Data // CRC-16
Page 20
Firmware description UM1818
20/47 DocID026935 Rev 3
Get module general purpose inputs/outputs configuration
From the COMM interface (USART)
From / to communication interface (PLM, USART)
Set module general purpose inputs/outputs configuration
From the COMM interface (USART)
From / to communication interface (PLM, USART)
Get module general purpose inputs value
From the COMM interface (USART)
buffer[0] = 11; buffer[1] = APP_SERVICE_FRAME; buffer[2,..7] = target_module.address; buffer[8] = SERVICE_IO_CONFIG_GET; buffer[9,10] = CRC16;
// Service frame payload length // Service frame type // Target device address (6 bytes) // Service Command // CRC-16
buffer[0] = 12; buffer[1] = APP_SERVICE_FRAME; buffer[2,..7] = target_module.address; buffer[8] =SERVICE_IO_CONFIG_GET; buffer[9] = *sender.configuration_value; buffer[10,11] = CRC16;
// Service frame payload length // Service frame type // Target device address (6 bytes) // Service command // input/output configuration // CRC-16
buffer[0] = 12; buffer[1] = APP_SERVICE_FRAME; buffer[2,..7] = target_module.address; buffer[8] = SERVICE_IO_CONFIG_SET; buffer[9] = target.configuration_value;
buffer[10,11] = CRC16;
// Service frame payload length // Service frame type // Target device address (6 bytes) // Service command // bit x = 1 -> IOx = output, bit x = 0
-> IOx = input // CRC-16
buffer[0] = 12; buffer[1] = APP_ACK_FRAME; buffer[2,..7] = target_module.address buffer[8]= APP_SERVICE_FRAME; buffer[9]= command_echo; buffer[10,11] = CRC16;
// Service frame payload length // ACK frame type // Target device address (6 bytes) // Service frame type // Echo // CRC-16
buffer[0] = 11; buffer[1] = APP_SERVICE_FRAME; buffer[2,..7] = target_module.address; buffer[8] = SERVICE_INPUTS_GET; buffer[9,10] = CRC16;
// Service frame payload length // Service frame type // Target device address (6 bytes) // Service command // CRC-16
Page 21
DocID026935 Rev 3 21/47
UM1818 Firmware description
47
From / to communication interface (PLM, USART)
Set module general purpose outputs value
From the COMM interface (USART)
From / to communication interface (PLM, USART)
Get module firmware release
From the COMM interface (USART)
buffer[0] = 12; buffer[1] = APP_SERVICE_FRAME; buffer[2,..7] = target_module.address; buffer[8] =SERVICE_INPUTS_GET; buffer[9] = *sender.inputs_value; buffer[10,11] = CRC16;
// Service frame payload length // Service frame type // Target device address (6 bytes) // Service command // Read GPIO Input value // CRC-16
buffer[0] = 12; buffer[1] = APP_SERVICE_FRAME; buffer[2,..7] = target_module.address; buffer[8] = SERVICE_OUTPUTS_SET; buffer[9] = target.outputs_value; buffer[10,11] = CRC16;
// Service frame payload length // Service frame type // Target device address (6 bytes) // Service command // Set GPIO output value // CRC-16
buffer[0] = 12; buffer[1] = APP_ACK_FRAME; buffer[2,..7] = target_module.address; buffer[8]= APP_SERVICE_FRAME; buffer[9]= command_echo; buffer[10,11] = CRC16;
// Service frame payload length // ACK frame type // Target device address (6 bytes) // Service frame type // Echo // CRC-16
buffer[0] = 11; buffer[1] = APP_SERVICE_FRAME; buffer[2,..7] = target_module.address; buffer[8] = SERVICE_FW_REL_GET; buffer[9,10] = CRC16;
// Service frame payload length // Service frame type // Target device address (6 bytes) // Service command // CRC-16
Page 22
Firmware description UM1818
22/47 DocID026935 Rev 3
From / to communication interface (PLM, USART)
Get module time clock value
From the COMM interface (USART)
From / to communication interface (PLM, USART)
Set module time clock value
From the COMM interface (USART)
buffer[0] = 15; buffer[1] = APP_SERVICE_FRAME; buffer[2,..7] = target_module.address; buffer[8] = SERVICE_FW_REL_GET; buffer[9,10] = target_module.firmware_release; buffer[11,12] = target_module.stack_release; buffer[13,14] = CRC16;
// Service frame payload length // Service frame type // Target device address (6 bytes) // Service command // Module firmware release (x.y) // Stack firmware release (x.y) // CRC-16
buffer[0] = 11; buffer[1] = APP_SERVICE_FRAME; buffer[2,..7] = target_module.address; buffer[8] = SERVICE_PLM_CLOCK_GET; buffer[9,10] = CRC16;
// Service frame payload length // Service frame type // Target device address (6 bytes) // Service command // CRC-16
buffer[0] = 14; buffer[1] = APP_SERVICE_FRAME; buffer[2,..7] = target_module.address; buffer[8] = SERVICE_PLM_CLOCK_GET; buffer[9] = target_module.hours; buffer[10] = target_module.minutes; buffer[11] = target_module.seconds; buffer[12,13] = CRC16;
// Service frame payload length // Service frame type // Target device address (6 bytes) // Service command // Hours // Minutes // Seconds // CRC-16
buffer[0] = 14; buffer[1] = APP_SERVICE_FRAME | BROADCAST_FLAG; buffer[2,..7] = target_module.address; buffer[8] = SERVICE_PLM_CLOCK_SET; buffer[9] = target_module.new_hours; buffer[10] = target_module.new_minutes; buffer[11] = target_module.new_seconds; buffer[12,13] = CRC16;
// Service frame payload length // Service frame type // Target device address (6 bytes) // Service command // Hours // Minutes // Seconds // CRC-16
Page 23
DocID026935 Rev 3 23/47
UM1818 Firmware description
47
From / to communication interface (PLM, USART)
GET PLM Module SNR ratio
From the COMM interface (USART)
From / to communication interface (PLM, USART)
Set PLM Module SNR ratio
From the COMM interface (USART)
From / to communication interface (PLM, USART)
buffer[0] = 12; buffer[1] = APP_ACK_FRAME; buffer[2,..7] = target_module.address; buffer[8]= APP_SERVICE_FRAME; buffer[9]= command_echo; buffer[10,11] = CRC16;
// Service frame payload length // Service frame type // Target device address (6 bytes) // Service frame type // Echo // CRC-16
buffer[0] = 11; buffer[1] = APP_SERVICE_FRAME; buffer[2,..7] = target_module.address; buffer[8] = SERVICE_SN_GET; buffer[9,10] = CRC16;
// Service frame payload length // Service frame type // Target device address (6 bytes) // Service command // CRC-16
buffer[0] = 12; buffer[1] = APP_SERVICE_FRAME; buffer[2,..7] = target_module.address; buffer[8] = SERVICE_SN_GET; buffer[9] = *sender.sn_value; buffer[10,11] = CRC16;
// Service frame payload length // Service frame type // Target device address (6 bytes) // Service command // SNR Ratio from 0 to 31 // CRC-16
buffer[0] = 12; buffer[1] = APP_SERVICE_FRAME; buffer[2,..7] = target_module.address; buffer[8] = SERVICE_SN_SET; buffer[9] = target.sn_value; buffer[10,11] = CRC16;
// Service frame payload length // Service frame type // Target device address (6 bytes) // Service command // SNR Ratio from 0 to 31 // CRC-16
buffer[0] = 12; buffer[1] = APP_ACK_FRAME; buffer[2,..7] = target_module.address buffer[8]= APP_SERVICE_FRAME; buffer[9]= command_echo; buffer[10,11] = CRC16;
// Service frame payload length // ACK frame type // Target device address (6 bytes) // Service frame type // Echo // CRC-16
Page 24
HID commands UM1818
24/47 DocID026935 Rev 3
Appendix A HID commands
HID frames are data frames where the payload is customized for the HID ballast application.
From the COMM interface (USART)
/* BROADCAST_FLAG = 0x80 -> data sent in broadcast - BROADCAST_FLAG = 0x00
-> data sent in unicast */
From / to communication interface (PLM, USART)
HID board reset
From the COMM interface (USART)
From / to communication interface (PLM, USART) Case hardware reset, the PLM set the reset GPIO pin to reset the HID ballast (GPIO Port A
Pin 6)
buffer[0] = n + 10; buffer[1] = APP_DATA_FRAME | BROADCAST_FLAG; buffer[2,..7] = target_module.address; buffer[8,..8+n-1] = user_data[n]; buffer[8+n,8+n+1] = CRC16;
// Data frame payload length (n + 10) // Data frame type // Target device address (6 bytes) // User data (n bytes, at least 1) // CRC-16
buffer[0] = n + 10; buffer[1] = APP_DATA_FRAME; buffer[2,..7] = target_module.address; buffer[8,..n] = HID_DATA; buffer[n+1,n+2] = CRC16;
// Data frame payload length (n + 10) // Data frame type // Target device address (6 bytes) // HID data // CRC-16
buffer[0] = 13; buffer[1] = APP_DATA_FRAME; buffer[2,..7] = target_module.address; buffer[8] = 0x73; buffer[9] = 0x00; buffer[10] = reset_type; buffer[11,12] = CRC16;
// Data frame payload length // Data frame type // Target device address (6 bytes) // command set char 's' // HID board command identify "reset" // Software reset = 0xaa, Hardware reset = 0x0c // CRC-16
buffer[0] = 12; buffer[1] = APP_ACK_FRAME; buffer[2,..7] = target_module.address; buffer[8]= APP_DATA_FRAME; buffer[9]= command_echo; buffer[10,11] = CRC16;
// Data frame payload length // ACK frame type // Target device address (6 bytes) // Data frame type // Echo // CRC-16
Page 25
DocID026935 Rev 3 25/47
UM1818 HID commands
47
Case Software reset
Lamp dimming
From the COMM interface (USART- Source “Concentrator”) and To the COMM interface (USART- Destination “HID ballast”)
From the COMM interface (USART- Destination “HID ballast”)
To the COMM interface (USART- Source “Concentrator”)
buffer[0] = 12; buffer[1] = APP_ACK_FRAME; buffer[2,..7] = target_module.address; buffer[8]= APP_DATA_FRAME; buffer[9]= 0x73; buffer[10,11] = CRC16;
// Data frame payload length // ACK frame type // Target device address (6 bytes) // Data frame type // Command char 's' // CRC-16
buffer[0] = 13; buffer[1] = APP_DATA_FRAME | BROADCAST_FLAG; buffer[2,..7] = target_module.address; buffer[8] = 0x73; buffer[9] = 0x01; buffer[10] = dimming_value; buffer[11,12] = CRC16;
// Data frame payload length // Data frame type // Target device address (6 bytes) // command set char 's' // HID board command identify "Dimming" // Dimming value 0 - 100 (0% - 100%) // CRC-16
buffer[0] = 2; buffer[1] = APP_DATA_FRAME; buffer[2] = 0x73;
// Data frame payload length // Data frame type // Char 's'
buffer[0] = 12; buffer[1] = APP_ACK_FRAME; buffer[2,..7] = target_module.address; buffer[8]= APP_DATA_FRAME; buffer[9]= 0x73; buffer[10,11] = CRC16;
// Data frame payload length // ACK frame type // Target device address (6 bytes) // Data frame type // Command char 's' // CRC-16
Page 26
HID commands UM1818
26/47 DocID026935 Rev 3
Get HID parameter
From the COMM interface (USART- Source “Concentrator”) and To the COMM interface (USART- Destination “HID ballast”)
From the COMM interface (USART- Destination “HID Ballast”)
buffer[0] = 12; buffer[1] = APP_DATA_FRAME; buffer[2,..7] = target_module.address; buffer[8] = 0x67; buffer[9] = param_to_get; buffer[10,11] = CRC16;
/* param_to_get value */
0x00 = HARDWARE VERSION 0x01 = BUS VOLTAGE 0x02 = LAMP VOLTAGE 0x03 = HARDWARE STATUS 0x04 = LAMP POWER 0x05 = LAST FAILURE 0x06 = POWER SUPPLY VOLTAGE 0x07 = BOARD TEMPERATURE (°C) 0x08 = N° OF POWER ON 0x09 = LAMP LIFETIME (Hours) 0x0a = GET ALL PARAMETERS
// Data frame payload length // Data frame type // Target device address (6 bytes) // command set char 'g' // HID Param Value // CRC-16
/* GET HARDWARE VERSION */
buffer[0] = 5; buffer[1] = 0x67; buffer[2] = 0x00; buffer[3] = hardware_release_xx; buffer[4] = hardware_release_yy;
// Data frame payload length // Get command 'g' ascii value // HARDWARE VERSION // Hardware release xx.yy (xx, yy = bcd format) // Hardware release xx.yy (xx, yy = bcd format)
Page 27
DocID026935 Rev 3 27/47
UM1818 HID commands
47
/* GET BUS VOLTAGE */
buffer[0] = 5; buffer[1] = 0x67; buffer[2] = 0x01; buffer[3] = bus_voltage_h; buffer[4] = bus_voltage_l;
// Data frame payload length // Get command 'g' ascii value // BUS VOLTAGE // High byte of bus voltage // Low byte of bus voltage
/* GET LAMP VOLTAGE */
buffer[0] = 5; buffer[1] = 0x67; buffer[2] = 0x02; buffer[3] = lamp_voltage_h; buffer[4] = lamp_voltage_l;
// Data frame payload length // Get command 'g' ascii value // LAMP VOLTAGE // High byte of lamp voltage // Low byte of lamp voltage
/* GET HARDWARE STATUS */
buffer[0] = 5; buffer[1] = 0x67; buffer[2] = 0x03; buffer[3] = hardware_status_h; buffer[4] = hardware_status_l;
/* hardware_status value */
0x00 = IDLE 0x01,0x02,0x03 = STARTUP 0x04,0x05 = WARMUP 0x06 = RUN 0x07 = WAIT 0x08 = FAILURE
// Data frame payload length // Get command 'g' ascii value // HARDWARE STATUS // High byte of hardware status // Low byte of hardware status
Page 28
HID commands UM1818
28/47 DocID026935 Rev 3
/* GET LAMP POWER */
buffer[0] = 5; buffer[1] = 0x67; buffer[2] = 0x04; buffer[3] = lamp_power_h; buffer[4] = lamp_power_l;
// Data frame payload length // Get command 'g' ascii value // LAMP POWER // High byte of lamp power // Low byte of lamp power
/* GET LAST FAILURE */
buffer[0] = 9; buffer[1] = 0x67; buffer[2] = 0x05; buffer[3] = hardware_status_h; buffer[4] = hardware_status_l; buffer[5] = bus_voltage_h; buffer[6] = bus_voltage_l; buffer[7] = lamp_voltage_h; buffer[8] = lamp_voltage_l;
// Data frame payload length // Get command 'g' ascii value // LAST FAILURE // High byte of hardware status before the failure // Low byte of hardware status before the failure // High byte of bus voltage before the failure // Low byte of bus voltage before the failure // High byte of lamp voltage before the failure // Low byte of lamp voltage before the failure
/* GET POWER SUPPLY VOLTAGE */
buffer[0] = 5; buffer[1] = 0x67; buffer[2] = 0x07; buffer[3] = board_temperature_h; buffer[4] = board_temperature_l;
// Data frame payload length // Get command 'g' ascii value // BOARD TEMPERATURE // High byte of board temperature (°C) // Low byte of board temperature (°C)
/* GET BOARD TEMPERATURE (°C) */
buffer[0] = 5; buffer[1] = 0x67; buffer[2] = 0x07; buffer[3] = board_temperature_h; buffer[4] = board_temperature_l;
// Data frame payload length // Get command 'g' ascii value // BOARD TEMPERATURE // High byte of board temperature (°C) // Low byte of board temperature (°C)
Page 29
DocID026935 Rev 3 29/47
UM1818 HID commands
47
/* GET N° OF POWER ON */
buffer[0] = 5; buffer[1] = 0x67; buffer[2] = 0x08; buffer[3] = power_on_n_h; buffer[4] = power_on_n_l;
// Data frame payload length // Get command 'g' ascii value // N. OF POWER ON // High byte of number of lamp power on // Low byte of number of lamp power on
/* GET LAMP LIFETIME (Hours) */
buffer[0] = 5; buffer[1] = 0x67; buffer[2] = 0x09; buffer[3] = lamp_lifetime_h; buffer[4] = lamp_lifetime_l;
// Data frame payload length // Get command 'g' ascii value // LAMP LIFETIME (hours) // High byte of lamp lifetime (hours) // Low byte of lamp lifetime (hours)
/* GET ALL PARAMETERS */
buffer[0] = 5; buffer[1] = 0x67; buffer[2] = 0x0a; buffer[3] = hardware_release_xx; buffer[4] = hardware_release_yy; buffer[5] = bus_voltage_h; buffer[6] = bus_voltage_l; buffer[7] = lamp_voltage_h; buffer[8] = lamp_voltage_l; buffer[9] = hardware_status_h; buffer[10] = hardware_status_l; buffer[11] = lamp_power_h; buffer[12] = lamp_power_l; buffer[13] = last_hardware_status_h; buffer[14] = last_hardware_status_l; buffer[15] = last_bus_voltage_h; buffer[15] = last_bus_voltage_l; buffer[17] = last_lamp_voltage_h; buffer[18] = last_lamp_voltage_l; buffer[19] = input_voltage_h; buffer[20] = input_voltage_l;
// Data frame payload length // Get command 'g' ascii value // GET ALL PARAMETERS // Hardware release xx.yy (xx, yy = bcd format) // Hardware release xx.yy (xx, yy = bcd format) // High byte of bus voltage before the failure // Low byte of bus voltage before the failure // High byte of lamp voltage before the failure // Low byte of lamp voltage before the failure // High byte of hardware status before the failure // Low byte of hardware status before the failure // High byte of lamp power // Low byte of lamp power // High byte of hardware status before the failure // Low byte of hardware status before the failure // High byte of bus voltage before the failure // Low byte of bus voltage before the failure // High byte of lamp voltage before the failure // Low byte of lamp voltage before the failure // High byte of power supply voltage // Low byte of power supply voltage
Page 30
HID commands UM1818
30/47 DocID026935 Rev 3
To the COMM interface (USART- source “concentrator”)
buffer[21] = board_temperature_h; buffer[22] = board_temperature_l; buffer[23] = power_on_n_h; buffer[24] = power_on_n_l; buffer[25] = lamp_lifetime_h; buffer[26] = lamp_lifetime_l;
// High byte of board temperature (°C) // Low byte of board temperature (°C) // High byte of number of lamp power on // Low byte of number of lamp power on // High byte of lamp lifetime (hours) // Low byte of lamp lifetime (hours)
/* GET HARDWARE VERSION */
buffer[0] = 14; buffer[1] = APP_DATA_FRAME; buffer[2,..7] = source_module.address; buffer[8] = 0x67; buffer[9] = 0x00; buffer[10] = hardware_release_xx; buffer[11] = hardware_release_yy; buffer[12,13] = CRC16;
// Data frame payload length // Data frame type // Source device address (6 bytes) // Get command 'g' ascii value // Response to g0 command // Hardware release xx.yy (xx, yy = bcd format) // Hardware release xx.yy (xx, yy = bcd format) // CRC-16
/* GET BUS VOLTAGE */
buffer[0] = 14; buffer[1] = APP_DATA_FRAME; buffer[2,..7] = source_module.address; buffer[8] = 0x67; buffer[9] = 0x02; buffer[10] = lamp_voltage_h; buffer[11] = lamp_voltage_l; buffer[12,13] = CRC16;
// Data frame payload length // Data frame type // Source device address (6 bytes) // Get command 'g' ascii value // Response to g2 command // High byte of lamp voltage // Low byte of lamp voltage // CRC-16
/* GET HARDWARE STATUS */
buffer[0] = 14; buffer[1] = APP_DATA_FRAME; buffer[2,..7] = source_module.address; buffer[8] = 0x67; buffer[9] = 0x03; buffer[10] = hardware_status_h; buffer[11] = hardware_status_l; buffer[12,13] = CRC16;
// Data frame payload length // Data frame type // Source device address (6 bytes) // Get command 'g' ascii value // Response to g3 command // High byte of hardware status // Low byte of hardware status // CRC-16
Page 31
DocID026935 Rev 3 31/47
UM1818 HID commands
47
/* hardware_status value */ 0x00 0x01,0x02,0x03 0x04,0x05 0x06 0x07
0x08
= IDLE = STARTUP = WARMUP = RUN = WAIT = FAILURE
/* GET LAMP POWER */
buffer[0] = 14; buffer[1] = APP_DATA_FRAME; buffer[2,..7] = source_module.address; buffer[8] = 0x67; buffer[9] = 0x04; buffer[10] = lamp_power_h; buffer[11] = lamp_power_l; buffer[12,13] = CRC16;
// Data frame payload length // Data frame type // Source device address (6 bytes) // Get command 'g' ascii value // Response to g4 command // High byte of lamp power // Low byte of lamp power // CRC-16
/* GET LAST FAILURE */
buffer[0] = 18; buffer[1] = APP_DATA_FRAME; buffer[2,..7] = source_module.address; buffer[8] = 0x67; buffer[9] = 0x05; buffer[10] = hardware_status_h;
buffer[11] = hardware_status_l;
buffer[12] = bus_voltage_h; buffer[13] = bus_voltage_l; buffer[14] = lamp_voltage_h; buffer[15] = lamp_voltage_l; buffer[16,17] = CRC16;
// Data frame payload length // Data frame type // Source device address (6 bytes) // Get command 'g' ascii value // Response to g5 command // High byte of hardware status before the
failure // Low byte of hardware status before the
failure // High byte of bus voltage before the failure // Low byte of bus voltage before the failure // High byte of lamp voltage before the failure // Low byte of lamp voltage before the failure // CRC-16
Page 32
HID commands UM1818
32/47 DocID026935 Rev 3
/* GET POWER SUPPLY VOLTAGE */
buffer[0] = 14; buffer[1] = APP_DATA_FRAME; buffer[2,..7] = source_module.address; buffer[8] = 0x67; buffer[9] = 0x06; buffer[10] = input_voltage_h; buffer[11] = input_voltage_l; buffer[12,13] = CRC16;
// Data frame payload length // Data frame type // Source device address (6 bytes) // Get command 'g' ascii value // Response to g6 command // High byte of power supply voltage // Low byte of power supply voltage // CRC-16
/* GET BOARD TEMPERATURE (°C) */
buffer[0] = 14; buffer[1] = APP_DATA_FRAME; buffer[1] = APP_DATA_FRAME; buffer[8] = 0x67; buffer[9] = 0x07; buffer[10] = board_temperature_h; buffer[11] = board_temperature_l; buffer[12,13] = CRC16;
// Data frame payload length // Data frame type // Source device address (6 bytes) // Get command 'g' ascii value // Response to g7 command // High byte of board temperature (°C) // Low byte of board temperature (°C) // CRC-16
/* GET N° OF POWER ON */
buffer[0] = 14; buffer[1] = APP_DATA_FRAME; buffer[2,..7] = source_module.address; buffer[8] = 0x67; buffer[9] = 0x08; buffer[10] = power_on_n_h; buffer[11] = power_on_n_l; buffer[12,13] = CRC16;
// Data frame payload length // Data frame type // Source device address (6 bytes) // Get command 'g' ascii value // Response to g8 command // High byte of number of lamp power on // Low byte of number of lamp power on // CRC-16
Page 33
DocID026935 Rev 3 33/47
UM1818 HID commands
47
/* GET LAMP LIFETIME (Hours) */
buffer[0] = 14; buffer[1] = APP_DATA_FRAME; buffer[2,..7] = source_module.address; buffer[8] = 0x67; buffer[9] = 0x09; buffer[10] = lamp_lifetime_h; buffer[11] = lamp_lifetime_l; buffer[12,13] = CRC16;
// Data frame payload length // Data frame type // Source device address (6 bytes) // Get command 'g' ascii value // Response to g9 command // High byte of lamp lifetime (hours) // Low byte of lamp lifetime (hours) // CRC-16
/* GET ALL PARAMETERS */
buffer[0] = 36; buffer[1] = APP_DATA_FRAME; buffer[2,..7] = source_module.address; buffer[8] = 0x67; buffer[9] = 0x0a; buffer[10] = hardware_release_xx; buffer[11] = hardware_release_yy; buffer[12] = bus_voltage_h; buffer[13] = bus_voltage_l; buffer[14] = lamp_voltage_h; buffer[15] = lamp_voltage_l; buffer[16] = hardware_status_h;
buffer[17] = hardware_status_l;
buffer[18] = lamp_power_h; buffer[19] = lamp_power_l; buffer[20] = last_hardware_status_h;
buffer[21] = last_hardware_status_l;
// Data frame payload length // Data frame type // Source device address (6 bytes) // Get command 'g' ascii value // Response to g10 command // Hardware release xx.yy (xx, yy = bcd format) // Hardware release xx.yy (xx, yy = bcd format) // High byte of bus voltage before the failure // Low byte of bus voltage before the failure // High byte of lamp voltage before the failure // Low byte of lamp voltage before the failure // High byte of hardware status before the
failure // Low byte of hardware status before the
failure // High byte of lamp power // Low byte of lamp power // High byte of hardware status before the
failure // Low byte of hardware status before the
failure
Page 34
HID commands UM1818
34/47 DocID026935 Rev 3
If an error occurs from the HID board or from the network, the following frame throughout the COMM will be sent:
buffer[22] = last_bus_voltage_h; buffer[23] = last_bus_voltage_l; buffer[24] = last_lamp_voltage_h; buffer[25] = last_lamp_voltage_l; buffer[26] = input_voltage_h; buffer[27] = input_voltage_l; buffer[28] = board_temperature_h; buffer[29] = board_temperature_l; buffer[30] = power_on_n_h; buffer[31] = power_on_n_l; buffer[32] = lamp_lifetime_h; buffer[33] = lamp_lifetime_l; buffer[34,35] = CRC16;
// High byte of bus voltage before the failure // Low byte of bus voltage before the failure // High byte of lamp voltage before the failure // Low byte of lamp voltage before the failure // High byte of power supply voltage // Low byte of power supply voltage // High byte of board temperature (°C) // Low byte of board temperature (°C) // High byte of number of lamp power on // Low byte of number of lamp power on // High byte of lamp lifetime (hours) // Low byte of lamp lifetime (hours) // CRC-16
/* ERROR FRAME RESPONSE */
buffer[0] = 12; buffer[1] = APP_ERROR_FRAME; buffer[4,5,6,7] = target_module.address; buffer[8,9] = HID_error_code; buffer[10,11] = CRC16;
/* HID_error_code value */
0x10 = HID response error 0x11 = HID command unknown 0x12 = HID board response timeout 0x13 = HID packet delivery impossible
// Error frame payload length // Error frame type // Target device address (6 bytes) // HID board error code (2 bytes) // CRC-16
Page 35
DocID026935 Rev 3 35/47
UM1818 Schematic diagrams and bill of material
47
Appendix B Schematic diagrams and bill of material
B.1 Schematic diagrams
Figure 12. Schematic diagram (1 of 5)
VFQFPN48
EP
49
TXD
1
RXD
2 3
VDDIO
4
TRSTN
5
TMS
6
GND TCK
7 8
TDO
9
TDI RESETN
10
VDD
11
XIN
12
13
X
G
V
V
SON
D
S
UDD
A
_
T
PLL
V
ZC
C
_
C
I
A
N
RX_IN
TX_OUT
PA_IN+
PA_IN-
C
V
L
CC
VSS
PA_OUT
25
141516
17
18
19
20
21
22
23
24
VVD_
RE
P
L_
SREE
G_
VDDI
VDDI
VS
G
1
RVED
S
ND
NC
NC
NC
V8
O
O
A
2
3
3
2
3
3
3
2
2
8
4
1
9
0
2
3
6
7
CL_SEL
336
5
RX_ON
47
46
45
444342
41
40
393837
T_R
B
B
R
R
EQ
1
0
U2 ST7580
RRR
R
R
E
E
E
E
E
PL_
SE
SE
SE
SE
SE
T
R
R
R
R
R
X
V
V
V
V
V
G
V
_
E
E
E
E
E
N
D
O
DDD
D
D
N
D
D
1
2
3
4
5
48
LEDSMD
LD1
HSMF-C155
0603
R4
560R
0603
R6
560R
VDDIO
BR0
BR1
CAT16-J4
1
234
8
765
RP1 4 x 10K
VDDIO
PLC_RXD
PLC_TXD
0402
C4
VDDIO
100n 16V
8MH
Z_MCO
0402
C10 100n 16V
L2
0805
BLM21PG 331SN1
C16 4u7 16V
GND_A GND_A
0402
C19 100n 16V
GND_A
0402
C17 100p 25V
GND_A
0402
C24 100n 16V
GND_A
0805
C21 10u 16V
GND_A
VCC_A
VDD_PLL
0402
C20 100n 16V
0805
C18 10u 16V
ZC_IN
RX_IN
TX_OUT
PA_IN+
CL
PA_IN-
VCC
0402
C22 100p 25V
0402
R15 130R
0402
R16 330R
1
2
3
Q1 2N7002
0402
R17 10K
VDDIO
CL_SEL
CL_SEL
GND_A
0805
L1
BLM21PG300SN1
PL_RX_ON
PL_TX_ON
PA_OUT
VDD
0402
R10 10K
VDDIO
PLC_RESETN
0402
C12 100n 16V
0805
C11 10u 16V
VDD_REG_1V8
0402C70805 100n 16V
C8
10u 16V
VDDIO
0402
C2
100n 16V
GND_A
VDDIO
Current Limit Setting
CAT16-J4
1
2
3
4
8
765
RP2 4 x 10K
0402
C1
100n 16V
0402
R2 10K
VDDIO
VDDIO
0402
R9 10K
0402
R8 10K
VDDIO
Transceiver Module
0402
R3
0R
0402
R1
0R
T_REQ
0402
R38 10K
VDDIO
GSPG25092014DI1530
Page 36
Schematic diagrams and bill of material UM1818
36/47 DocID026935 Rev 3
Figure 13. Schematic diagram (2 of 5)
Figure 14. Schematic diagram (3 of 5)
BOOT0
7
44
NRST
5 6
OSC_IN/PD0 OSC_OUT/PD1
PA0-WKUP
110
1
PA9
31
PA10
32
PA11
33
PA12
34
PA13/JTMS/SWDIO
37
PA15/JTDI
PA1
12
PA14/JTCK/SWCLK
38
PA2
13
PA3
14
PA4
15
PA5
16
PA7
PA6
17
PA8
239
0
2 3
1 1
0 9
8 9
P P P
B0 B1 B2/BOOT1
40
PB3/JTDO PB4/JNTRST PB5
41
PB6
42
PB7
43
234
6
VDD_1
48
VDD_2
9
VDD_3 VDDA
VSS_1
233
5
VSS_2
47
VSSA
VSS_3
8
PB8
45
PB9
46
PB10
21
PB11
22
PB12
25
PB13
26
PB14
27
PB15
28
1
VBAT
PC13/TAMPER_RTC
2 3
U1
PC15/OSC32_OUT
PC14/OSC32_IN
4
IC-STM32F103CBT7
X2
0402
FOXSDLF/080-20
C5
22p 50V
0402
C9
22p 50V
VDDIO
PL_RX_ON PL_TX_ON
PLC_RESETN
JTAG_TDO JTAG_TRST
JTAG_TCK JTAG_TDI
JTAG_TMS
OSC32_IN OSC32_OUT
0402
C15 100n 16V
0603
L3
VDDA
0805
BLM18AG102SN1D
C14
VDDIO
10u 16V
BT1
CR2032/1HF
VBAT
0402
R5
330R
PLC_RXD PLC_TXD
T_REQ
PLM_GPIO0 PLM_GPIO1 PLM_GPIO2 PLM_GPIO3
PLM_GPIO4 PLM_GPIO5
PLM_GPIO6
BOOT1
PLM_GPIO7
8MHZ_MCO USART_TX USART_RX STM32_USB_DM STM32_USB_DP
SPI_MOSI
SPI_MISO
SPI_SCK
BOOT0
SPI_NSS
0402
R13 10K
0402
C13 100n 16V
0402
R12
10K
VDDIO
0402
R11 1M
Host Controller
X1 MC-306
0402
C3
10p 50V
0402
C6
10p 50V
0402
C37 100n 16V
0805
C23 10u 16V
0402
C38 100n 16V
VDDIO
0402
C39 100n 16V
0402
R14 10K
VDDIO
RESET_uP
(uP Tx) (uP Rx)
VDDIO
0603
R39
560R
0603
R40
560R
LEDSMD
LD2
HSMF-C155
LED_RED LED_GREEN
GSPG25092014DI1535
0402
C29
100n 16V
1206
R18
33K
1206
R25
33K
1206
R26
33K
SOT23
Q2 BC847
0402
R19 22K
0402
R32 10M
1
2
4
3
U3
0402
HCPL-181-000E R30 33K
VCC_A VCC_A
ZC_IN
GND_AGND_A
L
N
Isolated Zero Crossing
DO-214AC
D1
STTH1L06A
0805
R22 100K
1
TP1 ZC_IN
GSPG25092014DI1545
Page 37
DocID026935 Rev 3 37/47
UM1818 Schematic diagrams and bill of material
47
Figure 15. Schematic diagram (4 of 5)
Figure 16. Schematic diagram (5 of 5)
18x8x16
C32
220n X2 250Vac
L4
1
4
10u 2.0A
8
5
1:1
ZT1
SMB
D4
T60403-K5024-X044
SM6T15CA
0603
R34 150R
DO214
D5 SMAJ5.0CA
0603
C36
SMD
18n 50V
L5
100u 350mA
0603
C35
10n 50V
1210
C30
10u 50V
D3
DO-214AC(SMA)
STPS1L30A
D2
DO-214AC(SMA)
VCC
STPS1L30A
0402
R23 24K
0402
R31 24K
VCC
PA_OUT
0402
R21
33K
PA
PA_IN+
PA_IN-
0402
R20
10K
0402
C28
100n 16V
0402
R29
22K
0402
C34 100p 25V
0402
R28
5K1
0402
R27
1K5
0402
C25
100p 25V
0402
C26
27p 50V
0402
C27
4.7p 50V
0402
C33 1n 50V
0402
R24 47K
0402
R33 47K
0402
C31
VCC
100n 16V
TX_OUT
L
N
COMM
1
2
3
Power Line Coupling Section
4
5
J2
L
N
COMM
90121-0765
RX_IN
1
TP2 TX_OUT
1
TP3
RX_IN
GSPG25092014DI1550
J1
1 2 3 4 5 6 7 8
90120-0768
CAT16-J4
1
2
3
4
8
7
6
5
RP3 4 x 10K
0402
R7
10K
JTAG_TCK
JTAG_TDI
JTAG_TDO
JTAG_TMS
JTAG_TRST
RESET_uP
VDDIO
JTAG Interface
GSPG25092014DI1555
Page 38
Schematic diagrams and bill of material UM1818
38/47 DocID026935 Rev 3
B.2 Bill of material (BOM)
Table 1. Bill of material
Part type MI code Design. Footprint Description Qty Manufacturer Order code Part number Order code 2
100n 16V MI0156
C1, C2, C4, C7, C10, C12, C13, C15, C19, C20, C24, C28, C29, C31, C37, C38,
C39
0402_C
Ceramic
capacitor 100n
16V 0402
17 0402YG104ZAT2A 698-3190
10p 50V MI0207 C3, C6 0402_C
Ceramic
capacitor 10p
50V X7R 5%
2 04025A100DAT2A 698-3065
22p 50V C5, C9 0402_C
Ceramic
capacitor 22p
50V
2
GRM1555C1H220JZ
01D
624-2187
10µ 16V MI0136
C8, C11, C14,
C18, C21, C23
0805S_C
Ceramic
capacitor 10µ
16V X5R 10%
6
GRM21BR61C106K
E15L
723-6039
47µ 16V C16 0805S_C
Ceramic
capacitor 47µ
16V 0805 +/-
15%
1
GRM21BR61C475K
A88L
723-6041
100p 25V
C17, C22, C25,
C34
0402_C
Ceramic
capacitor 100p
25V 0402
4 04023A101JAT2A 698-3055
27p 50V C26 0402_C
Ceramic
capacitor 27p
50V COG 0402
1
GRM1555C1H270JA
01D
723-5402
4.7p 50V C27 0402_C
Ceramic
capacitor 4.7p
50V COG 0402
1
GRM1555C1H4R7B
A01D
723-5436
10µ 50V C30 1210
Ceramic
capacitor 10µ
50V 1210 X7R
1 UMK325BJ106MM-T 758-3486
Page 39
UM1818 Schematic diagrams and bill of material
DocID026935 Rev 3 39/47
220n X2 250Vac C32 RADX2-152
Metalized
polyester film
dielectric 220n
250Vac pitch
15mm
1 ECQU2A224ML 1198297
1n 50V C33 0402_C
Ceramic
capacitor 1n
50V X7R 10%
1 04025C102KAT2A 698-3131
10n 50V C35 0603S_C
Ceramic
capacitor 10n
50V X7R 10%
1 C0603C103K5RAC 264-4595
18n 50V C36 0603S_C
Ceramic
capacitor 18n
50V
1
C0603C183K5RACT
U
1865536RL
CL10B183KB8
NNNC
766-5392
STTH1L06A MI0020 D1 DO214AA
Diode fast
recovery
1 STTH1L06A 8165505 STTH1L06A 485-8500
STPS1L30A D2, D3 SMA_DIODE
Low drop power
schottky
rectifier 1A 30V
0.3V
2 STPS1L30 485-8061 STPS1L30A 497-6577-1-ND
SM6T15CA D4 SMB
TRANSIL diode
15V 600W
1 SM6T15CA 436-9757
SMAJ5.0CA D5 DO214
Diode TVS bi-
directional 5V
400W
DO214AC
1 SMAJ5.0CA 764-5568 SMAJ5.0CA-TR 9802860RL
90121-0765 J2 SIP5_RA
Connector male
2.54mm pitch SIL RA
1 90121-0765
010883121 J3, J4
FKV12LN_STR
IP_MIRROR
2 010883121
BLM21PG300SN1 L1 0805S
EMI filter 30R
100 MHz 0805
1 BLM21PG300SN1
BLM21PG331SN1 L2 0805S
EMI filter 330R
100 MHz
1 BLM21PG331SN1 724-1545
Table 1. Bill of material (continued)
Part type MI code Design. Footprint Description Qty Manufacturer Order code Part number Order code 2
Page 40
Schematic diagrams and bill of material UM1818
40/47 DocID026935 Rev 3
BLM21PG300SN1 L1 0805S
EMI filter 30R
100 MHz 0805
1 BLM21PG300SN1
BLM21PG331SN1 L2 0805S
EMI filter 330R
100 MHz
1 BLM21PG331SN1 724-1545
BLM18AG102SN1
D
MI0160 L3 0603S
EMI filter BLM
1K 100MHz
400mA
1 BLM18AG102SN1D 230-3783
10µ 2.0A L4 IND_WE-PD3
Inductor 10µ
2.0A 74454010
1 74454010 74454010
100µ 350mA L5 IND_6x6
Inductor 100µ
350mA
1 B82462A4104K 495-8032
HSMF-C155 LD1, LD2 HSMF-C655
LED Bi-color
green/red SMD
2 HSMF-C155 486-0430
2N7002 MI0127 Q1 SOT23
N-channel
Trench
MOSFET
1 2N7002 112-5526
BC847 MI0135 Q2 SOT23A
NPN 45 V, 100
mA general-
purpose
transistors
1 BC847 445-2023
10K MI0167
R2, R7, R8, R9, R10, R12, R13, R14, R17, R20,
R38
0402_R
Resistor 10K
0.0625W
11 CRG0402F10K 667-8848
560R
R4, R6, R39,
R40
0603S_R
Resistor 560R
0.1W 1%
4 CRG0603F560R 213-2238
330R R5, R16 0402_R
Resistor 330R
0.0625W
2 CRG0402F330R 667-8646
1M R11 0402_R
Resistor 1M
0.0625W
1 CRG0402F1M0 667-9065
130R R15 0402_R
Resistor 130R
0.0625W
1 CRG0402F130R 667-8618
33K R18, R25, R26 1206S_R
Resistor 33K
0.33W 1%
3
CRCW120633K0FK
EA
679-2055
Table 1. Bill of material (continued)
Part type MI code Design. Footprint Description Qty Manufacturer Order code Part number Order code 2
Page 41
UM1818 Schematic diagrams and bill of material
DocID026935 Rev 3 41/47
22K R19, R29 0402_R
Resistor 22K
0.0625W 1%
2 CRG0402F22K 667-8892
33K R21, R30 0402_R
Resistor 33K
0.0625W
2 CRG0402F33K 667-8933
100K MI0229 R22 0805S_R
Resistor 100K
0.125W 1%
1 CRG0805F100K 223-0691
24K R23, R31 0402_R
Resistor 24K
0.0625W 1%
2 CRG0402F24K 667-8909
47K R24, R33 0402_R
Resistor 47K
0.0625W 0.1%
2 CRG0402F47K 667-8943
1K5 R27, R35 0402_R
Resistor 1K5
0.063W 1%
2 CRG0402F1K5 667-8707
5K1 R28 0402_R
Resistor 5K1
0.0625W 1%
1
CRCW04025K10FK
ED
678-9478
10M R32 0402_R
Resistor 10M
0.0625W
1
CRCW040210M0FK
ED
667-8709
150R R34 0603S_R
Resistor 150R
0.1W 1%
1 CRG0603F150R 213-2165
22R R36, R37 0402_R
Resistor 22R
0.063W 1%
2 CRG0402F22R 667-8558
4 x 10K MI0069 RP1, RP2, RP3
RESPACK_CA
T/CAY_16
Respack SMD
4 x 10K 0.25 5%3 CAT16-103J4LF 522-5412
CAT16-
103J4LF
1770124
IC-
STM32F103CBT7
U1 LQFP48_STM
STM32 ARM-
based 32-bit MCU with 64
kbytes Flash,
36-pin
VFQFPN,
industrial
temperature
1 STM32F103CBT7 714-7689
Table 1. Bill of material (continued)
Part type MI code Design. Footprint Description Qty Manufacturer Order code Part number Order code 2
Page 42
Schematic diagrams and bill of material UM1818
42/47 DocID026935 Rev 3
ST7580 U2
VFQFPN48_7x
7x1
B-FSK, B-PSK, Q-PSK, 8-PSK
Multi mode
power line
networking
system on chip
1
HCPL-181-000E U3 SO-4
Phototransistor
optocoupler
SMD Mini-Flat
type
1 HCPL-181 693-5277
USBLC6-2 MI0211 U4 SOT666
USB very low
capacitance
ESD protection
1 USBLC6-2P6 624-7687
MC-306 X1 TPSM32A
Crystal 32.768
kHz
1 MC-306 667-6117
FOXSDLF/080-20 X2 XTAL2
SMD Crystal
8.000 MHz
1
8.000MHz
49USMX/30/50/-
40+85/18pF/ATF
693-8869
T60403-K5024-
X044
ZT1
TRF_VAC5024
X044
Signal
transformer 1:1
1 T60403-K5024-X044
T60403-K5024-
X044
Table 1. Bill of material (continued)
Part type MI code Design. Footprint Description Qty Manufacturer Order code Part number Order code 2
Page 43
DocID026935 Rev 3 43/47
UM1818 CRC 16 calculation
47
Appendix C CRC 16 calculation
The CRC 16 is based on the X16 + X15 + X2 + 1 polynomial.
/* Used CRC 16 table */
const uint16_t TableCRC16[256] = { 0x0000, 0xC0C1, 0xC181, 0x0140, 0xC301, 0x03C0, 0x0280, 0xC241, 0xC601, 0x06C0, 0x0780, 0xC741, 0x0500, 0xC5C1, 0xC481, 0x0440, 0xCC01, 0x0CC0, 0x0D80, 0xCD41, 0x0F00, 0xCFC1, 0xCE81, 0x0E40, 0x0A00, 0xCAC1, 0xCB81, 0x0B40, 0xC901, 0x09C0, 0x0880, 0xC841, 0xD801, 0x18C0, 0x1980, 0xD941, 0x1B00, 0xDBC1, 0xDA81, 0x1A40, 0x1E00, 0xDEC1, 0xDF81, 0x1F40, 0xDD01, 0x1DC0, 0x1C80, 0xDC41, 0x1400, 0xD4C1, 0xD581, 0x1540, 0xD701, 0x17C0, 0x1680, 0xD641, 0xD201, 0x12C0, 0x1380, 0xD341, 0x1100, 0xD1C1, 0xD081, 0x1040, 0xF001, 0x30C0, 0x3180, 0xF141, 0x3300, 0xF3C1, 0xF281, 0x3240, 0x3600, 0xF6C1, 0xF781, 0x3740, 0xF501, 0x35C0, 0x3480, 0xF441, 0x3C00, 0xFCC1, 0xFD81, 0x3D40, 0xFF01, 0x3FC0, 0x3E80, 0xFE41, 0xFA01, 0x3AC0, 0x3B80, 0xFB41, 0x3900, 0xF9C1, 0xF881, 0x3840, 0x2800, 0xE8C1, 0xE981, 0x2940, 0xEB01, 0x2BC0, 0x2A80, 0xEA41, 0xEE01, 0x2EC0, 0x2F80, 0xEF41, 0x2D00, 0xEDC1, 0xEC81, 0x2C40, 0xE401, 0x24C0, 0x2580, 0xE541, 0x2700, 0xE7C1, 0xE681, 0x2640, 0x2200, 0xE2C1, 0xE381, 0x2340, 0xE101, 0x21C0, 0x2080, 0xE041, 0xA001, 0x60C0, 0x6180, 0xA141, 0x6300, 0xA3C1, 0xA281, 0x6240, 0x6600, 0xA6C1, 0xA781, 0x6740, 0xA501, 0x65C0, 0x6480, 0xA441, 0x6C00, 0xACC1, 0xAD81, 0x6D40, 0xAF01, 0x6FC0, 0x6E80, 0xAE41, 0xAA01, 0x6AC0, 0x6B80, 0xAB41, 0x6900, 0xA9C1, 0xA881, 0x6840, 0x7800, 0xB8C1, 0xB981, 0x7940, 0xBB01, 0x7BC0, 0x7A80, 0xBA41, 0xBE01, 0x7EC0, 0x7F80, 0xBF41, 0x7D00, 0xBDC1, 0xBC81, 0x7C40, 0xB401, 0x74C0, 0x7580, 0xB541, 0x7700, 0xB7C1, 0xB681, 0x7640, 0x7200, 0xB2C1, 0xB381, 0x7340, 0xB101, 0x71C0, 0x7080, 0xB041, 0x5000, 0x90C1, 0x9181, 0x5140, 0x9301, 0x53C0, 0x5280, 0x9241, 0x9601, 0x56C0, 0x5780, 0x9741, 0x5500, 0x95C1, 0x9481, 0x5440, 0x9C01, 0x5CC0, 0x5D80, 0x9D41, 0x5F00, 0x9FC1, 0x9E81, 0x5E40, 0x5A00, 0x9AC1, 0x9B81, 0x5B40, 0x9901, 0x59C0, 0x5880, 0x9841, 0x8801, 0x48C0, 0x4980, 0x8941, 0x4B00, 0x8BC1, 0x8A81, 0x4A40, 0x4E00, 0x8EC1, 0x8F81, 0x4F40, 0x8D01, 0x4DC0, 0x4C80, 0x8C41, 0x4400, 0x84C1, 0x8581, 0x4540, 0x8701, 0x47C0, 0x4680, 0x8641, 0x8201, 0x42C0, 0x4380, 0x8341, 0x4100, 0x81C1, 0x8081, 0x4040 };
/* CRC function */
Page 44
CRC 16 calculation UM1818
44/47 DocID026935 Rev 3
/************************************************************************* ******
* Function Name : CalcCRC16 * Description : Calculate a 16 bit CRC (X16 + X15 + X2 + 1) * Input : Buffer pointer, buffer length * Return : Calculated CRC **************************************************************************
*****/ uint16_t CalcCRC16(uint8_t *buf, uint8_t len) { uint16_t crc = 0;
while (len--) crc = (crc >> 8) ^ TableCRC16[(crc ^ (*(buf++))) & 0xff];
return (crc); }
Page 45
DocID026935 Rev 3 45/47
UM1818 Reference
47
5 Reference
1. ARM-based 32-bit MCU STM32F10x standard peripheral library Rel. 3.5.0 (2011)
2. ST7580 FSK, PSK multi-mode power line networking SoC datasheets (2012)
3. UM0932 ST7580 FSK, PSK multi-mode power line networking SoC user manual (2013)
4. AN4018 data link protocol for ST7580 PLM
5. IAR embedded workbench® IDE for STM32 microcontrollers Rel. 6.3 documentation (www.iar.com)
Page 46
Revision history UM1818
46/47 DocID026935 Rev 3
6 Revision history
Table 2. Document revision history
Date Revision Changes
29-May-2015 1 Initial release
29-Jul-2015 2 Figure 4 has been updated
12-Dec-2016 3
Updated:
- Figure 1.: STEVAL-IHP007V1 evaluation board
- Figure 2.: STEVAL-IHP007V1 block diagram
Page 47
DocID026935 Rev 3 47/47
UM1818
47
IMPORTANT NOTICE – PLEASE READ CAREFULLY
STMicroelectronics NV and its subsidiaries (“ST”) reserve the right to make changes, corrections, enhancements, modifications, and improvements to ST products and/or to this document at any time without notice. Purchasers should obtain the latest relevant information on ST products before placing orders. ST products are sold pursuant to ST’s terms and conditions of sale in place at the time of order acknowledgement.
Purchasers are solely responsible for the choice, selection, and use of ST products and ST assumes no liability for application assistance or the design of Purchasers’ products.
No license, express or implied, to any intellectual property right is granted by ST herein.
Resale of ST products with provisions different from the information set forth herein shall void any warranty granted by ST for such product.
ST and the ST logo are trademarks of ST. All other product or service names are the property of their respective owners.
Information in this document supersedes and replaces information previously supplied in any prior versions of this document.
© 2016 STMicroelectronics – All rights reserved
Loading...