Pergunta de entrevista da empresa STMicroelectronics

Can you explain how the timers work in the microcontrollers?

Resposta da entrevista

Sigiloso

6 de jun. de 2024

Let's understand the category in which the timers are differentiate 1. Hardware Timer - Advanced Timer / Basic Timers 2. Software Timer Every Timer requires a clock source. The source of the clock needed is a mapped prescaler which decides the exact frequency of the clock(via a MUX). The frequency is then mapped to the main counter (up/ down counter) which counts to the predefined value. If needed to generate a PWM pulse, then the Output High logic of the pin must be mapped with the timer counter. Once it reaches to defined value, overflow is triggered and the counter is reset. In the case of the software timer, it is generated via systick timer/hardware-based timer.