From 177641003c53844ad73584553a9d44f2da4648e2 Mon Sep 17 00:00:00 2001 From: Zach Eveland Date: Sun, 18 Dec 2011 14:18:38 -0500 Subject: fixed digitalWrite on timer 4 pins (D6 and D13) --- cores/arduino/wiring.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'cores/arduino/wiring.c') diff --git a/cores/arduino/wiring.c b/cores/arduino/wiring.c index 9c264d0..fb447eb 100644 --- a/cores/arduino/wiring.c +++ b/cores/arduino/wiring.c @@ -281,11 +281,15 @@ void init() #if defined(TCCR4A) && defined(TCCR4B) && defined(TCCR4D) /* beginning of timer4 block for 32U4 and similar */ sbi(TCCR4A, COM4A1); // clear channel A on output compare match + cbi(TCCR4A, COM4A0); sbi(TCCR4C, COM4D1); // clear channel D on output compare match + cbi(TCCR4C, COM4D0); sbi(TCCR4B, CS42); // set timer4 prescale factor to 64 sbi(TCCR4B, CS41); sbi(TCCR4B, CS40); sbi(TCCR4D, WGM40); // put timer 4 in phase- and frequency-correct PWM mode + sbi(TCCR4A, PWM4A); // enable PWM mode for comparator OCR4A + sbi(TCCR4C, PWM4D); // enable PWM mode for comparator OCR4D #else /* beginning of timer4 block for ATMEGA1280 and ATMEGA2560 */ #if defined(TCCR4B) && defined(CS41) && defined(WGM40) sbi(TCCR4B, CS41); // set timer 4 prescale factor to 64 -- cgit v1.2.3-18-g5258