Question: 2 . There is to be an array VALUES of 1 6 unsigned 8 - bit numbers in the range 0 - 1 5 .
There is to be an array VALUES of unsigned bit numbers in the range Display these in a
Memory View using the Hex rendering to see hex bytes Use the following values, in this order:
xxxxxxxxxxxFxExDxCxBxA
There are to be six global variables in data memory: PHASE, MINS, MAXS, MINU, MAXU, AVGU.
These are to be displayed in the Live Expressions View. Use Hex format.
Variable PHASE is to be a counter that increments from to it will not repeat. Each press
of the User Button is to interrupt the program to increment the value of PHASE. That is the only
function to be performed in response to the button interrupt.
The program is to perform a series of five tasks. Each task is to be a subroutine, called from the main
program. Following initialization of devices and global variables and turning off all LEDs, the main
program should contain only the five task subroutine calls, followed by a Here: b Here instruction
at the end to effectively stop the program after completing the five tasks.
Remain in each task subroutine until the value of PHASE changes. Then return to the main loop to
call the subroutine for the next task.
The tasks are to be performed are as follows.
TaskPHASE : In this subroutine:
Execute a continuous while loop that checks PHASE and returns when PHASE is no longer
TaskPHASE : In this subroutine:
a Configure the timer so that timer interrupts produce the LED pattern from Step of
Homework This pattern is to continue until the next task begins.
b Treating NUMBERS as an array of signed integers, find the minimum most negative value
and the maximum most positive value in the array. Store these in variables MINS and
MAXS, respectively.
c Execute a while loop to check PHASE and return with it is no longer
TaskPHASE :
a Configure the timer so that timer interrupts produce the blue and orange LED pattern from
Homework This pattern is to continue until the next task begins.
b Treating NUMBERS as an array of unsigned integers, find the minimum value and the
maximum value in the array. Store these in variables MINU and MAXU, respectively.
c Execute a while loop to check PHASE and return with it is no longer
TaskPHASE :
a Configure the timer so that the timer interrupt handler will read bytes from array VALUES
and display them on the LEDs. The bit number represented by bits of the byte are to
be displayed on the BlueRedOrangeGreen LEDs pins PDPD For example, if the
value to be displayed is then Blue would be off, Red and Orange would be
on and Green would be off. Each bytes LED representation should display for one half
second before changing to the next byte in the array. Stop changing the LEDs after the final
value of the array has been displayed, leaving that value on the LEDs until the next task.
b Treating NUMBERS as an array of unsigned integers, find the average of the values and
store this in variable AVGU.
c Execute a while loop to check PHASE and return with it is no longer
TaskPHASE :
Disable timer and button interrupts, turn all LEDs ON and return to the main progra
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
