How to go low power consumption while CPU and CAN controller running

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

How to go low power consumption while CPU and CAN controller running

969 Views
amitabh
Contributor I

I am using MC9S12G processor and want to enter a low power mode where i want to perform two I/O operations

1. Watchdog trigger(Using DIO)

2. LED (Using DIO))

 

I tried the stop instruction and find that the Core is not executing any instruction after asm STOP.

 

Is there any other way possible to go to low power mode with above requirement.

Labels (1)
3 Replies

495 Views
GordonD
Contributor IV

In the S12G family, the easiest way to periodically exit STOP mode is to use the Autonomous Periodical Interrupt (API) timer contained in the Clock, Reset and Power Management Unit (CPMU) module. The API timer consists of a low power RC oscillator and a 16-bit timeout register. Timeout periods can be selected from 0.2 mS - 13107.2 mS in 0.2 mS increments.

So, the API timer can be used to exit STOP to trigger the external Watchdog and blink the LED. The CPU can then reenter STOP mode and wait for the next API interrupt.

0 Kudos

495 Views
RadekS
NXP Employee
NXP Employee

In attachment you can see simple example code for periodical wake up from stop mode (G240-API+STOP-CW51).

Note: API RC oscillator (10kHz) isn’t trimmed from factory. There isn’t any universal setting; every MCU should be trimmed separately. Accuracy of trimmed API clock source is defined as +/-5%. In attachment you can see simple example code for API trimming (G240-API-CW51)


495 Views
iggi
NXP Employee
NXP Employee

S12CPMU core on S12G MCU supports following modes of operation:

  • Run Mode
  • Wait Mode
  • Stop Mode (Full and Pseudo)

Refer to chapter 10.1.2 Modes of Operation of the S12G reference manula (link below)

http://cache.freescale.com/files/32bit/doc/ref_manual/MC9S12GRMV1.pdf

For your case, you can either use run mode with low bus clock frequency for low power consumption, or enter into STOP or WAI mode and wait for an interrupt to wake up the MCU in order to do tasks.

In Wait mode the core runs (PLL is on), but you can set the peripheral's modes of operation i.e. low power options.

For example, the MSCAN has two additional modes with reduced power consumption, compared to normal mode: sleep and power down mode. In sleep mode, power consumption is reduced by stopping all clocks except those to access the registers from the CPU side. In power down mode, all clocks are stopped and no power is consumed.

The WAI instruction puts the MCU in a low power consumption stand-by mode. Additional power can be saved in power down mode because the CPU clocks are stopped. After leaving this power down mode, the MSCAN restarts and enters normal mode again. While the CPU is in wait mode, the MSCAN can be operated in normal mode and generate interrupts.

0 Kudos