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

Blinky in downloading but not working in LPC2148

Hi.. I am a newbie to ARM..

I bought an ARM LPC2148 development kit. I just took the following blinky code, compiled, and programmed the HEX to the processor using both Philips flash programmer and FLASH MAGIC. It shows no error. I am able to start the bootloader, see the connection in terminal ( in flash magic ), i can erase the processor, and burn the new BLINKY hex file....

But when i reset the processor, the blinky code is not running... when i reset the pin p0.14 is not low, i.e. the processor is not in the bootloader mode.. But the Blinky is not running... \

What is going wrong???? Am i missing something in the code ? or something to do with the hardware ????

Please help me out..

thanks in advance...

BLINKY.C
---------

#include <LPC214x.H> /* LPC21xx definitions */

void wait (void) { /* wait function */ int d;

for (d = 0; d < 1000000; d++); /* only to delay for LED flashes */
}

void main (void) { unsigned int i; /* LED var */

IODIR0 = 0x00FF0000; /* P1.16..23 defined as Outputs */

while (1) { /* Loop forever */ for (i = 1<<16; i < 1<<23; i <<= 1) { /* Blink LED 0,1,2,3,4,5,6 */ IOSET0 = i; /* Turn on LED */ wait (); /* call wait function */ IOCLR0 = i; /* Turn off LED */ } for (i = 1<<23; i > 1<<16; i >>=1 ) { /* Blink LED 7,6,5,4,3,2,1 */ IOSET0 = i; /* Turn on LED */ wait (); /* call wait function */ IOCLR0 = i; /* Turn off LED */ } }
}

Parents
  • Sorry for that.. i just realized that only after posting...

    BLINKY.C
    ---------

    #include <LPC214x.H>
    
    void wait (void)
    {
    int d;
    for (d = 0; d < 1000000; d++);
    }
    
    void main (void)
    {
    unsigned int i;
    
    IODIR0 = 0x00FF0000;
    
    while (1)
    {
      for (i = 1<<16; i < 1<<23; i <<= 1)
      {
            IOSET0 = i;
            wait ();
            IOCLR0 = i;
      }
      for (i = 1<<23; i > 1<<16; i >>=1 )
      {
           IOSET0 = i;
           wait ();
           IOCLR0 = i;
      }
     }
    }
    

    Hope now its clear... Help me out now...

Reply
  • Sorry for that.. i just realized that only after posting...

    BLINKY.C
    ---------

    #include <LPC214x.H>
    
    void wait (void)
    {
    int d;
    for (d = 0; d < 1000000; d++);
    }
    
    void main (void)
    {
    unsigned int i;
    
    IODIR0 = 0x00FF0000;
    
    while (1)
    {
      for (i = 1<<16; i < 1<<23; i <<= 1)
      {
            IOSET0 = i;
            wait ();
            IOCLR0 = i;
      }
      for (i = 1<<23; i > 1<<16; i >>=1 )
      {
           IOSET0 = i;
           wait ();
           IOCLR0 = i;
      }
     }
    }
    

    Hope now its clear... Help me out now...

Children