Question: Assignment 100 pts) 1. Write an assembly program that interfaces switches, SW1 and SW2, and LEDs, LED1 and LED2, as follows (You should use interrupts
Assignment 100 pts) 1. Write an assembly program that interfaces switches, SW1 and SW2, and LEDs, LED1 and LED2, as follows (You should use interrupts for both switches). [50 pts Initially, both the LEDs should be turned off. When SW2 is pressed for the first time, LED2 should be turned on. The next time SW2 is pressed, LED2 is turned off. The sequence continues hence each press changes the state of LED2. SW1 controls LED1 as follows: while SW1 is pressed, LED1 is on and when SW1 is released LED1 is turned off. Hint: Inside the ISR change the edge of P1IES to trigger the ISR as required. a. b. c. 2. Consider the C program given below: [50 pts #include sp430.h void main (void) // Stop watchdog timer long int i -e; P2DIR exe6; P2OUT- 8x82; while(1) // P2.1, P2.2 to output direction // Turn on LED2 /I Loop in place for(i-0; i
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
