From 209c685f1112e9f32cf146cc9d444290e6c3638c Mon Sep 17 00:00:00 2001 From: th9xer Date: Tue, 4 Dec 2012 18:31:06 +0000 Subject: [PATCH] [GRUVIN9X] Changes for SOMO sound module Correction to start pulse timing, and extended data setup time. Also started using the SOMO reset signal, this allows for faster power on and WDT reset initialization and stops erroneous playback after WDT reset. Connection needs to be made from PORTH pin 3 via a 220ohm series resistor to the SOMO14D reset pin. --- src/board_gruvin9x.cpp | 9 +++++---- src/gruvin9x/somo14d.cpp | 35 ++++++++++++++++++++--------------- src/open9x.h | 3 ++- 3 files changed, 27 insertions(+), 20 deletions(-) diff --git a/src/board_gruvin9x.cpp b/src/board_gruvin9x.cpp index 24dea87f7..97100bc86 100644 --- a/src/board_gruvin9x.cpp +++ b/src/board_gruvin9x.cpp @@ -46,10 +46,10 @@ inline void board_init() DDRG = 0b00010000; PORTG = 0xff; // 7-6:N/A, 5:GearSW, 4: Sim_Ctrl[out], 3:IDL1_Sw, 2:TCut_Sw, 1:RF_Power[in], 0: RudDr_Sw #if defined(DEBUG) && !defined(VOICE) - DDRH = 0b11110000; PORTH = 0b11011111; // PORTH:7-6 enabled for timing analysis output ... see below ... + DDRH = 0b11111000; PORTH = 0b11010111; // PORTH:7-6 enabled for timing analysis output ... see below ... #else - DDRH = 0b10110000; PORTH = 0b11011111; // [7:0 DSM/PPM TX-caddy control. 1=PPM, 0=DSM ] - // [6:SOMO14D-BUSY 5:SOMO14D-DATA 4:SOMO14D-CLK] + DDRH = 0b10111000; PORTH = 0b11010111; // [7:0 DSM/PPM TX-caddy control. 1=PPM, 0=DSM ] + // [6:SOMO14D-BUSY 5:SOMO14D-DATA 4:SOMO14D-CLK 3:SOMO14D-RESET] // [2:VIB_OPTION -- setting to input for now] // [1:TxD 0:RxD Spare serial port] #endif @@ -106,8 +106,9 @@ inline void board_init() /* * SOMO set-up (V4 board only) */ - OCR4A = 0x7d; + OCR4A = 0x1F4; //2ms TCCR4B = (1 << WGM42) | (3<