Commits

Trammell Hudson committed b7844b2 Draft

Clock scaling once again

  • Participants
  • Parent commits 3fce575

Comments (0)

Files changed (1)

 	out(WRCE, 1);
 }
 
-static uint16_t ms;
+static uint8_t ms;
 static uint8_t sec;
 static uint8_t min;
 static uint8_t hour;
 static void
 update_time(void)
 {
-	if (++ms < 500)
+	if (++ms < 125)
 		return;
 
 	ms = 0;
 
         // Timer 0 is used for a 64 Hz control loop timer.
         // Clk/256 == 62.5 KHz, count up to 125 == 500 Hz
+        // Clk/1024 == 15.625 KHz, count up to 125 == 125 Hz
         // CTC mode resets the counter when it hits the top
         TCCR0A = 0
                 | 1 << WGM01 // select CTC
                 | 0 << WGM02
                 | 1 << CS02 // select Clk/256
                 | 0 << CS01
-                | 0 << CS00
+                | 1 << CS00
                 ;
 
         OCR0A = 125;