MC9S08GT16 - problems with entering stop mode

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

MC9S08GT16 - problems with entering stop mode

1,080 Views
marigold
Contributor I
Hi,
I am trying to put microcontroller to stop mode 3 using this code:
/* register initialization */
  SOPT = 0x73;                                  
  SPMSC1 = 0x1C;                                      
  SPMSC2 = 0x00;                                      
  ICGC1 = 0x3C;                                      
  ICGC2 = 0x7C;
...
...
MCUInit();
Main(){
...
...
asm STOP
...
}
The problem is that the microcontroller doesn't enter stop mode. It executes the instruction asm STOP and goes to the next line of code, continuing normal work.
What do I do wrong? How should entering (and leaving) stop mode look like?
Please help,
- Marigold
Labels (1)
0 Kudos
Reply
1 Reply

356 Views
nogA
Contributor I
I'm not sure, but I think you should change your instructions with these:

SOPT = 0x73      -----> SOPT |= 0x20
SPMSC2 = 0x00 -----> SPMSC2 |= 0x02

These instructions must be after MCUInit() function. You must use, after all, EnableInterruopt() function.
0 Kudos
Reply