Hello,
I use a S12DP512 µC with CodeWarrior 3.1
What I liked to do is to disable the MSCAN block during the runtime of my Application.
I used the piece of code below:
- Request init mode
- Wait or Acknowledge
- Disable MSCAN via CANE
void disableMSCAN3(void) {
/* INITRQ = 1, request to enter initialisation-mode */
CAN3CTL0_INITRQ = 1;
// wait until initialisation-mode is entered
while (!CAN3CTL1_INITAK);
/* set MSCAN3 Control 1 Register
* CANE = 0 -> disable MSCAN3
*
* other settings remains!
*/
CAN3CTL1 = CAN3CTL1 & 0x7F; // or CAN3CTL1_CANE = 0
#ifdef REPORTING
if(CAN3CTL1_CANE){TxEventNotification(DISABLE_FAILED);}
#endif
}
This code works fine when the µC has a connection with the Debug tool. But when the µC looses it connection to the Debug tool (caused by reset button on Application board) CAN3CTL1_CANE remains unchanged.
Why did the device behave differently? Did anyone have a clue?