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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

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

686 次查看
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

标签 (1)
0 项奖励
回复
2 回复数

573 次查看
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 项奖励
回复

573 次查看
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 项奖励
回复