EMBEDDED SYSTEM APPLICATIONS

Page 72

Embedded System Applications if (INT1IF ==1) { // turn off LED1 and turn on LED2 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. 63


Turn static files into dynamic content formats.

CreateΒ aΒ flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.