General-Purpose Peripherals

Modern microcontrollers integrate a number of features that help in building stable and reliable embedded systems. Once the system is up and running, memory and peripherals can be accessed, and basic functionalities are in place. Only then can all the components of the system be initialized by activating the associated peripherals through the system registers, setting the correct frequencies for the clock lines, and configuring and activating interrupts. In this chapter, we describe the interface exposed by the microcontroller to access built-in peripherals and some basic system functionalities. In particular, we focus on the following:

  • The interrupt controller
  • System time
  • Generic timers
  • General-purpose I/O
  • The watchdog

While these peripherals are often accessible through the hardware-support libraries implemented and distributed by chip manufacturers, our approach here involves fully understanding the hardware components and the meaning of all the registers involved, by configuring and using the functionalities in the microcontroller straight through the interface exported by the hardware logic.

When designing drivers for a specific platform, it is necessary to study the interface provided by the microcontroller to access peripherals and CPU features. In the examples provided, the STM32F4 is used as a reference microcontroller for implementing platform-specific features. Nevertheless, inspecting a possible implementation on our reference platform allows to get better insight into how to interact with generic targets exposing similar functionalities, using the documentation provided by the silicon manufacturer.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
52.14.240.178