The goal of this chapter is to be able to pick up the datasheet of a component we have never used before and find in it everything we need in order to wire that component to the STM32C031C6 and write code that reads it or drives it. Every useful embedded system connects the chip to the physical world through input and output components, and the datasheet is the only place that says what a given component needs and what it gives back. Microcontrollers have datasheets too, and we have used one already: the USART registers we programmed came out of the reference manual (RM0490) and the STM32C031C6 datasheet. In this chapter we turn that same habit on the sensors and actuators around the chip.
This chapter covers one class day, a Wednesday x-hour, and it has no pre-class reading. In class each table takes one real component and its datasheet, works through a worksheet on it, and presents what it found to the rest of us. Between the five components we will see an analog voltage output, a part whose output is a signed quantity, and three parts that are read over a digital protocol.
For a part with an analog output, write the transfer function that converts its output voltage into a physical quantity; for an I2C part, list the addresses it can take.