Question: Lab 2 . GPIO on the TM 4 C 1 2 3 : Sequence - based Output Colors Using Arm Assembly Language ; Test 1

Lab 2. GPIO on the TM4C123: Sequence-based Output Colors
Using Arm Assembly Language
; Test 1
redPattern EQU 2_01010101010101010101010101010101
bluePattern EQU 2_01010101010101010101010101010101
greenPattern EQU 2_01010101010101010101010101010101
; Test 2
;redPattern EQU 2_00000101000000000101000000000101
;bluePattern EQU 2_00000101000001010000000001010000
;greenPattern EQU 2_00000101010100000000010100000000
; Test 3
;redPattern EQU 2_00010001000100010001000100010001
;bluePattern EQU 2_00100010001000100010001000100010
;greenPattern EQU 2_01000100010001000100010001000100
Purpose
The general purpose of this laboratory is to familiarize you further with the software development steps using the uVision simulator. You will learn how to perform digital input/output on parallel ports of the TM4C123. Software skills you will learn include shifting and rotation of registers.
You are NOT allowed to use conditional branches in your solution.
The ONLY instructions that you are allowed to use in your solution are:
Rotates
Shifts
Moves
Unconditional Branches (including BL).
You are also allowed to call the two subroutines provided (setData & wait500ms). No other instructions or subroutines are allowed.
In addition, your program (not including comments, directives, and subroutines) must be 25 lines of code or less.
Instructions
Use the starter project provided to you. Submit the project folder to in ONE zip file and the lab report as a separate PDF file.
Overview
The objective of this system is to make the LEDs on the LaunchPad blink in a very specific order. You will be given some test patters to try out. Each test pattern has 3 parts: the red pattern, blue pattern, and the green pattern. The pattern begins in bit 0 and ends in bit 31. However, your program will repeat each 32-bit sequence indefinitely.
For instance, if the patterns were given as follows:
redPattern EQU 2_01010101010101010101010101010101
bluePattern EQU 2_01010101010101010101010101010101
greenPattern EQU 2_01010101010101010101010101010101
then the first action is that the LaunchPad would turn all LEDs (RBG) on for 500ms because bit 0 of each pattern is 1. The second action is to turn the LEDs off for 500ms because bit 1 of each pattern is low.
If the pattern were instead as follows:
redPattern EQU 2_01010101010101010101010101010101
bluePattern EQU 2_00000000000000000000000000000000
greenPattern EQU 2_00000000000000000000000000000000
then only the red LED would flash because the blue and green patterns are always 0.
The last bits to be output are bits 31 of each pattern. Then the whole sequence begins again. Note that the patterns can be any combination of 1s and 0s for each color.
You will be using one of the I/O ports on the TM4c123(Port F, PF). Port F has 3 bits that are hardwired on LaunchPad to the LEDs. The outputs are in positive logic:
outputting a 1 will turn on the LED,
outputting a 0 will turn off the LED.
Below is the mapping of the I/O pins on Port F that are hardwired to the LEDs.
Bit1 is an output (connected to the Red LED)
Bit2 is an output (connected to the Blue LED)
Bit3 is an output (connected to the Green LED)
You are given two subroutines in the starter project to use as needed:
1. setData This subroutine outputs the 3 data bits to the microcontroller I/O pins. You must ensure that the value that you want to send to the red LED is in bit 1, the value that you want to send to the blue LED is in bit 2, and the value that you want to send to the green LED is in bit 3. All other bit values will be ignored. The data to output to the LEDs must be in R0 when you call the subroutine.
There is no return data. This subroutine overwrites the value in R1.
The subroutine is called as follows:
BL setData
2. wait500ms This subroutine should just provide 500ms of time delay. You must edit the first instruction in the subroutine so that the delay time is approximately 500ms each time the subroutine is called.
There is no return data. This subroutine overwrites the value in R0.
The subroutine is called as follows:
BL waitXms
Test 1(simulation)
The program demonstrates full functionality in the simulator by turning the output LEDs on and off according to the input patterns redPattern, bluePatter, and greenPattern. The program runs indefinitely.
Test 2(hardware demo)
The program demonstrates full functionality on the TI LaunchPad by turning the output LEDs on and off according to the input patterns redPattern, bluePatter, and greenPattern. The program runs indefinitely.
You need to demonstrate both the simulation part and the hardware part to the Lab instructor. You need to modify the code to show two different patterns to the lab instructor during the live demonstration. Both team members need to be present at the time of the demonstration. Please, show steps and code. I am lost

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 Programming Questions!