User Manual

35
CHAPTER 6
Matrix Application Guide
6.1 Overview
This Chapter describes the essentials for using the host protocol to configure
and use a Matrix module in an application. Please refer to Host Protocol
Document for Further Details on messaging.
6.1.1 Host Protocol
The host protocol that is used to communicate with a Matrix module is a
simple binary based protocol. Every message in the protocol consists of a
header, a trailer, and potentially some payload information, which is
consistent with other LSR module data packet structures. With the Matrix
module it is possible to configure the baudrate from 1.2k up to 115.2, and as
such it uses a DMA peripheral in conjunction with the UART so that reliable
data transfers are possible at the higher data rate. In order to simplify
operation of the DMA peripheral when used with the UART, all messages
sent to and received from the Matrix module should additionally have the
“Length” byte repeated as the first byte in a packet (prior to the header).
The header is made up of a start byte (0x01), a length byte that is the length
of the entire message including header and trailer, and a message type that
identifies the intention of the message.
The payload varies from message to message but in general includes things
such as data to be sent or received, or configuration information.
The trailer is made up of a checksum, which the sum of all of the bytes in the
message, starting at the start byte (0x01) and up through the payload, and
an end byte (0x04). Note that the checksum computation does not include
the additional “Length” byte that precedes the start byte.
Every message that the host device sends to the Matrix module has a
complimentary acknowledgement message that will get sent back upon
successful decoding and processing by the Matrix module.
6.1.2 Configuration
After power-up or after receiving a “Reset Request” (type 0x18) message,
the Matrix module will read the configurable parameters from the on-board
microcontroller’s non-volatile FLASH memory, and store them in RAM to be
used from that point on. Changing a parameter by sending the module a
new message does not automatically result in the module saving the
parameter to non-volatile memory, but rather just changes the value stored in
RAM. This allows a particular host application to change the configurable
parameters dynamically without unnecessarily writing to, and shortening the
lifetime of, the non-volatile memory. All of the Matrix module’s configurable
parameters that are stored in RAM can be saved to non-volatile memory by
sending a “Save Configuration Values to Non-Volatile Memory” (type 0x11)
message.