PRABAKARDEVA
Full Member level 2

Hi
I am newbie to work with LPC 1313 Microcontroller.Already I had Worked in 8 bit controllers.
i have written a code to toggle a led.That code was compiled without any errors and hex file also generated.
But thats not working in my board.So i suspect on hex file generation and in my coding..i will post my code.
Is there any procedure for generating hex file.?
Thanks in advance
I am newbie to work with LPC 1313 Microcontroller.Already I had Worked in 8 bit controllers.
i have written a code to toggle a led.That code was compiled without any errors and hex file also generated.
But thats not working in my board.So i suspect on hex file generation and in my coding..i will post my code.
Is there any procedure for generating hex file.?
Thanks in advance
Code:
#include "LPC13xx.h"
#include <cr_section_macros.h>
/*----------------------------------------------------*/
int main(void) {
LPC_SYSCON->SYSAHBCLKCTRL |= (1 << 6); /* Enable clock to the GPIO peripheral */
LPC_GPIO1->DIR |= (1 << 5); /* Set pin direction of PIO1_5 as output */
int i;
while(1) { /* Until power is available */
LPC_GPIO1->DATA |= (1 << 5); /* Set the output of PIO1_5 as one */
for(i = 0; i < 1000000; i++) { /* Wait (500ms approx.) */
}
LPC_GPIO1->DATA &= ~(1 << 5); /* Set the output of PIO1_5 as zero */
for(i = 0; i < 1000000; i++) { /* Wait (500ms approx.) */
}
}
return 0 ;
}
/*----------------------------------------------------*/