HCS12XEQ384: Why does leaving CAN-Init mode change PORT-Registers? (Bug?)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

HCS12XEQ384: Why does leaving CAN-Init mode change PORT-Registers? (Bug?)

717 Views
saschapfengler
Contributor II

At around the end of CAN0-Initialisiation, leaving CAN Init Mode changes several IO-Pin-Register values.

Has anyone else experienced this behaviour? (The CAN interface runs just fine)

 

At (see attachment) ...

/* Initmodus beenden */
CAN0CTL0 &= ~((uint8)CAN0CTL0_INITRQ_MASK);

... PORTAB changes from 0 to 0xFFFF

and PORTC changes from 0 to 2.

I haven't checked, if other registers suffer the same fate.

Original Attachment has been moved to: CanInit.c.zip

Labels (1)
0 Kudos
Reply
2 Replies

604 Views
saschapfengler
Contributor II

Before anyone invests time, I disabled parts of the code. (Function before said code block) Now only Port C changes its value. I guess there is a deeper lying problem somewhere in the entire project.

0 Kudos
Reply

604 Views
RadekS
NXP Employee
NXP Employee

Hi Sascha,

Please check MCU mode (MODA=PE5, MODB=PE6 pins). The port C is used for data in expanded modes.

 

How did you configure PUCR register?

The pull devices at port C are disabled by default after reset. So, floating input may get any value depending on any negligible events (like enabling CAN module). You should configure all unused digital pins into one of the known states (digital input with internal/external pull up/down or digital output). The operation in the linear region near to VDDX/2 may increase power consumption.

Note: This is not valid for analog pins until we enable appropriate digital input buffers.

Note: This recommendation is valid also for MCU pads which are not routed to any MCU pins (like port C and 112 LQFP package).

I hope it helps you.

Have a great day,
Radek

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply