Question: Using C Code for the MSP 430. Problem 1: Modify Example 10.9 using the timer Timer_A to toggle two LEDs in periodic time intervals of

Using C Code for the MSP 430.

Problem 1: Modify Example 10.9 using the timer Timer_A to toggle two LEDs in periodic time intervals of

1 second

5 seconds

30 seconds

You need to explain in detail the setting for Timer_A and the code in the interrupt service routine.

Problem 2: Modify the program written in Problem 1 to accept port interrupt from a switch. Initially, the system is toggling the two LEDs every 2 seconds. Whenever a port interrupt occurs, the LEDs will go to their original states for 5 seconds and then continue toggling every 2 seconds.

Using C Code for the MSP 430. Problem 1: Modify Example 10.9

Listing 10.9 Usage of the TAIV in C. #include #define RedLED B1T0 #define RedLEDToggle (PlOUT ^= RedLED ) void main(void) P?DIR RedLED; P1OUT = RedLED; TACCR0 = 62500; .enableinterrupts () LPM1/ enter low power mode #pragma vector-TIMER0.A1.VECTOR -interrupt void Timer-A(void)l switch( TAIV) case 0x02: break; case 0x04: break; case 0x0A: RedLEDToggle; break; Listing 10.9 Usage of the TAIV in C. #include #define RedLED B1T0 #define RedLEDToggle (PlOUT ^= RedLED ) void main(void) P?DIR RedLED; P1OUT = RedLED; TACCR0 = 62500; .enableinterrupts () LPM1/ enter low power mode #pragma vector-TIMER0.A1.VECTOR -interrupt void Timer-A(void)l 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!