Hello, welcome to this presentation of the low power timer, or LPTMR, module for Kinetis MCUs. In this session you ll learn about the LPTMR, it s



Similar documents
Hello, and welcome to this presentation of the STM32L4 reset and clock controller.

Low-Power Pin Sampling Techniques Using Kinetis L Series

APPLICATION NOTE. Atmel AVR134: Real Time Clock (RTC) Using the Asynchronous Timer. Atmel AVR 8-bit Microcontroller. Introduction.

Software Real Time Clock Implementation on MC9S08LG32

Section 29. Real-Time Clock and Calendar (RTCC)

AVR Timer/Counter. Prof Prabhat Ranjan DA-IICT, Gandhinagar

Atmel Norway XMEGA Introduction

RENESAS TECHNICAL UPDATE

AN4646 Application note

Section 14. Compare/Capture/PWM (CCP)

ARM Cortex STM series

HT46R14A Single Phase AC Induction Motor Frequency Converter Application

Real-Time Clock. * Real-Time Computing, edited by Duncan A. Mellichamp, Van Nostrand Reinhold

AVR126: ADC of megaavr in Single Ended Mode. Introduction. Features. AVR 8-bit Microcontrollers APPLICATION NOTE

Section bit A/D Converter

Data Sheet. Adaptive Design ltd. Arduino Dual L6470 Stepper Motor Shield V th November L6470 Stepper Motor Shield

8-bit Microcontroller. Application Note. AVR134: Real-Time Clock (RTC) using the Asynchronous Timer. Features. Theory of Operation.

Software Manual RS232 Laser Merge Module. Document # SU Rev A

AVR1321: Using the Atmel AVR XMEGA 32-bit Real Time Counter and Battery Backup System. 8-bit Microcontrollers. Application Note.

The Energy Harvesting Tipping Point for Wireless Sensor Applications

Section 19. Voltage Reference

ETEC Digital Controls PIC Lab 10 Pulse Width Modulation

USER GUIDE EDBG. Description

AVR1003: Using the XMEGA Clock System. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

How To Use A Watt Saver On A Microcontroller (Watt Saver) On A Cell Phone Or Mp3 Player

Chapter 6 PLL and Clock Generator

AVR134: Real Time Clock (RTC) using the Asynchronous Timer. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

Cascaded Counters. Page 1 BYU

Hello, and welcome to this presentation of the STM32 SDMMC controller module. It covers the main features of the controller which is used to connect

PAC52XX Clock Control Firmware Design

AVR131: Using the AVR s High-speed PWM. Introduction. Features. AVR 8-bit Microcontrollers APPLICATION NOTE

Kinetis Peripheral Module Quick Reference A Compilation of Demonstration Software for Kinetis Modules

Experiment # 9. Clock generator circuits & Counters. Eng. Waleed Y. Mousa

Microtronics technologies Mobile:

Getting Started with PIC24F/PIC24H Programming and Interfacing in C

AVR125: ADC of tinyavr in Single Ended Mode. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

NTE2053 Integrated Circuit 8 Bit MPU Compatible A/D Converter

DP8570A DP8570A Timer Clock Peripheral (TCP)

8051 MICROCONTROLLER COURSE

Configuring the FlexTimer for Position and Speed Measurement with an Encoder

Backup Power Domain. AN Application Note. Introduction

AN LPC1700 timer triggered memory to GPIO data transfer. Document information. LPC1700, GPIO, DMA, Timer0, Sleep Mode

DS1621 Digital Thermometer and Thermostat

DS1621 Digital Thermometer and Thermostat

Section 7. Oscillator

MicroMag3 3-Axis Magnetic Sensor Module

8-bit Microcontroller. Application Note. AVR415: RC5 IR Remote Control Transmitter. Features. Introduction. Figure 1.

National CR16C Family On-Chip Emulation. Contents. Technical Notes V

FRDM-KL25Z User's Manual Rev. 1.0

Application Note AN_209. AN_209 PDIUSBD12 to FT120 Migration Guide

TAR25 audio recorder. User manual Version 1.03

8-Bit Flash Microcontroller for Smart Cards. AT89SCXXXXA Summary. Features. Description. Complete datasheet available under NDA

ETEC 2301 Programmable Logic Devices. Chapter 10 Counters. Shawnee State University Department of Industrial and Engineering Technologies

Chapter 13. PIC Family Microcontroller

ES_LPC4357/53/37/33. Errata sheet LPC4357/53/37/33. Document information

