IOT

Getting Started with LPC1768

In this tutorial, we’ll discuss about the ARM Cortex-M3 Series, a brand-new subset of microcontrollers. To be more precise, we will examine the features, functions, and programming of an MCU based on the ARM Cortex-M3 Architecture. I’ve decided to use the NXP LPC1768 MCU for this. I will discuss the specs of the LPC1768 MCU, its internal block diagram, and memory map, and list out some of its generic applications in this Getting Started with LPC1768 guide.

Why LPC1768?

Let me walk you through the fundamentals of the ARM Cortex-M Series before I explain why. It is a collection of 32-bit RISC-based ARM CPU Cores that Arm Holdings has created and licensed. The Cortex-M Series Cores are made for inexpensive, low-power microcontrollers that can be employed in a variety of embedded applications.

There are various classes within the Cortex-M Series, including the Cortex-M0, M3, M4, and M7. Each of these variations is intended for a certain group of applications and has a number of functional or implementational peculiarities. As an illustration, the ARM Cortex-M3 variants feature a three-stage pipeline for instructions and do not support either Floating Point Instructions or DSP Instructions. However, the ARM Cortex-M7 variants handle both Floating Point and DSP instructions and feature a 6-stage pipeline.

Let’s now concentrate on the ARM Cortex-M3 architecture, which is the subject of this tutorial series. Since it is the first series in the complete ARM Cortex-M lineup, the 32-bit microcontroller market is its main focus. Many functions that were previously exclusively available in high-end microprocessors have been incorporated into ARM Cortex-M3 based MCUs.

LPC1768

The ARM Cortex-M3 Core was created as the famed ARM-7 Architecture’s replacement. It introduced a number of features, including memory protection, atomic bit manipulation, layered vector interrupts, and non-maskable interrupts. The ARM Cortex-M3 Core is a well-known and commonly utilized ARM Architecture in the microcontroller market thanks to all of these and many other capabilities.

The IP for the ARM Cortex-M3 is licensed to semiconductor manufacturers by Arm Holdings in the form of Verilog RTL (This is the Processor Core). They then adjust (or improve) the architecture in accordance with their needs while closely adhering to Arm specifications (This is the main Processor). They also include their unique brand of accessories to create a full microcontroller unit.

STMicroelectronics, NXP, Texas Instruments, Infineon, Microchip (Atmel), Toshiba, Analog Devices, and others are some of the well-known manufacturers of ARM Cortex-M3-based MCUs.

I’ve decided to use the LPC1768 MCU from NXP in this set of ARM Cortex-M3 tutorials. Despite being based on the ARM Cortex-M3 Architecture, I believe it to be a fairly straightforward device in terms of its Special Function Registers (SFR) implementation, good support for both hardware and software (IDEs and Simulators) as well as good documentation and well-written peripheral libraries.

How to Learn LPC1768 Effectively (or any ARM Device)?

It might be difficult to learn about a new device, let alone one as complex as an ARM Cortex-M3 based MCU. The documentation is terrifying, to begin with. The ARM Architecture Reference manual must come first, followed by the ARM Core Technical Reference Manual, and finally the ARM Core Generic User Guide. Just the ARM side of things here.

The vendor-specific documentation, such as the Reference Manual, User Guide, and Datasheet, is the next type. However, reading all of this documentation won’t be of any use. First of all, nobody reads the entire documentation—not even the best application developers (and I suggest you not to read the entire documentation). You’ll need to develop the habit of only reading what is absolutely necessary and skipping the rest (at that particular moment).

Learning complicated hardware, such as the ARM Cortex-M3 MCU LPC1768, has advantages of its own. All ARM Cortex-M3 devices, including the LPC1768, are logically arranged into a number of “functional blocks” because of their intricate architectural design. Each block functions largely independently from other blocks and has a unique set of registers.

Take the LPC1768 as an example. It has a GPIO Unit for connecting to multiple peripherals, a Clock Generation Unit for creating the primary system clock, a UART Peripheral for Serial Communication, and many more. You can narrowly concentrate on the GPIO Unit, its registers, and how to control them if you only want to learn about GPIOs.

Using this method, you can go through each peripheral and gain an understanding of how they interact with one another, how they communicate with the main processor, and how we can use them effectively to create programs.

