AN3975
Application note
Transparent serial link over ST7590 OFDM PRIME modem
1
Introduction
Nowadays, a lot of power meter manufacturers or smart grid providers are switching from
simple networks like RS845 to more sophisticated ones like PRIME. In order to help and
inform CTMs in their evaluation phase with transition from a simple protocol to a more
sophisticated one, a transparent bridge between RS485 and PRIME would be welcomed.
Such a system could easily help to evaluate PRIME protocol in the lab and in the field.
STMicroelectronics™, as a chip manufacturer, provides a system-on-chip realizing PRIME
protocol ST7590, and the implementation of such a transparent bridge is described in this
document. A part of this application note is a zip archive file with a firmware referenced
within this document.
November 2011
Doc ID 022170 Rev 1
1/26
www.st.com
Contents
AN3975
Contents
1
2
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.1
2.2
System description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
System specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
3
System implementation - HW . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.1
3.2
Power meter (RS485) part . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
PC (HyperTerminal) part . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4
System implementation - FW . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
4.1
4.2
PC (HyperTerminal) part . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Firmware project for PC part details. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Power meter (RS485) part . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Firmware project for power meter part details . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
5
System setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
5.1
5.2
HW interconnection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Communication setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
6
Tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
6.1
6.2
6.3
6.4
6.5
Signal shape and settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Sending short data from HyperTerminal to RS485 bus using
matching resistor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Sending short data from HyperTerminal to RS485 bus not using
matching resistor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Closed loop communication test of 320-byte message . . . . . . . . . . . . . . 19
Closed loop communication test of 2565-byte message . . . . . . . . . . . . . 22
Appendix A
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Function that avoids close loop test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Function that enables close loop test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
2/26
Doc ID 022170 Rev 1
AN3975
List of tables
List of tables
Table 1.
Table 2.
Table 3.
Table 4.
Signals of interconnection of STEVAL-PCC012V1 and RS485 module . . . . . . . . . . . . . . . . 9
LED behavior on CG for PC part of the application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
LED behavior of CG for power meter part of the application . . . . . . . . . . . . . . . . . . . . . . . 14
Document revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Doc ID 022170 Rev 1
3/26
List of figures
AN3975
List of figures
Figure 1.
Figure 2.
Figure 3.
Figure 4.
Figure 5.
Figure 6.
Figure 7.
Figure 8.
Figure 9.
Figure 10.
Figure 11.
Figure 12.
Figure 13.
Figure 14.
Figure 15.
Figure 16.
Figure 17.
Figure 18.
Figure 19.
RS485 over power line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Connectivity gateway board with RS485 extension . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
ST485ABDR in SO8 package - RS485 module schematic. . . . . . . . . . . . . . . . . . . . . . . . . . 8
CG (connectivity gateway) CN3 connector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Module signal pinout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Connectivity gateway board with interfacing USB and PLM . . . . . . . . . . . . . . . . . . . . . . . . 10
HW interconnection of the complete test system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Windows COM port setting dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Even parity bit P = 0 on the eighth position of the data bit . . . . . . . . . . . . . . . . . . . . . . . . . 15
Even parity bit P = 1 on the eighth position of the data bit . . . . . . . . . . . . . . . . . . . . . . . . . 16
RS485 - one-byte transmission - jumper J1 closed, matching resistor 120 connected . . . 17
RS485 - two-byte transmission - jumper J1 closed, matching resistor 120 connected. . . . 18
RS485 - two-byte transmission - jumper J1 opened, matching resistor 120 not
connected . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Closed loop setup for communication test using bigger datafiles, UART loop . . . . . . . . . . 20
Closed loop setup for communication test using bigger datafiles, RS485 loop . . . . . . . . . 20
Closed loop test - 320-byte data transfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Log of packets - 320-byte data transfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Closed loop test - 2,565-Kilobyte data transfer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Log of packets - 2,565-Kilobyte data transfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
4/26
Doc ID 022170 Rev 1
AN3975
System
2
2.1
System
System description
The system being described contains two basic parts:
Power meter part:
An interface to a power meter that can communicate with superior
system over RS485.
PC part:
An interface that can communicate with the PC (using a USB connection) that is
a superior system for the power meter.
Both interfaces are interconnected by a power line link using the ST7590 demonstration
board. Once there are some data to be sent to the power meter, the PC sends this data to
the USB Virtual COM port. In this system, the microcontroller (PC part) takes the data from
the USB, encapsulates it into the commands for the first power line modem (base node) and
sends it to the power line. Another modem reads the data coming from the power line
(service node), and sends them to the microcontroller, power meter part. The
microcontroller extracts the data from the power line modem and sends them to UART_A.
The RS485 driver is connected to UART_A, so the data sent to the UART_A are converted
to RS485 and these data are delivered to the power meter. If the power meter replies, the
data comes back through this channel to the PC.
The microcontroller module used in this application is the connectivity gateway (STEVAL-
PCC012V1). This module is referred to as CG in the following text.
2.2
System specification
Power meter part
(see
Figure 1
and
Figure 7)
●
●
●
●
●
Power meter with RS485 terminals. Two terminals (+, -) for half duplex RS485
Line driver for RS485 to UART_A
Connectivity gateway system with STM32 interfacing RS485 via UART_A
Connectivity gateway system with STM32 interfacing ST75xx via UART_B
PLM ST75xx using UART_B and connection to power lines
PC with USB
Connectivity gateway system with STM32 offering USB connection providing Virtual
COM port functionality.
Connectivity gateway system with STM32 interfacing ST75xx via UART_B
PLM ST75xx using UART_B and connection to power lines
ST7590, OFDM modulation, PRIME protocol, one logical channel opened by service
node.
PC part
(see
Figure 1)
●
●
●
●
Modulation and modem specifications
●
Doc ID 022170 Rev 1
5/26