Running Modes
Mode 0
Red LED blinks every 1/2 a second (using execution loop)
Mo
Running Modes
Mode 0
Red LED blinks every 1/2 a second (using execution loop)
Mode 1
Red LED blinks every 1/2 second (using execution loop)
Green LED blinks every 1/3 second (using timer & interrupt)
Mode 2
Red LED turns off
Green LED blinks every 1/3 second (using timer & interrupt)
Blue LED blinks every 1/4 second (using timer & signal)
Mode 3
Red LED stays off
Green LED turns off
Blue LED blinks slower, every 1/2 second (using timer & signal)
Objective
For this assignment, you should attempt to recreate the RGB LED activity listed above with the method inside parenthesis. Pressing the button on the Blacktop should advance to the next mode (advancing from 3 should go back to 0) and pressing the side button on the Launchpad should step back to the previous mode (moving backward from 0 should set the mode to 3).
Because you are using the buttons as interrupts, the completed program will have some initialization, execution loop and three interrupts: one for TIMER1_A0_VECTOR, one for PORT1_VECTOR and one for PORT2_VECTOR.
Tips
Do not recommend setting hardware parameters in the execution loop based on what mode you are in (for instance, checking to see what mode you are in every loop iteration and enabling interrupts for the timer if in Mode 1 or 2, otherwise disabling interrupts if in Mode 0 or 3).
This is a waste of time. You should set hardware parameters when changing modes.
Timers Map
Here is a map of the two timer modules and their relevant “registers”:I have the code I want you to complete it you will find the code in the doc complete the rest of the code (DONT MAKE CHANGES ON IT) THE COLORS HAVE TO CHANGE WHEN CLICKING BUTTON 1,2.Ihave upload an example of how when clicking the button the lights will change but that is JUST EXAMPLE AND IT IS IN C LANGUAGE THIS ASSIGNMENT IS ASSEMBLY