Datasheet

TMC8462 Datasheet Document Revision V1.5 2019-June-21
161 / 204
Clock polarity Clock phase SPI mode MOSI change MISO sample
0 0 0 SCK falling edge SCK rising edge
0 1 1 SCK rising edge SCK falling edge
1 0 2 SCK rising edge SCK falling edge
1 1 3 SCK falling edge SCK rising edge
Table 198: SPI mode conguration
Bit 4 reverses the bit order in the transmission, the least signicant bit of SPI_TX_DATA (Bit 0) is
transmitted rst, the least signicant bit of SPI_RX_DATA is the rst received bit, the most signicant
bit of SPI_TX_DATA is transmitted last and the most signicant bit of SPI_RX_DATA is the last bit
received.
Bit 3 can be used for datagrams longer than 64 bit. With this bit set, the chip select line is held
low after the transmission, allowing more transmissions in the same datagram. Before the last
transmission, this bit must be set to 0 again so that the chip select line goes high afterwards, ending
the datagram.
Bits 1 and 0 dene which chip select line (which slave) is used for the next transmission.
SPI_STATUS SPI transfer status
Bit 0 of this register is the Ready indicator for the SPI master unit.
When this bit is set, a new transfer can be started. When this bit is 0 and the start of a new transfer
is triggered, the trigger is ignored, the currently active transfer is nished but the new transfer is not started.
SPI_LENGTH SPI datagram length
This register denes the SPI datagram length in bits. Any length from
1 to 64 bits is possible.
SPI datagram length (bits) = SPI_LENGTH+1
SPI_TIME SPI bit duration This register denes the bit length and thus the SPI clock frequency.
The duration of one SPI clock cycle can be calculated as t
SCK
= (4+(2*SPI_TIME))/25MHz = (4+(2*SPI_TIME))*40ns,
the SPI clock frequency is f
SCK
= 25MHz/(4+(2*SPI_TIME)).
The delay between the falling edge of CSN (becoming active) and the rst SCK edge and the last SCK edge
and the rising edge of CSN is always a half SCK clock cycle (t
SCK
/2).
7.12.1 SPI Examples
TMC262 on SPI channel 0
This example shows the conguration of the SPI master unit for a TMC262 as SPI slave 0 and the transfer
of data to the TMC262s DRVCONF register.
1. Use 3.125 MHz SPI clock (25MHz/(4+(2*2))) = (25MHz/8)
SPI_TIME <= 0x02
2. Use 20 bit datagrams
SPI_LENGTH <= 0x13
3. Start on TX write, SPI-Mode 3, MSB rst, single datagrams, Slave 0)
SPI_CONF <= 0x0060
4. Wait until SPI-Master is ready
while (SPI_STATUS & 0x01 != 0x01)
©2019 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com