Embedded Systems Fundamentals · Interview question

What problems arise from a 16-bit timer counter?

A strong answer

A 16-bit counter maxes out at 65535, which limits both range and resolution. At a fast counter clock it wraps very quickly, e.g., at 1 MHz it overflows every ~65.5 ms, so to get a long period you need a large prescaler, which coarsens timing resolution (each tick represents more time), forcing a tradeoff between maximum period and granularity. Using the counter as a free-running timestamp is also tricky: elapsed-time calculations must handle wrap-around, which works correctly only with unsigned subtraction so the modular arithmetic wraps properly ((now - then) in uint16_t), and any single measurement longer than one full wrap is ambiguous unless you also count overflows. If you genuinely need long, high-resolution timing, you either chain two timers (one counts the other's overflows), accumulate overflow interrupts in software to extend the width, or use a 32-bit timer if the chip has one (32 bits at 1 MHz wraps every ~71 minutes). So the 16-bit limit shapes prescaler choice, demands overflow-aware time math, and sometimes dictates which timer peripheral you pick.

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

Timers & Counters

Count clock ticks to make precise time: prescaler and auto-reload set the period, and output-compare/input-capture modes generate and measure waveforms, with no CPU delay loops.

More Timers & Counters questions

Browse all 472 interview questions
What problems arise from a 16-bit timer counter? | EmbeddedPrep.io