dolphinlabs
...
Doplhin labs
News

LPC2148-LED Interfacing


1.      LED

Objective:

To display single LED blinking.

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 of LED interface block to +5V supply.

3.      Connect P0.16 pin controller to single LED of LED interface block using wire.

 

Diagram:

+5V

 

Source code:

#include "LPC214x.H"                        /* LPC21xx definitions */

#include "type.h"

#define TEST_LED    (1 << 16)

void delay(int count)

{

  int j=0,i=0;

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

  {

       for(i=0;i<35;i++);               /* At 60Mhz, the below loop introduces delay of 10 us */

  }

}

int main(void)

{

            SCS     = 0;

    IODIR0 |= TEST_LED;

            while(1)            

            {

            IOSET0 = TEST_LED;                      /* turn ON LED */

                        delay(50000);

            IOCLR0 = TEST_LED;                     /* turn OFF LED */                           

                        delay(50000);

            }

}

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

                                     


Get SOCIAL







SAFE & SECURE SHOPPING

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