Discover millions of ebooks, audiobooks, and so much more with a free trial

Only $11.99/month after trial. Cancel anytime.

ARM-based Microcontroller Projects Using mbed
ARM-based Microcontroller Projects Using mbed
ARM-based Microcontroller Projects Using mbed
Ebook812 pages4 hours

ARM-based Microcontroller Projects Using mbed

Rating: 5 out of 5 stars

5/5

()

Read preview

About this ebook

ARM-based Microcontroller Projects Using mbed gives readers a good understanding of the basic architecture and programming of ARM-based microcontrollers using ARM’s mbed software. The book presents the technology through a project-based approach with clearly structured sections that enable readers to use or modify them for their application. Sections include: Project title, Description of the project, Aim of the project, Block diagram of the project, Circuit diagram of the project, Construction of the project, Program listing, and a Suggestions for expansion. This book will be a valuable resource for professional engineers, students and researchers in computer engineering, computer science, automatic control engineering and mechatronics.

  • Includes a wide variety of projects, such as digital/analog inputs and outputs (GPIO, ADC, DAC), serial communications (UART, 12C, SPI), WIFI, Bluetooth, DC and servo motors
  • Based on the popular Nucleo-L476RG development board, but can be easily modified to any ARM compatible processor
  • Shows how to develop robotic applications for a mobile robot
  • Contains complete mbed program listings for all the projects in the book
LanguageEnglish
Release dateApr 15, 2019
ISBN9780081029701
ARM-based Microcontroller Projects Using mbed
Author

Dogan Ibrahim

Dogan Ibrahim graduated from the University of Salford with First Class Honours in Electronic Engineering. He then completed an MSc course in Automatic Control Engineering at the University of Manchester, and PhD in Digital Signal Processing at the City University in London. Prof Ibrahim worked at several companies and gained industrial experience before returning to the academic life. Prof Ibrahim is currently a Fellow of the IET, and a Chartered Electrical Engineer. His interests are in the fields of microcontroller based automatic control, digital signal processing, and computer aided design. Dogan Ibrahim has been a lecturer at South Bank University, London, and Principal Research Engineer at GEC Hirst Research Centre. Prof Ibrahim is the author of over 70 technical books in the fields of microcontrollers and electronic engineering. He is currently a systems consultant, carrying out consultancy work to various firms in London.

Read more from Dogan Ibrahim

Related to ARM-based Microcontroller Projects Using mbed

Related ebooks

Computers For You

View More

Related articles

Reviews for ARM-based Microcontroller Projects Using mbed

Rating: 5 out of 5 stars
5/5

2 ratings0 reviews

What did you think?

Tap to rate