APPLICATION. si32library. Callback CMSIS HARDWARE. Figure 1. Firmware Layer Block Diagram

Am186ER/Am188ER AMD Continues 16-bit Innovation

HDMM01 V1.0. Dual-axis Magnetic Sensor Module With I 2 C Interface FEATURES. Signal Path X

AN3371 Application note

CoE3DJ4 Digital Systems Design. Chapter 4: Timer operation

UNIT 4 Software Development Flow

Timer A (0 and 1) and PWM EE3376

Using Altera MAX Series as Microcontroller I/O Expanders

1. Learn about the 555 timer integrated circuit and applications 2. Apply the 555 timer to build an infrared (IR) transmitter and receiver

Comparison of MC9S08QE128 and MCF51QE128 Microcontrollers Scott Pape and Eduardo Montanez Systems Engineering, Freescale Microcontroller Division

STM32L. Ultra-low-power Cortex -M3 devices

A 5 Degree Feedback Control Robotic Arm (Haptic Arm)

Extending the swsusp Hibernation Framework to ARM. Russell Dill

CHAPTER 11: Flip Flops

CHAPTER 1 COMMANDS FOR DEVICE MANAGEMENT...

Develop a Dallas 1-Wire Master Using the Z8F1680 Series of MCUs

1/22/16. You Tube Video. Definitions. Duty Cycle: on-time per period (specified in per cent)

Hello and welcome to this training module for the STM32L4 Liquid Crystal Display (LCD) controller. This controller can be used in a wide range of

Please refer to the chapters below for detailed information about all aspects of the products usage.

AN108 IMPLEMENTING A REALTIME CLOCK. Relevant Devices. Introduction. Key Points. Overview

ABB i-bus EIB Logic Module LM/S 1.1

Implementing a Real-Time Clock on the MSP430

GCLK (Generic Clock Management) PM (Power Management) SYSCTRL (Clock Source Control) The following devices can use this module:

LCM NHD-12032BZ-FSW-GBW. User s Guide. (Liquid Crystal Display Graphic Module) RoHS Compliant. For product support, contact

Freescale Semiconductor, I

Hi Hsiao-Lung Chan Dept Electrical Engineering Chang Gung University, Taiwan

Designing an Induction Cooker Using the S08PT Family

