Strictly necessary cookies are on by default and cannot be turned off. Functional, Performance and Tracking/targeting/sharing cookies can be turned on below based on your preferences (this banner will remain available for you to accept cookies). You may change your cookie settings by deleting cookies from your browser. Then this banner will appear again. You can learn more details about cookies HERE.
Strictly necessary (always on)
Functional, Performance and Tracking/targeting/sharing (default off)
I would like to suggest a feature that would allow multiple configurations to be set up through the customizer. In an automotive CAN application, it is required to try 2 different baud rates and 11 bit and 29 bit ID format. It is difficult to work with the CAN_RX_CFG and CAN_TX_CFG structs to reinitialize the CAN mailboxes with different values for switching between the 11 and 29 bit ID formats.
You dont have to change the CAN_RX_CFG and CAN_TX_CFG structs to change the baud rate or IDE . You can directly write to the CAN register to do the same
Changing Baud Rate
The Bridge allows to you operate in one of the following Baud rates 1000, 800, 500, 250, 125, 62.5, 20 and 10 Kbps. Though the CAN protocol does not have any limitation on the Baud rate, these are the standard values this project currently supports. The default Baud rate is 1000 Kbps.
To change the Baud rate you need to modify the PreScaler value and time segment values of the CAN component. Below is the simple code snippet showing the same.
The following table gives you the values of the BRP, tseg1, tseg2, sjw and sample modes for the various Baud rates supported in this project.
You can also change the IDE through register write.
Changing the IDE and RTR Bit Field
To set or clear the IDE and RTR bit fields you need to modify the CAN TX CMD register. The CAN Component has 8 TX mailbox and each mailbox has on TX CMD register defined. This TX CMD register is 32 bit register in which bit 20 and 21 corresponds to the IDE and RTR respectively. By writing to TX CDM register you can set as well clear the IDE and RTR bits. The following #defines will allow you to do that