Zum Hauptinhalt springen
Nicht aus der Schweiz? Besuchen Sie lehmanns.de

Programming of Embedded Systems (eBook)

Applications to SM32F10x μControllers
eBook Download: EPUB
2025
352 Seiten
Wiley-Iste (Verlag)
9781394427604 (ISBN)

Lese- und Medienproben

Systemvoraussetzungen
142,99 inkl. MwSt
(CHF 139,70)
Der eBook-Verkauf erfolgt durch die Lehmanns Media GmbH (Berlin) zum Preis in Euro inkl. MwSt.
  • Download sofort lieferbar
  • Zahlungsarten anzeigen

Many everyday objects have become embedded, connected and even autonomous. The engineers and technicians who develop them must have skills in both computer science and electronics.

Drawing on some 20 years of experience in the field of hardware and embedded computing, Programming of Embedded Systems analyzes how physical objects can interact with microcontrollers. It presents the fundamental principles of programming and code structuring. Although based on a specific family (STM32) of microcontrollers, the various chapters outline general concepts applicable to any microcontroller. They analyze the mechanisms that govern exchanges between a computer program and a hardware component of the embedded object.

Each chapter details the programming of peripheral units and ends with an example using a common application for managing the heating of a home equipped with a photovoltaic installation to illustrate implementation in the programming language C.



Vincent Mahout is Lecturer at INSA Toulouse, France, where he teaches automation and hardware and embedded computing.

Thierry Rocacher is Associate Professor of Electrical Engineering at INSA Toulouse, France, where he teaches electronics and embedded computing.

Guillaume Auriol is Associate Professor of Electrical Engineering at INSA Toulouse, France, where he teaches electronics and embedded computing.

1
Aims, Context and a Guiding Thread Example


1.1. Aims of this book


The programming of any kind of μcontroller is a relatively complicated job when starting from scratch. The first task is to gather together all the documentation related to the equipment and tools you are going to use. Between the datasheets, reference manuals, user manuals, etc., it is normal to find yourself faced with several thousands of pages that will have to be reviewed and cross-referenced before any information relevant to the task can be extracted.

However, one simple alternative is available to those who might become discouraged by this abundance of documentation. It consists of using prewritten examples that can be found on the Internet in abundance. Reading such “source” files allows you to acquire the knowledge required to implement basic functions at a lower cost.

This book aims to follow an intermediate approach. Throughout the various chapters, we aim to provide the reader with the information needed to start programming an application on a STM32-type architecture from the very beginning and/or to understand the examples more easily and quickly than they would have gathered on their own. We also aim to be as general as possible. Thus, each chapter that deals with a specific peripheral unit will begin with a section explaining how the peripheral operates, without any programming considerations nor its particular version for the μcontroller being studied.

We hope to shed a methodological light on programming. Whether it be via the chapter on general programming principles (see Chapter 2) or via different program examples, we will try to apply coding and structuring techniques that offer both rigor, safety and readability.

Finally, let us point out that this work is based on a particular version of the STM32 μcontrollers from the STmicro© product range, namely, the STM32F10x family.

1.2. What this book contains... and what it does not


This book cannot be exhaustive. Indeed, the family of STM32 μcontrollers is particularly vast. It would therefore be unrealistic to claim that every particular subtlety or limitation for a specific μcontroller version will be presented. The reader will therefore necessarily need to consult the documentation specific to their μcontroller in order to ensure the existence and compatibility of the functions presented in this book.

In addition, we have chosen only to deal with peripheral units that seem to be the most widespread when controlling embedded systems to us. Without minimizing either their importance or usefulness, certain units, although present in μcontrollers, will not be discussed in the chapters of this book. The beginner programmer will find plenty to engage with in the units we will cover in detail. The more advanced programmer will be able to find clarifications on the electronic structure of the peripheral units that cannot be obtained simply by reading the reference manual STMicroelectronics (2011).

These large units that are “absent” in our discussion are:

  • any circuit related to the debugging unit DBG connections;
  • units linked to external memory access:
    • FSMC (Flexible Static Memory Controller)-type units,
    • SDIO (Secure Digital Input/Output interface)-type units;
  • digital/analog (DAC) units;
  • communication bus CAN units;
  • USB and OTG_USB port management units;
  • units supporting the Ethernet ETH protocol;
  • cyclic redundancy check (CRC) units;
  • the electronic signature of the circuits.

After a reminder on the elements of C for embedded systems in Chapter 2, this book is then divided into chapters, each explaining one of the main functionalities required in the creation of the vast majority of embedded applications:

  • Chapter 3 presents the general aspects of the STM32F10x architecture. We will also discuss some important concepts such as internal clocks, watchdogs.
  • Chapter 4 is dedicated to everything related to managing the μcontroller at the pin level, in particular detailing the binary input/output aspects (GPIO).
  • Chapter 5 explains the crucial aspect of embedded system programming, namely, interrupts and their management as well as the principles of using a DMA.
  • Chapter 6 explains everything related to time management via Timer units.
  • Chapter 7 focuses on an important functionality of Timers which allows for PWM (Pulse Width Modulation)-type signals to be generated.
  • Chapter 8 studies everything to do with analog/digital converters.
  • Chapter 9 is dedicated to communications peripherals: serial communication via USART (Universal Synchronous and Asynchronous Receiver Transmitter), SPI (Serial Peripheral Interconnect) communication and lastly the industrial I2C (Inter-Integrated Circuit) bus.
  • The final chapter addresses the various energy-management modes offered by the STM32.
  • The appendix is a reminder on the technological foundations of digital electronics.

