MCF51JM32VLH won't enter WAIT mode without BDM connected (it hangs)

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

MCF51JM32VLH won't enter WAIT mode without BDM connected (it hangs)

1,033 Views
Novalis
Contributor III

Hello,
do you have any idea, why I cannot put MCF51JM32VLH into WAIT mode when it is not connected to BDM?

When connected to BDM, everything works fine. When I disconnect BDM, unplug power and plug it back, CPU hangs (only watchdog resets it) when I try to enter wait mode ( _Wait;  macro)

 

It worked fine with sample of MCF51JM128VLH I received from Freescale, but now when I bought MCF51JM32VLH it only works with BDM connected. I don't know what can the problem be. HW should be the same ... I don't have more samples to try it again on new PCB I'm putting JM32 to.

 

Thanks,

Novalis

Labels (1)
0 Kudos
2 Replies

315 Views
WayneZ
Contributor I

What is the setting for SOPT1? Note that some SOPT1 bits are write-once. Also, what are the instructions for entering WAIT mode, typically defined in deriviative.h? For example here is what I am using for MCF51QE128.

 

    // Watchdog disabled. Stop Mode Enable. Background Pin enable. RESET pin enable
    SOPT1 = SOPT1_BKGDPE_MASK | SOPT1_STOPE_MASK;


#define _Stop asm ( mov3q #4,d0; bclr.b d0,SOPT1; stop #0x2000; )
  /*!< Macro to enter stop modes, STOPE bit in SOPT1 register must be set prior to executing this macro */

#define _Wait asm ( mov3q #4,d0; bset.b d0,SOPT1; nop; stop #0x2000; )
  /*!< Macro to enter wait mode */

 

Also, is CPUCR being set? If so, to what value? We were using an early version of the MCF51QE128 which had a timing problem when entering stop and accessing flash memory, so interrupt vectors were moved to ram. (this has since been fixed in the MCF51QE128), however, we also had to set CPUCR as follows, although you may need different values:

 

    asm ( move.l #0xD2000000, D0)
    asm ( movec D0, CPUCR)

    SPMSC2 = SPMSC2_LPWUI_MASK | SPMSC2_PPDE_MASK ;
    INTC_WCR = 0x80; // needed to wake from stop mode
    // and interrupt (not reset) with errors

 

 

    SPMSC1 = 0;

 

Wayne

0 Kudos

315 Views
Novalis
Contributor III
Hello Wayne, sorry for this late reply :smileyhappy: I think i've finaly had time to find the problem (It didn't bother me that much before). Only thing I had to do was write this: INTC_WCR = 0x80; But it is strange, because reference manual says that it is the default state after reset .... so theoreticaly this line shouldn't be needed. But I'm happy it helped :smileyhappy: Martin
0 Kudos