Sample code using ADS for the TC334 to enter Standby mode with VEXT powered

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
cwunder
Employee
Employee
100 solutions authored 5 likes given 50 likes received
This example shows how to set the microcontroller in power saving mode standby with VEXT still powered. The standby mode is triggered via a SW request by writing into the Power Management Control and Status Register. 
 
The code is configured so that the AURIX can be woken up from standby mode using these options:
  • PINA (port pin 14.1) and can be controlled by a terminal program.
  • /ESR0 pin wake from an edge
  • /PORST pin from SW S501 on the TriBoard
Description:
The routine runStandby() is used to put the microcontroller system in Standby mode. However first configure your parameters in the routine configStandby().
  • Two configurations in terms of indication are done using LED2 and LED1
  • The LED2 connected to pin 33.5 is switched on to indicate the the start of the application
  • The LED1 connected to pin 33.4 is switched on to indicate that it is entering in Standby mode
  • Note: Both will turn off when Standby mode has successfully entered. In addition the power LED for VDD will turn off, The power LEDs for 3.3V and %V will stay on since the power is not turned off.
  • The application waits for approximately 10 seconds
  • Then LED1 is switched on to signal that Standby mode is entered in approximately one second
 The routine stepIntoStandbyMode() executes the following sequence to enter the Standby mode by splitting it into two routines, one running from PFlash and the other is running from PSPR of the CPU
1) clearStandbyWakeupStatus() routine will clear all the Wake-up flags
2) configStandby() will configure the data struct to your desired settings
  • Configure PINA connected to port pin 14.1 as the desired Wake-Up trigger request
  • Configure PINA Wake-Up trigger to react on any edge
  • Configure /ESR0 as the desired Wake-Up trigger request
  • Configure /ESR0 Wake-Up trigger to react on any edge
  • Configure /PORST Wake-Up trigger
  • Disable Wake-Up on VEXT ramp-up
  • Disable the SCR
  • Ramp down the PLL and switch to the backup clock
  • NVM memories are put to sleep

3) Request Standby mode by writing the SCU_PMCSR0.B.REQSLP = 0x3;
4) Set CPU Endinit
Note: The standby mode becomes active as soon as the CPU Endinit is set.

 
Best regards,
-Chris 
0 Replies