TI 2803x DSP chip LIN communication baud rate adaptation
[Copy link]
Set the ADAPT bit in the SCIGCR1 register to 1 to enable the baud rate adaptation function. During the frame header reception, the slave node can measure the baud rate using the synchronization field. The SCI/BLIN synchronizer determines two counters during the frame header reception: BRK_count and BAUD_count.
The LIN standard protocol specifies 11 Tbits as the threshold for the slave node to detect the gap field (the gap field is at least 13 Tbits dominant). At the fifth consecutive falling edge, BAUD_count can be measured, and from this point, the slave node can calculate the Tbit, that is, BAUD_count/8, or BAUD_count>>3. The detected baud rate can be obtained through the above Tbit, and the user-programmed baud rate can be obtained through the baud rate configuration register.
MBRS is used to measure BRK_count and BAUD_count, and automatically adapts to any allowed LIN bus baud rate. When detecting the gap field, since this part is always at a dominant level with no level change, could the Tbit used by BRK_count be the Tbit corresponding to MBRS, i.e. 20kbps?
If the synchronization field is not detected within the given tolerance range, the mismatched synchronization field error (ISFE) flag will be set. If the ISFE interrupt is enabled, the ISFE interrupt will be triggered. Once a valid gap field (more than 11 Tbits) is detected, the receiver state machine will reset to receive the new frame. This reset condition is only valid in the response state. During the frame header reception process, if an additional gap field appears, a reset should not occur.
-------------------------------------------------- -------------------------------------------------- ---------------
The above is the theoretical part. Later, a LIN baud rate adaptation test was done. After the baud rate adaptation function is turned on, the value in the baud rate configuration register BRSR will change according to the test result. However, it is found that its reliability is not good and it is easy to make mistakes. The test results are shown in the figure below. At the beginning, there will be occasional mistakes. After a period of communication, the communication will even be disconnected. However, it may also be because the program is not written well.
References:
TMS320F2803x Piccolo Local Interconnect Network (LIN) Module User's Guide (Literature Number: SPRUGE2B)
|