© Warren Gay 2018
Warren GayBeginning STM32https://doi.org/10.1007/978-1-4842-3624-6_14

14. Analog-to-Digital Conversion

Warren Gay1 
(1)
St. Catharines, Ontario, Canada
 

Embedded computing often needs to convert an analog signal level into a digital form for analysis. One application is measuring temperature by the voltage developed across a semiconductor. It is no surprise then that the STM32 platform has both an analog-to-digital converter (ADC) and a built-in channel to the ADC for measuring temperature.

This chapter’s demonstration project will illustrate how to use the libopencm3 routines to access the ADC peripheral, reading analog channels PA0 and PA1, in addition to reading the chip temperature and its internal reference voltage.

STM32F103C8T6 ...

Get Beginning STM32: Developing with FreeRTOS, libopencm3 and GCC now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.