Skip to main content

Chapter 6 Analog-to-Digital Conversion

The goal of this chapter is to read a potentiometer with the STM32C031C6’s own analog-to-digital converter, configuring it ourselves register by register. Most of the sensors you will use in this course report their measurement as a voltage: a temperature, a light level, the angle of a knob. The STM32C031C6 computes only with integers. The Analog-to-Digital Converter (ADC) is the bridge between the two, and it is the peripheral that turns continuous signals that measure the world into digital signals comprehensible to our processor.
This chapter covers one class day, and one reading that comes before it. The reading works out what an ADC’s number means and how the converter arrives at it; in class we’ll wire the potentiometer and get a count out of it. Section 6.3 collects the hardware details we’ll want to look up later.