1 minute read
REVIEW QUESTIONS
if (INT1IF ==1)
// turn off LED1 and turn on LED2
Advertisement
LED1= 0;
LED2= 1;
INT1IF=0; //Clear INT1IF,
REVIEW QUESTIONS
1. List sources of interrupts in the PIC18 microcontroller.
2. Explain the steps to enable External hardware interrupt on RB0 (INT1)
3. Explain the steps to enable External hardware interrupt on RB0 (INT2)
4. PIC microcontroller is connected to a lamp via pin RC0, while LDR is connected to pin
RB1. When the voltage across the LDR becomes zero volts, the lamp will turn on. Write
a program using an interrupt method.
5. A wood cutting machine in a factory does not have safety features. To improve the
safety feature of the machine, you are assigned to develop a safety system using an
infrared sensor which is used to detect the presence of the hand. When an object
(hand) is detected, the machine will stop immediately. Design the safety system by using a PIC18 microcontroller with suitable I/O devices. Sketch a schematic diagram
for the system and write a program for the control system.