Also, how does one calculate the ICR and OCR values? For example, if I have to do a toggle for 50% duty cycle, one needs to set an OCR value. How is calculation done?
I know this formula:
Frequency of Timer Interrupt = MCU Clock frequency/(Prescaler x(Compare Match Register Value + 1)
I do not know the OCR value here.
The frequency of the timer interrupt is that my frequency of interest? Like I want to generate a 125kHz square wave from say pin 9. So is that the frequency of the timer?
Best,
A