38.6.1 Reading a TEF Object

Before reading a TEF object, the application must check that the TEF is not empty by reading the CxTEFSTA register. The TEF is not empty if TEFNEIF is set.

The TEF user address points to the address in RAM of the next TEF object to read. The actual address in RAM is calculated using Equation 38-13. TE0 of the TEF object is read first, followed by TE1 and TE2.

Equation 38-13. Start Address of the TEF Object
A = B a s e A d d r e s s = C x F I F O B A
Note: CxFIFOBAH/L needs to be set to a value between 0x2600 and the end of RAM, leaving enough room to allow the TEF and Transmit Queue (if enabled) as well as the FIFOs.

After the TEF object is read from RAM, the TEF needs to be incremented by setting UINC (CxTEFCON[8]). This will cause the CAN Protocol module to increment the tail pointer and update CxTEFUA.

Now the next message can be read from the TEF.