Skip to main content

Subsection 1.2.4 Part 4: Explore the Registers

Now we’ll find out what the setup lines in blinky.c actually do, by changing them one at a time. Predict what will happen before you make each change, then verify on the board, and discuss your predictions with a neighbor.

Activity 1.2.4. Register Exploration.

(a)

Comment out GPIOA->MODER |= (1U << 10); (leave the clock enable and the MODER clear line). Build, flash, and confirm your prediction.

(b)

Restore the MODER line. Comment out RCC->IOPENR |= GPIOAEN;. Build, flash, and confirm your prediction.

(c)

Restore the RCC line. Replace GPIOA->ODR |= LED_PIN; with GPIOA->ODR = LED_PIN; (no |=). Does this change behavior for a single-LED Blinky? When would it matter?