Featured Post

ARM- ADC and LCD Interface

In real world all natural quantities like temperature, pressure, light intensity etc. are analog. If we have to deal with such quantities us...

Friday, 7 May 2021

ARM GPIO Programming- LED Running

 In all GPIO Programming,

First ARM ports are set to input and output using IODIR

For port 0: it will be IODIR0

Port1:IODIR1, and so on

Fr changing data or writing data to pin IOSET command is used

For PORT0: IOSET0 and for PORT 1 it is IOSET1


Similarly for clearing output pin IOCLR is used as in the following program.

Example For ARM GPIO Programming- LED Running : 

#include <lpc213x.h>

void delay_ms(unsigned int count)

{

    unsigned int j=0,i=0;

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

    {

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

    }

}

/* start the main program */

int main()

    //unsigned int i;

    IODIR1 = 0xffffffff; //Configure the P1 pins as OUTPUT;

    while(1)

    {

        IOSET1=0xffffffff;

        delay_ms(1000);

        IOCLR1= 0xffffffff;

        delay_ms(1000);

    }

}

The Circuit arrangement is as given below


circuit arrangement for ARM GPIO - LED Running


No comments:

Post a Comment