From 8c84dc7a5520c655f1debf0041a540cf5eff1057 Mon Sep 17 00:00:00 2001 From: DigitalConfections Date: Tue, 30 Jun 2020 14:48:56 -0400 Subject: [PATCH] Ver 0.15 o Moved calibration output signal to OC2A (PB3) due to issues getting the signal to appear on OC2B. --- Arduino-microfox/Arduino-microfox.ino | 5 ++++- Arduino-microfox/defs.h | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Arduino-microfox/Arduino-microfox.ino b/Arduino-microfox/Arduino-microfox.ino index 33dcb32..8d7de22 100644 --- a/Arduino-microfox/Arduino-microfox.ino +++ b/Arduino-microfox/Arduino-microfox.ino @@ -238,10 +238,13 @@ void doSynchronization(void); TCCR2B = 0; TCCR2A |= (1 << WGM21); /* set Clear Timer on Compare Match (CTC) mode with OCR2A setting the top */ #if CAL_SIGNAL_ON_PD3 - TCCR2A |= (1 << COM2B0); /* Toggle OC2B (PD3) on compare match */ + pinMode(PIN_CAL_OUT,OUTPUT); /* 601Hz Calibration Signal */ + TCCR2A |= (1 << COM2A0); /* Toggle OC2A (PB3) on compare match */ #endif /* CAL_SIGNAL_ON_PD3 */ TCCR2B |= (1 << CS22) | (1 << CS21) | (1 << CS20); /* 1024 Prescaler */ + OCR2A = 0x0C; /* set frequency to ~300 Hz (0x0c) */ + OCR2B = 0x00; /* Use system clock for Timer/Counter2 */ ASSR &= ~(1 << AS2); /* Reset Timer/Counter2 Interrupt Mask Register */ diff --git a/Arduino-microfox/defs.h b/Arduino-microfox/defs.h index 56a25ef..bc47c81 100644 --- a/Arduino-microfox/defs.h +++ b/Arduino-microfox/defs.h @@ -70,7 +70,7 @@ /****************************************************** * Set the text that gets displayed to the user */ -#define SW_REVISION "0.14" +#define SW_REVISION "0.15" //#define TRANQUILIZE_WATCHDOG @@ -105,6 +105,7 @@ typedef unsigned char uint8_t; #define PIN_DIP_1 5 #define PIN_DIP_2 6 #define PIN_AUDIO_OUT 9 +#define PIN_CAL_OUT 11 typedef enum { BEACON = 0,