MSCAN12 Usage without BDM-Debugging enabled.

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

MSCAN12 Usage without BDM-Debugging enabled.

1,718 Views
andrea_olivieri
Contributor I
Hi guys!
Several weeks ago I've post a query about MSCAN12 Configuration. All these matter are fixed but unfortunately a I've gotta new one.
Well:
I tryed to flash my uC by using Metrowerks CW debugger editor, and the loaded application works good.
I stopped this one and I removed BDM connector in by uC board
As soon i pushed Reset Button into demo board:...Chil-Out!
No signals coming out from Transmitting MSCAN12 Controller.
 
PS:
  • Demo board it's a startes kit (ZK-S12-B By SofTec Microsystems).
  • All template of the application It's done and filled by Processor Expert Except (Except for MSCAN12 controller Sw. Which template It's been done by Processor Expert but it's been filled by me).
  • Of course I've connected a receiving node (I'm shure I've done it correctly).
  • I've just read Processor Expert Manual. It say that for advanced beans it doesn't work cause my licencing. but it does not said nothing about an applications where basic beans sre developed by PE Tool and advanced beans SW it's done by user.

Have U got a solution for me? please!...

Thanks in advance.

Andrea Olivieri. (In Italy I'ts a male name)

Labels (1)
0 Kudos
3 Replies

465 Views
Alban
Senior Contributor II
Ciao Andrea,
 
The common cause for this kind of effect is the COP (Computer Operating Properly) = Watchdog.
In Special Single Chip Mode (SSCM), the COP is disabled by default.
 
Look at the Reset pin and if you see it going up and down it is likely to be the reason.
To solve this, you go to the COP Chapter and there is one register to write to.
 
Cheers,
Alban.
0 Kudos

465 Views
andrea_olivieri
Contributor I
I realized that Peripheral initialization start up correctly up to CAM module initialization end, but it fail  as soon tried to get out by init mode.  To be more precise,  the code section where the app fail is thath:
...
/*Init Mode exit Request*/
CAN0CTL0_INITRQ = 0;
/*Waiting for Init Mode exit ACK*/
while(CAN0CTL1_INITAK != 0){};    <=========== FAILURE IS HERE!
...
Basically, uC doesn't reach out the Init Mode for MSCAN (But Just only if Debugger is not active.)
Which kind of trouble rise up COP with my app?
Does it possible that it let to start my application since MSCAN12 tryed to leave out by initialization mode?
See U.
Thanks in advance!
Andrea Olivieri (In Italy It's a male name)
 
0 Kudos

465 Views
dustinwestaby
Contributor II

I had an identical issue on a MC9S12XDP on a SofTec Microsystems dev board.  Everything is fine with the BDM connected.  Remove the BDM and reset, the MSCAN init function hangs while waiting for the "Init Mode Exit ACK".

Solution for me was the CANE flag in the CANCTL1 register.  I found a line of code that was disabling CAN during startup init, then with the BDM detached my CAN init function could not turn CAN back on.

From the manual:

The MSCAN enable bit (CANE) is writable only once in normal system operation modes, which

provides further protection against inadvertently disabling the MSCAN.

Meaning that while the BDM debugger is connected, the CANE can be set to Disabled then later Enabled. However, with the BDM is disconnected, CANE can only be written once.  If disabled, is stuck disabled and will refuse the "Init Mode Exit Request".



Special thanks for your thread for leading me in the right direction.  This guy also helped.

9S12XE CAN initialization

0 Kudos