Procedure The basic approach to Lab 2 will be to develop and debug your system u
ID: 3672958 • Letter: P
Question
Procedure
The basic approach to Lab 2 will be to develop and debug your system using the simulator using a negative logic switch (PF4) and a positive logic LED (PF2). This lab will run on the LaunchPad using SW1 on PF4 and the blue LED on PF2.To run the Lab 2 simulator, you must do two things. First, execute Project->Options and select the Debug tab. The debug parameter field must include -dLab2. Second, the Lab2.dll file must be added to your KeilARMBIN folder. You can download Lab2.dll from our class website. You can start this lab by using the starter folder from your Lab 1 and add in more files that are needed for your project.
Part a. Write a Main Program and related subroutines if necessary.
Write a main program in assembly that implements the input/output system. The flow chart is shown in Figure 2.3, illustrating the basic steps for the system.
You should use use bit-specific addressing to access I/O ports.
Part b - Test in Simulation
Test the program in simulation mode. Use the built-in logic analyzer to verify the LED is toggling at the rate at which it was designed. In particular, capture two screenshots like Figure 2.1 showing when the switch is pressed, the LED is ON for 20 ms and OFF for 20 ms.
Part c - Simulation Timing
Simulators typically run slower than real hardware. Use the built in logic analyzer to measure how much Cortex-M time is simulated in 20 seconds. Hit the reset twice to clear the time axis on the plot. Run the simulator for 20 human seconds (real time with your watch), and then stop simulation. Observe the logic analyzer time to determine the amount of Cortex-M simulated. For example, my computer simulated 15 sec of Cortex-M time in 10 sec of human time, meaning the simulator was running 50% faster (1.5x) compared to a real Cortex-M. There are many factors that affect this ratio, so expect to see this ratio vary. The point of the exercise is to get a sense of how a simulator manages time.
Part d - Test in Hardware
Load your software onto the board and test it again. If the PF4 switch is not pressed, then the blue LED is on, which you can see by noticing its bright blue color. If the PF4 switch is pressed, then the blue LED toggles and you can see that by noticing its dim blue color.
Explanation / Answer
please follow this link
http://users.ece.utexas.edu/~valvano/Volume1/EE319K_LabManualSp15.pdf
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.