Question
a) Using the continuous mode... Write a C code that runs on the LaunchPad and uses Timer_A in the continuous mode. Run the timer from
a) Using the continuous mode... Write a C code that runs on the LaunchPad and uses Timer_A in the continuous mode. Run the timer
from ACLK and set it to the 12 KHz VLO (see highlighted code below). Within the timer, adjust the
clock signal so that is becomes 6,000 Hz. Each time TAR rolls back to zero, toggle the red LED, which is mapped to Port 1.0 and is active high. What is the duration generated by the timer?
Before writing the code, fill the configuration below by looking at the help sheet.
Configuration TASSEL = ID = Mode = TACLR =
b) Using the up mode...
Write a C code that runs on the LaunchPad and uses Timer_A in the up mode. Run the timer from ACLK and set it to the 12 KHz VLO (see highlighted code below). Within the timer, adjust the clock signal so that is becomes 3,000 Hz. Our goal is to generate a delay of 0.5 seconds. How many cycles does this correspond to? When the duration of the timer elapses, toggle the red LED, which is mapped to Port 1.0 and is active high.
Before writing the code, fill the configuration below by looking at the help sheet.
Configuration TASSEL = ID = Mode = TACLR = TACCR0 =
At startup, ACLK is loaded by default from the crystal. Since the crystal is not soldered on the LaunchPad board out-of-the-box, ACLK is idle. The code below diverts ACLK to the internal VLO signal at 12 KHz.
/7 Code that sets ACLK to VLO @ 12 KHz // Write this at the top of the main // Set XTS=0 // Clear LEXT1S // Set LFXTIS-2 (VLO) BCSCTL3 &= ~LFXT 1S 3; /7 Code that sets ACLK to VLO @ 12 KHz // Write this at the top of the main // Set XTS=0 // Clear LEXT1S // Set LFXTIS-2 (VLO) BCSCTL3 &= ~LFXT 1S 3
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started