Specifications of LPC1768

An ARM Cortex-M3-based Microcontroller in the LPC1700 Series is NXP’s LPC1768. The CPU speed of this device can reach 100 MHz. The Harvard Architecture serves as the foundation for the Arm Cortex-M3 main processor core, which has three buses: one for instructions, one for data, and one for peripherals.

The LPC1768 MCU has the following peripherals, which are peripherals, to speak of: 512 kB Flash, 64 kB RAM, USB Interface, Ethernet MAC, 4 UARTs, 2 CANs, 3 I2C Interfaces, SPI, 2 SSP Controllers, 2-input 2-output I2S, 8-channel ADC with 12-bit resolution, 10-bit DAC, 4 Timers, 8-channel DMA, 6-channel PWM, Motor Control PWM,

The LPC1768 MCU’s brief set of specifications is provided below. I advise you to consult the data sheet for all the facts.

  • ARM Cortex-M3 processor with integrated NVIC, MPU, and 100 MHz CPU.
  • For in-system programming (ISP) and in-application programming, there is an on-chip bootloader (IAP).
  • 64 kB of on-chip SRAM and 512 kB of on-chip Flash memory.
  • DMA controller with 8 channels that works with ADC, DAC, timing devices, UART, SSP, and I2S.
  • AHB Multilayer Matrix Connect to a different bus for the AHB Master (CPU, DMA, Ethernet and USB). For all additional peripherals, split the APB Bus.
  • Serial Interfaces
    • Ethernet MAC with RMII Interface
    • Full-speed USB 2.0 Controller
    • Four UARTs
    • 2-channel CAN Controller
    • 2 SSP Controllers
    • 3 I2C Interfaces
    • SPI
    • I2S
  • Other Peripherals
    • 70 GPIO Pins
    • 8-channel 12-bit ADC
    • 10-bit DAC
    • 4-Timers
    • Dedicated PWM Block
    • Motor Control PWM
    • Quadrature Encoder Interface
    • RTC
    • WDT

Block Diagram of LPC1768

The LPC1768 MCU’s internal block diagram is displayed in the image below. The ARM Cortex-M3 Processor, as shown in the block diagram, is made up of three buses: the I-code bus (for Instruction Fetch), the D-code bus (for Data Access), and the System Bus (for peripheral access).

Getting Started with LPC1768 Block Diagram

The ARM Cortex-three M3’s buses, as well as the other Bus Masters (such as DMA, USB, and Ethernet), are connected to the rest of the peripherals using the Multi-layer AHB Matrix.

Memory Map of LPC1768

Like other ARM Cortex-M3 MCUs, the LPC1768 MCU includes multiple memory regions for Flash, RAM, AHB Peripherals, and APB Peripherals. The LPC1768 has a 4 GB address space because it has a 32-bit architecture.

The memory map for the complete 4 GB address space is shown in the next graphic.

Getting Started with LPC1768 Memory Map

Applications of LPC1768

Being an ARM Cortex-M3-based Microcontroller, the LPC1768 MCU has the processing ability to handle rather complicated embedded applications. Here is a list of some typical uses for this MCU:

  • Motor Control
  • Alarm / Security Systems
  • Industrial Networking
  • Lighting Control Units
  • eMetering Equipment
  • Consumer grade Refrigeration and Washing Units

Hardware and Software Suggestions

In this Getting Started with LPC1768 guide, I’d like to offer some recommendations for the tools and programmes needed to create LPC1768 applications.

All LPC1768 MCUs include UART Bootloaders, so any development board having an LPC1768 MCU and an on-board UART to USB interface will work. You don’t require an expensive or high-end development board.

In terms of the software, I like to write and debug the C code for the LPC1768 using the Keil MDK IDE. I’ll be utilizing the Flash Magic programming tool, which is made especially for NXP microcontrollers with UART bootloaders, to program the LPC1768 MCU.

You can purchase a JTAG Debugger for ARM Microcontrollers if you’re interested. However, this is optional, and Keil MDK’s simulator capability will suffice.

Conclusion

I hope all of you understand how to get started with LPC1768 MCU. We MATHA ELECTRONICS will be back soon with more informative blogs.

Leave a Reply

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