0% found this document useful (0 votes)
756 views16 pages

Embedded Systems Lab 18ECL66: Demonstrate The Use of An External Interrupt To Toggle An LED On/Off

1) The document describes an experiment to toggle an LED on and off using an external interrupt from the LPC1768 microcontroller. 2) Key steps include configuring the external interrupt pin EINT3 and its polarity, enabling the interrupt, and writing an algorithm to toggle the LED when the interrupt occurs. 3) The results show that the LED is successfully controlled and toggled on and off through the external interrupt generated by a switch, demonstrating the use of external interrupts on the LPC1768 microcontroller.

Uploaded by

JAYANTH J
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
756 views16 pages

Embedded Systems Lab 18ECL66: Demonstrate The Use of An External Interrupt To Toggle An LED On/Off

1) The document describes an experiment to toggle an LED on and off using an external interrupt from the LPC1768 microcontroller. 2) Key steps include configuring the external interrupt pin EINT3 and its polarity, enabling the interrupt, and writing an algorithm to toggle the LED when the interrupt occurs. 3) The results show that the LED is successfully controlled and toggled on and off through the external interrupt generated by a switch, demonstrating the use of external interrupts on the LPC1768 microcontroller.

Uploaded by

JAYANTH J
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 16

EMBEDDED SYSTEMS LAB

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.

LPC1768 has 4 external interrupt pins EINT0/1/2/3.

In this experiment, EINT3 is configured to toggle LED on/off.


Block diagram:
ARM Cortex M3 Evaluation Board

External interrupt module


LPC 1768
 
Switch LED

Circuit Diagram:

LPC1768

P2.13

P2.12
Algorithm:

• Identify the port address of External interrupt (EINT3) from the schematic diagram.

• Configure the pins P2.13 to function as external interrupts in PINSEL register.

• Clear previous interrupts if any in EINT3.

• Configure the EINT3 as Edge/level triggered in EXTMODE register.

• Select the polarity (falling/rising edge, Active low/high) of interrupt in EXPOLAR


register.

• Enable the interrupts by calling NVIC_EnableIRQ() with IRQ number.


31 30 29 28 2726 25 24 23 22 2120 19 18 17 16 15 14 13 12 11 10 8 9 7654 3210

0 1 0 0 =4

PINSEL4 = 0X04000000

this value id used to configure PINSEL4 register to


operate as External Interrupt.
External Interrupt Flag Register - EXTINT
31 30 29 28 2726 25 24 23 22 2120 19 18 17 16 15 14 13 12 11 10 8 9 7654 3210

1000 =8

Therefore

EXTINT = 0X00000008
External Interrupt Mode Register - EXTMODE

31 30 29 28 2726 25 24 23 22 2120 19 18 17 16 15 14 13 12 11 10 8 9 7654 3210

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

P2.12 – For LED- bit 25 & 24 made 0


PINSEL4 = 0xFCFFFFFF
Result and Discussion:
• LED interfacing is successful and controlled (ON /OFF) through the
switch button action that act as external interrupt.
 
Conclusion:
• External interrupt program is compiled and hex file created
successfully in Keil microvision 4 software.
• Hex file is dumped to ARM Cortex M3 (LPC 1768) evaluation board
using Flash magic.
• Successfully toggled LED through external interrupt.
Thank You

You might also like