Blink LED on LPC1114FN28 is not working

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

Blink LED on LPC1114FN28 is not working

Jump to solution
777 Views
Anonymous
Deactivated User

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 Kudos
1 Solution
763 Views
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

View solution in original post

0 Kudos
6 Replies
736 Views
Anonymous
Deactivated User

-

0 Kudos
764 Views
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 Kudos
754 Views
Anonymous
Deactivated User

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 Kudos
747 Views
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 Kudos
733 Views
Anonymous
Deactivated User

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 Kudos
718 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

You are welcome!

0 Kudos