This chapter describes the MTi 1-s pinout and gives details about the supported communication interfaces.
.png?Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9kemY4dnF2MjRlcWhnLmNsb3VkZnJvbnQubmV0L3VzZXJmaWxlcy8yNzc1NC8zNTEzNS9ja2ZpbmRlci9pbWFnZXMvcXUvaW1hZ2UoNjgpLnBuZyIsIkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTc2NTgzODYzNX19fV19&Signature=jK2r7rJixUMDI6IAmMunZC~e-b~ku5BK6G713wR6D4MP8Fs00Io8HSxBIzARPJqG5JTk0A3Dxet3663whwregpcqQ0zQFFLB2NGL01ZOwP-L9aNquUQfl5ioEwyEQP5M5Q8VUguJK~E3CQ94uz~PmbGtpXJg5yHks-P5xtVaCPfkfwW8k1XY3O5eCDu4aVJdLQh5lCIqYIjxCqdXrd4meeyXhzuOerKFndKYBJ9KGnwlYiUsQXwQr~kD1LmeiaMIJsYkKMNtjCiwO~LnwRbsvPiKu7sXqzOPPMBJsBprS8~iAW4gxZ2e8Y4lHjw7~XYS6IS1FO9pjn9wQNdNAVhZ8A__&Key-Pair-Id=K2TK3EG287XSFC)
Pin configuration of the MTi 1-series module (top view)
The pin map depends on the peripheral selection, as can be seen in the table below. Configuring the peripheral is explained in #Peripheral interface selection.
Pin mapping for peripheral selection
|
|
PSEL: I2C |
PSEL: SPI |
PSEL: UART half duplex |
PSEL: UART full duplex |
|
1#1 |
AUX_SCK/DNC |
AUX_SCK/DNC |
AUX_SCK/DNC |
AUX_SCK/DNC |
|
2 |
DNC |
DNC |
DNC |
DNC |
|
3 |
DNC |
DNC |
DNC |
DNC |
|
4 |
GND |
GND |
GND |
GND |
|
5 |
VDDA |
VDDA |
VDDA |
VDDA |
|
6 |
nRST |
nRST |
nRST |
nRST |
|
7 |
VDDIO |
VDDIO |
VDDIO |
VDDIO |
|
8 |
GND |
GND |
GND |
GND |
|
9 |
DNC |
SPI_nCS |
DNC |
DNC |
|
10 |
ADD2#2 |
SPI_MOSI |
DNC |
DNC |
|
11 |
ADD1#2 |
SPI_MISO |
DNC |
DNC |
|
12 |
ADD0 |
SPI_SCK |
DNC |
DNC |
|
13 |
GND |
GND |
GND |
GND |
|
14 |
PSEL0 |
PSEL0 |
PSEL0 |
PSEL0 |
|
15 |
PSEL1 |
PSEL1 |
PSEL1 |
PSEL1 |
|
16 |
SYNC_IN |
SYNC_IN |
SYNC_IN |
SYNC_IN |
|
17 |
RESERVED |
RESERVED |
RESERVED |
RESERVED |
|
18#1 |
AUX_RX/DNC |
AUX_RX/DNC |
AUX_RX/DNC |
AUX_RX/DNC |
|
19#1 |
AUX_TX/DNC |
AUX_TX/DNC |
AUX_TX/DNC |
AUX_TX/DNC |
|
20#1 |
SYNC_PPS/DNC |
SYNC_PPS/DNC |
SYNC_PPS/DNC |
SYNC_PPS/DNC |
|
21 |
DNC |
DNC |
DE |
RTS |
|
22 |
DRDY |
DRDY |
nRE |
CTS#3 |
|
23 |
I2C_SDA |
DNC |
UART_RX |
UART_RX |
|
24 |
I2C_SCL |
DNC |
UART_TX |
UART_TX |
|
25 |
GND |
GND |
GND |
GND |
|
26#1 |
AUX_nCS/DNC |
AUX_nCS/DNC |
AUX_nCS/DNC |
AUX_nCS/DNC |
|
27#1 |
AUX_MOSI/DNC |
AUX_MOSI/DNC |
AUX_MOSI/DNC |
AUX_MOSI/DNC |
|
28#1 |
AUX_MISO/DNC |
AUX_MISO/DNC |
AUX_MISO/DNC |
AUX_MISO/DNC |
[1] AUX and SYNC_PPS pins are only available on MTi-7/8.
[2] I2C addresses, see #List of I2C addresses.
[3] CTS cannot be left unconnected if the interface is set to UART full duplex. If HW flow control is not used, connect to GND.
|
Name |
Type |
Description |
|---|---|---|
|
Power Interface |
||
|
VDDA |
Power |
Analog power supply voltage for sensing elements |
|
VDDIO |
Power |
Digital supply voltage. Also used as I/O reference. |
|
Controls |
||
|
PSEL0 |
Selection pins |
These pins determine the signal interface. See #Peripheral interface selection. Note that when the PSEL0/PSEL1 is not connected, its value is 1. When PSEL0/PSEL1 is connected to GND, its value is 0. |
|
PSEL1 |
||
|
nRST#nrst note |
|
Active low reset pin. Only drive with an open drain output or momentary (tactile) switch to GND. During normal operation this pin must be left floating, because this line is also used for internal resets. This pin has an internal weak pull-up to VDDIO. |
|
ADD2 |
Selection pins |
I2C address selection lines. See #List of I2C addresses.
|
|
ADD1 |
||
|
ADD0 |
||
|
Signal Interface |
||
|
I2C_SDA |
I2C interface |
I2C serial data input/output |
|
I2C_SCL |
I2C serial clock input |
|
|
SPI_nCS |
SPI interface |
SPI chip select input (active low) |
|
SPI_MOSI |
SPI serial data input (slave) |
|
|
SPI_MISO |
SPI serial data output (slave) |
|
|
SPI_SCK |
SPI serial clock input |
|
|
RTS |
UART interface |
Hardware flow control output in UART full duplex mode (Ready-to-Send) |
|
CTS |
Hardware flow control input in UART full duplex mode (Clear-to-Send). If flow control is not used, connect to GND |
|
|
nRE |
Receiver control signal output in UART half duplex mode |
|
|
DE |
Transmitter control signal output in UART half duplex mode |
|
|
UART_RX |
Receiver data input |
|
|
UART_TX |
Transmitter data output |
|
|
SYNC_IN |
Sync interface |
Accepts a trigger input to request the latest available data message |
|
DRDY |
Data ready |
Data ready output indicates that data is available (SPI / I2C) |
|
Auxiliary interface (MTi-7/8 only) |
||
|
AUX_RX |
Auxiliary GNSS interface |
Receiver data input from GNSS module |
|
AUX_TX |
Transmitter data output to GNSS module |
|
|
SYNC_PPS |
Pulse per second input from GNSS module |
|
|
AUX_nCS |
Auxiliary SPI interface |
SPI chip select output |
|
AUX_MOSI |
SPI serial data output (master) |
|
|
AUX_MISO |
SPI serial data input (master) |
|
|
AUX_SCK |
SPI serial clock output |
|
The MTi 1-series module supports UART, I2C, and SPI interfaces for host communication. The host can select the active interface through the peripheral selection pins PSEL0 and PSEL1. The module reads the state of these pins at start-up, and configures its peripheral interface according to the Table below. To change the selected interfaces, the host must first set the desired state of the PSEL0 and PSEL1 pins, and then reset the module. The module has internal pull-ups on the PSEL0 and PSEL1 pins. If these pins are left unconnected, the peripheral interface selection defaults to I2C (PSEL0 = 1, and PSEL1 = 1).
|
Interface |
PSEL1 |
PSEL0 |
|---|---|---|
|
I2C |
1 |
1 |
|
SPI |
1 |
0 |
|
UART half-duplex |
0 |
1 |
|
UART full-duplex |
0 |
0 |
At its core, the module uses the Xsens-proprietary Xbus protocol which is compatible with all Xsens Motion Tracker products. This protocol is available on all interfaces; UART (asynchronous serial port interfaces), I2C and SPI interfaces. The I2C and SPI interfaces differ from UART in that they are synchronous, and have a master-slave relationship in which the slave cannot send data by itself. This makes the Xbus protocol not directly transferable to these interfaces. For this purpose, the module introduces the MTi Synchronous Serial Protocol (MTSSP) protocol, a protocol for exchanging standard Xbus protocol messages over the I2C and SPI interfaces. The below figure shows how MTSSP fits in the module's (simplified) communication architecture. The module has generic Input- and Output-Queues for Xbus protocol messages. For I2C and SPI, the MTSSP layer translates these messages, while for the UART connection, the module transports the messages as-is.
.png?Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9kemY4dnF2MjRlcWhnLmNsb3VkZnJvbnQubmV0L3VzZXJmaWxlcy8yNzc1NC8zNTEzNS9ja2ZpbmRlci9pbWFnZXMvcXUvaW1hZ2UoNjkpLnBuZyIsIkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTc2NTgzODYzNX19fV19&Signature=Hr-Dv7h9Y8pe4fLssacK5NodKHwBPlw--Kk9aOCOSyIokfO7220pIgd4Xa2rVI5tcokh5a0BRVAk06rFZwKHq3eXg5OsiUFdmI7e-bUhRsoGbo5tRDrVzMD5I6Az13d9O5o-seSkGMRaWTOnvT5JEiSwNl-Sv6hTnBUVfK44HhBobGslACXqjOp6rmbPn3XtaYKpTwmJZLdIBefBD9BVPoRa3IgtQujEvYYsj2boU1TvDMtrIheUuZZ6eXZWT8AD0iAWRH4tBbpth6Y~2yu5KrrjQfr0vQGNwmR34xS5Mwy6Y45gyFwOXytszqBwOlDmOgdUomdUk2TkR256th8KJw__&Key-Pair-Id=K2TK3EG287XSFC)
Communication architecture of MTi 1-series module (simplified)
The Xbus protocol is Xsens’ proprietary protocol for interfacing with the MTi 1-series. The MT Low Level Communication Protocol Documentation is a complete reference for the protocol. For a better understanding of the MTSSP explanation, the advice is to read the protocol reference first.
This Section specifies the MTi Synchronous Serial Protocol (MTSSP). The MTi 1-series module uses MTSSP as the communication protocol for both the I2C and SPI interfaces. The embedded example codes, which can be found in the MT SDK folder of the MT Software Suite, provide a reference implementation for the host side of the protocol.
Data flow
MTSSP communication happens according to the master-slave model. The MTi 1-series module will always fulfill the slave-role while the user/integrator/host of the module is always the Master. The Master always initiates and drives communication. The Master either writes a message to the module, or reads a message from the module.
The figure below shows the data flow between the host (Master Device), and the MTi 1-s (Slave). The Master can control the Module by sending Xbus messages to the Control Pipe. The Module considers the bytes received in a single bus transfer to be exactly one Xbus message. The MTi 1-s places the received message in the Input Queue for further handling. The Xbus Interpreter handles the messages in the Input Queue, and places the response messages in the Output Queue. The Master Device can read these response messages from the Notification Pipe.
The Master can switch the Module between configuration and measurement mode by sending the usual GotoConfig and GotoMeasurement (reduced Xbus) messages to the Control Pipe. When placed in Measurement mode, the module will place the generated measurement data (MTData2) in the Measurement Pipe. The Master Device has to read the Measurement Pipe to receive measurement data.
For the Master to know the size of the messages in the Notification and Measurement pipes, it can read the Pipe Status. The Pipe Status contains the size in bytes of the (single) next message in both the Notification and Measurement pipes. The Master can tweak the behavior of the protocol by writing the Protocol Configuration. The Master can also read the Protocol Configuration to check current behavior, and get protocol information.
Note: Both the Measurement Pipe and the Notification Pipe have limited sizes and can therefore only contain a limited number of (reduced) Xbus messages. The amount of messages that can be contained in the pipes depends on the size of the individual messages. Both pipes act as a First-In-First-Out (FIFO) buffer: When reading from either pipe, the oldest message in the pipe will be read first. Once the pipe is full, a newly produced message will be discarded by the MTi 1-s and a (reduced Xbus) error message (data overflow, 0x42 0x01 0x29 0x95) will be added to the Notification Pipe. It is therefore important for the host to read out new messages in time, such that the pipe will not fill up, resulting in lost measurement data or notifications.
For best practices for I2C and SPI communication, please see BASE: Best practices I2C and SPI for MTi 1-series
.png?Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9kemY4dnF2MjRlcWhnLmNsb3VkZnJvbnQubmV0L3VzZXJmaWxlcy8yNzc1NC8zNTEzNS9ja2ZpbmRlci9pbWFnZXMvcXUvaW1hZ2UoNzApLnBuZyIsIkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTc2NTgzODYzNX19fV19&Signature=RtySxhkhQrXU314pwRlQjJvQ3Gb8efabuXKTiruZKa4tx~UhydFeoqrgLPu-VPmX2aqRLuyMl6c1acNWuU5l3suUFjS0nPq-FxTbDG0-I6r7a~CQL4YTAhECnADVjpCe6a92icgJU6timobqqSEeL6yNDCmoP6bLhgs~SrMJW-YrPQLOsQa9jkQyTuvX-08AQbr0IBJ8bhJEiKJqd-GBptKjHPWzHCIJ1kifTXc3UICCkhMz2~ndlsNYjHz8~jPI2yraanpWEu30pG~ZecpbiO2banF~ugejJ6zQMhjqSlyNv09D9xEDCfttxfUX0RptEhtign8GeCvKheGmtiIHRw__&Key-Pair-Id=K2TK3EG287XSFC)
Data flows within MTSSP
Data ready signal
The Data Ready Signal (DRDY) is a notification line driven by the module. Its default behavior is to indicate the availability of new data in either the Notification or the Measurement pipe. By default, the line is low when both pipes are empty, and will go high when either pipe contains an item. As soon as the Master has read all pending messages, the DRDY line will go low again.
The Master can change the behaviour of the DRDY signal using the Procotol Configuration. Please refer to the description of the ConfigureProtocol opcode (#List of defined opcodes) for more information.
Opcodes
The Master starts each transfer with an opcode. The opcode determines the type of the transfer. The defined opcodes are as listed in the table below. Following the opcode, and depending on whether it is a read or write transfer, the Master either reads or writes one or more data bytes. The specific transfer format depends on the underlying bus protocol (I2C or SPI).
For some opcodes, the MTSSP uses reduced Xbus messages. A reduced Xbus message is a regular Xbus message with the preamble and busID fields removed to save bandwidth. These fields correspond to the first two bytes of a regular Xbus message. The calculation of the checksum for a reduced Xbus message still includes the busID and assumes its value to be 0xFF. For an overview of available Xbus messages, refer to the MT Low Level Communication Protocol Documentation.
|
Opcode |
Name |
Read/Write |
Data format |
Description |
|---|---|---|---|---|
|
0x01 |
ProtocolInfo |
Read |
Opcode defined |
Status of the protocol behaviour, protocol version |
|
0x02 |
ConfigureProtocol |
Write |
Opcode defined |
Tweak the Protocol, e.g. the behaviour of the DRDY pin, behaviour of the pipes |
|
0x03 |
ControlPipe |
Write |
Reduced Xbus |
Used to send control messages to the module |
|
0x04 |
PipeStatus |
Read |
Opcode defined |
Provides status information for the read pipes |
|
0x05 |
NotificationPipe |
Read |
Reduced Xbus |
Used to read non-measurement data: errors, acknowledgements and other notifications from the module |
|
0x06 |
MeasurementPipe |
Read |
Reduced Xbus |
All measurement data (Xbus: MTData2) generated by the module will be available in the measurement pipe |
ProtocolInfo (0x01)
The ProtocolInfo opcode allows the Master to read the active protocol configuration. The format of the message is as follows (All data is little endian, byte aligned):
|
|
m_version:
|
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
|---|---|---|---|---|---|---|---|
|
VERSION [7:0] |
|||||||
m_drdyConfig:
|
Bits 7:4 |
Reserved for future use |
|---|---|
|
Bit 3 |
MEVENT: Measurement pipe DRDY event enable 0 : Generation of DRDY event is disabled 1 : Generation of DRDY event is enabled (default) |
|
Bit 2 |
NEVENT: Notification pipe DRDY event enable 0 : Generation of DRDY event is disabled 1 : Generation of DRDY event is enabled (default) |
|
Bit 1 |
OTYPE: Output type of DRDY pin 0: Push/pull (default) 1: Open drain |
|
Bit 0 |
POL: Polarity of DRDY signal 0: Idle low (default) 1: Idle high |
ConfigureProtocol (0x02)
The ProtocolInfo opcode allows the Master to change the active protocol configuration. The format of the message is as follows (All data is little endian, byte aligned):
|
|
m_drdyConfig:
|
Bits 7:4 |
Reserved for future use |
|
Bit 3 |
MEVENT: Measurement pipe DRDY event enable 0 : Generation of DRDY event is disabled 1 : Generation of DRDY event is enabled (default) |
|
Bit 2 |
NEVENT: Notification pipe DRDY event enable 0 : Generation of DRDY event is disabled 1 : Generation of DRDY event is enabled (default) |
|
Bit 1 |
OTYPE: Output type of DRDY pin 0: Push/pull (default) 1: Open drain |
|
Bit 0 |
POL: Polarity of DRDY signal 0: Idle low (default) 1: Idle high |
ControlPipe (0x03)
The ControlPipe opcode allows the Master to write messages to the Control Pipe. The bytes following the opcode represent a single (reduced) Xbus message.
PipeStatus (0x04)
The PipeStatus opcode allows the Master to retrieve the status of the module's Notification- and Measurement pipes. The format of the message is as follows (All data is little endian, byte aligned):
|
|
NotificationPipe (0x05)
The Master uses the NotificationPipe opcode to read from the Notification Pipe. The read data is a single reduced Xbus message.
MeasurementPipe (0x06)
The Master uses the MeasurementPipe opcode to read from the Measurement Pipe. The read data is a single reduced Xbus message (MTData2).
The MTi 1-series module acts as an I2C Slave. The User of the MTi 1-series module is the I2C Master.
The user can configure the I2C slave address through the ADD0, ADD1 and ADD2 pins. The module reads the state of these pins at start-up, and configures the slave address according to the table below. The ADD0, ADD1 and ADD2 pins are pulled-up internally, so when left unconnected, the address selection defaults to 0x6B (ADD = 111).
|
I2C address |
ADD2 |
ADD1 |
ADD0 |
|---|---|---|---|
|
0x1D |
0 |
0 |
0 |
|
0x1E |
0 |
0 |
1 |
|
0x28 |
0 |
1 |
0 |
|
0x29 |
0 |
1 |
1 |
|
0x68 |
1 |
0 |
0 |
|
0x69 |
1 |
0 |
1 |
|
0x6A |
1 |
1 |
0 |
|
0x6B (default) |
1 |
1 |
1 |
|
Feature |
Slave Requirement |
MTi 1-series |
|---|---|---|
|
7-bit slave address |
Mandatory |
Yes |
|
10-bit slave address |
Optional |
No |
|
Acknowledge |
Mandatory |
Yes |
|
Arbitration |
N/A |
N/A |
|
Clock stretching |
Optional |
Yes#4 |
|
Device ID |
Optional |
No |
|
General Call address |
Optional |
No |
|
Software Reset |
Optional |
No |
|
START byte |
N/A |
N/A |
|
START condition |
Mandatory |
Yes |
|
STOP condition |
Mandatory |
Yes |
|
Synchronization |
N/A |
N/A |
[4] The MTi-1 module relies on the I2C clock stretching feature to overcome fluctuations in processing time. The Master is required to support this feature.
Writing to the MTi 1-s
Write operations consists of a single I2C write transfer. The Master addresses the module and the first byte it sends is the opcode. The bytes that follow are the data bytes. The interpretation of these data bytes depends on the opcode, as described in #MTSSP.
The maximum message size a module can receive is 512 bytes. If the Master sends more than 512 bytes, the module will reset its receive-buffer, which reduces the received message to consist only of the excess bytes.
The below figure shows the I2C transfer of a write message operation:
.png?Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9kemY4dnF2MjRlcWhnLmNsb3VkZnJvbnQubmV0L3VzZXJmaWxlcy8yNzc1NC8zNTEzNS9ja2ZpbmRlci9pbWFnZXMvcXUvaW1hZ2UoNzEpLnBuZyIsIkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTc2NTgzODYzNX19fV19&Signature=PS39IMrVEXNXxnTqT2U0WNAjV3zX-DOFrTz7ZZt~0ubeSu~OU1BnuEHUuHMZhllHnuPDIPLRLfSKwfCQVZ8smmdUyiEmwvFUaJjkzSfLEo-iEQ04BRpKQQcKh7MTAjn9OAjDY6HSgS0nUGI-cj6WLfs69blGC~J8A6dsNZw-yTA00ZbUwwyFpxX-li~lY0dboSpy9g6Mj0JCA7Oybqdh7iVPDNibzhnn-u6etxf0xhLywK-OeQHkofjRdUNpM2BxUTqiBX5Zgj2v17gwHmNCwybzyZjjgVFHiNADTHvo3hbbao~a9EDVfnXhpjF3vCAkmfsffXSCOqPqeBhJs8FEIA__&Key-Pair-Id=K2TK3EG287XSFC)
I2C write message operation
Reading from the module
To read from the module, the Master first does an I2C write transfer to transmit the opcode. The opcode tells the module what data the Master wants to read. The module then prepares the requested data for transmission. The Master then does an I2C read transfer to retrieve the data. The figure below shows the I2C transfers for the described read method.
.png?Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9kemY4dnF2MjRlcWhnLmNsb3VkZnJvbnQubmV0L3VzZXJmaWxlcy8yNzc1NC8zNTEzNS9ja2ZpbmRlci9pbWFnZXMvcXUvaW1hZ2UoNzIpLnBuZyIsIkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTc2NTgzODYzNX19fV19&Signature=Rdb4Is7lAd3G~0VTsqEw7ZvvS0bQt-Tgmo1CBK1G7TaxwWXUA2OBCYHTolQI78Ve~~KxFAlEYd6u2voa0j0ZGTsyQz1aBpjW8lU-lweohKAlyDw4SHrBe~vUyUCq61UhGiPGgGaReFZETuVb~eTo7EIYWm~2YAx1Hqe0D91vclmSO2BjDpx78GgowEN2j33foOdtp6jiK9BW8FvNP8cfM0R7pSYcOSorNLHAL~Dg7O5r6ooAlSPmJ~D~SIWjkWVLh3LHLNZatteVWy9ND6Uk6jet667ygJyZxoOq2ne~Ht3wHlJSbYW~2F9TL2cIQ6MsOyg3v8lwwVgUOHP7pMtnMQ__&Key-Pair-Id=K2TK3EG287XSFC)
Read message operation with full write transfer and full read transfer (I2C)
Alternatively, the user can perform the read operation using an I2C transfer with a repeated start condition. The below figure depicts this read method.
.png?Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9kemY4dnF2MjRlcWhnLmNsb3VkZnJvbnQubmV0L3VzZXJmaWxlcy8yNzc1NC8zNTEzNS9ja2ZpbmRlci9pbWFnZXMvcXUvaW1hZ2UoNzMpLnBuZyIsIkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTc2NTgzODYzNX19fV19&Signature=FejJDlsPB4WbDwHziafkgCI2NzEZlIoDPBE8XJX8J-HYfujRJL0gnFxJpeotZla0gyWT7iRc05YariWfOmQw9H7X-xDh5kr2-hJfAm-OphLFtboc20a64-SgpRfJXdj1IqyRYe8jYCbLnK6Ncil37SHOpX1QaZrK45naCgdnPQYY54mne-KYaRkw22BdLRf7YjLMr4LLyUgawhcVw-teG25Eb6rEydCrIdGqjBuqF6KGwVwaQgeu7RJUKzT7e-bXSScJph~WVYX99O2mGkSI2esAJyWG6qkFz4MP~Xymes0NxY3cbMVTAoY0cT7yg9PDyUAfK7oDV5juENoNVeKPOw__&Key-Pair-Id=K2TK3EG287XSFC)
Read message transfer using a repeated start condition (I2C)
The Master controls how many data bytes it reads. For reading the Notification- and Measurement Pipes, the number of bytes the Master must read depends on the size of the pending message. In order to determine the correct number of bytes, the Master should first read the Pipe Status to obtain the sizes of the pending messages.
If the Master reads more bytes than necessary, the module will restart sending the requested data from the beginning.
The MTi 1-series module acts as an SPI Slave. The User of the MTi 1-series module is the SPI Master.
SPI Configuration
The MTi 1-series supports 4-wire mode SPI. The four lines used are:
The module uses SPI mode 3: It captures data on the rising clock edge, and it latches/propagates data on the falling clock edge. (CPOL=1 and CPHA=1). Data is clocked-out MSB first. The module uses an 8-bit data format.
Data transfer
The module uses a single type of SPI transfer for all communications. The below figure depicts this basic transfer.
.png?Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9kemY4dnF2MjRlcWhnLmNsb3VkZnJvbnQubmV0L3VzZXJmaWxlcy8yNzc1NC8zNTEzNS9ja2ZpbmRlci9pbWFnZXMvcXUvaW1hZ2UoNzQpLnBuZyIsIkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTc2NTgzODYzNX19fV19&Signature=olHA8yPh~Yjl1c7tVxKrKKvDmOxS7ZR5VBYIcKlx95OgZVzetWROg5i2NioYIgbrfTwXRfD0YmicANU8ztYSMov0RRCTjeEHIuTptyr9F~AA-IGaEKVZ-dpvvXnPimwsRxtYsi0A3iiMb6td69I5SHPG8pta~QNfTh2CUrJsqEg5JfdXRZdtUHxyarSflOr2FSAkpf7UfveFA7xflXUQvFoSgp3nhrXkFBnxsqbtjj-IhbSIWFKDqFyb6oRau-8fZL0J8TFT8cnx1cAC8JSOM98QdfrltJ-PNRm5el~OFjuRBC8C-EoLprXd-3ApAghOVnup0~Ggq1iJukOPqvL6vw__&Key-Pair-Id=K2TK3EG287XSFC)
SPI basic transfer
The Master starts a transfer by pulling the SPI_nCS low, in order to select the Slave. The Master must keep the SPI_nCS line low for the duration of the transfer. The Slave will interpret the rising edge of the SPI_nCS line as the end of the transfer. The Master places the data it needs to transmit on the SPI_MOSI line. The Slave will place its data on the SPI_MISO line.
The Master first transmits the opcode. The opcode determines what kind of data the Master transmits, and what kind of data the Master wants to read from the Slave (see #MTSSP). The second-to-fourth byte the Master transmits are the fill words. These fill words are needed to give the Slave time to select the data it must send for the remainder of the transfer. Both Master and Slave are free to choose the value of the fill words, and the receiving end should ignore their value. However, the first 4 bytes transmitted by the MTi 1-series module (Slave) are always 0xFA, 0xFF, 0xFF, 0xFF.
Following the first four words are the actual data of the transfer. It is the responsibility of the Master to determine how many bytes it must transfer. For reading the Notification- and Measurement Pipes, the number of bytes the Master must read depends on the size of the pending message. In order to determine the correct number of bytes, the Master should first read the Pipe Status to obtain the sizes of the pending messages.
Timing
The table below and figure specify the timing constraints that apply to the SPI transport layer. The Master must adhere to these constraints.
SPI timing
|
Symbol |
Parameter |
Unit |
Min |
Max |
|---|---|---|---|---|
|
T1 |
Slave select to first complete word delay |
μs |
4 |
|
|
T2 |
Byte time |
μs |
4 |
|
|
T3 |
Consecutive SPI transfer guard time |
μs |
3 |
|
|
|
Max SPI bitrate |
Mbit |
|
2 |
.png?Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9kemY4dnF2MjRlcWhnLmNsb3VkZnJvbnQubmV0L3VzZXJmaWxlcy8yNzc1NC8zNTEzNS9ja2ZpbmRlci9pbWFnZXMvcXUvaW1hZ2UoNzUpLnBuZyIsIkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTc2NTgzODYzNX19fV19&Signature=QsvGAmMQgYk3S7OUX-nWstkbxOh0qjUvd6qzgNzfbQd2Yn5a0zJ-i0xF8uMdyxrcjQdiLBHPwN5xYJFzQ9IOlqqCcvbjEpv~VLVt0ioAPdMmSQrPxkP6j7mpjbH-v3zMdD5ZHcnM65qMfVjstKIbRO7Om8ASOD~GU7tFNVvZWCJgiB6XP7yKUgJuH4QEmvi7jfFTGyVSB62C-mfhTx7DXsy~4xXSZJJ3JA0Jb2IXtolWU3i3V6zVe77VjqZT9FKvcNClBJm6O8aTfR6QGzEe7vKGHUXPWb8gTa7gI-IfecCqyiRlOkO88h18p8n5B0SBI-Ar6crQIRut1cNod6cchQ__&Key-Pair-Id=K2TK3EG287XSFC)
SPI timing
The user can configure the MTi 1-series module to communicate over UART in half-duplex mode. The UART frame configuration is 8 data bits, no parity and 1 stop bit (8N1). In addition to the RX and TX pins, the modules use control lines nRE and DE. The modules use these control outputs to drive the TX signal on a shared medium and to drive the signal of the shared medium on the RX signal.
A typical use case for this mode is to control an RS485 transceiver where the shared medium is the RS485 signal, and the nRE and DE lines control the buffers inside the transceiver.
When the module is transmitting data on its TX pin it will raise both the nRE and DE lines, else it will pull these lines low. The below figure depicts the behaviour of the involved signals.
.png?Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9kemY4dnF2MjRlcWhnLmNsb3VkZnJvbnQubmV0L3VzZXJmaWxlcy8yNzc1NC8zNTEzNS9ja2ZpbmRlci9pbWFnZXMvcXUvaW1hZ2UoNzYpLnBuZyIsIkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTc2NTgzODYzNX19fV19&Signature=AYZURXvYn5NOP05NtmlVJbszRPK~Fkj8WNC06K4Ao51LMBIa7IealiQwkPcFdG8BUNqYUxdoEmPrwbQpyUvLF3AoUabBNhB-eRg0c5l07sWqJDzvgRfyF9Kw2h7Ip-6Eu5sJ8dpEiGLS5rY8wgVKevth7VCYpW-JdPct8q3Ubrvj2s53x-8pPlGjpH~QoKOKtJlRQf1FLU~uiYcPDAxYl3-T2L1TsHuVGZROJ3qd3Bu1hKJqvcJI5afx~u4GSZyCk0wKEevNKMacXgs8AyEwqBg5-mOTRuVJe74l5Snklf9zy36wSgbujffg~Z4aUxS4chwg3u6L6bwVU6qhH5Ldtg__&Key-Pair-Id=K2TK3EG287XSFC)
Behaviour of the nRE and DE lines
Note that in this mode the UART of the MTi 1-s itself is still operating full duplex.
The user can configure the MTi 1-s module to communicate over UART in full duplex mode with RTS/CTS flow control. The UART frame configuration is 8 data bits, no parity and 1 stop bit (8N1). In addition to the RX and TX signals for data communication, the module uses the RTS and CTS signals for hardware flow control.
The CTS signal is an input for the module. The module checks the state of the CTS line at the start of every byte it transmits. If CTS is low, the module transmits the byte. Otherwise, it postpones transmission until CTS is lowered. When, during the transmission of a byte, the user raises the CTS signal, then the module completes transmission of that byte before postponing further output. The module will not retransmit this byte. The figure below shows the behaviour of the TX and CTS lines.
.png?Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9kemY4dnF2MjRlcWhnLmNsb3VkZnJvbnQubmV0L3VzZXJmaWxlcy8yNzc1NC8zNTEzNS9ja2ZpbmRlci9pbWFnZXMvcXUvaW1hZ2UoNzcpLnBuZyIsIkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTc2NTgzODYzNX19fV19&Signature=S1UgxcmuBdaudrwMdCEeLV1UVD5REnCMeMJTc11UnLxLckSwjT6ZVRP5rjo28SMJnYTP3oH2QVdBZVaQCZJHFJ5r7AxeXF1lmOlwjNqwkxX2iFLWeuEEv9FGHLzdraFuXA-kVZJtPzvXlcLHxTkq9kK~eff3mlJQMHqM3DtOoHzlo6nx3c0xuaNbR14pP-xphv4~LK0mwM8eD2LRf66L4PCOfZv8NHrQomqdbtxDWVJGIMK2oReVxKiKDY5v9DBpmJfhwAK~1TDTOwdTc53AurZMrTqOtNir15z23yhrgP8lPGUlOsWnHIKSPWL6rJN8gmO3kBphejcORpGMBLkMxQ__&Key-Pair-Id=K2TK3EG287XSFC)
Data transmit behaviour under CTS
The RTS signal is an output for the module. If the RTS line is high, the module is busy and unable to receive new data. Otherwise, the module’s UART is idle and ready to receive. After receiving a byte, the direct memory access (DMA) controller of the module will transfer the byte to its receive first in first out (FIFO) buffer. The module will raise the RTS signal during this transfer. Therefore, with every byte received, the module raises the RTS line quickly. The figure below shows this behaviour.
.png?Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9kemY4dnF2MjRlcWhnLmNsb3VkZnJvbnQubmV0L3VzZXJmaWxlcy8yNzc1NC8zNTEzNS9ja2ZpbmRlci9pbWFnZXMvcXUvaW1hZ2UoNzgpLnBuZyIsIkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTc2NTgzODYzNX19fV19&Signature=FIsSw1QCtcCLJ5AHiRGBuW-zEClSTfMozDqUkMj3zQ~0kL8wuhd~abVw1qf2rKOKvSCktoNFRAOtOWjUO0uj9EelYpePHy~Z5bqAalsTlhkPnRwv0PukiAikWwdWH6CMpbVdU6xtbsYR06pWkx90kVcRGxRx3y1MwoVpRO9OQ3XJgd~uQcz1J-6nfUQnzguvq0ezI4XzGPHRAclXle2I9lCE9gWTFFHTATSKt3WhCOomshKPVgOU5jGUZMgEg6XWCoE9UH~JTVZKW8aH5Vr~cHleeODgJsVrcJJUEn9PqCx5XKe2~MMWskz3VYgyIpjUe1r1M9yuzkJ4dS-cnoq8qA__&Key-Pair-Id=K2TK3EG287XSFC)
RTS behaviour under data reception
The user can use this communication mode without hardware flow control. In this case, the user must tie the CTS line low (GND) to make the module transmit.