Message Edited by kbu on 2006-11-0609:59 AM
#include
void main(void)
{
SOPT = 0b01100011; //disable COP and allow stop mode
SPMSC1 = 0b00010100; //disable LVD
SPMSC2 = 0b00000000;
ICGC1 = 0b00111100;
ICGC2 = 0x00100001;
SRTISC = 0x17; // 1ms RTI
//IRQSC |= 0b00010000;
IRQSC_IRQIE = 1; /enable IRQ
// data direction on all ports to output
PTADD = 0xff;
PTBDD = 0xff;
PTCDD = 0xff;
PTDDD = 0xff;
PTEDD = 0xff;
PTGDD = 0xff;
// all ports as low
PTAD = 0x80; //I have a LED on one pin (same thing on the assembly code too)
PTBD = 0x00;
PTCD = 0x00;
PTDD = 0x00;
PTED = 0x00;
PTGD = 0x00;
for(;
{
asm STOP;
}
}
interrupt void PWRLib_RTIClock_ISR(void)
{
SRTISC |= 0b01000000; // ack the RTI
PTAD_PTAD7 ^= 1; // toggle LED
}
kbu wrote:
The only difference between the AN2493 sample code is that its written with the GB60 includes, whearas because I'm using the MC13213 I'm including the GT60 header. (the one difference I can see is that GB60 explicitly disables PortF, but the GT60 doesn't have the portF so I don't disable that in my code)
Stop modes: see Chapter 3.2 of datasheet S08GT60
– System clocks stopped; voltage regulator in standby
– Stop1 — Full power down of internal circuits for maximum power savings
– Stop2 — Partial power down of internal circuits, RAM contents retained
– Stop3 — All internal circuits powered for fast recovery
As with STOP3 everything stays powered-up, no wonder you get a high IDD.
Think about using STOP1 to get to very low consumption. It's a bit more work, but STOP3 is not really a STOP mode, but rather a WAIT...
Alban.
System Options Register 1 (SOPT1)
This high page register is a write-once register so only the first write after reset is honored.
of course any DC load or any other peripheral enabled in STOP mode might add some more current on top of mentioned ones.
Regards, Pavel