Page 1
This document explains how to use and set up the firmware and the software designed for the STEVAL-IHP007V1 board and all the necessary setup for using the hardware. The system is based to the ST7580 data link protocol firmware, data link protocol described in the application note AN4018.
UM1818 Features 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 •...
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.
Page 5
UM1818 Description 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.
Page 6
Description UM1818 Figure 4. User interface connector PLM_GPIO7 SPI_ MOSI PLM_GPIO6 SPI_ MISO PLM_GPIO5 SPI_S CK SPI_ NSS PLM_GPIO4 PLM_GPIO3 USART_RX PLM_GPIO2 USART_TX PLM_GPIO1 USB_ DP PLM_GPIO0 USB_ DM VDDIO BOOT0 TSW-112-08-L-D- RA GSPG23072015DI1045 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.
UM1818 Hardware installation 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.
Firmware description UM1818 Firmware description 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.
Page 9
UM1818 Firmware description 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...
Firmware description UM1818 Figure 8. RFU flowchart (1of 2) Figure 9. RFU flowchart (2 of 2) 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”.
UM1818 Firmware description 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.
Page 12
Firmware description UM1818 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...
UM1818 Firmware description 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.
Page 14
Firmware description UM1818 /* 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...
UM1818 Firmware description 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...
Firmware description UM1818 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).
UM1818 Firmware description 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) buffer[0] = n + 11;...
Page 18
Firmware description UM1818 Service command list /* 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...
Page 19
UM1818 Firmware description Set module parameters: programming user parameters From the COMM interface (USART) buffer[0] = 44 // Service frame payload length buffer[1] = APP_SERVICE_FRAME | BROADCAST_FLAG; // Service frame type buffer[2,..7] = target_module.address; // Target device address (6 bytes) buffer[8] = SERVICE_PARAM_SET;...
Page 20
Firmware description UM1818 Get module general purpose inputs/outputs configuration From the COMM interface (USART) buffer[0] = 11; // Service frame payload length buffer[1] = APP_SERVICE_FRAME; // Service frame type buffer[2,..7] = target_module.address; // Target device address (6 bytes) buffer[8] = SERVICE_IO_CONFIG_GET; // Service Command buffer[9,10] = CRC16;...
Page 21
UM1818 Firmware description From / to communication interface (PLM, USART) buffer[0] = 12; // Service frame payload length buffer[1] = APP_SERVICE_FRAME; // Service frame type buffer[2,..7] = target_module.address; // Target device address (6 bytes) buffer[8] =SERVICE_INPUTS_GET; // Service command buffer[9] = *sender.inputs_value; // Read GPIO Input value buffer[10,11] = CRC16;...
Page 22
Firmware description UM1818 From / to communication interface (PLM, USART) buffer[0] = 15; // Service frame payload length buffer[1] = APP_SERVICE_FRAME; // Service frame type buffer[2,..7] = target_module.address; // Target device address (6 bytes) buffer[8] = SERVICE_FW_REL_GET; // Service command buffer[9,10] = target_module.firmware_release;...
Page 23
UM1818 Firmware description From / to communication interface (PLM, USART) buffer[0] = 12; // Service frame payload length buffer[1] = APP_ACK_FRAME; // Service frame type buffer[2,..7] = target_module.address; // Target device address (6 bytes) buffer[8]= APP_SERVICE_FRAME; // Service frame type buffer[9]= command_echo;...
HID commands UM1818 Appendix A HID commands HID frames are data frames where the payload is customized for the HID ballast application. From the COMM interface (USART) buffer[0] = n + 10; // Data frame payload length (n + 10) buffer[1] = APP_DATA_FRAME | BROADCAST_FLAG;...
Page 25
UM1818 HID commands Case Software reset buffer[0] = 12; // Data frame payload length buffer[1] = APP_ACK_FRAME; // ACK frame type buffer[2,..7] = target_module.address; // Target device address (6 bytes) buffer[8]= APP_DATA_FRAME; // Data frame type buffer[9]= 0x73; // Command char 's' buffer[10,11] = CRC16;...
Page 26
HID commands UM1818 Get HID parameter From the COMM interface (USART- Source “Concentrator”) and To the COMM interface (USART- Destination “HID ballast”) buffer[0] = 12; // Data frame payload length buffer[1] = APP_DATA_FRAME; // Data frame type buffer[2,..7] = target_module.address; // Target device address (6 bytes) buffer[8] = 0x67;...
Page 27
UM1818 HID commands /* GET BUS VOLTAGE */ buffer[0] = 5; // Data frame payload length buffer[1] = 0x67; // Get command 'g' ascii value buffer[2] = 0x01; // BUS VOLTAGE buffer[3] = bus_voltage_h; // High byte of bus voltage buffer[4] = bus_voltage_l;...
Page 28
HID commands UM1818 /* GET LAMP POWER */ buffer[0] = 5; // Data frame payload length buffer[1] = 0x67; // Get command 'g' ascii value buffer[2] = 0x04; // LAMP POWER buffer[3] = lamp_power_h; // High byte of lamp power buffer[4] = lamp_power_l;...
Page 29
UM1818 HID commands /* GET N° OF POWER ON */ buffer[0] = 5; // Data frame payload length buffer[1] = 0x67; // Get command 'g' ascii value buffer[2] = 0x08; // N. OF POWER ON buffer[3] = power_on_n_h; // High byte of number of lamp power on buffer[4] = power_on_n_l;...
Page 30
HID commands UM1818 buffer[21] = board_temperature_h; // High byte of board temperature (°C) buffer[22] = board_temperature_l; // Low byte of board temperature (°C) buffer[23] = power_on_n_h; // High byte of number of lamp power on buffer[24] = power_on_n_l; // Low byte of number of lamp power on buffer[25] = lamp_lifetime_h;...
Page 31
UM1818 HID commands /* hardware_status value */ 0x00 = IDLE 0x01,0x02,0x03 = STARTUP 0x04,0x05 = WARMUP 0x06 = RUN 0x07 = WAIT = FAILURE 0x08 /* GET LAMP POWER */ buffer[0] = 14; // Data frame payload length buffer[1] = APP_DATA_FRAME; // Data frame type buffer[2,..7] = source_module.address;...
Page 32
HID commands UM1818 /* GET POWER SUPPLY VOLTAGE */ buffer[0] = 14; // Data frame payload length buffer[1] = APP_DATA_FRAME; // Data frame type buffer[2,..7] = source_module.address; // Source device address (6 bytes) buffer[8] = 0x67; // Get command 'g' ascii value buffer[9] = 0x06;...
Page 33
UM1818 HID commands /* GET LAMP LIFETIME (Hours) */ buffer[0] = 14; // Data frame payload length buffer[1] = APP_DATA_FRAME; // Data frame type buffer[2,..7] = source_module.address; // Source device address (6 bytes) buffer[8] = 0x67; // Get command 'g' ascii value buffer[9] = 0x09;...
Page 34
HID commands UM1818 buffer[22] = last_bus_voltage_h; // High byte of bus voltage before the failure buffer[23] = last_bus_voltage_l; // Low byte of bus voltage before the failure buffer[24] = last_lamp_voltage_h; // High byte of lamp voltage before the failure buffer[25] = last_lamp_voltage_l; // Low byte of lamp voltage before the failure buffer[26] = input_voltage_h;...
UM1818 Schematic diagrams and bill of material Appendix B Schematic diagrams and bill of material Schematic diagrams Figure 12. Schematic diagram (1 of 5) VDDIO VDDIO VDDIO 4 x 10K 4 x 10K 0402 0402 CAT16-J4 CAT16-J4 0402 VDDIO PL_RX_ON 560R VDDIO VDDIO...
Page 36
Schematic diagrams and bill of material UM1818 Figure 13. Schematic diagram (2 of 5) VDDIO 560R 0603 VDDIO 560R 0603 Host Co n troller 0402 HSMF-C155 LED_RED LEDSMD PA0-WKUP LED_GREEN T_REQ BOOT1 PLC_RXD (uP Tx) B2/BOOT1 JTAG_TDO PLC_TXD (uP Rx) PB3/JTDO JTAG_TRST PLM_GPIO0...
Bill of material (BOM) Table 1. Bill of material Part type MI code Design. Footprint Description Manufacturer Order code Part number Order code 2 C1, C2, C4, C7, C10, C12, C13, Ceramic C15, C19, C20, 100n 16V MI0156 0402_C capacitor 100n 0402YG104ZAT2A 698-3190 C24, C28, C29,...
Page 39
Table 1. Bill of material (continued) Part type MI code Design. Footprint Description Manufacturer Order code Part number Order code 2 Metalized polyester film 220n X2 250Vac RADX2-152 dielectric 220n ECQU2A224ML 1198297 250Vac pitch 15mm Ceramic 1n 50V 0402_C capacitor 1n 04025C102KAT2A 698-3131 50V X7R 10%...
Page 40
Table 1. Bill of material (continued) Part type MI code Design. Footprint Description Manufacturer Order code Part number Order code 2 EMI filter 30R BLM21PG300SN1 0805S BLM21PG300SN1 100 MHz 0805 EMI filter 330R BLM21PG331SN1 0805S BLM21PG331SN1 724-1545 100 MHz EMI filter BLM BLM18AG102SN1 MI0160 0603S...
Page 41
Table 1. Bill of material (continued) Part type MI code Design. Footprint Description Manufacturer Order code Part number Order code 2 Resistor 22K R19, R29 0402_R CRG0402F22K 667-8892 0.0625W 1% Resistor 33K R21, R30 0402_R CRG0402F33K 667-8933 0.0625W Resistor 100K 100K MI0229 0805S_R...
Page 42
Table 1. Bill of material (continued) Part type MI code Design. Footprint Description Manufacturer Order code Part number Order code 2 B-FSK, B-PSK, Q-PSK, 8-PSK VFQFPN48_7x Multi mode ST7580 power line networking system on chip Phototransistor optocoupler HCPL-181-000E SO-4 HCPL-181 693-5277 SMD Mini-Flat type...
UM1818 Reference Reference ARM-based 32-bit MCU STM32F10x standard peripheral library Rel. 3.5.0 (2011) ST7580 FSK, PSK multi-mode power line networking SoC datasheets (2012) UM0932 ST7580 FSK, PSK multi-mode power line networking SoC user manual (2013) AN4018 data link protocol for ST7580 PLM IAR embedded workbench®...
Revision history UM1818 Revision history Table 2. Document revision history Date Revision Changes 29-May-2015 Initial release 29-Jul-2015 Figure 4 has been updated Updated: 12-Dec-2016 Figure 1.: STEVAL-IHP007V1 evaluation board Figure 2.: STEVAL-IHP007V1 block diagram 46/47 DocID026935 Rev 3...
Page 47
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.
Need help?
Do you have a question about the STEVAL-IHP007V1 and is the answer not in the manual?
Questions and answers