diff --git a/timer.c b/timer.c index 6e15ef6..1ba5e7b 100644 --- a/timer.c +++ b/timer.c @@ -39,16 +39,19 @@ void timer_init(void) timer_time = 0; // - Time accuracy: 1 millisecond (corresponding frequency: 1kHz) - // ==> F_CPU = 2Mhz - // ==> 16Mhz / 64 = 250 kHz - // ==> let timer count to 250 to get 1kHz frequency + // ==> F_CPU = 20Mhz + // ==> 20Mhz / 256 = 78.125 kHz + // ==> let timer count to 78 to get (almost) 1kHz frequency // therefore: - // - Set Timer/Counter0 prescaler to 64 ==> (1< (1< (1<