Skip to main content
Tran Hung
Associate II
May 31, 2018
Question

Wakeup SPC570S40E1 from STOP mode by NMI pin.

  • May 31, 2018
  • 3 replies
  • 3176 views
Posted on May 31, 2018 at 09:31

Hello everyone;

I am working with SPC570S discovery board. I would like to implement the STOP mode to reduce the power consumption and then wake up by using NMI pin like PA[4] or PC[15].

I already entry the STOP mode however the board does not wake up from STOP mode. The program seems to be halted and then showed a warning like this picture.

0690X0000060L2KQAU.png

The mode is then unidentified.

0690X0000060L2PQAU.png

My code is attached in the file below.

Can someone help me to configure the wake up unit from STOP mode?

I am appreciate to your help. Thanks you so much.

#stop-mode-wake-source #wakeup-pin #spc570s-disp

Note: this post was migrated and contained many threaded conversations, some content may be missing.
This topic has been closed for replies.

3 replies

Tran Hung
Tran HungAuthor
Associate II
June 1, 2018
Posted on June 01, 2018 at 07:03

LE_SAINT.Erwan

‌ Can you support me about this problem?

Tran Hung
Tran HungAuthor
Associate II
June 1, 2018
Posted on June 01, 2018 at 08:42

Yvin.Erwan

Can you support me about this problem?

Erwan YVIN
ST Employee
June 6, 2018
Posted on June 06, 2018 at 10:11

Hello ,

According to your code :

Flash is in Low power mode ..

MC_ME.STOP0_MC.B.FLAON = 3; /* Flash is in low-power mode */�?�?

you can not access to the Wakeup function

Maybe ,you should put your function in RAM.

(Standby or Stop Mode) there are nice example in SPC5Studio :

SPC560Dxx OS-Less STANDBY SRAM Test Application for Discovery

SPC560Dxx_RLA WKPU API Test Application for Discovery

You can not debug in Low Power mode.

Best regards

Erwan

Tran Hung
Tran HungAuthor
Associate II
June 15, 2018
Posted on June 15, 2018 at 05:28

Hello

Yvin.Erwan

‌!

I looked at some examples of SPC560 processor:

SPC560Dxx OS-Less STANDBY SRAM Test Application for Discovery

SPC560Dxx_RLA WKPU API Test Application for Discovery

I found that SPC560 has interrupt vectors for the wake up feature: [table 155: Interrupt vector table]

0690X0000060BVAQA2.png

However, I havent found any software interrupt vector in SPC5

Which interrupt should I use to wake up in SPC570 MCU?

Erwan YVIN
ST Employee
June 15, 2018
Posted on June 15, 2018 at 16:03

Hello Tran ,

it is different from SPC56D.

you should see the chapter 3

you should set your pad in NMI and set correctly the NMI Configuration Register

Example for a machine Check Occurrence

void interruptRoutine_IVOR1(void){printf('
***** Interrupt IVOR1: Machine Check occurs *****
');NMI_MCR_ISR(); /* NMI wake up from Lpmode*/};�?�?�?�?�?�?�?

Best regards

Erwan

Tran Hung
Tran HungAuthor
Associate II
September 3, 2018

Hello @zambrano.luigi​ @Erwan YVIN​ !

Over-current protection by eTimer FAULT safing mode.

 ----------------------------------------------------------------------------------------------

I have a question about eTimer PWM.

I tried to configure eTimer_0 ETC_4 as a source FAULT_0 for eTimer 3. The PA[13] is assigned as an external input fault source. My configuration code is below:

void etimer_config ()

{

ETIMER_0.CH[4].CNTR.R = 1000;

ETIMER_0.CH[4].CTRL1.B.CNTMODE = 0x6U; /* Edge of secondary source triggers primary count till compare */

ETIMER_0.CH[4].CTRL1.B.PRISRC = 0x18U; /* primary count source = IP bus clock/2 */

ETIMER_0.CH[4].CTRL1.B.SECSRC = 0x4U; /* Counter #4 input pin etimer0.ch[4]/ PA[13] */

ETIMER_0.CH[4].CTRL1.B.ONCE = 0U; /* count repeatedly */

ETIMER_0.CH[4].CTRL1.B.LENGTH = 0U; /* count until rolling over */

ETIMER_0.CH[4].CTRL1.B.DIR = 0U; /* count up */

ETIMER_0.CH[4].CTRL2.B.OEN = 0U; /* output disable */

ETIMER_0.CH[4].CTRL2.B.RDNT = 0U; /* disable redundant channel */

ETIMER_0.CH[4].CTRL2.B.INPUT = 0x1U;  /* External input signal enable*/

ETIMER_0.CH[4].CTRL2.B.SIPS = 0x1; /* Positive edge for recounting*/

ETIMER_0.CH[4].CTRL3.B.FMODE = 1;   /* change mode */

ETIMER_0.CH[4].CTRL3.B.FDIS = 1; /* The channel OFLAG output is affected by this FAULT pin. */

ETIMER_0.CH[4].FILT.B.FILT_CNT = 7; /* sample filter counter*/

ETIMER_0.CH[4].FILT.B.FILT_PER = 255; /* input filter period */

ETIMER_0.CH[4].CCCTRL.B.CPT2MODE = 0x2U;  /*Capture 2 Mode Control*/

ETIMER_0.CH[4].CCCTRL.B.CPT1MODE = 0x2U;  /*Capture 1 Mode Control*/

ETIMER_0.CH[4].CCCTRL.B.CFWM = 0x1U;  /*FIFO = 2*/

}

void FAULT_PIN_Configure ()

{

    SIUL2.MSCR_MUX[206].R = 0x1U;

}

When this program operates, the PWM of eTimer_3 already disable, but it is enable when the fault pin PA[13] change the state. Can you review my configuration?