This is my startup code. I don't save any registe because I want only to wake up the MCU from stop2!! To see if the MCU exit from stop2 I use an amperometer ( if the code works right I expect fluctuation in the current value but now I only read a fixed 0,5mA current absorbed by the 13213-SRB board).
Where I'm wrong?
__EXTERN_C void _Startup(void){
asm{
LDX #initSOPT;
STX SOPT;
LDX #initSPMSC1;
STX SPMSC1;
LDA IRQSC
ORA #$10 //IRQ ON
STA IRQSC
LDX #$17 //RTI CFG
STX SRTISC
LDA SPMSC2;
AND #$08; //check PPDF
BEQ Start_App;
INIT:
//if i'm coming from stop 2
LDA initSPMSC2; //enable stop2
ORA #$07;
STA SPMSC2;
JMP main;
Start_App:
//Init stop mode ( first execution )
LDA initSPMSC2; //enable stop2
ORA #$03;
STA SPMSC2;
end:
JMP main;
}
/****************************************************************/
#include "MC9S08GB60.h"
void main(void){
for(;;){
SRTISC = 0x57;
asm{
stop
}
}
};
Also I've some problem with stop mode 2!!
I've configured registers for stop and RTI timer clocked internally with 1Khz oscillator, but the MCU never reset itself... also if I don't write the recover procedure in the "start08.c" file but I leave to restart like a power up the MCU simply Sleep forever.
I have the same question……How can i enter the "stop3" mode?
Thanks
Hi,
I am viswanath, I did on STOP modes, Configurations for stop modes are right but the usage is
not correct, i mean u have to call _asm STOP when ever and where ever u want to use.
One more thing is Low Power modes(Hibernate & Doze) are for MODEM and STOP modes are for
MCU.
Regards,
Viswanath K