DSPRelated.com
Forums

FlexCAN msg buffer Control/Status register initial values:

Started by Corey, Rick August 2, 2005
FlexCAN msg buffer Control/Status register initial values:

Hi All

How are people initializing the 56F8300/E  FlexCan Control/Status register "CODE" field for mailboxes that are not in use? 

I have been setting these to "1000" , meaning "Transmit Buffer, but not ready for Transmit".  I had no problems I was aware of.  I reasoned that an empty Transmit mailbox was somehow "safer" and "less busy" than a Receive mailbox that was marked inactive. 

Now a phrase in the manual makes me think that maybe "0000" would be a better way to initialize unused mailboxes.
Would anyone venture a guess?

(I have set FCMAXMB to "3" which seems to mean "0..3" not "0..2", since my Mailbox#3 can be made active.)

BACKGROUND:

I happen to be chasing some bug that looks like random changes of a Receive message filter.
(It is probably a rouge pointer overwriting the filter FCMB2_ID_LOW, until I learn differently.)

While searching for clues, I noticed a phrase in the Freescale Peripheral Manual for 56800/E:

The Control/Status word of all MBs must be written either as active or inactive MB

I'm guessing that "inactive" means CODE value "RX NOT ACTIVE".

Has anyone used a "CODE" value in the
FlexCAN message Buffer Control/Status register of either
"1000" (TX but not Ready") or "0000" (RX but not active)? 

Would anyone guess which one is "better"?

Thanks in advance.


Msg Buffer registers:  Figure 7.3
        the field "CODE"  is bits 4-7                                      page 7-6 or PDF page 200

CODE values:  Table 7-2 and 7-3                                        page 7-7 or PDF page 201

Section 7.6.10:  FlexCAN Initialization / Reset Sequence        page 7-17  or PDF page 211


Rick Corey
Sr. Software Engineer