The TMS302F28335 offers two CAN-Interfaces: CAN_A and CAN_B. Each Interface needs one RX and one TX Pin for receive and transmit operations. Each Interface can only be used one time.
Each CAN-Module can use up to 32 mailboxes. Use 0-15 for Tx-operations, and 16-31 for Rx- operation.
For configuration of mailboxes, user needs to create an object of type CanMailbox and assign values for Identifier, extended Identifier, messageLength, direction and active/inactive to respective object.
For extended Identifier = 0, the Identifier-length will be 11 bit. Identifier values are valid from 0x00 to 0x7FF.
For extended Identifier = 1, the Identifier-length will be 29 bit. Identifier values are valid from 0x00 to 0x1FFF FFFF.
Messages are priorized by lowest identifier first
Amount of data-bytes that will be sent or received via a mailbox, needs to be configured by assigning a value to messageLength attribute of CanMailbox object. The maximal length for receive and transmit operations is 8 byte. Variable msg for CAN-operations in example code is of type Uint64. Using a variable of Uint64 for receive and transmit operations enables the module to read and write all bytes (in case of messageLength = 8).
RX | TX | |
---|---|---|
CAN_A | GPIO18 / GPIO30 | GPIO19 / GPIO31 |
CAN_B | GPIO10 / GPIO13 / GPIO17 / GPIO21 | GPIO8 / GPIO12 / GPIO16 / GPIO20 |