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

GPIO writing problem for LPC2129

Hello,

I am working on LPC2129 using Keil uVision V4.21. I am not able to run a simple GPIO toggling code for my board (a custom board). I have got one .HEX file along with the board which is for toggling of the GPIO pins and it runs perfectly.I do not have the C code for the same.

My code works fine on the Keil simulator but not on the actual hardware :( .
Please let me know where is the mistake or where I need to look for some code change.
The code is as follows and Frquency setting is 12MHz.

#include <LPC21xx.H>
void Delay(void)
{
        int i,j;

        for(i=0; i<10; i++)
          for(j=0;j<1000;j++);

}

int main(void)
{

        PINSEL1 |= 0x00000000;
        IO0DIR  |= 0x00000080;

        while(1)
        {
                IO0SET = 0x00000080;
                Delay();
                IO0CLR = 0x00000080;
                Delay();
        }
    return 0;
}


*Compilation ends with expected warning of unreachable statement (return 0), hope it has nothing to do with the problem above and it should not be :)

Also one more thing, I could not find fast GPIO and Mask registers in the LPC21xx.h file, well
that I can define in the header file with the reference of addresses provided in the user manual.

Regards,
Kaustubh

0