They're opposite directions of the same compare/capture register (CCR). In output compare, you write a value to the CCR and the timer acts on an output pin when the counter reaches that value, toggling, setting, or clearing the pin, or firing an interrupt, so you generate precise timing and waveforms in hardware (PWM is a special output-compare mode where the CCR sets the duty cycle). In input capture, an external edge on a pin causes the timer to latch the current counter value into the CCR, so you measure timing: by capturing the counter at successive rising/falling edges you compute pulse width, period, or frequency with hardware-precise timestamps, no CPU polling. The mnemonic: output compare is counter-drives-pin (generate), input capture is pin-latches-counter (measure). Both offload timing-critical work from the CPU to the timer hardware.
Embedded Systems Fundamentals · Interview question
What's the difference between output compare and input capture?
A strong answer
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.