210 likes | 348 Vues
Lizard Labs Interrupts and Energy Modes. EFM32 Training Module. Interrupts. Interrupt Activation. Peripheral. NVIC. event. IF. SETPEND. enter ISR. IEN. SETENA. Clearing Interrupt Flag. Clearing Interrupt Flag. Clearing Interrupt Flag. Interrupt Example.
E N D
Lizard LabsInterrupts and Energy Modes EFM32 Training Module
Interrupt Activation Peripheral NVIC event IF SETPEND enter ISR IEN SETENA
Enter/Exit Energy Modes • Enter any low energy mode from software • Any event wakes up the CPU (enters EM0) • In EM4 MCU has to go through reset to wake up
Entering a Low Energy Mode Sleep instruction • WFI – Wait for Interrupt WFI SLEEPDEEP bit set? N Y LF oscillators running? Write EM4 sequence to EM4CTRL Y N EM1 EM4 EM2 EM3
Peripherals and Energy Modes CPU and Memory Clock Management Energy Management ARM Cortex-M3 processor High Freq Crystal Osc High Freq RC Osc Voltage Regulator Embedded Trace Macrocell Voltage Comparator ARM Cortex-M processor Memory Protection Unit MemoryProtection Unit Low Freq Crystal Osc Low Freq RC Osc Power-on Reset Brown-out Detector Flash Program Memory RAM Memory Debug Interface DMA Ultra Low Freq RC Osc Auxiliary RC Osc Auxiliary RC Osc Back-up Power Domain 32-bit bus Peripheral Reflex System Serial Interfaces I/O Ports Timers and Triggers Analog Modules Security Low Energy Sensor IF USART External Bus Interface Timer/Counter ADC DAC UART AES Accelerator TFT Driver Low Energy Timer Real Time Counter LCD Controller Operational Amplifier Low Energy UART I2C External Interrupt General Purpose I/O Pulse Counter Watchdog Timer Analog Comparator Pin Reset GPIO Wake-up USB Backup RTC EM0 (Run Mode) Available down to: EM1 (Sleep) EM2 (Deep Sleep) EM3 (Stop Mode) EM4 (Shutoff Mode)
Program Flow – Sleep and Interrupt Program ISR INSTR1 INSTR1 INSTR2 INSTR2 Event Sleep EM1 INSTR3 WFI RETI INSTR4 INSTR5
Program FlowSleep-on-Exit ISR1 ISR2 INSTR1 INSTR1 INSTR2 INSTR2 Event 2 Event 1 EM1 INSTR3 INSTR3 RETI RETI Sleep Note: SLEEPONEXIT bit in SCR must be set!
InterruptPriority • 3 high-priority interrupts • 8 configurable levels • Default level is 0 • Interrupt preemption
InterruptPreemption ISR1 Priority: 2 ISR2 Priority: 1 Program INSTR1 INSTR1 INSTR1 Interrupt Interrupt INSTR2 INSTR2 INSTR2 INSTR3 INSTR3 INSTR3 INSTR4 INSTR4 RETI INSTR5 RETI
www.silabs.com/mcu Hands-On Lesson: TM0008 in Simplicity Studio