Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts of Database Management

Authors: Philip J. Pratt, Joseph J. Adamski

7th edition

978-1111825911, 1111825912, 978-1133684374, 1133684378, 978-111182591

More Books

Students also viewed these Databases questions