GPIO CONFIGURATOIN IN LPC845 BREAKBOARD

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

GPIO CONFIGURATOIN IN LPC845 BREAKBOARD

1,013 次查看
DHARSAN
Contributor III

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 项奖励
回复
1 回复

984 次查看
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 项奖励
回复