Question
Using the UP mode: Write a C code that runs on the LaunchPad MSP430 and uses Timer_A in the continuous mode. Run the timer from
Using the UP mode: Write a C code that runs on the LaunchPad MSP430 and uses Timer_A in the continuous mode. Run the timer from ACLK and set it to the 12 KHz VLO (code shown 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.
Timer_A Elements: Channel 0
Event: TAR= TACCR0 (compare)
Bits: CCIE/CCIFG
Main register (16-bit): TACCR0
Configuration register (16-bit): TACCTL0
Vector: TIMERA0_VECTOR (single-source)
Configuration:
TASSEL = [1: ACLK]
ID = [0: divide by 1] [1: divide by 2] [2: divide by 4] [3: divide by 8]
Mode = [1: UP]
TACLR = [Clear TAR to zero]
TACCR0 = [TAR]
//Code that sets ACLK to VLO @ 12 kHz
BCSCTL1 &= ~XTS; //Set XTS=0
BCSCTL3 &= ~LFXT1S_3; //Clear LFXT1S
BCSCTL |= LFXT1S_2; // Set LFXT1S=2 (VLO)
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