EasyManuals Logo

Texas Instruments MSP430 User Manual

Texas Instruments MSP430
413 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 #105 background imageLoading...
Page #105 background image
105
Explanation
In this demo, Timer_A3 is configured as an up counting timer, i.e. it will count from 0 to a top value
determined by the contents of TA0CCR0 register. Again, SMCLK is used as the clock source for the
timer but this time it is not scaled down. SMCLK is set to 1 MHz and so does Timer_A3. This means
every one tick of Timer_A3 is one microsecond in duration. To make it appear that all four seven
segments are simultaneously on without any flickering, we need to scan them fast enough to fool our
eyes. We also have to ensure that each segment gets enough time to light up properly. In order to do
so we need to scan the segments at one millisecond rate. To get one millisecond from a timer with
one microsecond tick interval, we have to load it with 999, not 1000. This is so because from 0 to 999
the total number of ticks is 1000. In short, 1000 times 1 microsecond equals 1 millisecond. Thus,
TA0CCR0 is loaded with 999.
/* TA0CCR0, Timer_A Capture/Compare Register 0 */
TA0CCR0 = 999;
/*
* TA0CTL, Timer_A3 Control Register
*
* TASSEL_2 -- SMCLK
* ID_0 -- Divider - /1
* MC_1 -- Up Mode
*/
TA0CTL = TASSEL_2 | ID_0 | MC_1 | TAIE;

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