Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

If any, which line of code is problematic to the function of LEDs toggling? Type in any integer number between 1-30 inclusive as answer 1#include

If any, which line of code is problematic to the function of LEDs toggling? image text in transcribedType in any integer number between 1-30 inclusive as answer

1#include 2 3#define TCNT CONST 10000 4 5// Non-blocking using timer interrupt implementation 6 int main(void) 5 // Stop watchdog timer 8 I/ Upon reset CPU frequency is 16MHz 9 10 PJDIRBITeBIT1; 11 PJOUTBITe; 12 PJOUT &=nBIT1; 13 14 Configure timer A as a clock divider to generate delay 15 TA0CCTL0=CCIE; 16 TA0CTL TASSEL 2 + 1D 3 + MC 1; // Use the SMCLK to clock the counter, SMCLK/8, count up mode 17 TA0CCRO=TCNT CONST-1; 18 // Set PJ.0 and PJ.1 to output direction. We only select these two LEDs to alternate toggling // Arbitrarily set PJ.0 to ON // Set PJ.1 to OFF // Enable counter interrupt on counter compare register 0 // Set maximum count (Interrupt frequency 8MHz/8/TCNT CONST = 10Hz) // Enter LPMe 19 _BIS_SR(CPUOFF) 20 disable interrupt(): 21 22 return 0 23 24 25// TimerA interrupt service routine 26#pragma vector = TIMER0 AO VECTOR 27_interrupt void Timer_A (void) f 28 PJoUT BITe BIT1; 29 30 // Disable interrupts because already set auto startup // Requires a return for new Energia version to be safe from compilation errors // Toggle between PJ.0 and PJ.1 using XOR

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

Spatial Databases A Tour

Authors: Shashi Shekhar, Sanjay Chawla

1st Edition

0130174807, 978-0130174802

More Books

Students also viewed these Databases questions

Question

x-3+1, x23 Let f(x) = -*+3, * Answered: 1 week ago

Answered: 1 week ago

Question

=+j Enabling a productive global workforce.

Answered: 1 week ago

Question

=+ Are you interested in creating or

Answered: 1 week ago

Question

=+working on a micro-multinational?

Answered: 1 week ago