Chapter 3. Programming I/O

In this chapter, we will cover the following topics:

  • Performing arithmetic operations
  • Illustrating machine storage classes
  • Configuring GPIO ports
  • Configuring UART ports
  • Handling interrupts
  • Using timers to create a digital clock

Introduction

The release of uVision5 heralded the integration of software packs to support a range of microcontroller devices and simplify the task of programming I/O by allowing the user to select from a menu of I/O options to provide the necessary source code in our project. This is extremely helpful and represents a huge leap forwards as compared to previous versions of the IDE that provided the user with comparatively little help with configuring I/O libraries. But, it does raise a dilemma; what do we do if our target hardware isn't supported? In this chapter, we'll investigate some of the functions that configure I/O devices and gain an understanding of what is involved in writing I/O interfaces for other targets. We'll need to refer to STM Reference manual RM0090 (www.st.com) throughout this chapter as it provides complete information on how to use the STM32F405xx/07xx, STM32F415xx/17xx, STM32F42xxx, and STM32F43xxx microcontroller memory and peripherals. We start by writing a program that adds numbers and then use this apparently trivial code to motivate a deeper discussion of data types.

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

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