Getting started with microcontrollers programming with LPCXpresso

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

Getting started with microcontrollers programming with LPCXpresso

2,542 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by napoleo on Thu Dec 06 04:35:07 MST 2012
Hello. Can you please recommend a tutorial/material in order to get started with microcontrollers programming?

Thanks.
0 Kudos
22 Replies

1,861 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by napoleo on Thu Dec 13 04:30:57 MST 2012

Quote: whitecoe
I came across this a couple of days ago which you might find interesting...

http://www.downtowndougbrown.com/2012/06/microcontrollers-gpiotimersinterrupts-example-and-lpcxpress...

And if you google for "embedded programming" or similar, you will get lots of hits on general introductory material, such as:

http://www.scriptoriumdesigns.com/embedded/index.php

I would also suggest that you make sure that you read the NXP LPCXpresso Getting Started Guide, as well as the Red Suite documentation (which LPCXPresso is based on):

http://support.code-red-tech.com/CodeRedWiki/RedSuiteDocs

And watch the CodeRed / NXP video at....

http://www.youtube.com/watch?v=E6vSPloei-0

NXP also have a few other videos knocking around which you might find useful...

http://www.lpcware.com/LPCXpresso

HTH!



The second link provided is very useful. However, the code for LPCXpresso is missing. Is there such a material for begginers for LPCXpresso users? I am currently using LPC11U14 and I would like simple programs to speed up my program development.
0 Kudos

1,861 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by napoleo on Mon Dec 10 07:24:54 MST 2012

Quote: Zero
Of course you have to choose the MCU you are using, so change MCU and clean / build your project again ;)

Was the working sample project a LPC11U14 project :confused:



No, it was on LPC1114. Does this create any problems?
0 Kudos

1,861 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Mon Dec 10 06:20:44 MST 2012
Of course you have to choose the MCU you are using, so change MCU and clean / build your project again ;)

Was the working sample project a LPC11U14 project :confused:
0 Kudos

1,863 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by napoleo on Mon Dec 10 06:17:26 MST 2012

Quote: napoleo
Yes, I have compiled a project previously. That's not the problem. I am using an LPC11U14 and I have chosen the LPC1114 because this is indicated in the tutorial. Might this be the problem?


Yes, that's the problem.
0 Kudos

1,863 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by napoleo on Mon Dec 10 06:13:01 MST 2012

Quote: Zero
No further information?

Did you ever get a project compiled (from example folder) ?

Is your firewall / antivirus preventing compiler from running (or installation before) ?



Yes, I have compiled a project previously. That's not the problem. I am using an LPC11U14 and I have chosen the LPC1114 because this is indicated in the tutorial. Might this be the problem?
0 Kudos

1,863 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Mon Dec 10 06:07:28 MST 2012

Quote:

Description Resource Path Location Type
make: *** [LPCXpressoTest.axf] Error 1 C/C++ Problem

No further information?

Did you ever get a project compiled (from example folder) ?

Is your firewall / antivirus preventing compiler from running (or installation before) ?
0 Kudos

1,863 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by napoleo on Mon Dec 10 05:41:41 MST 2012

Quote: Zero
Your project is compiling without problems here with LPCXpresso v5.0.12 [Build 1083] [2012-11-22] :)

Are you using an actual LPCXpresso version :confused:



I am using the same platform: [SIZE=1]
[SIZE=3]Version: LPCXpresso v5.0.12 [Build 1083] [2012-11-22] [/SIZE]


[SIZE=3]What does the following error mean?[/SIZE]
[SIZE=3]Description Resource Path Location Type
make: *** [LPCXpressoTest.axf] Error 1     C/C++ Problem
I am using LPC11U14[/SIZE]
[/SIZE]
0 Kudos

1,863 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Mon Dec 10 05:13:25 MST 2012
Your project is compiling without problems here with LPCXpresso v5.0.12 [Build 1083] [2012-11-22] :)


Quote:

13:03:54 **** Build of configuration Debug for project LPCXpressoTest ****
make all
Building file: ../src/cr_startup_lpc11.c
Invoking: MCU C Compiler
arm-none-eabi-gcc -D__REDLIB__ -DDEBUG -D__CODE_RED -D__USE_CMSIS=CMSISv2p00_LPC11xx -I"C:\nxp\workspace\CMSISv2p00_LPC11xx\inc" -Os -g3 -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -mcpu=cortex-m0 -mthumb -MMD -MP -MF"src/cr_startup_lpc11.d" -MT"src/cr_startup_lpc11.d" -o "src/cr_startup_lpc11.o" "../src/cr_startup_lpc11.c"
Finished building: ../src/cr_startup_lpc11.c

