Blink LED on LPC1114FN28 is not working

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Blink LED on LPC1114FN28 is not working

ソリューションへジャンプ
822件の閲覧回数
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 解決策
808件の閲覧回数
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 返答(返信)
781件の閲覧回数
Anonymous
適用対象外

-

0 件の賞賛
809件の閲覧回数
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 件の賞賛
799件の閲覧回数
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 件の賞賛
792件の閲覧回数
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 件の賞賛
778件の閲覧回数
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 件の賞賛
763件の閲覧回数
ZhangJennie
NXP TechSupport
NXP TechSupport

You are welcome!

0 件の賞賛