8357.TI_FLEX_UG
8357.TI_FLEX_UG
8357.TI_FLEX_UG
Version 0.2
The information and/or drawings set forth in this document and all rights in and to inventions disclosed
herein and patents which might be granted thereon disclosing or employing the materials, methods,
techniques, or apparatus described herein are the exclusive property of Texas Instruments. No disclosure of
information or drawings shall be made to any other person or organization without the prior consent of
Texas Instruments.
2
3.2 Trouble shoot for USB to Serial Dongle Communications............................................................ 31
3.3 Trouble shoot for PLC LQM Diagnostic Tool to Device Communications...................................... 32
3
1.0 TI PLC Development Kit Overview
1.1 Features
The TI PLC Development Kit for FLEX contains the following main components and supported features:
Operating frequency range supporting Sub-10KHz band, CENELEC A/B/C/D and FCC band
Selectable frequency bands with BW of 3 kHz, 12 kHz or 24 kHz
4
Data rates up to 64 kbps
Transmission with OFDM and FEC
Number of used data carriers is 24
Differential Phase modulation (DBPSK/DQPSK/D8PSK)
ROBO mode provides Repetition code with DBPSK+FEC
Convolutional encoder/Viterbi decoder
Bit interleaving for noise effect reduction
CRC8 in headers and CRC32 in data for error detection
Data randomization for uniform power distribution
Automatic gain control
Zero-crossing detection
Supports FLEXOFDM PHY, PRIME MAC, IEC61334 -4-32 LLC
RS-232 interface for diagnostic port interface
Serial interface for host data port interface: UART, SPI, etc.
LEDs and test points for firmware and hardware debug
USB/JTAG for custom firmware download
o Firmware upgrade binary image (only used for HW platforms that does not have pre-flashed
image)
(flash_upgrade.out)
5
o F28335 Support libraries: csl.lib, uart.lib
PC Software/GUI
o TI PLC Quality Monitor GUI
Example projects:
o FLEX PHY projects: example of using PHY lib only
o SCI/UART project: example of configuring SCI transmit and receive
HW documentations
o AFE daughter card schematics and Gerber files
o Docking board schematics and Gerber files
o BOM
6
a. flex_iec432_flash.out – This image supports IEC61334-4-32 LLC and convergence layer stack
on top of Prime MAC and FLEX PHY operations. It demonstrates the followings:
i. Point to point and point to multi-points operation: Demonstration of PLC device
PHY layer performance, file transfer and message transmission through FLEX
PHY/Prime MAC/PRIME IEC432-CL/IEC432-LLC without a Base Node. This is to be
run with the PLC Quality Monitor (PQM) PC tool.
4. Example projects under “SW” directory zip files
a. FLEX PHY example project – Demonstrates the usage of PHY library API
b. SCI example project – Demonstrate SCI operation in loopback mode.
5. Tool
a. PLC host tool installer – This installs PLC eMeter GUI, “iprawput” application and
“HostAppEmu” application
7
1.3.1 PLC Point-to-Point HW Setup
Host PC
Null modem cable
power line
Null modem cable
The PLC-DK can be used to demonstrate point-to-point or point-to-multipoint communication over power
line. This is to be used with PLC Quality Monitor GUI Tools to test PHY/MAC operability and send data
between the two boards over the power line media1. It requires 2 PCs, and 2 null modem cables.
If the host PC can be configured to use two serial ports, then the demo setup can be ran on a single PC,
using a different serial port to communicate with each board.
The PLC Development Kit provided is configured with the default jumper/connector positions. The following
three tables describe the connector/jumper name, descriptions, default positions and other options if
available.
AFE
Connector/Jumper Descriptions Default Position
1
Note that the DSP control cards are pre-loaded with “Flex_iec432_flash.out” and ready to be used.
8
J2 PLC Docking Board Connector
J3 PLC Docking Board Connector
JP5 RX Path Close
Table 1 PLC AFE Connector/Jumper
PLC Dock
Connector/Jumper Descriptions Default Position Options
J1 DSP Control Card Connector
J2 SCI-A Connector
Open Boot from Flash
J3 Boot Options Open 1-2 Boot from SPI-A
2-3 Boot from SCI-A
Transformer T2 Open T2 Not Used
J4 Close
Selection Close T2 Is Used
ECAP Channel 1-2 ECAP1
J5 2-3
Selection 2-3 ECAP3
J6 SCI-C Connector
2 GPIO1
J7 GPIO Test Pin Open 4 GPIO3
6 GPIO4
Transformer T1 Open T1 Not Used
J8 Open
Selection Close T1 Is Used
1-2 SCI-B to USB
J11, J12 SCI-B, SCI-C Selection Open 2-3 SCI-B to J6
3-4 SCI-C to J6
SPI/McBSP to PGA 1-2 SPI to PGA
J13, J14, J15, J16 1-2
Selection 3-4 McBSP to PGA
Open Mains Not Connected
J10, J17 AC Mains Close
Close Mains Connected
M3 AFE Daughter Card Connector
JP1 Power Supply Connector
TB1 Power Line Connector
Table 2 PLC Dock Connector/Jumper
USB/JTAG/SCI
Macro Descriptions Default Position Options
J1 Boot Selection Open Open Boot from Flash
Close Boot from SCI-A
J2 JTAG Connector
J3 N/A Open Connected to GPIO34
USB/SCI-B Open SCI-B Not Connected to USB
J4 Close
Selection Close SCI-B Connected to USB
Table 3 PLC USB/JTAG/SCI Macro
9
2.0 Using Demo Application
The PLC Quality Monitor GUI diagnostic tool - PQM is the window to the PLC-DK user to provide graphical
displays, system information, PHY and MAC parameter configurations and statistics.
Graphical Displays
o PHY Parameters – PHY parameters configuration (see details below)
o RSSI graph – Plot is in dBuV. Note this is limited between 70 dBuV and 98 dBuV.
o SNR graph – Plot is in dB.
10
o Bit Error Rate graph – Plots of PHY layer bit error rate, one line for each MCS (only
applicable to PHY test mode operation)
o Packet Error Rate graph – Plots of PHY layer packet error rate, one line for each MCS
PHY statistics – This panel provides statistics in the physical link.
MAC statistics – This panel provides statistics in the MAC and CL layers
Transfer statistics – This panel provides statistics when file transfer is in operation.
System Information – This panel provides system version information and PHY/MAC/CL IPv4/LLC
configurations.
Note that the only selection that should be changed is the port number and baud rate (in red box above).
The rest of the port settings should not be modified for PLC device compatibility.
11
The following describes the configuration settings:
12
o When selected or enabled, the PLC device will set message header RPY bit to 1 during
DATA_TRANSFER message used for Data.Indicate (Rx Data Path) to provide flow control for
host device. (Host has to send an ACK to PLC before next DATA_TRANSFER.Indicate will be
sent to host).
Serial Ports
o Data port
The Data Port is the serial port the PLC device used for host and PLC communication
following “plcSUITE host message protocol”. This can be either SCI-A or SCI-B on
Rev C. hardware and newer. This port is used by a host application (hostAPPEMU)
to communicate with the PLC device.
o Diagnostic port
The Diagnostic Port is the serial port the PLC device uses to transfer diagnostic
messages to the PLC Quality Monitor or Logger Tools. This can be either SCI-A or
SCI-B on Rev C. hardware and newer. If using IEC432/LLC, the Diagnostic port can
be shared with Data port if required, however, if using IPv4, the Data port and
Diagnostic port must be different and cannot be shared.
Note that SCI-B shall not be selected for docking board HW prior to Revision C
System
o Serial Number
The hexadecimal serial number of the PLC device, entered as ####-####-####,
where # can be 0-9, a-f.
o EUI address
The hexadecimal EUI-48 of the PLC device, entered as ##:##:##:##:##:##, where #
can be 0-9, a-f.
PHY
o FLEX – FLEX PHY normal mode
o FLEX ROBO – FLEX PHY robust mode
MAC
o Default ARQ enabled: ARQ is enabled by default
o Default PAC enabled: Packet Aggregation disabled by default
o Rx Max Hold PPDU: maximum number of PPDUs Rx MAC can hold
o Maximum number of connection: default maximum number of simultaneous connections
o Maximum connection queue length: default maximum queue sizes
o Default Security profile
IEC61334-4-32 LLC
o Src LSAP – The local LSAP involved in the data unit transmission
o Default destination LSAP
The default destination LSAP used by the eAppEMU when in eAppEMU interfaces
with IEC61334-4-32 LLC
o Default destination MAC address
13
The default destination node address used by the eAppEMU when in eAppEMU
interfaces with IEC61334-4-32 LLC
The following example illustrates how to change the device type from “IEC432-LLC” to “Point-to-Point”:
The following window will pop up and selecting “YES” will reset the PLC device and new device mode will be
in effect.
14
2.4 Getting System Information
The Get System Info option (Menu->Options->Get System Info) retrieves the current System Information
values from the PLC-DK. These are represented in the System Information view. These values may be set
using the Set System Config (Menu->Options->Set System Config).
15
Note that if both transmit and receive PLC LQM tool is running on the same PC, it is
recommended to use a larger update periods (e.g. 3 seconds) to avoid too many
traffic between device and host PC.
Note that the enabling of PHY “Test Mode” on the Transmit or Receive would require the device mode to be
“Point to Point”. The following window will be prompted if device is not already in “Point to Point”. Click
“Yes” to reset the device and “Point to Point” mode will be set. The PHY test can now be continued,
16
The following describes the PHY TX parameters that can be configured :
ROBO – PHY Robust mode (non-FLEX standard)
PRM – This is not supported. Do not select.
Modulation – DBPSK, DQPSK, D8PSK. Note this field is ignored if sweep MCS is selected. If ROBO
mode is selected, then DBPSK + 1/4 repetition or DBPS + 1/8 repetition can be selected.
FEC - ON or OFF. Note this field is ignored if sweep MCS is selected. If ROBO mode is selected,
this field is not valid since FEC is always on.
Level – Transmit Level
(Note that the maximum transmit level should be set to 2 for AFE HW prior to Revision C)
0 : Maximum Output Level (MOL)
1 : MOL – 3dB
2 : MOL – 6dB
3 : MOL – 9dB
4 : MOL – 12dB
5 : MOL – 15dB
6 : MOL – 18dB
7 : MOL – 21dB
The following describes the PHY TX parameters that can be configured for PHY Tx test mode only:
Test Mode - When enabled, it configures the transmitter in test mode and it transmits fixed
data pattern (selected in data pattern box) for BER testing
Sweep MCS – When enabled, test will sweep through all MCS for the packets transmitted. The
order of MCS used is DBPSK, DQPSK, D8PSK, DBPSK+FEC, DQPSK+FEC and D8PSK+FEC.
Sweep PPDU length - When enabled, test will sweep through all valid PPDU length in increasing
order for the MCS used.
Continuous – When enabled, test will continuously transmit PPDUs as specified. When disabled,
test will transmit the “Number of PPDUs per setting” (see below) as specified and stop. .
Data Pattern – When PHY test mode is enabled, data pattern for the packet payload to be
transmitted can be selected. The following data patterns are available:
17
PPDU length – PPDU length in bytes. Note this field will be ignored when sweep PPDU length is
selected. The current firmware version supports a PPDU length of 1 byte to maximum of 500
bytes. It is also governed by maximum length allowed for the selected modulation scheme.
Inter-PPDU time – The gap time between PPDU in unit of 10 microseconds.
Number of PPDUs per setting – The number of PPDU per setting during MCS sweep, PPDU
length sweep or MCS/PPDU length sweep.
The following describes the PHY Rx Parameters can be configured in PHY Rx Test mode only:
Test Mode - When enabled, receiver will start comparing receive packet using the data pattern
selected and compute BER for BER testing.
Data Pattern – When test mode is enabled, it can select data pattern used for comparison in
computing BER. A ramp data patter from 0 to 255 or a fixed data byte set by octet value. Note
this should be identical to the selection in the transmitter for valid BER result.
18
MAC PIB (PRIME standard Section 4.5.1 – MAC variable attributes) can be retrieved as follows (Menu-
>Function->Get MAC PIBs):
19
2.9 Configuring Connection Parameters
Note AES and PAC should not be used for this release
Once a connection is opened, the “Open” button will change to “Close”. The “Refresh” button will
refresh the dialog based on the current firmware Test Connection status, i.e., if the Test Connection is
open or closed.
1. Cenelec A/B/C/D and FCC band with fixed bandwidth of 24 kHz in step of 976.5
Hz.
20
3. Sub-10kHz with fixed bandwidth of 3 kHz in step of 122 Hz.
The following table lists the frequency band configuration and tone selection
commands:
Note: The default TMDSPLCKIT-V2 AFE HW supports Cenelec A band only (35-90 kHz). Special
AFE HW is required for other frequency bands. They are provided based on request.
21
The default setting when running flex (flex_iec432_flash) at power up uses
configuration 1 with:
1. Enter the command “0xF7 0x00 0x40”. Note this selects the starting tone index
to be 64. Or if command “0xF7 0x01 0x00” is used, the starting tone index is
256.
1. Enter the command “0xF5”. Note this changes the operation to Cenelec A band
with fixed bandwidth of 12 kHz and tone spacing of 488 Hz.
22
2. Click the “Send” button.
The following table lists the command and the corresponding frequency bands when
configuration 1 is selected:
23
0xF7 0x00 0x39 55.66 79.10
0xF7 0x00 0x3A 56.64 80.08
0xF7 0x00 0x3B 57.62 81.05
0xF7 0x00 0x3C 58.59 82.03
0xF7 0x00 0x3D 59.57 83.01
0xF7 0x00 0x3E 60.55 83.98
0xF7 0x00 0x3F 61.52 84.96
0xF7 0x00 0x40 62.50 85.94
0xF7 0x00 0x41 63.48 86.91
0xF7 0x00 0x42 64.45 87.89
0xF7 0x00 0x43 65.43 88.87
0xF7 0x00 0x44 66.41 89.84
0xF7 0x00 0x45 67.38 90.82
0xF7 0x00 0x46 68.36 91.80
Cenelec B Band
0xF7 101 98.63 122.07
1. Cenelec A/B/C/D and FCC band with fixed bandwidth of 12 kHz in step of 488.28
Hz (upto ~500 kHz). The same command “0xF7” as described above for
selecting starting tone can be used.
“0xf8 X1 X2 Y1 Y2 L”
For example, to transmit signal from tone index 400 to 800 with level 5 will be:
“0xf8 0x01 0x90 0x03 0x20 5”
24
The PHY performance can be tested in a point-to-point configuration where system configuration steps
described on Section 2.3 should be used. One modem should be configured as transmitter in test mode and
the other modem as receiver in test mode (Menu->Options->PHY Parameters). The HW should be set up as
described in Section 3.1. An example for PHY test with DBPSK+FEC, transmitting at level -9 dB, PPDU length
of 100 bytes and inter-PPDU interval of 100 us in continuous mode is shown.
Note it does not support concurrent bi-directional data transfer.
Note that the enabling of PHY “Test Mode” on the Transmit or Receive would require the device mode to be
“Point to Point”. The following window will be prompted if device is not already in “Point to Point”. Click
“Yes” to reset the device and “Point to Point” mode will be set. The PHY test can now be continued,
By enabling the channel status and link quality report and setting report period (as described in Section 4.2),
the PHY performance (SNR/RSSI/PER/BER) will be displayed in the graphs and the statistics will be displayed
in the statistics panel.
25
The Send Message function (Menu->Function->Send Message) sends a small text message from the one
device to another in point-to-point configuration. It is intended to test and verify communication between
the two systems in a point-to-point configuration.
Note that this operation would require the device mode to be “Point to Point”. On the transmitting device,
the following window will be prompted if device is not already in “Point to Point”. Click “Yes” to reset the
device and “Point to Point” mode will be set. Message send can then be continued,
On the receiving device, the device mode must be set to “Point to Point” following steps described in
Section 2.3
Note that the connection type such as ARQ enabled, PAC enabled or security profile used for the message
send can be modified via System configuration settings using steps described in Section 2.3.
When this option is selected, you may fill in a message and press send, and the other host will display the
message.
Note that the connection type such as ARQ enabled, PAC enabled or security profile used for the message
send can be modified via System configuration settings using steps described in Section 2.3.
26
On the receiving device, the device mode must be set to “Point to Point” following steps described in
Section 2.3
Note that the connection type such as ARQ enabled, PAC enabled or security profile used for file transfer
can be modified via System configuration settings using steps described in Section 2.3.
This function is not a guaranteed error-free delivery (the file received may have dropped packets) and is a
means to push data from one board to another. The receiver will note both payload CRC and missing packet
errors and will attempt to notify the sender of these errors.
There are two modes for file transfer, stream and non-stream. Stream mode streams packets to the
receiver without waiting for the receiver to acknowledge receipt. A No NACKS option is also allowed in
stream mode. If un-selected, it requests receiver to only send NAKs when there is error. In non-stream
mode the receiver must ACK each packet before the sender will send the next.
The packet size may also be specified. This value represents the total packet size, including any protocol
headers. If an invalid size is entered, when Send is pressed, the following error will be displayed.
Once the file transfer begins, the Transfer Information section reflects transfer statistics.
27
Statistics may be cleared by selecting “File/New” or by pressing the New File button.
The transfer may be aborted by either the sender or receiver. The sender may abort by pressing the Abort
button and the receiver may abort by selecting the menu option “Functions/Abort file receive”.
28
2.14 Flash Firmware
The flash firmware function (Menu->Function->Flash Firmware) downloads the new firmware image to the
DSP control card (instead of via JTAG using CCS flash programming as described in Appendix B).
Note if this is the first time running the “Flash Firmware” function on an old HW (RevB and older), the
procedures described in Error! Reference source not found. should be completed first before continuing.
For example, the “Flex_appemu_sn_flash.srec” should be used for the FLEX service node test
29
2. After Flash is erased, you will see the programming is in progress (packet by packet).
3. After programming is complete, you will see the following window. The new downloaded firmware
will boot up.
30
3.0 System Trouble Shoot
3.1 Trouble shoot for squirt
The Serial Port is muxed by a driver called Squirt. The driver’s interface is on the windows taskbar. There
may be times that the driver has to be reset because no data is being forwarded to/from the applications.
To reset the Squirt driver, either right click the Squirt Taskbar Icon and select “Reset” or double click the
Squirt Taskbar Icon (which will momentarily turn green to indicate reset).
In the event of application exception (conditions where the applications have encountered a severe error
and is terminated), the Squirt Driver may require termination cleanup. When this occurs, you must exit any
PLC Host tools (PQM, Logger, etc.) and terminate the Squirt Driver by selecting all Squirt tasks (both
SQUIRT*.exe and SquirtSerialPort.exe) from the Task Manager and ending their process.
31
Note that the enumerated COM port needs to be lower than “COM19”. If not, it can be changed by selecting
the corresponding serial port, right click and click on “properties”. Then select the “features” panel and the
COM port can changed.
Note that it is recommended to power off the device prior to unplugging the USB serial dongle from the
PC.
3.3 Trouble shoot for PLC LQM Diagnostic Tool to Device Communications
To check that the PLC LQM tool is communicating to the device, check that it can read system
information following steps in Section 2.4.
If USB serial converter is being used, check that the correct COM port has been selected. Note that
the COM port may not be enumerated to the same port number when its unplugged an re-
plugged or a new USB port is being used.
If PLC LQM tool has previously been communicating to the device and it was kept opened while
device has been reset or power cycled, it is recommended to close the PLC LQM tool and re-
opened.
32
APPENDIX A – Code Composer Studio Installation and Setup
33
APPENDIX B - PLC-DK Hardware Resource Usages
Table 4 PLC-DK GPIO pins configurations
34
Peripherals Flex Build Usage Interrupt
32-bit CPU Timers
1. During packet transmission
- Trigger Tx DMA to ePWM/HRPWM @ 500 kHz
2. CSMA
Timer 0 - Track FLEX frame structure PIE 1.7
Timer 1 Absolute timer (FLEX PHY Time Stamp)
Timer 2 DSP-BIOS Systick INT14
Watchdog Timer
TBD (Reset)
ADC
Rx ADC samples @ 250 kHz
McBSP
McBSPB PGA controls (in SPI mode)
SCI
PIE 9.1 - Rx
SCIA Diagnostic port PIE 9.2 - Tx
PIE 9.3 - Rx
SCIB Host port PIE 9.4 - Tx
SPI
SPIA PGA controls (optional)
I2C
Interface to EEPROM
eCAP
eCAP1 Zero crossing measure
eCAP2 Zero crossing measure
ePWM
ePWM1 Tx sample (integer part)
ePWM2 Tx sample (integer part)
HRPWM
Tx sample (fractional part)
DMA
Channel 1 ADC PIE 7.1
Channel 2 PWM PIE 7.2
Channel 3 PWM
35
MEM/MIPS BenchMark
FLASH 139 kB
RAM 68 kB
MIPS Average 95 MIPs
36
APPENDIX C – Logger Setup
A PLC Event Logger can be used for diagnostic purpose. Set up communication Port (via Logger
Settings).
Goto View
Click on Settings
Select the check box for PLC Logger 1(COM1)
Highlight PLC Logger 1
37
Click Setup and select communication port used for connecting to the serial connection on the
docking board. In this example, it uses COM1 port.
38
Click on Setup and configure serial port as follows:
39
APPENDIX D – PHY Example Project
The PHY examples demonstrate the calling of PHY library API when HW is setup with 2 devices connected
via power line. One device will send one packet and wait for one receive packet and then transmit another
packet. This alternates between Tx and Rx. The packet is of size of 756 bytes with a repeating ramp data
pattern using the followings:
Modulation: DQPSK with FEC enabled
PPDU payload length: 63 symbols
1. Unzip ti_Flex_phy_example.zip
2. In CCS, open Flex phy test project phy_tx_rx_bios.pjt (Menu Project->Open –
test_tx_rx\test_tx_rx_bios.pjt)
3. In CCS, Build project (Menu Project->Build Clean)
4. In CCS, Reset target (Menu Debug->Reset CPU)
5. In CCS, Load phy_tx_rx_bios.out (refer to section Appendix B: Download binary to F28335 Flash)
Attach the JTAG to the board and connect (Debug->Connect)
Flash the board (Menu Tools/F28xx On-Chip Flash Programmer)
Verify the Clock Configuration Settings.
Under Operation, enter the filename to program, or press the “Browse” button to
locate the .out file)
Press the “Execute Operation” button
6. In CCS, Reset, Run (Menu Debug->Run) and LED flashes.
7. Load the same code to the second board.
8. Connect the two boards via power line cables. Both boards should be alternating between Rx and Tx
and the LEDs should be blinking.
40
Source File Description
• Test bench
– Project file: test_tx_rx_bios.pjt
– Test bench: test_tx_rx_bios.c and test_phy_swi.c demonstrates alternating FLEX PHY Tx and PHY rx
using provided PHY library
– Linker command:test_tx_rx_BIOS_flash.cmd
– Test example for flash
• Header files
– PHY common: phy.h
– PHY Tx: phy_tx.h
– PHY Rx: phy_rx.h
– HAL: hal_afe.h
– Chip support library header files
• Libraries
– PHY lib: phy_flex_lin.lib
– HAL lib: hal_afe_150.lib
– Chip Support lib: csl_150_noFPU.lib
• The PHY library example project demonstrates packet transmission and reception at the physical
layer in a TDD fashion.
• Sequence of operation
– Board A sends a packet
– Board B receives packet and sends a packet back to board A
– This will be repeated.
– LED on DSP control card will blink if packet transmission and reception is ongoing
DMA Channels
o Channel 1 – Receive ADC input
o Channel 2 – Transmit PWM_1A output
o Channel 3 – Transmit PWM_2A output
CPU Timers
o Timer 0 – PHY
o Timer 1 – FLEX PHY System Timer 20-bits in 10us increment
o Timer 2 – Not Used
GPIO
41
a. GPIO 00 – PWM_1A
b. GPIO 02 – PWM_2A
c. GPIO 12 – OPA Enable
• AFE initialization
– HAL_afeTxInit
– HAL_afeRxInit
-PHY_rxPpduRelease
- LED toggle
42
Start packet transmission
– PHY_txPpdu(&PHY_tx_ppdu_s, cb_tx);
ISR Descriptions
• DMA1 Channel ISR – Incoming ADC samples ready for process @ symbol rate
/* post RX SWI */
SWI_inc(&SWI_PHY_RX);
/* Post TX SWI */
SWI_inc(&PHY_TX_SWI);
Tx SWI
PHY_TX_SWI() -- Calls PHY API for TX symbol processing (PHY_txSmRun()).
Rx SWIs
43
• PHY_RX_SWI() -- Wait for DMA channel 1 ready (incoming ADC samples ready)
– Perform PHY Rx symbol processing
• PHY_rxSmRun()
44