LPCXpresso Programming Manual
This manual is for those who just installed the LPCXpresso tools and now wonder how to start programming.
The first step is, as with every program, to read the manual. But after you have read the "Getting Started" manual that came with the LPCXpresso tools you might still have some questions.
Even if you are an experienced C programmer, but without any experience with embedded systems, you might still have a lot of questions.
This manual will try to answer some of those questions by handling these questions when I see there is a need for them (and whenever I have time or feel like writing something).
I will not handle all different LPCXpresso processors or boards, I will discuss the LPCXpresso modules with a 1114, 1343 and 1769 microcontroller since this are the reference platforms I have to test my examples on.
What "user" manual ?
When you start working on embedded system, things might be a bit confusing.
Where is the user manual, which user manual, why can't I find the information I am looking for in my user manual etc.
All questions that you might ask.
For most embedded systems you will need multiple manuals to find everything - LPCXpresso is not different, it might even have more manuals than you are used to from some other systems.
Let's have a look at the set of manual you might want to consult:
- The datasheet of your LPC1xxx version of the microcontroller
This datasheet contains all electrical specifications (voltages, timings) that are important when you create your own hardware or when you need to connect other hardware.
It will e.g. tell you if, and which, pins are capable of providing high current for driving an LED directly.
- The user manual of your LPC1xxx version of the microcontroller
This manual contains the most inportant stuff for us. It explains which peripheral blocks are in the microcontroller, which registers they contain and what those registers do.
If you did not yet download this manual, go to the NXP website, search for your chip and download this manual now. You will need this manual a lot!
- The Getting Started Manual
You already read this one right? It's included with the LPCXpresso tools (START -> LPCXpresso_vx.x -> Help and Guides -> Getting Started).
If not, do so first. It will not only explain you how to use Eclipse (the IDE environment) but it also shows you how to start, compile and debug a project.
- The Eclipse manual
If you like - I never read the Eclipse manual, most of my questions were already answered in the Getting Started, by clicking my way through the IDE or by searching Google (my all time friend).
- The Gnu manuals
Or more specifically the Gnu arm-tools manuals. The manuals are available as pdf documents under the "support" tab.
These manuals will tell you what options there are for the ARM compiler, how to use the tools, how to setup your own environment/linker scripts/output formats.
The average programmer might just use the standard LPCXpresso project settings and change those using the project options in the IDE but it you want to use some of the special 'tricks' or create your own linker scripts (e.g. when using a different Flash layout or when you want to reserve certain RAM or Flash settings for special purposes) then this is where to look.
- The FreeRTOS manuals
You will notice that some of the example projects that are provided with LPCXpresso are based on FreeRTOS. I will not discuss FreeRTOS in this manual - when you feel like there is a need for a multi tasking OS on your microcontroller, FreeRTOS is a good choice and the manuals on freertos.org will get you further with this.
- Board schematics
You will need to know how the (external) hardware is connected to the microcontroller so you will need some board schematics or a good description of the board. Schematics for the LPCXpresso boards can be found on Embedded Artist's website, for the RDB1768 see Code Red's site and for other boards, check the manufacturers website.
I suggest that you download the schematics and manuals for the board to your local PC and keep them somewhere safe. If later on the manufacturer decides to update or remove the information you still have your own local copy.
From here on
The following chapters introduce a number of the peripherals of the LPC1xxx.
Each chapter builds on the knowledge of the previous one so it is best to start at the top and sequentially read your way downwards.