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 #255 background imageLoading...
Page #255 background image
Timer Basics: How Timers Work
As we just discussed, the Capture feature provides a deterministic method of capturing the count
value when triggered. While handy, there is another important requirement for timers…
Compare
A key feature for timers is the ability to create a consistent, periodic interrupts.
As we know, TIMER_A can do this, but the timer’s frequency (i.e. time period) is limited to
dividing the input clock by 2
16
. So, while the timer may be consistent, but not very flexible.
Thankfully, the Compare feature of TIMER_A (TIMER_B & TIMER_D) solves this problem.
Compare Basics
Compare Actions
Interrupt (CCIFGn)
Signal peripheral
Modify pin (TAx.n)
Capture/Compare
Register (CCR
n
)
Counter
Register
15 0
Clock Input
Clock
GPIO Pin (TACLK)
Counter
Overflow Action
Interrupt (TAIFG)
when Counter = Compare
Compare Actions can occur
Notes
There are usually 2 to 7 compare registers (CCR’s), therefore
up to 8 interrupts or signals can be generated
Counter must count-to Compare value to generate action
TAR
Once again, the top portion of this diagram remains the same (Clock Input + Counter Register).
The bottom portion of the diagram differs from the previous diagrams. In this case, rather than
using the CCR register for capture, it’s used as a compare register. In this mode, whenever a
match between the Counter and Compare occurs, a compare action is triggered. The compare
actions include generating an interrupt, signaling another peripheral (e.g. triggering an ADC
conversion), or changing the state of an external pin.
The “modify pin” action is a very powerful capability. Using the timer’s compare feature, we can
create sophisticated PWM waveforms. (Don’t worry, there’s more about this later in the chapter.)
MSP430 Workshop - Timers 6 - 9

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