Review must be at least 10 words

    Book preview

    ARM-based Microcontroller Projects Using mbed - Dogan Ibrahim

    book.

    Chapter 1

    Introduction

    Abstract

    Microcontrollers are single chip computers that include a minimum of a microprocessor, memory, and input-output module. Depending on the complexity, some microcontrollers include additional components such as counters, timers, interrupt control circuits, serial communication modules, analog-to-digital converters, digital signal processing modules, and so on. Thus, a microcontroller can be anything from a tiny single chip embedded controller to a large computer system having keyboard, monitor, hard disk, printer, and so on. A microprocessor is different from a microcontroller in many different ways with the main difference being that a microprocessor requires several additional external support chips such as memory and input-output circuits before it can be used as a digital controller. This chapter is an introduction to the principles of microcontrollers where several examples of microcontroller-based systems are described.

    Keywords

    Microprocessor; Microcontroller; Assembly language; High-level language; ARM; Microcontroller control system; STM32-Nucleo development board

    1.1 Overview

    Microcontrollers are single chip computers that include a minimum of a microprocessor, memory, and input-output module. Depending on the complexity, some microcontrollers include additional components such as counters, timers, interrupt control circuits, serial communication modules, analog-to-digital converters, digital signal processing modules, and so on. Thus, a microcontroller can be anything from a tiny single chip embedded controller to a large computer system having keyboard, monitor, hard disk, printer, and so on.

    A microprocessor is different from a microcontroller in many different ways. The main difference is that a microprocessor requires several additional external support chips such as memory and input-output circuits before it can be used as a digital controller. A microcontroller on the other hand includes all these support chips on the same chip and that is why it is called a single chip computer. As a result, multiple chip microprocessor-based computer systems consume considerably more power than microcontroller-based systems. The costs of the single chip microcontroller systems are also much lower than the costs of the multiple chip-based microprocessor systems.

    Microprocessors and microcontrollers operate by executing user programs. These programs are stored in the program memory of the device and consist of instructions that can be understood and obeyed by the device. The device fetches these instructions from its program memory one by one and then implements the required operations. Under the control of the user program data is received from external input devices (inputs), manipulated as requested, and then sent to external devices (outputs).

    Microcontrollers (and microprocessors) have traditionally been programmed using the assembly language of the target device. The assembly language consists of many mnemonics where each mnemonic describes a basic instruction that can be carried out by the device. Although the assembly language is very fast, it has many disadvantages. Firstly, because of the syntax of the assembly language, it is difficult to learn this language. Secondly, processors developed by different manufacturers have different sets of assembly language instructions. Even in most cases the processors manufactured by the same manufacturer may have different assembly language instruction sets. As a result, the programmer may be required to learn a different assembly language every time a new processor is to be used. Thirdly, in general, it is difficult to maintain a program written using the assembly language.

    Although the assembly language is still in use in some real-time applications, nowadays most applications are developed using a high-level language, such as BASIC, C, C ++, C#, Visual BASIC, PASCAL, JAVA, and so on. Perhaps the greatest advantage of the high-level languages is the ease of learning and fast program development. Large and complex programs can be developed in much shorter times compared to the assembly language. For example, to write a piece of assembly language program code to multiply two floating point numbers can take several hours or even more time and mistakes can easily be made. On the other hand, using a high-level language we just multiply the two numbers. Additionally, it is much easier to maintain a program written using a high-level language. High-level languages also have the benefit that in general the same user program can easily be transported to work on a different processor with little or no modifications. High-level languages are supported by large number of built-in libraries that make it easy to develop very complex programs in relatively short times. Finally, another advantage of using the high-level languages is that the developed program can easily be tested and this feature shortens the development time considerably.

    In this book we shall be using the C language which is perhaps currently the most popular language used in microcontroller-based applications. As we shall see in the later chapters, the Mbed integrated development environment will be used to develop our projects. Mbed is an online integrated development environment that is used to develop ARM (Advanced RISC Machines) processor-based applications. Using Mbed we can write a program in C, then compile the program, and upload the executable code to the target ARM processor. The advantage of using Mbed is that it is easy to learn and use and is supported by very large number of library functions. The projects in this book are all based on the ARM processor. There are many ARM development boards available in the market. In this book we shall be using a model of the STM32-Nucleo development boards manufactured by STMicroelectronics. As will be discussed in detail in the later chapters, STM32-Nucleo boards are complete microcontroller development boards incorporating fast 32-bit ARM processors together with all the support circuitry to help develop complex projects. The STM32-Nucleo development boards are Mbed compatible which makes them ideal boards for developing complex applications in relatively short times.

    1.2 Example Microcontroller-Based Control System

    In this section we shall see how a microcontroller can be used in a simple control system application. Fig. 1.1 shows a liquid control system where the aim is to control the level of the liquid in the reservoir at a specified point. Water is pumped from the reservoir to the tank using a pump and pipes. In Fig. 1.1 the level of the liquid is controlled manually without using a microcontroller. Here, the person in charge observes the liquid level inside the tank and turns the pump off when the liquid level reaches the required prespecified level.

    Fig. 1.1 Manual liquid level control system.

    The system shown in Fig. 1.1 is manual and requires constant attention of a person. A simple microcontroller version of this system is shown in Fig. 1.2. Here, the liquid level is read by the microcontroller via a liquid level sensor device. The program running inside the microcontroller compares the actual liquid level with the desired level and then actuates the pump automatically in order to keep the liquid at the desired level. If the liquid inside the tank is low, the microcontroller operates the pump to draw more liquid from the reservoir.

    Fig. 1.2 Microcontroller-based liquid level control system.

    The system shown in Fig. 1.2 is a very simplified liquid level control system with no user interaction. In a more sophisticated system we may include a keypad to set the desired liquid level and an LCD (liquid crystal display) to see the desired and/or the actual liquid levels in the tank. Fig. 1.3 shows the block diagram of our upgraded system. Notice that here we are using two inputs and two outputs from our microcontroller.

    Fig. 1.3 Adding a keypad and an LCD.

    We can make our system even more sophisticated as shown in Fig. 1.4 by adding an audible alarm to indicate when the water level is above the desired point. Also, a PC can be interfaced to the microcontroller so that, for example, the actual liquid levels can be sent to the PC at regular intervals and graphs of liquid level variations can be plotted on the PC between the required

    Enjoying the preview?
    Page 1 of 1