SPRACE5A May 2019 – May 2021 F29H850TU , F29H859TU-Q1 , TMS320F280021 , TMS320F280021-Q1 , TMS320F280023 , TMS320F280023-Q1 , TMS320F280023C , TMS320F280025 , TMS320F280025-Q1 , TMS320F280025C , TMS320F280025C-Q1 , TMS320F280040-Q1 , TMS320F280040C-Q1 , TMS320F280041 , TMS320F280041-Q1 , TMS320F280041C , TMS320F280041C-Q1 , TMS320F280045 , TMS320F280048-Q1 , TMS320F280048C-Q1 , TMS320F280049 , TMS320F280049-Q1 , TMS320F280049C , TMS320F280049C-Q1 , TMS320F28075 , TMS320F28075-Q1 , TMS320F28076 , TMS320F28374D , TMS320F28374S , TMS320F28375D , TMS320F28375S , TMS320F28375S-Q1 , TMS320F28376D , TMS320F28376S , TMS320F28377D , TMS320F28377D-EP , TMS320F28377D-Q1 , TMS320F28377S , TMS320F28377S-Q1 , TMS320F28378D , TMS320F28378S , TMS320F28379D , TMS320F28379D-Q1 , TMS320F28379S , TMS320F28384D , TMS320F28384S , TMS320F28386D , TMS320F28386S , TMS320F28388D , TMS320F28388S , TMS320F28P650DH , TMS320F28P650DK , TMS320F28P650SH , TMS320F28P650SK , TMS320F28P659DH-Q1 , TMS320F28P659DK-Q1 , TMS320F28P659SH-Q1
This section provides a brief description of the example projects, along with applicable waveforms captured with an oscilloscope. Note that the examples are within C2000Ware.
This example illustrates the use of self-test mode. A message is transmitted once per second, using a simple delay loop for timing. The message that is sent is a 2 byte message that contains an incrementing pattern. This example sets up the CAN controller in "External" Loopback test mode. Data transmitted is visible on the CANTXA pin and is received internally back to the CAN Core. It is important that the GPIO mapping in device.h file in this project is edited to reflect the GPIO pins that are used for CAN function in your hardware. Otherwise, the transmitted data will not be seen on CANTXA pin.
Figure 2-1 shows the activity on the CANTXA pin.
Similar to can_ex1_loopback.c, but uses interrupts.
This example shows basic setup of CAN in order to transmit and receive messages. It sets up CAN-A as the transmitter and CAN-B as the receiver. A receive interrupt is asserted on CAN-B to verify the received data.
This example illustrates how to setup the CAN module for transmission. It could prove very useful to check the hardware connections of the CAN circuit.
Figure 2-2, Figure 2-3 and Figure 2-4 show how data is stored in the IFxDATA registers.
31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
Data_3 | Data_2 | Data_1 | Data_0 | ||||||||||||||||||||||||||||
R/W-0h | R/W-0h | R/W-0h | R/W-0h | ||||||||||||||||||||||||||||
31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
Data_7 | Data_6 | Data_5 | Data_4 | ||||||||||||||||||||||||||||
R/W-0h | R/W-0h | R/W-0h | R/W-0h | ||||||||||||||||||||||||||||
With the above configurations, data is transmitted in the order shown in Figure 2-5.
Figure 2-5 depicts the waveform on the CANTXA pin.
Figure 2-6 shows the waveform at the CANRXA pin. Note that during the ACK phase, the transmitting node transmits a recessive, but it is driven low by the receiver.
This example is a simple illustration of how to setup the CAN module for reception. This example could prove very useful to generate an ACK for another CAN node.
This example demonstrates the ability of the CAN-A module to transmit a Remote-frame and receive a response in the same mailbox. CAN-B node is configured to respond to the Remote frame. If CAN-B is not available, a CAN bus analyzer may be used to provide a response. Note that the response time from such equipment may be more, because it involves some overhead due to the application running on the PC.
Figure 2-7 shows the response from a bus analyzer. Note that it takes about 13 ms for the response to show up on the bus.
Figure 2-8 shows the response from CAN-B. Response is in microseconds in this case.
Figure 2-9 demonstrates the ability of the module to respond to a Remote-frame. A remote frame is transmitted from the CAN bus analyzer and the module responds.
This example demonstrates acceptance mask filtering. It can be used to evaluate the effects of MXtd & MDir bits. Table 2-1 shows the various scenarios and the outcomes. Mailbox direction was set to Receive (Dir = 0) , An extended ID was written to the mailbox (Xtd = 1) and filtering enabled (UMask = 1). MXtd and MDir bits were cycled through the four possible combinations.
MXtd | Mdir | Outcome |
---|---|---|
1 | 1 | Frame received |
1 | 0 | Frame received |
0 | 1 | Frame received |
0 | 0 | Frame received |
MXtd | Mdir | Outcome |
---|---|---|
1 | 1 | Frame not received |
1 | 0 | Frame not received |
0 | 1 | Frame received |
0 | 0 | Frame received |
MXtd | Mdir | Outcome |
---|---|---|
1 | 1 | Frame not received |
1 | 0 | Frame not received |
0 | 1 | Frame received |
0 | 0 | Frame received |
It is important to remember that the stored Message Identifier will be over-written by the identifier of the received frame. In order for acceptance filtering to work correctly for subsequent frames, the message object must be reinitialized with the original identifier.