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
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.
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!
-----------------------------------------------------------------------------------------------------------------------