AnsweredAssumed Answered

Wake-up from pseudo stop mode and RAM retention for S1912ZVCA product

Question asked by Bhushan Patil on Aug 5, 2016
Latest reply on Aug 15, 2016 by Radek Sestak

Hi,

 

I am using S1912ZVCA19F0WKH (magni v 192kB) controller.

 

I have done this configuration for API to generate API interrupts

 

      

main()

{

/* Autonomous Periodical Interrupt initialisations. */

       /*CPMUACLKTR API clock trimming register*/

       CPMUACLKTR_ACLKTR0 = 1;

CPMUACLKTR_ACLKTR1 = 1;

CPMUACLKTR_ACLKTR2 = 1;

CPMUACLKTR_ACLKTR3 = 1;

CPMUACLKTR_ACLKTR4 = 1;

CPMUACLKTR_ACLKTR5 = 0;

       /*CPMUAPICTL API control register settings*/

CPMUAPICTL_APICLK = 0; //Clock source for API is ACLK

CPMUAPICTL_APIES = 1; //External wave form visible at pin (Reference: Pg 250)

CPMUAPICTL_APIEA = 1; //Waveform can be accessed externally

CPMUAPICTL_APIE = 1; //API interrupt enabled whenever APIR timeout happens.

CPMUAPICTL_APIF = 1; //Clear the interrupt flag by writing 1

 

       /*Select the time for API*/

       /* Refer to Pg no: 253 */

CPMUAPIRH = 0xE7;

       CPMUAPIRL = 0xFF;

 

/*CPMU clock initialisations*/

       CPMUCLKS_PSTP = 1; //Oscillator 4Mhz continues to run --> Pseudo stop mode

CPMUCLKS_CSAD = 1; // COP stopped in stop mode

CPMUCLKS_PRE = 1; //RTI enabled in pseudo stop mode

CPMUCLKS_PCE = 0; //COP disabled in Pseudo stop mode

       CPMUCLKS_RTIOSCSEL = 1; //RTI clock source is OSCCLK

CPMUCLKS_COPOSCSEL1 = 0;

CPMUCLKS_COPOSCSEL0 = 1; //COP clock source is OSCCLK

 

for(;;)

{

/*Set of instructions*/

 

CPMUAPICTL_APIFE = 1; //API is enabled; this bit is set to 1 to start API timer*/

__asm(ANDCC #0x6F);

__asm(STOP);  //Enter pseudo stop mode

}

}

 

Using the above configuration; I am able to get API interrupt without stop command in main function.

But if I use stop command device will not wake up once it enters stop mode.

I want to call main function again in API interrupt function without losing any ram data.

 

interrupt ISR_API( void )

{

       if (CPMUAPICTL_APIF)

       {

/* Clear the interrupt flag. */

CPMUAPICTL_APIF = 1;     /* APIF. Clear the interrupt flag by writing 1. */

/*Call the operation to be performed*/

main();

       }

}

 

Kindly help me regarding this.

 

Regards,

Bhushan

Outcomes