Question: 3 . 2 The Up Mode In the up mode, we set the upperbound of TAR to any value that we choose. TAR counts from

3.2 The Up Mode
In the up mode, we set the upperbound of TAR to any value that we choose. TAR counts
from zero up to the value of register TACCR0. This is the register of Channel 0. The up mode
is inherently linked to Channel 0. The timeline below shows how the timer runs. When TAR
reaches TACCR0, it rolls back to zero and continues counting. Also, when TAR rolls back to
zero (while counting), the TAIFG flag is set by the hardware.
TAR: 0,1,2,..., TACCR0,0,1,2,..., TACCR0,0,1,...
TAIFG set TAIFG set
The register TACCR0 is 16-bit. To have a period of 100 cycles, we set TACCR0=100-1=99.
TAR then counts between 0 and 99, spending one cycle at each count.
Since our microcontroller chip has multiple Timer A modules (called Timer0 A, Timer1 A,
etc), well use the term TA0CCR0 in the code to indicate that were using Timer0 A Channel 0
register.
The code for the up mode is very similar to the continuous mode. Below are the differences.
First, we need to set TARs upperbound using TA0CCR0. Set it so the timers period is 1 second
(flashing period is 2 seconds). Well use ACLK (configured to the 32 KHz crystal) and divide it
by 1.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!