cancel
Showing results for 
Search instead for 
Did you mean: 

Wakeup SPC570S40E1 from STOP mode by NMI pin.

Tran Hung
Associate II
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 discussion has been locked for participation. If you have a question, please start a new topic in order to ask your question
11 REPLIES 11
Posted on June 19, 2018 at 13:56

Hi Tran,

In attachment you can find an example on how to use the Wakeup Unit on SPC570S Discovery to generate a IVOR1. The following steps are needed to execute it:

1. Import the project in SPC5Studio

2. Generare

3. Apply the workaround that I suggested you to enable the IVOR 1 (setting the macroIVOR0_HANDLER on TRUE in the file ivor_cfg.h)

4. Compile the project and flash it on the board

5. Connect the pin C26 (connector X3) with one of the three push buttons available on the board (for example, with the SW1). The pin C26 is connected with the pin PA[4] of the core, that has been configured as NMI within the functionNMIPinConfig().

6. Execute the application

You should see LED1-3 blinking.Now, if you push the button SW1, an IVOR1 will be generated and the execution should remain within the while(1) loop in the IVOR1 callback function (_ivor1_callback).

Please, let me know if this example has clarified the usage of the Wakeup Unit.

Regards,

Luigi

________________

Attachments :

SPC570Sxx_RLA WKPU Test Application for Discovery.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HxUK&d=%2Fa%2F0X0000000ayi%2FZrxmyTxfb_ilibI1.zImAaYIqtljBi27XY0KRzZMKV8&asPdf=false
Tran Hung
Associate II

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?