Question: Q 2 [ 4 0 Points ] . You are designing a system to control the brightness of an LED using timer - based Pulse
Q Points You are designing a system to control the brightness of an LED using timerbased Pulse Width Modulation
PWM on a microcontroller.
Part Calculate the period of a PWM signal with a frequency of kHz in microseconds. The microcontrollers clock
frequency is MHz and the timer uses a prescaler of Calculate the value to be loaded into the timers register
TACCRx value to achieve a kHz PWM frequency.
Part Given the calculated TACCRx value from part compute the TACCRx for the and duty cycle.
Part Assume the timer is in bit mode max Calculate the minimum and maximum achievable PWM fre
quencies using the MHz clock and a prescaler of Determine the resolution of the duty cycle as a percentage.
Part Suppose you switch to a bit timer with the same MHz clock and a prescaler of Calculate the
maximum TACCRx value. Calculate the minimum achievable PWM frequency.
Q Points A push button is used to control an LED based on these rules: Every time the push button is pressed,
the LED turns ON for seconds; If the button is pressed again within the second window, the timer resets, and the
LED stays ON for another seconds from the latest press. A user interacts with the button as follows:
Press : Time seconds
Press : Time seconds
Press : Time seconds
Press : Time seconds
Part Calculate the total time the LED stays ON based on the button press sequence. Provide a timeline showing
the ON and OFF states of the LED.
Part Explain if there are any periods where pressing the button has no effect and why that happens.
Part Consider a scenario where the button is pressed every seconds starting at Time seconds. How long
would the LED remain ON by the th press?
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
