mc9s12xep100 stop mode + API interrupt

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

mc9s12xep100 stop mode + API interrupt

800 Views
xiaokangkp
Contributor III

Hi all,

There is a problem confuse me for a long time. When using MC9S12xep100, I entered the full stop mode with API interrupt enabled. The current consumption is about 2.2mA, but I found the datasheet said like belows:(Table A-14)

pastedImage_5.png

yeah, we can see it says the current consumption is about 42 uA, How to make it ?  If I just enter the full stop mode without API enable, the current consumption is about 62 uA. 

Is there anything I haven't noticed or missed? Thank you in advance.

The following is part of the code for reference:

void MCU_EnterFSTPMode(void)
{
PLLCTL |= 0x80; // set FSTWKP = 1

CLKSEL_PSTP = 0;
//MCU enter into full sleep mode
asm ANDCC #0x7F; 
asm STOP;
}

void API_Init(void)

{

VREGAPICL |= 0x01; // clear Autonomous Periodical Interrupt Flag VREGAPICL_APIF
VREGAPIR = 4999; // set interval time
VREGAPITR = 0; // initial trim value
VREGAPICL = 0x07; // source of clock, API enable, interrupt enable, clear flag if set

}

void interrupt 64 API_Interrupt(void)
{
VREGAPICL |= 0x01; //write 1 to clear VREGAPICL_APIF

PORTA_PA1 = ~PORTA_PA1;

}

0 Kudos
6 Replies

616 Views
kef2
Senior Contributor IV

Are you measuring stop mode current with CPU reset/powered on with BDM disconnected?

0 Kudos

616 Views
xiaokangkp
Contributor III

Thank you for your timely reply, Edward . The process of measuring stop mode current is like follow steps:

step1. download the programme, and remove BDM. then the xep100 board is power down.

step2. Powered the xep100 board with a DC power supply. A current meter is connected in series to measure the current.

0 Kudos

616 Views
kef2
Senior Contributor IV

Thanks and sorry, I shouldn't ask this keeping in mind you see only 62uA without API.

I would check if it helps changing API trim settings, max, min and middle.

BTW, 4999 period setting is about 1s. How long does it take to immediately reenter stop mode to let you keep measuring stop current? High current wake spikes can increase your average current. Did you try using maximum API period setting or perhaps use oscilloscope to read supply current high and low?

No more ideas, don't have any S12XE board at hand.

0 Kudos

616 Views
RadekS
NXP Employee
NXP Employee

Hi Kang,

I agree with Edward. The current consumption measurement method may be the key. If possible, please check consumption via shunt at power line and oscilloscope. That way you will get at least a ratio between times in stop and run mode.  

You wrote, that you use full stop mode. The running oscillator in pseudo stop mode increases slightly immediate power consumption. On the other side, it may significantly decrease the time for clock stabilization after leaving stop mode and this way effectively decrease average power consumption. If you will see significant improvement with pseudo stop mode, you may focus on oscillator circuit parameters and time for oscillation starts.  

Did you implement PLL re-init in API interrupt?
It is rather useless for code with just a few instructions. However, it may play a role when you execute a longer piece of code or if you implement any waiting loops. If you will see lower power consumption without PLL, the issue may be in PLL settings and long PLL lock time. In such case, please use the PLL calculator for S12XE.

The pin staus stay unchanged in stop mode. Are any loads connected to MCU during stop mode (LEDs, transistors, ICs, ...)?

Best regards

Radek

0 Kudos

616 Views
RadekS
NXP Employee
NXP Employee

Hi Kang,

The floating digital inputs may increase power consumption.

Please ensure that all digital pins are in one of defined state (output, input with internal pull-up/down, or input with external pull-up/down). This is not valid for port AD until we enable digital buffer in DIEN register.

Be aware, that this should be done also for pins which are not directly routed in your version of the package - for example Port R.

I hope it helps you

Radek

0 Kudos

616 Views
xiaokangkp
Contributor III

Hi Radek,

   Thanks for your reply. I have processed the IO port you mentioned.  The current consumption is also about 2.2mA.

   Just a quick summary of my current situation:

   situation1. just enter into full stop mode, all the IO and modes have be handled. current consumption is about 62uA.

   situation2. Based on situation1, also enable the API function and its interrupt. current consumption is about 2.2mA.

  

  what i want do is to get a lower current consumption when i enter the full stop mode with API functions enabled. thanks!

0 Kudos