diff main.c @ 31:5d6a841eef82

/128 prescaler for adc
author Matt Johnston <matt@ucc.asn.au>
date Thu, 27 Jun 2013 00:12:32 +0800
parents ce5097eacf2f
children cce426bb6d3e
line wrap: on
line diff
--- a/main.c	Thu Jun 27 00:12:01 2013 +0800
+++ b/main.c	Thu Jun 27 00:12:32 2013 +0800
@@ -762,8 +762,10 @@
 {
     PRR &= ~_BV(PRADC);
     
-    // /64 prescaler, interrupt
-    ADCSRA = _BV(ADEN) | _BV(ADPS2) | _BV(ADPS1) | _BV(ADIE);
+    // /128 prescaler (86kHz), interrupt
+    ADCSRA = _BV(ADEN) 
+        | _BV(ADPS2) | _BV(ADPS1) | _BV(ADPS0)
+        | _BV(ADIE);
 
     // set to measure 1.1 reference
     ADMUX = admux;