Manfred Meier

Disable of MSCAN failed after Init on S12DP512

Discussion created by Manfred Meier on May 20, 2008
Latest reply on May 21, 2008 by Manfred Meier


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 */
  // 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

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?