User manual
RS232-ADC16/24
5 Frame layout
This chapter specifies the used frame format. A frame does not contain more
than one command; each command is send together with all of its parameters.
Parameters larger than eight bits are expected in big-endian format, which
means the most significant byte (MSB) is send before the least significant byte
(LSB).
On serial line each byte is send with eight bits, one start bit and one stop bit.
There are no parity bits envolved in communication. The standard baud rate is
115200 baud. At the moment no handshaking is used because the host is
intended to wait for a response before sending a new request. Handshake can
be implemented in further versions as RS232-ADC16/24 provides a fully
populated RS232 connector.
A frame is encoded in an human readable ASCII format. Therefore each byte of
the frame's data is converted into two HEX digits. The converted frame then
consists of one start character, the command and parameters in HEX digits, a
packet LRC – also in HEX digits – and an end character.
Byte
1
Byte
2
Byte
3
Byte
4
Byte
5
... Byte
n-2
Byte
n-1
Byte
n
: Command Parameter
1
LRC <CR>
The end character is a "carriage return" (<CR>, '\r') resulting in hex code 0x0D.
Any addional "new line" (<NL>, '\n', 0x0A) is ignored by device and added to
any response.
Example : Read two ADC channels starting at 0x0001
Request :
:0400010002..<CR><NL>
Response :
:0404XXXXYYYY..<CR><NL>
Note : The first parameter is the byte count of read data, XXXX the value of
channel1, YYYY the value of channel2. LRC checking in requests can be
avoided by setting LRC to "..", replies always have a LRC although it is set to
".." in this example.
Page 6/22