Chapter1GPIO and Blinky: Your First Embedded Program
Welcome to ENGS 28! Our goal in this chapter is to control a pin of the STM32C031C6 microcontroller from a program we write ourselves, and to make an LED blink with it. The tradition in programming is to start with “Hello, World”, a minimal program that proves everything is working. In embedded systems, the equivalent is Blinky: a program that makes an LED flash on and off. By the end of this chapter you will understand every line of a working Blinky program, including the hardware it runs on, the registers it writes to, and the bit-manipulation idioms used throughout the course.
The material here corresponds to Days 1, 1X, and 2 of the course. We’ll start in the first class with the board in your hands, and the reading in the next section comes after that class. The hardware is the STM32 Nucleo-64 development board, and the microcontroller on it is the STM32C031C6, based on an Arm® Cortex®-M0+ processor core.