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 and implement grades of brightness. Every press of the BTN button should modify the LED brightness randomly. Use TIMER for generating PWM and LETIMER for buttons debouncing.
Use software random number generator that generates next random number in the range according to the recursive formula
rand rand
Before generating the random numbers initialize variable rand with Recursive implementation of the random number generator is not required.
making it entirely interruptdriven and adding to it the following features:
LED brightness must be randomly modified with second period only when the button BTN is pressed and must be kept at the last set value upon its release.
When button BTN is pressed, the LED brightness must be set to a random value every second provided by RTCC Use the same software pseudorandom number generator as in Assignment Detection of any button press should start TIMER for debouncing and detection of any button release should stop it
Implement button debouncing algorithm with ms debouncing period provided by TIMER
Use LETIMER for direct control of the LED brightness with PWM and ms period.
Thus, you will need to implement handlers for events: button state changes, TIMERms events, and RTCC sec event. Each of them must be interruptbased 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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
