Commits

Trammell Hudson  committed be20fc1

Configure for 2 MHz clock

  • Participants
  • Parent commits fc173f1

Comments (0)

Files changed (1)

  * Test string:
  * now is the time for all good men to come to the aid of their country
  * the quick brown fox jumps over the lazy dogs
+ *
+ * At 2 MHz the 45.45 baud (22ms) can be generated with the clock.
  */
 
+#undef F_CPU
+#define F_CPU  2000000UL
+
 #include <avr/io.h>
 #include <avr/pgmspace.h>
 #include <avr/interrupt.h>
 
 int main(void)
 {
-	// set for 1 MHz clock so that we can do 45 baud
+	// set for 2 MHz clock so that we can do 45 baud
 #define CPU_PRESCALE(n) (CLKPR = 0x80, CLKPR = (n))
-	CPU_PRESCALE(1);
+	CPU_PRESCALE(3);
 
 	// Disable the ADC
 	ADMUX = 0;