Building file: ../src/main.c
Invoking: MCU C Compiler
arm-none-eabi-gcc -D__REDLIB__ -DDEBUG -D__CODE_RED -D__USE_CMSIS=CMSISv2p00_LPC11xx -I"C:\nxp\workspace\CMSISv2p00_LPC11xx\inc" -O0 -g3 -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -mcpu=cortex-m0 -mthumb -MMD -MP -MF"src/main.d" -MT"src/main.d" -o "src/main.o" "../src/main.c"
Finished building: ../src/main.c

Building file: ../src/timer.c
Invoking: MCU C Compiler
arm-none-eabi-gcc -D__REDLIB__ -DDEBUG -D__CODE_RED -D__USE_CMSIS=CMSISv2p00_LPC11xx -I"C:\nxp\workspace\CMSISv2p00_LPC11xx\inc" -O0 -g3 -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -mcpu=cortex-m0 -mthumb -MMD -MP -MF"src/timer.d" -MT"src/timer.d" -o "src/timer.o" "../src/timer.c"
Finished building: ../src/timer.c

Building target: LPCXpressoTest.axf
Invoking: MCU Linker
arm-none-eabi-gcc -nostdlib -L"C:\nxp\workspace\CMSISv2p00_LPC11xx\Debug" -Xlinker -Map="LPCXpressoTest.map" -Xlinker --gc-sections -mcpu=cortex-m0 -mthumb -T "LPCXpressoTest_Debug.ld" -o "LPCXpressoTest.axf"  ./src/cr_startup_lpc11.o ./src/main.o ./src/timer.o   -lCMSISv2p00_LPC11xx
Finished building target: LPCXpressoTest.axf

make --no-print-directory post-build
Performing post-build steps
arm-none-eabi-size "LPCXpressoTest.axf"; # arm-none-eabi-objcopy -O binary "LPCXpressoTest.axf" "LPCXpressoTest.bin" ; checksum -p LPC1114_302 -d "LPCXpressoTest.bin";
   text       data        bss        dec        hex    filename
   1860          8         28       1896        768    LPCXpressoTest.axf


13:03:55 Build Finished (took 967ms)

Are you using an actual LPCXpresso version :confused:
0 Kudos

1,863 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by napoleo on Mon Dec 10 04:45:49 MST 2012

Quote: Zero
Quick Start is not including all IDE functions :rolleyes:

Try good old Menu: File->Export->General->Archive File

or Right click on project and Export->General->Archive File

Your problem is a missing CRP word, which is included automatically while creating a new project :eek:

Probably something of this code is missing in your main.c:
#include <cr_section_macros.h>
#include <NXP/crp.h>
 
// Variable to store CRP value in. Will be placed automatically
// by the linker when "Enable Code Read Protect" selected.
// See crp.h header for more information
__CRP const unsigned int CRP_WORD = CRP_NO_CRP ;



Please see the project attached and let me know what is the problem. Thanks!
0 Kudos

1,863 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Mon Dec 10 04:36:19 MST 2012
Quick Start is not including all IDE functions :rolleyes:

Try good old Menu: File->Export->General->Archive File

or Right click on project and Export->General->Archive File

Your problem is a missing CRP word, which is included automatically while creating a new project :eek:

Probably something of this code is missing in your main.c:
#include <cr_section_macros.h>
#include <NXP/crp.h>

// Variable to store CRP value in. Will be placed automatically
// by the linker when "Enable Code Read Protect" selected.
// See crp.h header for more information
__CRP const unsigned int CRP_WORD = CRP_NO_CRP ;
0 Kudos

1,863 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by napoleo on Mon Dec 10 04:27:19 MST 2012

Quote: Zero
:confused: Can't read this jpg (373 x 280) :)

Could be useful to post error text and also exported project ;)



Description Resource Path Location Type
make: *** [LPCXpressoTest.axf] Error 1     C/C++ Problem
Linker CRP Enabled, but no CRP_WORD provided within application LPCXpressoTest    C/C++ Problem

These are the errors. How can I export the project? The export to archieve (zip) option is not available from the quick start menu.
0 Kudos

1,863 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Mon Dec 10 04:11:29 MST 2012
:confused: Can't read this jpg (373 x 280) :)

Could be useful to post error text and also exported project ;)
0 Kudos

1,863 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by napoleo on Mon Dec 10 03:51:11 MST 2012

Quote: whitecoe
I came across this a couple of days ago which you might find interesting...

