
TMC2225 DATASHEET (Rev. 1.15 / 2023-FEB-16)
17
4.2 CRC Calculation
An 8 bit CRC polynomial is used for checking both read and write access. It allows detection of up to
eight single bit errors. The CRC8-ATM polynomial with an initial value of zero is applied LSB to MSB,
including the sync- and addressing byte. The sync nibble is assumed to always be correct. The
TMC2225 responds only to correctly transmitted datagrams containing its own node address. It
increases its datagram counter for each correctly received write access datagram.
������������������ = ������8 + ������2 + ������1 + ������0
SERIAL CALCULATION EXAMPLE
CRC = (CRC << 1) OR (CRC.7 XOR CRC.1 XOR CRC.0 XOR [new incoming bit])
C-CODE EXAMPLE FOR CRC CALCULATION
void swuart_calcCRC(UCHAR* datagram, UCHAR datagramLength)
{
int i,j;
UCHAR* crc = datagram + (datagramLength-1); // CRC located in last byte of message
UCHAR currentByte;
*crc = 0;
for (i=0; i<(datagramLength-1); i++) {
currentByte = datagram[i];
for (j=0; j<8; j++) {
if ((*crc >> 7) ^ (currentByte&0x01))
{
*crc = (*crc << 1) ^ 0x07;
}
else
{
*crc = (*crc << 1);
}
currentByte = currentByte >> 1;
} // for CRC bit
} // for message byte
}
// Execute for all bytes of a message
// Retrieve a byte to be sent from Array
// update CRC based result of XOR operation
4.3 UART Signals
The UART interface on the TMC2225 uses a single bi-direction pin:
UART INTERFACE SIGNAL
PDN_UART
Non-inverted data input and output. I/O with Schmitt Trigger and VCC_IO level.
The IC checks PDN_UART for correctly received datagrams with its own address continuously. It adapts
to the baud rate based on the sync nibble, as described before. In case of a read access, it switches
on its output drivers and sends its response using the same baud rate. The output becomes switched
off four bit times after transfer of the last stop bit.
TMC22xx
(R/W access)
TMC22xx #1
(write only access)
TMC22xx #2
(write only access)
Master CPU
(µC with UART)
TXD
1k
RXD
Master CPU
(µC with UART)
TXD
Figure 4.1 Attaching the TMC2225 to a microcontroller UART
www.trinamic.com











































































