MSP432 ARM Timer Programming

Slides:



Advertisements
Similar presentations
Interrupts, Low Power Modes and Timer A (Chapters 6 & 8)
Advertisements

Chung-Ta King National Tsing Hua University
More fun with Timer/Counters
4-1 Timers Timers can be used for  timing  event counting  pulse width measurement  pulse generation  frequency multiplication There are 8 Timers.
Chung-Ta King National Tsing Hua University
UBI >> Contents Chapter 7 Timers Description of clock signals MSP430 Teaching Materials Texas Instruments Incorporated University of Beira Interior (PT)
5-1 Timer/Counters In many microprocessor systems we need to:  count logic pulses  measure the frequency of signals  measure the period of pulses 
Chung-Ta King National Tsing Hua University
Timers. Range of timers Watchdog timer: Included in all devices (watchdog timer+). Its main function is to protect the system against malfunctions but.
LAB 7: WDT+ and Low-Power Optimization
T IMERS - 2. O UTPUT U NIT Each capture/compare block contains an output unit. The output unit is used to generate output signals such as PWM signals.
16-Bit Timer/Counter 1 and 3 Counter/Timer 1,3 (TCNT1, TCNT3) are identical in function. Three separate comparison registers exist. Thus, three separate.
1 Chapter 4 Timer Operation (I. Scott MacKenzie).
ECE 371- Unit 11 Timers and Counters (“Stop Watches and Alarm Clocks”)
7/23 Timers in Coldfire Processor Computer Science & Engineering Department Arizona State University Tempe, AZ Dr. Yann-Hang Lee (480)
ARM Timers.
System Clocks.
Timers ELEC 330 Digital Systems Engineering Dr. Ron Hayne
MSP430 Mixed Signal Microcontroller – Parte 2 Afonso Ferreira Miguel Source: slau056d – Texas instruments.
Unit 10.2 Timer Examples. Example – Music Generation Channel 6 – Set up as a timer Output to Generate Square Waves Channel 4 – Set up as a timer Output.
CPE 323 Introduction to Embedded Computer Systems: Watchdog Timer, Timer A Instructor: Dr Aleksandar Milenkovic Lecture Notes.
Timer Peripherals.
ECE 447 Fall 2009 Lecture 10: TI MSP430 Timers and Capture Modes.
Lecture 11: TI MSP430 Timers Compare Modes
LAB 8: Program Design Pattern and Software Architecture
© 2009, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction  Purpose This course provides an introduction to the peripheral functions.
1 68HC11 Timer Chapter HC11 Timer Subsystem Several timing functions: Basic timing Basic timing Real time interrupts Real time interrupts Output.
Lecture 12 Multi-Function Timer Pulse Unit 2 (MTU2a)
1 68HC11 Timer HC11 or HC12: Chapter HC11 Timer Subsystem  Several timing functions: Basic timing Basic timing Real time interrupts Real time.
Network and Systems Laboratory nslab.ee.ntu.edu.tw.
#1 of 10 Tutorial Introduction PURPOSE -To explain how to configure and use the Timer Interface Module in common applications OBJECTIVES: -Identify the.
67015 ACLK (32.768kHz) Timer count (ex. TA0R) Interrupt Note: Timer Settings : Upmode / CCR0=7 / CCR1 =7/ CCR2=1 Interrupts Enabled: CCR1/CCR2/overflow.
1 68HC11 Timer. 2 68HC11 Timer Subsystem Several timing functions: Basic timing Basic timing Real time interrupts Real time interrupts Output compare.
ECE 382 Lesson 32 Lesson Outline Lab 6 Introduction Pulse Width Modulation Capture / Compare Example Lab 6 Tips Admin Lab#6 “prelab” due BOC lesson 33.
16F877A.
Recall the Container Thermometer
Why are Timer Functions Important?
Lecture 10: TI MSP430 Timers and Capture Modes
ECE 3430 – Intro to Microcomputer Systems
Lecture 8: TI MSP430 Interrupts, ISRs
PWM and DC Motor Control
CS4101 Introduction to Embedded Systems Lab 6: Low-Power Optimization
EMBEDDED SYSTEMS Unit 3.
Timer and Interrupts.
ECE 3430 – Intro to Microcomputer Systems
Timer Source: under
AVR Addressing Modes Subject: Microcontoller & Interfacing
Instructor: Dr Aleksandar Milenkovic Lecture Notes
RX 8-Bit Timer (TMR) 4/20/2011 Rev. 1.00
Freescale ARM Timer Programming
ECE 3430 – Intro to Microcomputer Systems
ECE 3430 – Intro to Microcomputer Systems
CS4101 Introduction to Embedded Systems Lab 7: Serial Communication
CS4101 Introduction to Embedded Systems Lab 4: Interrupt
Atmel ARM Timer Programming
Timer.
8051 Timers / Counters It has two timers Timer 0 and Timer 1.
CS4101 Introduction to Embedded Systems Lab 7: Serial Communication
MSP432 ARM Timer Programming
STM Arm Timer Programming
Timer Source: under
Lecture 12 Multi-Function Timer Pulse Unit 2 (MTU2a)
Timer Source: under
ECE 3430 – Intro to Microcomputer Systems
CS4101 Introduction to Embedded Systems Lab 2: Basic IO and Timer
Prof. Chung-Ta King Department of Computer Science
MSP430 Clock System and Timer
ECE 3567 Microcontrollers Lab
Presentation transcript:

