Question: Repeat Problem using Interrupt I/O by connecting the comparator output to INT1. Note that RB1 is also multiplexed with INT1. Write main program and interrupt service routine in C language. The main program will configure the I/O ports, enable interrupt INT1, turn the LED OFF, and then wait for interrupt. The interrupt service routine will turn the LED ON and return to the main program at the appropriate location so that the LED is turned ON continuously until the next interrupt.
Problem: In Figure, the PIC18F4321 is required to turn on an LED connected to bit 1 of Port D if the comparator voltage Vx > Vy; otherwise, the LED will be turned off. Write a C language program to accomplish this using conditional or polled I/O.