12.07.2015 Views

Low Energy Timer - AN0026 - Application Note - Energy Micro

Low Energy Timer - AN0026 - Application Note - Energy Micro

Low Energy Timer - AN0026 - Application Note - Energy Micro

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

1 Introduction...the world's most energy friendly microcontrollersThe unique LETIMER TM , the <strong>Low</strong> <strong>Energy</strong> <strong>Timer</strong>, is a 16-bit timer that is available in energy mode EM2in addition to EM1 and EM0. Because of this, it can be used for timing and output generation when mostof the device is powered down, allowing simple tasks to be performed while the power consumption ofthe system is kept at an absolute minimum. The LETIMER runs from the LFACLK which can be clockedby the LFXO, LFRCO or HFCORECLK LE /2. If clocked by the HFCORECLK LE /2 the LETIMER and otherperipherals running from the LFACLK will not be available in EM2.The LETIMER can be used to output a variety of waveforms with minimal software intervention.Thewaveforms include PWM, pulses with the duraction of one LFACLK LETIMER period and variable frequencywaveforms. The LETIMER is also connected to the Real Time Counter (RTC), and can be configuredto start counting on compare matches from the RTC.An overview of the LETIMER module is shown in Figure 1.1 (p. 2) . The LETIMER is a16-bit down-counter with two compare registers, LETIMERn_COMP0 and LETIMERn_COMP1. TheLETIMERn_COMP0 register can optionally act as a top value for the counter. The repeat counterLETIMERn_REP0 allows the timer to count a specified number of times before it stops. Both theLETIMERn_COMP0 and LETIMERn_REP0 registers can be double buffered by the LETIMERn_COMP1and LETIMERn_REP1 registers to allow continuous operation. The timer can generate a single pinoutput, or two linked outputs.Figure 1.1. LETIMER OverviewPeripheral busLETIMER Controland StatusCOMP1(Top Buffer)=COMP1 Match(COMP1 interrupt flag)RTC eventSWLFACLK LETIMERnStartUpdateReloadCOMP0(Top)CNT (Counter)Top loadlogic= 0=COMP0 Match(COMP0 interrupt flag)PulseControlUnderflow(UF interrupt flag)pinLETn_O0ctrlStop 0PulseControlpinctrlLETn_O1REP0(Repeat)BufferWrittenREP1(Repeat Buffer)= 1UpdateRepeatload logic= 1REP0 Zero(REP0 interrupt flag)REP1 Zero(REP1 interrupt flag)2013-05-08 - an0026_Rev1.05 2 www.energymicro.com

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!