MSP432 ARM Timer Programming Chapter 5 MSP432 ARM Timer Programming

A 3-bit Counter

An 8-bit up-counter stages

An 8-bit down-counter stages

Counting Events Using a Counter

Using Counter as a Timer

Capturing

System Tick Timer Internal Structure

STCTRL (System Tick Control)

System Tick Counting

STRVR vs. STCVR

System Tick Timer Internal Structure

Timer32 Registers Offset Acronym Register Name Type Reset Value 00H T32LOAD1 Timer 1 Load Register RW 04H T32VALUE1 Timer 1 Current Value Register R FFFFFFFFH 08H T32CONTROL1 Timer 1 Timer Control Register 20H 0CH T32INTCLR1 Timer 1 Interrupt Clear Register W - 10H T32RIS1 Timer 1 Raw Interrupt Status Register 14H T32MIS1 Timer 1 Interrupt Status Register 18H T32BGLOAD1 Timer 1 Background Load Register T32LOAD2 Timer 2 Load Register 24H T32VALUE2 Timer 2 Current Value Register 28H T32CONTROL2 Timer 2 Timer Control Register 2CH T32INTCLR2 Timer 2 Interrupt Clear Register 30H T32RIS2 Timer 2 Raw Interrupt Status Register 34H T32MIS2 Timer 2 Interrupt Status Register 38H T32BGLOAD2 Timer 2 Background Load Register 0H

T32CONTROLxRegister

Counting in Free-Running Mode vs. Periodic Mode

T32RIS Register

T32LOAD vs. T32VALUE

The Timer32 Prescaler

Timer_A Simplified Diagram

A more detailed diagram of Timer_A

TAxR register

TAxCTL register

TAxCTL register bit Name Description TAIFG Timer_A Interrupt Flag TAIFG Timer_A Interrupt Flag 0: Timer did not overflow 1: Timer overflowed 1 TAIE Timer_A Interrupt Enable (0: Disabled, 1: Enabled) 2 TACLR Timer_A Clear 4-5 MC Mode Control: 00: Stop mode: timer is halted 01: Up mode: Timer counts up to TAxCCR0 10: Continuous mode: Timer counts up to 0xFFFF 11: Up/down mode: Timer counts up to TAxCCR0 then down to 0. 6-7 ID Input divider: These bits select the divider for the input clock: 00: divide by 1 01: divide by 2 10: divide by 4 11: divide by 8 8-9 TASSEL Timer_A clock Source Select: These bits select the Timer_A clock source: 00: TAxCLK (external clock): The timer uses external clock which is fed to the PM_TAxCLK pin. 01: ACLK (internal clock) 10: SMCLK (internal clock) 11: INCLK

TAxCCRn Registers and TAxCCTLn Flags

TAxCCRn Register

TAxCCTLn Register

