An embedded system is a microcontroller together with the components it reads and drives (Figureย 4.1.1). The STM32C031C6 measures nothing and moves nothing on its own. It reads input components, which turn something in the physical world into a signal the chip can read, and it drives output components, which change something in the physical world.
Figure4.1.1.Top-level view of an embedded system. Sensors, switches, and data streams feed into the microcontroller through interfaces; the microcontroller sends commands out to displays, actuators, and data streams through interfaces on the other side.
Getting a peripheral to work requires answers to a set of questions, and for most of them the componentโs datasheet is the only place to look. What supply voltage does it need, and what are the minimum and maximum operating conditions it can tolerate? What signal does it produce or consume, and what does that signal actually represent? Does the chip do its own analog-to-digital conversion and give you numbers over a digital protocol such as I2C (Inter-Integrated Circuit) or SPI, or does it output a raw voltage that the analog-to-digital converter (ADC) built into the STM32C031C6 must interpret? Is there a built-in analog front end, or do you need external signal conditioning? How should you wire it up, and what does your code need to configure before it will respond? These are a few of the essential questions, but not the only ones.
Datasheets can be intimidating: they are written for engineers who already know the jargon, and they pack enormous amounts of information into dense tables. They also vary between component types and between manufacturers. Reading one takes patience. What makes it manageable is that most datasheets are organized along the same lines, so once we know which section answers which question, we can find our way around a datasheet we have never opened before.
The first page typically shows at least the high-level picture: Features (a bullet list of what the part does) and a Description paragraph (always read this: it names the interface and application). The body then contains, roughly in this order:
Pinout / Pin descriptions: which pin is which, and what each one does. Absolute Maximum Ratings: never exceed these; doing so destroys the part. Recommended Operating Conditions: the range the part is designed to work in. Electrical Characteristics: voltages, currents, timing, in a table with Min / Typ / Max columns. Application Information (sometimes called "Theory of Operation" or "Detailed Description"), the most important section for a designer: example schematics, register maps, and usage notes. Packaging Information: physical dimensions of the available package options (DIP, SOT-23, QFN, etc.). Rarely relevant for breadboard work, but critical if you are designing a PCB.
One notation to watch for: a pin name with a bar over it (or a star next to it in a table) is active low: you pull it to ground to activate it, rather than driving it high.
An embedded system is a microcontroller together with the components it reads and drives. The STM32C031C6 measures nothing and moves nothing on its own.
Does it do its own conversion and give you numbers over a digital protocol such as I2C (Inter-Integrated Circuit) or SPI, or does it output a raw voltage that the STM32C031C6โs analog-to-digital converter (ADC) must interpret?
Datasheets vary between component types and manufacturers, and reading one takes patience. What makes it manageable is that most are organized along the same lines.