Page 1 of 1

[NUC131] Using CAN to Adjusting Baud Rate Automatically

Posted: 17 Sep 2021, 09:55
by chhsieh3
  • Application: This sample code receives data on the CAN bus by periodically changing the baud rate of NUC131 CAN to match the baud rate of the CAN bus.
  • BSP Version: NUC131 Series BSP CMSIS V3.00.005
  • Hardware: NuTiny-EVB-NUC131-LQFP64 V1.0
This sample code contains two projects, "CAN_TX_RX" and "CAN_Auto_Adjust_BPS". The "CAN_TX_RX" is a CAN sending and receiving demo, which is written to facilitate testing the function of "CAN_Auto_Adjust_BPS" demo.

The "CAN_Auto_Adjust_BPS" demo receives data on the CAN bus by periodically changing the baud rate of NUC131 CAN until it can normally receive data on the CAN bus, so as to match the baud rate of the CAN bus. After matching the baud rate of the CAN bus, packets will be periodically sent to the CAN bus. This demo can detect whether the baud rate range is 50 Kbps~1 Mbps, and step is 50 Kbps.

You can download the sample code at https://www.nuvoton.com/resource-downlo ... 0908174604