Learn to Program ARM Cortex-M3 LPC1768 Microcontroller

From previous post, I believe now you are familiar with basics of Cortex-M3 architecture . In this tutorial, we would learn to program ARM Cortex-M3 LPC1768 Microcontroller. The first step is to get introduced yourself with programming environment because microcontroller are intended for programming and because when they are programmed they works. For programming LPC1768 Microcontroller we have plenty of free software available.

For ARM Microcontroller and especially when it comes to beginner I suggest to stick with Keil µVision4. I found Keil is very nice tool to start with because of its simplicity. Demo version is enough to get you start. I am sure as long as you are student or making hobby projects you won’t need much…..Anyways in future I’ll write article for Eclipse but for now Keil is something good to go with…You just need to register by filling simple form to download this software for free from official website of Keil

The step-by-step procedure shown in the video below:

In this case Keil µVision4 is only software tool you needed to write software application and flashing code into LPC1768 Microcontroller. As we move further you would get clear picture about how things done. Let’s discuss little bit about flashing LPC1768 Microcontroller. Throughout the process from writing your very first LED blink program to get your LED blink on real hardware, your programmer plays very important role.

Here we will use CoLinkEx ARM-JTAG Adaptor which is USB Programmer:

ColinkEx-ARM-JTAG-Programmer
ColinkEx ARM JTAG Programmer

The one thing that I love about ColinkEx ARM-JTAG Adapter, it’s very easy to use and configure with Keil µVision4. You only need to install ColinkExUSBDriver (V1.2.1) and ColinkEx Plugin for Keil RealView MDK. To download please click here

I have made video which will guide you step-by-step how to install drivers and plug-in required to setup programming environment for Keil µVision4. Please follow video provided down below,

There are couples of things which I would like to point out about ColinkEx ARM JTAG Adapter. This adapter is completely open source means you can make your own if you want. ColinkEx adapter is not just a programmer it also support debugging capability. I am big fan of this adapter and very thankful to CooCox for developing such great low-cost adapter for programming & debugging Cortex-M series microcontroller. For details about chip support and all please visit official website. The only thing that you have to keep in mind is ColinkEx only works with Windows operating system as long as my knowledge goes. For Linux users, I will write another tutorial in near future about how to use on-chip bootloader for flashing LPC1768 Microcontroller.

I think this is enough for this tutorial. In next article will show you step-by-step how to light up LED which will be first project of this series. I suggest you to follow whole series in sequence to get things done properly. Learning ARM Cortex-M3 is not one day task it needs consistent effort and focus. But as like any task once understand basics then rest of your journey will be smooth ride in adventurous world of Microcontroller. I hope you will find this tutorial educational. If you have any question then please write down in comment box or message me. Thank You..!!!

Buy Cortex-M3 LPC1768 Microcontroller Kit

Buy Cortex-M3 LPC1768 Microcontroller Kit

About Umesh Lokhande

Umesh Lokhande holds a Master degree in Scientific Instrumentation from University of Applied Sciences Jena, Germany. and has previously worked at Orbotech, Alere Technologies etc. Umesh is also a founder and first author of BINARYUPDATES.COM

6 comments

  1. Hello team,

    I am interested to build my own design with the chip LPC1768. I would like to know when i have or i “buy alone” the chip comes with bootloader or with any embeded system. i have to download from the vendor. what could be the best way ?? what is minimal requirements to put on working a hardward. to load the program “*.hex” could i connect RS232 from chip to RS232 PC, could works ??

    any help i would appreciated.

    regards,
    RT

    • Hello Raul

      When you buy any bare metal chip say for exmple NXP LPC1768, By default your chip been shipped with primary bootloader. This primary bootloader uses UART0 pins to download program into LPC1768s flash memory. If I understood your question correctly then you don’t need to worry about any additional programming. Just make sure your Power Up circuit and RESET machanism while designing your board.

      * Yes, you can use RS232 Cable to program .hex file onto LPC1768 Microcontroller via UART0 Pins
      I hope this would help you. If you need any more details then let me know


      Good Luck and Have a fun with your design

      CHeers

  2. Perfect, Thank you so much, Umesh.

    May you clear me about any embeded system. I have to load over internal memory or external ?? what are the parameters ?? it has to resided in especific address or not. For example i would like to use an Ethernet resources on LCP1768 to control a process over the net. What do you recommend me to design, what could be the easy way.

    I need to read any document or material to create ethernets app.

    regards,
    RT

    • Hello Raul, In any microcontroller programming we flash output file i.e. (.HEX) into microcontroller’s internal flash memory, only in special cases we use RAM resources. Also we always have to load file into internal flash and that to specific memory address. The reason is when MCU build it has huge memory block and its been divided into pieces like some memory assign for FLASH, RAM etc. etc. We always choose memory address specific to flash while compiling our source code (.C file) so that when we load into MCU. It will sits into FLASH memory of MCU, where it is needs to be……!!!!

      * About Ethernet,I will write post in future. Since not having opportunity to work on ethernet. I am sorry for now

      I hope this answers will solve your confusion.

      Happy Programming

      CHeers

  3. Ashutosh Tiwari

    Hello Umesh,

    I need to program LPC 1768 for LED Display. I am using Keil but its not supportable as its a trial version. Is full version too expensive?

    Or do we have a turnaround software to write hex code in LPC 1768? Can we use eclipse too? Is keil full version freely available somewhere?

  4. HELLO ! HI ,
    I need to program LPC 1769 for LED BLINKING WITH TIME DELAY AND HOW TO SET PLL M & N VALUES . I am using Keil NOW.

Leave a Reply

Your email address will not be published. Required fields are marked *

Login

Register | Lost your password?