Skip to main content

Abstract

Previous chapters focused on the inner working principles of the STM32F4 microcontroller. In order to use the microcontroller properly, it should interact with the outside world. To do so, we will introduce interfacing digital input and output (digital I/O) to and from the microcontroller in this chapter. Peripheral units dedicated for this operation are called general-purpose input and output (GPIO) pins. These will form a bridge between code-based bit values (logic level 0 or 1) and voltage levels to be fed or received from the outside world. Therefore, we will first explore the bit representation in terms of voltage values. In other words, we will show how the logic level 0 or 1 can be represented in voltage level. Afterward, we will deal with interfacing these voltage levels with the microcontroller. Here, we will handle different structures such as interfacing the microcontroller with inputs having a high voltage value or output to loads requiring high current or voltage. We will also focus on digital I/O setup within the STM32F4 microcontroller followed by its usage. We will consider C, C++, and MicroPython languages for this purpose. As the end of the chapter application, we will start with digital input and output operations in the robot vacuum cleaner to be developed throughout the book.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD 79.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

References

  1. Analog Devices: Low Voltage Logic Interfacing, mt-098 rev.0, 01/09, wk edn. (2009)

    Google Scholar 

  2. Horowitz, P., Hill, W.: The Art of Electronics, Cambridge University Press, 3rd edn. Newness (2015)

    Google Scholar 

  3. NXP: Level shifting techniques in I2C-Bus design, an10441 edn. (2007)

    Google Scholar 

  4. Sedra, A.S., Smith, K.C.: Microelectronic Circuits, 5th edn. Oxford University Press, Oxford (2004)

    Google Scholar 

  5. STMicroelectronics: STM32F427xx STM32F429xx, docid024030 rev 10 edn. (2018)

    Google Scholar 

  6. STMicroelectronics: STM32F405/415, STM32F407/417, STM32F427/437 and STM32F429/439 advanced Arm-based 32-bit MCUs, rm0090 rev 19 edn. (2021)

    Google Scholar 

  7. Texas Instruments: Logic guide, SDYU001AB, (2017)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

4.1 Electronic supplementary material

Rights and permissions

Reprints and permissions

Copyright information

© 2022 Springer Nature Switzerland AG

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Ünsalan, C., Gürhan, H.D., Yücel, M.E. (2022). Digital Input and Output. In: Embedded System Design with ARM Cortex-M Microcontrollers. Springer, Cham. https://doi.org/10.1007/978-3-030-88439-0_4

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-88439-0_4

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-88438-3

  • Online ISBN: 978-3-030-88439-0

  • eBook Packages: EngineeringEngineering (R0)

Publish with us

Policies and ethics