GPIO Configuration Issue on LPC1768 Microcontroller with Keil IDE

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

GPIO Configuration Issue on LPC1768 Microcontroller with Keil IDE

127 Views
joshmarripudi
Contributor I

Hello,

I am working on the LPC1768 microcontroller through Keil IDE. I am just trying to set the pin P1.14 high which is connected to an LED on the development board which I am using. This is my code:

#include <lpc17xx.h>

int main(void) {
    SystemInit();
    SystemCoreClockUpdate();

    LPC_PINCON->PINSEL2 &= ~((1 << 29) | (1 << 28));  
    LPC_GPIO1->FIODIR |= (1 << 14);                  
    LPC_GPIO1->FIOSET = (1 << 14);                  

    while (1) {}
}

I generated the .hex file and loaded it onto the microcontroller's flash memory using the Flash Magic tool. However, I am unable to turn on the LED with the above code. Instead of the LED, I tried setting a different pin as a GPIO pin and setting the output high, but that didn't work either. What am I missing? 

0 Kudos
1 Reply

77 Views
HangZhang
NXP Employee
NXP Employee

Hi @joshmarripudi 

You can refer the led_blinky demo.

LPCOpen Software for LPC17XX | NXP Semiconductors

HangZhang_0-1713410124550.png

HangZhang_1-1713410192072.png

Hope this will help you.

BR

Hang

 

0 Kudos