Embedded Systems Lab 18ECL66: Demonstrate The Use of An External Interrupt To Toggle An LED On/Off
Embedded Systems Lab 18ECL66: Demonstrate The Use of An External Interrupt To Toggle An LED On/Off
Embedded Systems Lab 18ECL66: Demonstrate The Use of An External Interrupt To Toggle An LED On/Off
18ECL66
PART B
Title
Demonstrate the use of an external interrupt to toggle an LED On/Off
Mr. Aravind R
Assistant Professor
Dept. of ECE
GSSSIETW, Mysuru
Aim: To toggle an LED through the external interrupt in ARM Cortex M3
Microcontroller (LPC 1768).
Objectives:
• To configure & use LPC 1768 eternal interrupt EINT3.
• To interface LED & control it through interrupt.
Introduction:
• An interrupt is an event that alters the sequence in which the
processor executes instructions.
• Types:
• Internal Interrupts- are triggered by a software instruction and operate
similarly to a jump or branch instruction
• External Interrupts- is caused by an external hardware module.
Circuit Diagram:
LPC1768
P2.13
P2.12
Algorithm:
• Identify the port address of External interrupt (EINT3) from the schematic diagram.
0 1 0 0 =4
PINSEL4 = 0X04000000
1000 =8
Therefore
EXTINT = 0X00000008
External Interrupt Mode Register - EXTMODE
Therefore 1000 =8
EXTMODE = 0X00000008
External Interrupt Polarity Register - EXTPOLAR
31 30 29 28 2726 25 24 23 22 2120 19 18 17 16 15 14 13 12 11 10 8 9 7654 3210
0000 =0
Therefore
EXTPOLAR = 0X00000000
PINSEL4 = 0X04000000
EXTINT = 0X00000008
EXTMODE = 0X00000008
EXTPOLAR = 0X00000000