This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

LPC1768 coding

Hi friends.I am new to ARM programming.I am working on NXP LPC1768 processor.
There are 8 LED's interfaced to the processor as follows.
LED0-P2.0
LED1-P2.1
LED2-P2.2
LED3-P2.3
LED4-P2.4
LED5-P2.5
LED6-P1.25
LED7-P1.26
i want to display the equivalent values of 0 to 255 on these LED's.
When we use the FIOSET and set any particular pin only that pin gets set and provious pins remain unchanged.
I have used following code.

#include "lpc17xx.h"
#include "type.h"
#include "delay.h"

int main (void)
{
        unsigned int i;
        unsigned long value=0;
        SystemInit();
        LPC_GPIO2->FIODIR = 0x0000003F;
        while(1)
        {
                LPC_GPIO2->FIOCLR=0x0000003F;
                for(i=1;i<64;i++)
                {
                        value=value+1;
                        LPC_GPIO2->FIOSET=(value);
                        delay_ms(100);
                }
                i=0;
        }

}

The output is worng.Please suggest me.
Thank you

0