Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write an interrupt driven RISC - V MCU program that drives 8 LEDs. Each time there is an interrupt, the program reads a 4 -

Write an interrupt driven RISC-V MCU program that drives 8 LEDs. Each time there is an interrupt, the program reads a 4-bit value from the input port. After reading 16 values (16 interrupts), the program averages those values and outputs the LED pattern corresponding to the average to the LEDs. The LEDs thus represent a visual representation of the average of the value read from the input when each time there was an interrupt. Assume an external device connected to the RISC-V MCU generates an interrupt and provides an input value for reading. You must use the provided LUT for this problem. The dark circles in the diagram below represent the "on" LEDs. Note the difference in average value and the patter on the LEDs that need to be output.
LED port address =0x1100C000
Input port address =0x11004444
Dont use I/O instructions in the interrupt service routine
Minimize the number of instructions in your solution
.data # 16 total values
my_lut: .byte 0x00,0x01,0x02,0x03,0x04,0x06,0x07,0x08, #LED output patterns
.byte 0x0C,0x0E,0x0F,0x10,0x18,0x1C,0x1E,0x1F

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

develop ideas for a research project;

Answered: 1 week ago