TAxCCTLn Register (Table 17-6 of the chip manual) bit Name Description 15-14 CM Capture mode 00: No capture 01: Capture on rising edge 10: Capture on falling edge 11: Capture on both rising and falling edges 13-12 CCIS Capture/compare input select. These its select the TAxCCR0 input signal: 00: CCIxA 01: CCIxB 10: GND 11: VCC 11 SCS Synchronize capture source. This bit is used to synchronize the capture input signal with the timer clock. 0: Asynchronous capture 1: Synchronous capture

TAxCCTLn Register (Table 17-6 of the chip manual) (Cont.) bit Name Description 10 SCCI Synchronized capture/compare input. The selected CCI input signal is latched with the EQUx signal and can be read via this bit. 8 CAP Capture mode 0: Compare mode 1: Capture mode 7-5 OUTMOD Output mode. Modes 2, 3, 6, and 7 are not useful for TAxCCR0 because EQUx = EQU0 000: OUT bit value 001: Set 010: Toggle/reset 011: Set/reset 100: Toggle 101: Reset 110: Toggle/set 111: Reset/set

TAxCCTLn Register (Table 17-6 of the chip manual) (Cont.) bit Name Description 4 CCIE Capture/compare interrupt enable. This bit enables the interrupt request of the corresponding CCIFG flag. 0: Interrupt disabled 1: Interrupt enabled 3 CCI Capture/compare input. The selected input signal can be read by this bit. 2 OUT Output. For output mode 0, this bit directly controls the state of the output. 0: Output low 1: Output high 1 COV Capture overflow. This bit indicates a capture overflow occurred. COV must be reset with software. 0: No capture overflow occurred 1: Capture overflow occurred CCIFG Capture/compare interrupt flag 0: No interrupt pending 1: interrupt pending

TAxEXn Register

Counting in Up Mode

Clock in Timer_A

Continuous mode

Input Edge Time Capturing

TAxCCTLn Register

TAxCCTLn Register (Table 17-6 of the chip manual) bit Name Description 15-14 CM Capture mode 00: No capture 01: Capture on rising edge 10: Capture on falling edge 11: Capture on both rising and falling edges 13-12 CCIS Capture/compare input select. These its select the TAxCCR0 input signal: 00: CCIxA 01: CCIxB 10: GND 11: VCC 11 SCS Synchronize capture source. This bit is used to synchronize the capture input signal with the timer clock. 0: Asynchronous capture 1: Synchronous capture

TAxCCTLn Register (Table 17-6 of the chip manual) (Cont.) bit Name Description 10 SCCI Synchronized capture/compare input. The selected CCI input signal is latched with the EQUx signal and can be read via this bit. 8 CAP Capture mode 0: Compare mode 1: Capture mode 7-5 OUTMOD Output mode. Modes 2, 3, 6, and 7 are not useful for TAxCCR0 because EQUx = EQU0 000: OUT bit value 001: Set 010: Toggle/reset 011: Set/reset 100: Toggle 101: Reset 110: Toggle/set 111: Reset/set

TAxCCTLn Register (Table 17-6 of the chip manual) (Cont.) bit Name Description 4 CCIE Capture/compare interrupt enable. This bit enables the interrupt request of the corresponding CCIFG flag. 0: Interrupt disabled 1: Interrupt enabled 3 CCI Capture/compare input. The selected input signal can be read by this bit. 2 OUT Output. For output mode 0, this bit directly controls the state of the output. 0: Output low 1: Output high 1 COV Capture overflow. This bit indicates a capture overflow occurred. COV must be reset with software. 0: No capture overflow occurred 1: Capture overflow occurred CCIFG Capture/compare interrupt flag 0: No interrupt pending 1: interrupt pending

Choosing the Capture Edge CM Capture mode 00 No capture 01 Capture on rising edge 10 Capture on falling edge 11 Capture on both edges

Port pin assignement of Timer_A TA0.0 P7.3 TA1.0 P8.0 TA2.0 P8.1 TA3.0 P10.4 TA0.1 P2.4 TA1.1 P7.7 TA2.1 P5.6 TA3.1 P10.5 TA0.2 P2.5 TA1.2 P7.6 TA2.2 P5.7 TA3.2 P8.2 TA0.3 P2.6 TA1.3 P7.5 TA2.3 P6.6 TA3.3 P9.2 TA0.4 P2.7 TA1.4 P7.4 TA2.4 P6.7 TA3.4 P9.3

Measuring Period and Pulse Width