Question: Write an ARM assembly program in the Keil MDK format that controls the brightness of the LED on the demo board. Set initial LED duty

Write an ARM assembly program in the Keil MDK format that controls the brightness of the LED on the demo board. Set initial LED duty cycle to 21% and implement 32 grades of brightness. Every press of the BTN0 button should modify the LED brightness randomly. Use TIMER0 for generating PWM and LETIMER for buttons debouncing.
Use software random number generator that generates next random number in the range [0-31] according to the recursive formula
rand =((rand *11045)+123)%32,
Before generating the random numbers initialize variable rand with 21. Recursive implementation of the random number generator is not required.
making it entirely interrupt-driven and adding to it the following features:
LED brightness must be randomly modified with 1/4-second period only when the button BTN0 is pressed and must be kept at the last set value upon its release.
When button BTN0 is pressed, the LED brightness must be set to a random value every 1/4 second provided by RTCC. Use the same software (pseudo)-random number generator as in Assignment 4. Detection of any button press should start TIMER0 for debouncing and detection of any button release should stop it.
Implement button debouncing algorithm with 20-ms debouncing period provided by TIMER0.
Use LETIMER for direct control of the LED brightness with PWM and 5-ms period.
Thus, you will need to implement handlers for 3 events: button state changes, TIMER020-ms events, and RTCC 1/4-sec event. Each of them must be interrupt-based with NVIC, so no polling loops. This way, the main loop in main() should be reduced to
loop wfi b loop

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!