
F_Start
Address
0x68
0x99
0x99
0x99
0x99
0x99
F_Start
0x68
C_cod
e
0x23
Length
len
0
1
2
3
4
5
7
8
9
0x99
6
Header
Data
CS
0x16
0..9
10..len+9
len+10
len+11
Chapter 4
SLAU587 – August 2014
Serial Communication Commands
4.1
Introduction
To enable the EVM to be a useful tool, an external interface is necessary. The EVM uses its UART port
connected to a RS232 DB-9 connector to communicate to the external PC. This section describes the
protocol of the EVM sending out readings and commands.
NOTE:
You can change the provided source code to perform custom communication protocols,
commands, responses, and functions.
4.2
Communication Protocol
During the operation, the EVM communicates with the external host via the serial communication port with
these parameters:
•
9600 bps, No parity, 8 data bit, 1 stop bit
The EVM supports polling mode communication which gives access to the full range of functionality,
reading of complete set of measurement results, reading and writing calibration factors.
4.2.1 Polling Mode
When EVM is running, the EVM waits for a command from the host through the serial port. When the
command frame receives and passes the frame checking, the EVM interprets the command and performs
the requested action. The EVM communicates with the host using a data frame format as shown in
Figure 4-1. Polling Mode Data Frame Format
The frame starts with a 9 bytes header followed by a data field of 0 to 255 byte then a check sum byte
and a frame ending byte.
The header starts with 0x68, followed by an address field which is fixed to 0x999999999999. User can
modify the provided communication protocol source code (emeter-dlt645.c) to make the EVM respond to
different address.
Followed by a fixed delimiter 0x68 and 0x23 is the length byte which indicates the number of bytes in the
Data field. The end of the frame is a check sum byte which is a modulus 256 byte sum of each byte from
the beginning of the header to the end of the data field followed by an end of frame marker 0x16.
23
SLAU587 – August 2014
Serial Communication Commands
Copyright © 2014, Texas Instruments Incorporated