GPIO CONFIGURATOIN IN LPC845 BREAKBOARD

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

GPIO CONFIGURATOIN IN LPC845 BREAKBOARD

145 Views
DHARSAN
Contributor I

Hi,

    How to configure GPIO in LPC845 to toggle LED?

    As I already work with existing configuration in 2 ways that I have mentioned below which gives error as undeclared. The first configuration didn't gave any error but led not toggling. The second configuration gave error. Kindly send the correct one.

1.)

SYSCON->SYSAHBCLKCTRL1 |=(1<<20); //CLOCK FOR GPIO PORT 1

GPIO->DIR[1] |=(1<<2);       //DIR PIN FOR GPIO PORT 1 PIN 2 (RED LED)

GPIO->NOT[1] |=(1<<2);       //TOGGLING  PORT 1 PIN 2 (RED LED)

2.)

LPC_SYSCON->SYSAHBCLKCTRL1 |=(1<<20);  //CLOCK FOR GPIO PORT 1

LPC_GPIO_PORT->DIR[1] |=(1<<2);    //DIR FOR GPIO PORT 1 PIN 2 (RED LED)

LPC_GPIO_PORT->NOT[1] |=(1<<2);     //TOGGLING  PORT 1 PIN 2 (RED LED) 

0 Kudos
1 Reply

116 Views
Pablo_Ramos
NXP Employee
NXP Employee

Hi @DHARSAN 
There is a demo that you can take as reference in the SDK of lpc845breakout.

Pablo_Ramos_0-1714422662757.png

Hope it helps you!

0 Kudos