ST STEVAL-IHP007V1 User Manual
ST STEVAL-IHP007V1 User Manual

ST STEVAL-IHP007V1 User Manual

Street lighting power line modem evaluation board based on st7580 plm and stm32 microcontroller

Advertisement

Quick Links

UM1818
User manual
Street lighting power line modem evaluation board based on
ST7580 PLM and STM32 microcontroller
Introduction
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. 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
December 2016
DocID026935 Rev 3
1/47
www.st.com
47

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the STEVAL-IHP007V1 and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for ST STEVAL-IHP007V1

  • 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.
  • Page 2: Table Of Contents

    Contents UM1818 Contents Features ........... 3 Description .
  • Page 3: Features

    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 •...
  • Page 4: Description

    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.
  • Page 7: Hardware Installation

    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.
  • Page 8: Firmware Description

    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...
  • Page 10: Firmware Download

    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”.
  • Page 11: Firmware Architecture

    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...
  • Page 13: Firmware Data Types

    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...
  • Page 15: Firmware Frame Types

    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...
  • Page 16: Ping Frames

    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).
  • Page 17: Service Frames

    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;...
  • Page 24: Appendix A Hid Commands

    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;...
  • Page 35: Appendix B Schematic Diagrams And Bill Of Material

    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...
  • Page 37: Jtag Interface

    UM1818 Schematic diagrams and bill of material Figure 15. Schematic diagram (4 of 5) 100p 25V 0402 27p 50V 0402 0402 4.7p 50V STPS1L30A TX_OUT 100n 16V 0402 0402 0402 DO-214AC(S MA) 0402 0402 PA_IN- PA_OUT 10u 50V COMM TX_OUT PA_IN+ 1210 0402...
  • Page 38: Bill Of Material (Bom)

    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...
  • Page 43: Appendix Ccrc 16 Calculation

    UM1818 CRC 16 calculation 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,...
  • Page 44 CRC 16 calculation UM1818 /************************************************************************* ****** * 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;...
  • Page 45: Reference

    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®...
  • Page 46: Revision History

    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.

Table of Contents