1.3. About the code examples


This book is intended to be primarily practical. Unlike what is provided in the manufacturer’s documentation, commented examples can be found throughout this book to concretely illustrate the steps one can follow to set up a particular configuration or simple application example. Chapter 2 is dedicated to the key implementation principles when adopting methods and structures suitable for one’s needs.

The examples provided are written to be as readable as possible for educational purposes only. We want the reader-programmer to perfectly discern between the different actions they can take when setting up their own application. However, we also invite them to inspect the efficiency of their code and therefore to optimize the instructions accordingly.

1.4. Choosing your μcontroller: the STM32 family


The family of STM32 μcontrollers is available in many versions. What is more, as they are recent technologies, this family undergoes regular developments and additions. Consequently, this book cannot claim to be up-to-date and the information presented1 in this chapter will necessarily be incomplete. However, it is important to us to draw up a quick portrait of the STM32 family, so that the reader can realize one of the first difficulties when it comes to implementing a μcontroller : Which one to choose?

1.4.1. Criteria when choosing a μcontroller


The question of which μcontroller to choose can be complex. Rather than trying to answer it, we propose a list of a certain number of technical criteria:

  • the number and nature of the inputs/outputs required to control the system in which the μcontroller will be used;
  • the number and nature of the peripherals that will be useful to the application. A system-oriented design must therefore be carried out;
  • the μcontroller package. This may seem anecdotal, but this choice is important and will depend on several factors:
    • the need to miniaturize as much as possible or not,
    • the production equipment: it is not the same skill, nor the same equipment, that will be required to assemble a LQFP, QFPN nor even a BGA case on a printed circuit board (PCB);
  • memory capacity: this is often what determines the price of the component. This includes the RAM, as well as the flash memory. Depending on the application, the ROM or RAM requirements can be very different. Among the indicators that can help us choose are:
    • a system analysis allowing for any particular RAM requirements to be anticipated,
    • the libraries used: depending on their complexity, the use of flash memory in particular can be increased as opposed to programming with custom libraries that meet a particular need (the method presented in this book);
  • operating speed: a high operating speed ensures that the processor can function quickly enough for a given task. However, good programming that is simple and efficient makes it possible to obtain high operating speeds with a reasonable processor frequency. This is the path that we propose in this book again. There are very powerful cross-platform libraries (HAL [Hardware Abstraction Layer] by STmicro©), which offer the advantage of an apparent ease of development, but at the cost of making multiple calls to generic and nested interrupt routines, which extend processing times. Here again, the objective of this book is to go against the grain of using these generic libraries so that the programmer is able to optimize this or that critical functionality in terms of speed when necessary;
  • electrical consumption: this has been a very important area of improvement for all μcontroller manufacturers over the years, and STmicro© is very well established in this area. Most of the controllers offered include a...

Erscheint lt. Verlag 10.12.2025
Reihe/Serie ISTE Invoiced
Sprache englisch
Themenwelt Mathematik / Informatik Informatik
Technik Elektrotechnik / Energietechnik
Schlagworte Autonomous • code structuring • connected • Embedded Systems • Microcontrollers • photovoltaic installation • programming • Programming language C • Systems
ISBN-13 9781394427604 / 9781394427604
Informationen gemäß Produktsicherheitsverordnung (GPSR)
Haben Sie eine Frage zum Produkt?
EPUBEPUB (Adobe DRM)

Kopierschutz: Adobe-DRM
Adobe-DRM ist ein Kopierschutz, der das eBook vor Mißbrauch schützen soll. Dabei wird das eBook bereits beim Download auf Ihre persönliche Adobe-ID autorisiert. Lesen können Sie das eBook dann nur auf den Geräten, welche ebenfalls auf Ihre Adobe-ID registriert sind.
Details zum Adobe-DRM

Dateiformat: EPUB (Electronic Publication)
EPUB ist ein offener Standard für eBooks und eignet sich besonders zur Darstellung von Belle­tristik und Sach­büchern. Der Fließ­text wird dynamisch an die Display- und Schrift­größe ange­passt. Auch für mobile Lese­geräte ist EPUB daher gut geeignet.

Systemvoraussetzungen:
PC/Mac: Mit einem PC oder Mac können Sie dieses eBook lesen. Sie benötigen eine Adobe-ID und die Software Adobe Digital Editions (kostenlos). Von der Benutzung der OverDrive Media Console raten wir Ihnen ab. Erfahrungsgemäß treten hier gehäuft Probleme mit dem Adobe DRM auf.
eReader: Dieses eBook kann mit (fast) allen eBook-Readern gelesen werden. Mit dem amazon-Kindle ist es aber nicht kompatibel.
Smartphone/Tablet: Egal ob Apple oder Android, dieses eBook können Sie lesen. Sie benötigen eine Adobe-ID sowie eine kostenlose App.
Geräteliste und zusätzliche Hinweise

Buying eBooks from abroad
For tax law reasons we can sell eBooks just within Germany and Switzerland. Regrettably we cannot fulfill eBook-orders from other countries.

Mehr entdecken
aus dem Bereich

von Herbert Voß

eBook Download (2025)
Lehmanns Media (Verlag)
CHF 19,50
Management der Informationssicherheit und Vorbereitung auf die …

von Michael Brenner; Nils gentschen Felde; Wolfgang Hommel …

eBook Download (2024)
Carl Hanser Fachbuchverlag
CHF 68,35