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

1 Expert Approved Answer
Step: 1 Unlock

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

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 Computer Engineering Questions!