LPC-2148-Interfacing-with-LED

LED Interfacing with LPC2148


Schematic Diagram

LED



Interfacing Description


Port Pin No. LED 
P0.15 D1
P0.16 D2
P0.17 D3
P0.18 D4
P0.19 D5
P0.20 D6
P0.21 D7
P0.22 D8

Embedded C code for the Interfacing



/**************************************************************************/
/* Project Name:-LED's Interfacing with LPC2148  */
/* Device:- LPC2148                          */
/* Compiler:- KeilUvision4                   */
/* Language:- Embedded C  */
/* Visit www.wikinote.org for more Details   */
/********************************************************************************************/
#include<lpc21xx.h>
void delay(void);
int main (void)
{
IODIR0 = 0x007F8000; /***configure P0.15 to P0.22 as an output pins***/
while (1)                           /***Loopforever***/
{     
IOSET0=0x007F8000; //***turn LEDs ON by setting P0.15 to P0.22 as High***/   
delay();
IOCLR0=0x007F8000; //***turn LEDs Off by setting P0.15 to P0.22 as Low***//
delay();   
}
}
void delay(void)
{
 unsigned int j;  
 for(j=0;j<1000000;j++);
}

Video Tutorial Plus Keil Simulation



Video Tutorial





References

  • WikiNote Foundation
  • Prof. Sujit Wagh

Last modified: Saturday, 8 February 2020, 6:46 PM