![]() |
|
If you can't view the Datasheet, Please click here to try to view without PDF Reader . |
|
Datasheet File OCR Text: |
november 2011 doc id 022170 rev 1 1/26 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. www.st.com
contents AN3975 2/26 doc id 022170 rev 1 contents 1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 2 system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 2.1 system description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 2.2 system specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 3 system implementation - hw . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 3.1 power meter (rs485) part . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 3.2 pc (hyperterminal) part . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 4 system implementation - fw . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 4.1 pc (hyperterminal) part . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 firmware project for pc part details. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 4.2 power meter (rs485) part . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 firmware project for power meter part details . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 5 system setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 5.1 hw interconnection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 5.2 communication setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 6 tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 6.1 signal shape and settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 6.2 sending short data from hyperterminal to rs485 bus using matching resistor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 6.3 sending short data from hyperterminal to rs485 bus not using matching resistor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 6.4 closed loop communication test of 320-byte message . . . . . . . . . . . . . . 19 6.5 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 AN3975 list of tables doc id 022170 rev 1 3/26 list of tables table 1. signals of interconnection of st eval-pcc 012v1 and rs485 module . . . . . . . . . . . . . . . . 9 table 2. led behavior on cg for pc part of the application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 table 3. led behavior of cg for power meter part of the application . . . . . . . . . . . . . . . . . . . . . . . 14 table 4. document revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 list of figures AN3975 4/26 doc id 022170 rev 1 list of figures figure 1. rs485 over power line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 figure 2. connectivity gateway board with rs485 extension . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 figure 3. st485abdr in so8 package - rs485 module schematic. . . . . . . . . . . . . . . . . . . . . . . . . . 8 figure 4. cg (connectivity gateway) cn3 connector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 figure 5. module signal pinout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 figure 6. connectivity gateway board with interfacing usb and plm . . . . . . . . . . . . . . . . . . . . . . . . 10 figure 7. hw interconnection of the complete test system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 figure 8. windows com port setting dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 figure 9. even parity bit p = 0 on the eighth position of the data bit . . . . . . . . . . . . . . . . . . . . . . . . . 15 figure 10. even parity bit p = 1 on the eighth position of the data bit . . . . . . . . . . . . . . . . . . . . . . . . . 16 figure 11. rs485 - one-byte transmission - jumper j1 closed, matching resistor 120 connected . . . 17 figure 12. rs485 - two-byte transmission - jumper j1 closed, matching resistor 120 connected. . . . 18 figure 13. rs485 - two-byte transmission - jumper j1 opened, matching resistor 120 not connected . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 figure 14. closed loop setup for communication test using bigger datafiles, uart loop . . . . . . . . . . 20 figure 15. closed loop setup for communication test using bigger datafiles, rs485 loop . . . . . . . . . 20 figure 16. closed loop test - 320-byte data transfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 figure 17. log of packets - 320-byte data transfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 figure 18. closed loop test - 2,565-kilobyte data transfer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 figure 19. log of packets - 2,565-kilobyte data transfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 AN3975 system doc id 022170 rev 1 5/26 2 system 2.1 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 part (see figure 1 ) 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 modulation and modem specifications st7590, ofdm modulation, prime protocol, one logical channel opened by service node. system AN3975 6/26 doc id 022170 rev 1 figure 1. rs485 over power line ! - 0 # m a s t e r o f c o m m u n i c a t i o n 6 i r t u a l # / - p o r t 5 3 " 5 3 " # o n n e c t i v i t y ' 4 7 5 ! 2 4 ? " 5 ! 2 4 5 ! 2 4 0 , - 3 4 x x 3 & |