The network basics are:
- The CAN bus is a 2-wire differential bus using non-return-to-zero (NRZ) encoding and has two states:
- Recessive state (logical 1)
- Dominant state (logical 0)
- When the bus is idle, any node can initiate a transmission to any other node. When two or more nodes (ECUs) attempt to transmit at the same time, a nondestructive arbitration technique sends messages in
order of priority so that no messages are lost.
- The message transmission is multicast. Data messages transmitted are identifier-based, not address-based.
- The content of the message is labeled by the identifier that is unique throughout the network (for example: RPM, temperature, position, pressure, and so forth).
- All nodes on the network receive the message and each performs an acceptance test on the identifier. If the message is relevant, it is processed; otherwise, it is ignored.
- The unique identifier also determines the priority of the message (the lower the numerical value of the identifier, the higher the priority).
- Data is transmitted and received using message frames, consisting of the following basic fields:
- Arbitration field
- Control field
- Data field (up to 8 bytes for classical CAN and up to 64 bytes for CAN FD)
- CRC field
- ACK field
For more information, see ISO 11898-1:2015: CAN data link layer and physical signaling.
MCAN power up and clock sequence :
- Select CANCLK from the available clock sources: the HFCLK (HFXT or HFCLK_IN) or the SYSPLL (SYSPLLCLK1).
- Enable the corresponding clock source.
- Wait until the clock source is stable (SYSCTL_CLKSTATUS[*GOOD] bit = 1).
- Enable MCAN power by setting PWREN for MCAN.
- Wait until MCAN is ready (SYSCTL_SYSSTATUS[MCAN0READY] = 1).