Blink LED on LPC1114FN28 is not working

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

Blink LED on LPC1114FN28 is not working

跳至解决方案
1,147 次查看
Anonymous
不适用

Hi,

I am quite new to LPC MCUs. I  am using Keil v5 and have a problem to run the following sourcecode.

#include <LPC11xx.h> /* LPC11xx Peripheral Registers */
#include "system_LPC11xx.h"

#define LED (1<<9) /* LED D1 connect to PIO1_9 */


int main(void)
{
LPC_SYSCON ->SYSAHBCLKCTRL |= (1 << 8); // Enable Clock for TMR1
LPC_IOCON ->PIO1_9 |= (1 << 0); // PIN1_9 = CT16B1_MAT0
LPC_TMR16B1 ->MR0 = 3000; // 50% Duty Cycle
LPC_TMR16B1 ->PR = 12000;
LPC_TMR16B1 ->MR3 = 4000; // Cycle Length
LPC_TMR16B1 ->MCR |= (1 << 10); // TC Reset on MR3 Match
LPC_TMR16B1 ->PWMC |= (1 << 0); // PWM Mode
LPC_TMR16B1 ->TCR |= (1 << 0); // GO
while (1);

// unreachable
return 0;
}

I copied this sourcecode from a working project, which I found in the Internet, into my project. I created my project from scratch.

If I build and upload my project the LED is not blinking.

If I build and upload the project which I found in the Internet, the LED is blinking.

I am afraid that I missed a very important thing in my project to configure.

 

Could somebody help me please?

 

Br,

Kai

0 项奖励
回复
1 解答
1,133 次查看
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi Kai,

Which demo package do you work with? Did you test LPCOpen from this site?

https://www.nxp.com/design/microcontrollers-developer-resources/lpcopen-libraries-and-examples/lpcop...

Please make sure you build chip lib and board lib before the blinky demo.

Have a nice day,

Jun Zhang

在原帖中查看解决方案

0 项奖励
回复
6 回复数
1,106 次查看
Anonymous
不适用

-

0 项奖励
回复
1,134 次查看
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi Kai,

Which demo package do you work with? Did you test LPCOpen from this site?

https://www.nxp.com/design/microcontrollers-developer-resources/lpcopen-libraries-and-examples/lpcop...

Please make sure you build chip lib and board lib before the blinky demo.

Have a nice day,

Jun Zhang

0 项奖励
回复
1,124 次查看
Anonymous
不适用

Hi Jun,

thanks for your reply.

I will dig into the demo packages but the problem is that I setup up the chip on a bread board. So I do not have a LPCXpresso board with that chip.

I was not aware to build CHIp and board Library. Is the a documentation available to do that?

Regards,

Kai

0 项奖励
回复
1,117 次查看
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi Kawi

There is LPCOpen document on the LPCOpen download site. You can check by yourself if the related information is included.

Anyway, build chip and board file is necessary because the application project need it during build.

2021-03-05_18-34-04.jpg

Have a nice day,

Jun Zhang

0 项奖励
回复
1,103 次查看
Anonymous
不适用

Hi again,

I got it working with MCUXpresso, which is actually quite good.

I try to get it running on KEIL as well.

Many thanks for your support.

 

Regards,

Kai

0 项奖励
回复
1,088 次查看
ZhangJennie
NXP TechSupport
NXP TechSupport

You are welcome!

0 项奖励
回复