dsPIC33/PIC24 - ECAN, FNRB (FIFO Next Read Buffer Pointer bits) Not Resetting as Expected

When the CAN FIFO is configured with the following settings:
FSA = b01000; // FIFO Starts at Message Buffer 8
DMABS = 0b000; // 4 buffers in DMA RAM,
the FNRB pointer is not resetting back to buffer 8 after receiving of 4 messages, it continues to increment up to value 32. Why does this happen?

This configuration of FSA and DMABS is invalid. The FIFO Start buffer (FSA) address must be less than or equal to the FIFO End buffer. DMABS defines DMA Buffer Size, as well as the FIFO End buffer: FIFO End buffer = DMA Buffer Size - 1.

Choose a value for the FSA less than or equal to the FIFO End buffer. The valid range, in this case, is FSA = b00000 … b00011.

For more information, please search Microchip's Reference Manual page for the "dsPIC33E/PIC24E FRM, Enhanced Controller Area Network (ECAN)" document.

© 2024 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.