Question: Task 1: Write a program using both external interrupt and PORTB interrupt to adjust a PWM signal. Connections: Two buttons at RB0 and RB4.
Task 1: Write a program using both external interrupt and PORTB interrupt to adjust a PWM signal.
• Connections: Two buttons at RB0 and RB4. One LED at RA1
• Concept: There are two delay loops named t_up and t_down. Their total is always constant T.
• Main program: Star with t_up = t_down. In an infinite loop, turn on the LED and wait for t_up, turn off LED and wait for t_down.
• External Interrupt: Increase t_up by 10% of T. If t_up is 100% of T don’t increase.
• PORTB Interrupt: Decrease t_up by 10% of T. If t_up is 0% of T don’t decrease.
Write button functions.
Step by Step Solution
3.49 Rating (149 Votes )
There are 3 Steps involved in it
Creating a program to adjust a PWM signal using both external interrupt and PORTB interrupts involves working at the embedded programming level often ... View full answer
Get step-by-step solutions from verified subject matter experts