How To Program A Microcontroller Board (Eb064) With A Psp Microcontroller (B064-74) With An Ios 2.5V (Power) And A Ppt (Power Control) (Power Supply) (

Section bit A/D Converter

AT15007: Differences between ATmega328/P and ATmega328PB. Introduction. Features. Atmel AVR 8-bit Microcontrollers APPLICATION NOTE

Decimal Number (base 10) Binary Number (base 2)

Fujitsu Microelectronics Europe Application Note MCU-AN E-V10 FR FAMILY 32-BIT MICROCONTROLLER MB91460 CLOCK SUPERVISOR APPLICATION NOTE

Reconfigurable System-on-Chip Design

Phase-Locked Loop Based Clock Generators

F 2 MC-8FX FAMILY MB95200 SERIES ELECTRONIC SAFE DEMO REFERENCE SOLUTION 8-BITMICROCONTROLLER APPLICATION NOTE

Design of a High Speed Communications Link Using Field Programmable Gate Arrays

Flexible Active Shutter Control Interface using the MC1323x

Section 9. I/O Ports

AVR311: Using the TWI Module as I2C Slave. Introduction. Features. AVR 8-bit Microcontrollers APPLICATION NOTE

DAC Digital To Analog Converter

8254 PROGRAMMABLE INTERVAL TIMER

AVR151: Setup and Use of the SPI. Introduction. Features. Atmel AVR 8-bit Microcontroller APPLICATION NOTE

Freescale Semiconductor, I

X 4 CONFIDENTIAL X 4 OTHER PROGRAMME: CUSTOMER: CONTRACT NO.: WPD NO.: DRD NO.: CONTRACTUAL DOC.:

TURBO PROGRAMMER USB, MMC, SIM DEVELOPMENT KIT

Transcription:

Hello, welcome to this presentation of the low power timer, or LPTMR, module for Kinetis MCUs. In this session you ll learn about the LPTMR, it s main features and the application benefits of leveraging this function. 0

In this presentation, we ll cover: An overview of the module On-chip interconnections and inter-module dependencies Hardware and software configuration An example use case And a few frequently asked questions 1

Let s first begin with an overview of the module. 2

LPTMR Features Features of the low power timer, include: A 16-bit counter: This block can be configured to operate as a time counter with optional prescaler, or as a pulse counter with optional glitch filter across all power modes, including the low-leakage leakage modes. The LPTMR is reset only on global power on reset (POR) or low voltage detect (LVD), allowing it to be used as a time of day counter. The interrupt is generated asynchronously to the system clock and can be used to generate a wakeup from any low-power mode, including the low-leakage modes. The LPTMR has a configurable clock source. 3

Now, let s discuss on-chip interconnections and inter-module dependencies. 4

LPTMR Clocking There are four clock sources by which the LPTMR is clocked: 1. The internal reference clock. This reference is not available in VLPS, LLS or VLLS modes. 2. The external reference clock, which is not available in VLLS0 mode. 3. The low power oscillator. This is a 1kHz clock and is also not available in VLLS0 mode. 4. The 32 khz secondary external reference clock, which is available in all low power modes. The LPTMR operates in all power modes as long as a clock is available. The LPTMR prescale register configures the input source to be used in pulse counter mode with the prescaler clock select bits. These bits should only be altered when the LPTMR is disabled. 5

Now, let s discuss hardware configuration. 6

LPTMR Pulse Counter Input Options In pulse counter mode, the selected input source directly clocks the counter and no other clock source is required. The external inputs for pulse counting are LPTMR_ALT1, LPTMR_ALT2, and when available LPTMR_ALT3. The LPTMR can also count CMP comparisons on CMP0. 7

Board Level Routing Suggestions Ensure the LPTMR_ALT1, LPTMR_ALT2, or LPTMR_ALT3 pins you want to count pulses on are not being used by another feature. Note that LPTMR_ALT1 is muxed with XTAL, and LPTMR_ALT3 is muxed with RESET_B on some devices, limiting the use of these signals as inputs. 8

Next, let s move on and discuss software configuration. 9

LPTMR Register Setup The LPTMR only has three configuration registers, so the setup for basic timer counting and pulse counting is straight forward. The three configuration registers are: 1. The low power timer control status register 2. The low power timer prescale register 3. The low power timer compare register Before using any of these registers, it is important to enable the clock gate to the LPTMR. In addition, any configuration to the LPTMR should happen with the timer disabled, with LPTMRx_CSR[TEN]=0 and always set LPTMRx_CSR[TEN] to 1 as the very last step 10

Example Code Using Kinetis SDK This is an example of the LPTMR configured to generate an interrupt every second. When the interrupt is triggered, LED1 changes status and information is printed to a terminal. To initialize the LPTMR module, call the LPTMR_DRV_Init() function. In order to use this function, it is necessary to define data structure lptmruserconfig. This contains the LPTMR user configuration options. In order to set the period, call the function LPTMR_DRV_SetTimerPeriodUs (microseconds). This function configures the LPTMR time period in microseconds, while the LPTMR is working as a time counter. After the time period, the callback function is called. This function cannot be called while the LPTMR is working as a pulse counter. The value in microseconds (us) should be an integer multiple of the clock source time slice. If the interrupt is enabled, then it is necessary to use the LPTMR_DRV_InstallCallback function. This function installs the user-defined callback in the LPTMR module. When an LPTMR interrupt request is served, the callback is executed inside the ISR. Now we are ready to start the module The LPTRM DRV Start function starts the 11

Let s review an example use case. 12

Typical Use Case: Wake-Up Timer The LPTMR is useful in low power applications. In this example, you ll see it is used as a wake-up timer to wake the part out of sleep modes after a certain amount of time. If a clock is not available, thelptmrcanbeusedinpulse counter mode with the glitch filter enabled to wake-up the part based on pulse counts. In addition the LPTMR can trigger events like an ADC conversion. 13

Now, let s review some frequently asked questions. 14

LPTMR FAQs Question: Does the LPTMR counter increment while in debug? Answer: Yes, the LPTMR counter increments even while halted in debug. Question: The reference manual mentions an LPTMR_ALT3 input pin; where is it? Answer: This input is chip dependent. Please refer to the pinout diagram in the reference manual to confirm whether it is available in your package. Question: How do I properly read the counter register (LPTMRx_CNR)? Answer: The counter register (LPTMR_CNR) cannot be initialized, but can be read at any time by ensuring that the bus clock is at least two times faster than the rate at which the LPTMR counter is incrementing and that on each read, the software first writes to the CNR with any value. 15

This concludes our presentation on the LPTMR module. For more information on the LPTMR for Kinetis MCUs, please visit the references listed here. We also invite you to visit us on the web at Freescale.com/Kinetis and check out our Kinetis community page. 16

17