How to generate a 1 microsecond (1 µs) timer interrupt on the STM32G0B1RCT6 using the internal clk
Hi, actually, I want to generate a 1 microsecond (1 µs) timer interrupt on the STM32G0B1RCT6 microcontroller using their internal clocks.
For the STM32G0B1RCT6 controller running at 16MHz APB timer clock, I set the prescaler value to 0 [16MHz clock frequency / (0+1) = 16MHz counter clock -> 1/16MHz = 62.5ns counter period] and the counter period to 15 [ARR is set to 15: 62.5ns*(15+1)=62.5ns*16=1us]. This configuration is intended to represent a 62.5ns interval once the counter starts counting. I then set the ARR (Auto-Reload Register) value to 15+1=16. However, on the oscilloscope, the interrupt is generated every 4.24 microseconds. Could you explain why this is happening and tell me the correct values for the prescaler and ARR?
i'm not using only hal Drivers,i will attached the screenshot
for your reference.
