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 #298 background imageLoading...
Page #298 background image
(Extra Credit) Lab 6c Timer using Up Mode
4. Modify the TIMER_A_configureUpMode() function?
Here is the code we wrote for the previous part of the lab exercise. We only need to make
one change to the code. Since we will drive the signal directly from the timer, we don’t need
to generate the CCR0 interrupt anymore.
Mark up the code below to disable the interrupt.
(We’ll bet you can make this change without
even looking at the API documentation. Intuitive code is one of the benefits of using DriverLib!)
TIMER_A_configureUpMode(
TIMER_A0_BASE, // Setup Timer A0
TIMER_A_CLOCKSOURCE_ACLK,
// Timer clock source
TIMER_A_CLOCKSOURCE_DIVIDER_1, // Timer clock divider
0xFFFF / 2, // Period: (0x8000) / 32Khz = 1/2 sec
TIMER_A_TAIE_INTERRUPT_ENABLE, // Enable interrupt on TAR counter rollover
TIMER_A_CCIE_CCR0_INTERRUPT_ENABLE, // Enable CCR0 compare interrupt
TIMER_A_DO_CLEAR // Clear TAR & previous divider state
);
5. What ‘compare’ value does CCR2 need to equal in order to toggle the output signal at
¼ second?
CCR0=0x8000
CCR2
0x0
¼ Second
CCR2 = __________________
½ Second
6 - 52 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