Question: Edit code (toggles red light when overflow occurs) using timer Timer_A to toggle two LEDS(red and green) in periodic intervals A)1 sec B)5sec C)30 sec

Edit code (toggles red light when overflow occurs) using timer Timer_A to toggle two LEDS(red and green) in periodic intervals

A)1 sec B)5sec C)30 sec

#include

#define RedLED BIT0

#define RedLEDToggle (P1OUT ^=RedLED)

Void main (void)

{

WDTCTL=WDTPW|WDTHOLD;

P1DIR = REDLED;

P1OUT=RedLED;

TACTL=TASSEL_2|ID_3|MC_3|TAIE;

TACCRO=62500;

_enable_interrupts();

LPM1;

}

#pragma vector=TIMER0_A1_VECTOR

__interrupt void TIMER_A(void)

{ switch(TAIV)

{

case 0x02: break;

case 0x04: break;

case 0x0A: REDLEDTOGGLE;

break;

}

}

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!