EasyManuals Logo

Texas Instruments MSP430 Student Guide

Texas Instruments MSP430
398 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #258 background imageLoading...
Page #258 background image
Timer Details: Configuring TIMER_A
Timer Details: Configuring TIMER_A
There are four steps required to get Timer_A working in your system:
1. Configure the main Timer/Counter by programming the TACTL control register.
2. Setup each CCR that is needed for your application. We will examine this step from both the
Capture and Compare perspective.
3. Next, you need to start the timer. (We also listed clearing the timer IFG bits, which is normally
done right before starting the timer.)
4 Steps to Program Timer_A
16-bit Counter (TAR)
CCR0 (TACCR0)
.
.
.
Timer_A Ctrl Reg (TACTL)
CCR0 Ctrl Reg (TACCTL0)
CCR6 (TACCR6)
CCR6 Ctrl Reg (TACCTL6)
Timer Setup Code
1. Configure Timer/Counter (TACTL)
Clocking
Which Count Mode
Interrupt on TAR rollover?
2. Setup Capture and/or Compare Registers
Capture (TACCTL):
Input
Interrupt on Capture?
Compare (TACCTL, TACCR):
Compare-to Value
Output mode (How output signal
changes at compare (EQU) events)
Interrupt on Compare?
3. Clear interrupt Flags & Start Timer
Timer Interrupt Service Routine(s)
4. Write 1-2 ISR’s (CCR0, others)
4. Finally, if your timer is generating interrupts, you need to have an associated ISR for each
one.
(While interrupts were covered in the last chapter, we briefly summarize this again in context of
the Timer_A.)
We will intermix how to write code for the timer with further examination of the timer’s features.
6 - 12 MSP430 Workshop - Timers

Table of Contents

Other manuals for Texas Instruments MSP430

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Texas Instruments MSP430 and is the answer not in the manual?

Texas Instruments MSP430 Specifications

General IconGeneral
BrandTexas Instruments
ModelMSP430
CategoryMicrocontrollers
LanguageEnglish

Related product manuals