http://www.downtowndougbrown.com/2012/06/microcontrollers-gpiotimersinterrupts-example-and-lpcxpress...

HTH!



I take 2 errors after debugging this code (please the screenshot attached). What's the problem?
0 Kudos

1,863 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ArneB on Fri Dec 07 06:37:05 MST 2012
Please have a look at this line card: http://www.nxp.com/documents/line_card/75017327.pdf

Just a short overview:
LPC8xx   = Cortex M0+ core, simple peripherals
LPC11xx = Cortex M0 core, simple peripherals
LPC12xx = Cortex M0 core, extended peripherals
LPC13xx = Cortex M3 core, simple peripherals
LPC17xx = Cortex M3 core, extended peripherals
LPC18xx = Cortex M3 core, even more peripherals...
LPC40xx = Cortex M4 core, extended peripherals
LPC43xx = Cortex M4 + Cortex M0 (dual core), extended peripherals

The letters inside the part numbers (e.g. LPC11A14) are a hint for additional functionality:
A = analog modules (Comparator, DAC etc.)
U = USB
C = CAN
D = LCD driver
E = integrated EEPROM (but other family members have an EEPROM, too...)

Usually you can port your program very easily, if the core doesn't change. As an example: LPC1114->LPC11A14 or LPC11U14->LPC1227. I would suggest that you start with a very simple controller like a LPC1114 and a LPCXpresso board. These little beasts are great for exploring the LPC world :D
0 Kudos

1,863 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by serge on Fri Dec 07 06:30:42 MST 2012
The U version has a USB connection and 4 reduced power modes (look here) and the A version has an eeprom, dac and an integrated temp sensor but lacks the USB connection (look here)

Concerning how to choose a particular MCU: First make an inventory of what you need in your design: flash memory, ram, eeprom, usb, nic, i2c, gpio, etc etc
and then go to http://www.nxp.com/parametrics/ and pick your MCU :p

Now concerning the difference between the LPC11U14 and the LPC1114/302 i think someone else can better help you because i normaly develop for LPC13xx and LPC17xx (which are cortex m3 microcontrollers)
0 Kudos

1,863 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by napoleo on Fri Dec 07 04:25:55 MST 2012
It is not very clear to me what are the difference. Can you please make it more clear? Further, what are the criteria for selecting a microcontroller? In the case of LPC11A14 and LPC11U14, what are the difference in respect to the code that should be developed?
Finally, is an LPC11U14 identical with LPC1114/302 mentioned in the recommended tutorial? I am a bit confused.
Thanks.
0 Kudos

1,863 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by serge on Fri Dec 07 01:28:28 MST 2012
You can find the differences in the User Manual LPC11U14 and User Manual LPC11A14 (Could not locate an english version of UM10527. I always got a ZH version:mad:) The differences between the two MCU's can be found here: http://www.nxp.com/products/microcontrollers/cortex_m0/

Those User Manuals are a) your best friend and b) you holy bible;). So make sure you read those many times.:p
0 Kudos

1,863 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by napoleo on Thu Dec 06 10:11:29 MST 2012
Does LPCXpresso board come with an LPC11U14 MCU? I was wondering if this MCU is the same with the one employed in the recommended tutorial (http://www.downtowndougbrown.com/2012/06/microcontrollers-gpiotimersinterrupts-example-and-lpcxpress...). In the case that I use a different MUC in the future (like LPC11A14, what is the difference by the way?) what changes should I apply in terms of code?
0 Kudos

1,863 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Thu Dec 06 05:26:44 MST 2012
See #2 of http://knowledgebase.nxp.com/showthread.php?p=19050
0 Kudos

1,863 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by whitecoe on Thu Dec 06 05:24:10 MST 2012
I came across this a couple of days ago which you might find interesting...

http://www.downtowndougbrown.com/2012/06/microcontrollers-gpiotimersinterrupts-example-and-lpcxpress...

And if you google for "embedded programming" or similar, you will get lots of hits on general introductory material, such as:

http://www.scriptoriumdesigns.com/embedded/index.php

I would also suggest that you make sure that you read the NXP LPCXpresso Getting Started Guide, as well as the Red Suite documentation (which LPCXPresso is based on):

http://support.code-red-tech.com/CodeRedWiki/RedSuiteDocs

And watch the CodeRed / NXP video at....

http://www.youtube.com/watch?v=E6vSPloei-0

NXP also have a few other videos knocking around which you might find useful...

http://www.lpcware.com/LPCXpresso

HTH!
0 Kudos