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 #268 background imageLoading...
Page #268 background image
Timer Details: Configuring TIMER_A
Compare Code Example
Let’s look at the code required to setup CCR2 for use in a Compare operation.
One thing you might notice about the TIMER_A_initCompare() function is that it requires fewer
parameters than the complementary initCompare function.
Example’s Parameter Value What is Parameter For? Value
TIMER_A0_BASE
Which timer are you using? TA0
TIMER_A_CAPTURECOMPARE_REGISTER_2
Which CCR is being configured? CCR2
TIMER_A_CAPTURECOMPARE_INTERRUPT_ENABLE
Enable the CCR interrupt? CC2IE = 1
TIMER_A_OUTPUTMODE_SET_RESET
How should the output signal be handled? OUTMOD=0x3
0xBEEF
What ‘compare’ value will be written to CCR2? CCR2 = 0xBEEF
The OutputMode setting will be configured using the “Set/Reset” mode (which correlates to the
value 0x3). Once again, with so many different output mode choices, we’ll defer the full
explanation of this until the next topic.
6 - 22 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