Embedded Systems Fundamentals · Interview question

Why doesn't my GPIO/UART/timer do anything even though I configured its registers correctly?

A strong answer

Almost certainly its peripheral clock isn't enabled. To save power, MCUs gate the clock to every peripheral off by default, and a peripheral with no clock is effectively dead, you can sometimes even write its configuration registers but they read back as zero or have no effect. The fix is to enable the peripheral's clock in the Reset and Clock Control (RCC) block before configuring it, e.g., set the GPIOA-enable bit in the relevant RCC AHB/APB enable register, then configure GPIOA. This clock-gating is deliberate (idle peripherals draw no dynamic power), but it's the single most common "why is nothing happening" bug for newcomers, because the configuration code looks correct in isolation. Order matters: clock on, then configure, then use.

What a weak answer sounds like

You know the answer. Do you know what gets you dinged?

Pro breaks down the answer most candidates actually give to this question — and the specific reason an interviewer marks it down. It’s the difference between sounding correct and sounding senior, on all 472 questions.

From the lesson

Inside an MCU

The block diagram demystified: a CPU core, flash and SRAM, and peripherals wired together by internal buses, and why peripherals working in parallel with the CPU is the whole point.

More Inside an MCU questions

Browse all 472 interview questions
Why doesn't my GPIO/UART/timer do anything even though I configured its registers correctly? | EmbeddedPrep.io