dolphinlabs
...
Doplhin labs
News

LPC2148-7 Segment Display



Warning: readfile(7 segment display.htm) [function.readfile]: failed to open stream: No such file or directory in /home/dolphinlabs/public_html/Word-SubMenu-Display.php on line 104

1.      7-Segment

Objective:

Interfacing of 7 Segment with LPC2148 microcontroller

Hardware Connections for LPC2148 Board:-

1.      Plug in the USB cable to your computer and to the Board. Once the USB cable is plugged in, Board is powered up.

2.      Connect +5V COMMON ANODE pin of 7 segment interface to +5V supply pin

3.      Connect Disp1 pin to P0.17 pin of microcontroller

4.      Connect P1.16-P1.22 pin of microcontroller to 7-segment.

Diagram:

+5V

 

Source Code:

 //Seven segment display (Common Anode Configuration)

 #include<lpc21xx.h>

void delay(int count);

void main()

{

   int a[10]={0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,0x80,0x90};

  int i;

            IODIR1=0xFF0000; //Set direction from P1.16 to P1.23

            IODIR0|=0x20000;

  while(1)

{                                             

for(i=0;i<=9;i++)

{

IOSET0=0x20000;      //Set display

IOSET1=a[i]<<16;     //Set 7-segment display

delay(90000);

IOCLR1=a[i]<<16;    //Clear 7-segment display

delay(90000);

}

}

}

void delay(int count)

{

  int j=0,i=0;

 

  for(j=0;j<count;j++)

  {

    /* At 60Mhz, the below loop introduces

    delay of 10 us */

    for(i=0;i<35;i++);

  }

}

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


Get SOCIAL







SAFE & SECURE SHOPPING

visa card master card maestro card
Maverick IT Industries Pvt. Ltd.