I am new to embedded systems designing. I have to generate a 56kHz signal with a MCU running at 1Mhz. I want high accuracy. If I just use a timer, it gives me 55.55kHz.
Is there any way I can divide the clock frequency to a high value and using that, generate a 56kHz signal?
Best Answer
56.00 kHz is 1 MHz / 17.86. That means a simple integer divider can only hit 1 MHz / 17 = 58.82 kHz or 1 MHz / 18 = 55.56 kHz. If you can't change the 1 MHz clock (very slow for a normal microcontroller) and can only divide it by a integer, then no, you can't get 56.00 kHz.
There are several options: