Search This Blog

Sunday, January 22, 2017

Tutorial on ARM Mbed


                                   
 BEGINNERS GUIDE TO ARM MBED PLATFORM



This tutorial provides an introduction on ARM Mbed based microcontrollers. The tutorial focusses on LPC1768 microcontroller.


Introduction: ARM Mbed is an operating system and platform , by large developed by ARM for a group of microcontrollers under the cortex M series. It is a platform for internet connected devices.
This platform encompasses development tools, cloud services and operating system support for creation and development of 'internet of thing'(Iot) systems on ARM platform. 
This development ecosystem boasts of a well defined online compiler support for the software code, tools for building and testing ,and a host of development boards, which can be deployed for any type of application. 

SECTION1
Introducing ARM Mbed LPC1768 MCU

The ARM Mbed LPC1768 is a ARM cortex M3 microcontroller developed by NXP systems. The mbed takes the form of a 2 inch by 1 inch PCB, with 40 pins arranged in two rows of 20 with 0.2 inch spacing between the pins. It is to be noted that even though LPC1768 has 100 pins, board projects out only 40 pins, which are currently usable.

External view of the mbed board with pinouts

As  seen from the above picture, the board houses the cortex M3 core, whose pins are connected to the different peripherals. A reset switch is seen on the centre of the board, to force restart of the current program. 
Downloading the program onto the mbed core is acheived through a universal serial bus (USB) connector, and this also is used for powering the mbed.
There are five LEDS on the board, one is used for status, while other four are connected to the microcontroller digital outputs. 
To the extreme left of the board are the power pins. The board works with a DC voltage range of 4.5 to 9V. Since some of the internal units in the board worls with 3.3V, there is an onboard voltage regulator (LM1117), which drops the voltage to 3.3V. There is also a +5V pin which can be used. 
There are also analog inputs, used for reading sensor values, and there exists PWM ouputs, used for controlling external power devices such as motors. The board supports five serial interfaces, I2C, SPI, CAN, USB and ethernet, which can be used for various applications.


Front view of Mbed board

Beneath the board, there exists another microcontroller called as 'interface microcontroller' which interfaces with the USB. This controller acts as the USB terminal to the host computer. It receives the program code through the USB, and transfers those programs to a inbuilt 16Mbit 'flash memory'. This memory is also called as the 'USB disk'. This controller communicates with LPC1768 through a UART serial data link.

Bottom view of Mbed board

The above diagram shows the bottom view of the board, which houses the interface controller' and other supporting peripherals. We can also see bergsticks/ connectors projecting out of the board. 


Section-2: Getting started with the mbed LPC1768 board

This section of the article explains as to how to get started creating applications using the mbed board

Materials required

1. Mbed LPC1768 board with the USB cable
2. PC with any operating system

Step 1: Create an mbed account using 'mbed.org' website. Use the 'signup' option.



Step 2:  Select 'Compiler' from the site. This directs you to the online compiler.



Step 3: Open an existing project from the project workspace. Select 'Blink_Internal_LED project.























Step 4:  Connect the mbed board to the computer through the USB cable. The mbed is recognized by the computer as a removable drive. As mentioned earlier, this is the 16Mbit flash drive. Open the folder which contains a HTML 'mbed' image. You can as well open the mbed site from this image, else you can do it from a separate window. ( As you have done from the previous step)


















Step 5:  Once the mbed board is connected, the board checks automatically for USB to UART drivers, in the system. If the board is not enumerated/ recognized by the computer, then the respective USB to UART (CP2102 driver) driver is to be downloaded. Once this driver is installed, the board is identified.

Step 6:  We see that from step 3, a program named Blink_Internal_LED is open. ( main.cpp file). Compile the program as shown in the diagram below.



Step 7: After a successfull compilation, it is seen that a binary file gets created ( .hex file ). This file would be available in 'downloads' page of the system.  Copy this image / file and paste it in the mbed drive ( Refer to step 4 ). The picture below shows the image being created in the bottom end.



Step 8: Once the image is copied, the image lies inside the mbed drive. Now press the reset switch, in the middle of the mbed board. Once pressed, the application starts running on the board.
















No comments:

Post a Comment