SLDU019B December 2015 – March 2016 PGA450-Q1
Use the steps that follow to test the UART connection with the TI GER board.
The description of the TX data packet is as follows:
The description of the RX data packet is as follows:
The function that calculates the checksum is described as follows:
Table 4 provides a checksum calculation of four bytes shown. If the frame has four data bytes of the protected identifier and three data bytes, the calculation is the same. The data = 0x4A, 0x55, 0x93, 0xE5.
Action | Hex | Carry | D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 |
---|---|---|---|---|---|---|---|---|---|---|
0x4A | 0x4A | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | |
+0x55 = Add Carry | 0x9F
0x9F |
0 | 1
1 |
0
0 |
0
0 |
1
1 |
1
1 |
1
1 |
1
1 |
1
1 |
+0x93 = Add Carry | 0x132
0x33 |
1 | 0
0 |
0
0 |
1
1 |
1
1 |
0
0 |
0
0 |
1
1 |
0
1 |
+0xE5 = Add Carry | 0x118
0x19 |
1 | 0
0 |
0
0 |
0
0 |
1
1 |
1
1 |
0
0 |
0
0 |
0
1 |
Invert | 0xE6 | 1 | 1 | 1 | 0 | 0 | 1 | 1 | 0 | |
0x19 + 0.xE6 = | 0xFF | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
The resulting sum is 0x19. Inversion yields the final result of: checksum = 0xE6. The receiving node can check the consistency of the received frame by using the same addition mechanism. When the received checksum (0xE6) is added to the intermediate result (0x19) the sum is 0xFF.
The previously described TX command is called command0 – Sensor Check Command. If the sensor is address 0x01 and the user attempts to communicate with a sensor using a different address, sensor 0x01 gives no response. In the following TX example shown in Figure 7, no response was received as displayed in the RX box because, in this example, command0 was sent to sensor address 0x02.