From ed06aea0864c1ad59f1e88d53283db1f5b4d0ee5 Mon Sep 17 00:00:00 2001 From: Casey Halverson Date: Thu, 2 Jul 2015 13:52:30 -0700 Subject: [PATCH 1/3] FM Beacon --- examples/FMBeacon/FMBeacon.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/FMBeacon/FMBeacon.ino b/examples/FMBeacon/FMBeacon.ino index 0966214..44ce000 100644 --- a/examples/FMBeacon/FMBeacon.ino +++ b/examples/FMBeacon/FMBeacon.ino @@ -65,4 +65,4 @@ void loop() { // Wait 10 seconds and check the channel again. delay(10000); } -} \ No newline at end of file +} From 81fc8a656664d5729d1da876ba55dd2210afadbf Mon Sep 17 00:00:00 2001 From: Casey Halverson Date: Thu, 2 Jul 2015 13:55:16 -0700 Subject: [PATCH 2/3] fixed frequency calculation per data sheet fixed frequency calculation per data sheet. this should be a 16 multiplier now vs. 8 for the old RDA 1846. --- HamShield.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/HamShield.cpp b/HamShield.cpp index afadace..7fe816a 100644 --- a/HamShield.cpp +++ b/HamShield.cpp @@ -254,7 +254,7 @@ void HamShield::softReset() { void HamShield::setFrequency(uint32_t freq_khz) { radio_frequency = freq_khz; - uint32_t freq_raw = freq_khz << 3; // shift by 3 to multiply by 8 + uint32_t freq_raw = freq_khz << 4; // shift by 4 to multiply by 16 (was shift by 3 in old 1846 chip) // send top 16 bits to A1846S_FREQ_HI_REG uint16_t freq_half = (uint16_t) (0x3FFF & (freq_raw >> 16)); From 0bfd349b648b8e295f84c2c751f559bd3d9caebe Mon Sep 17 00:00:00 2001 From: morgan Date: Thu, 2 Jul 2015 14:15:34 -0700 Subject: [PATCH 3/3] updated setRfPower function. It now sets the PADRV bits on the AU1846 --- HamShield.cpp | 13 +++---------- HamShield.h | 3 +++ examples/SerialTransceiver/SerialTransceiver.ino | 4 ++-- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/HamShield.cpp b/HamShield.cpp index 7fe816a..eae5b2f 100644 --- a/HamShield.cpp +++ b/HamShield.cpp @@ -384,7 +384,7 @@ void HamShield::setTX(bool on_noff){ setGpioLow(5); // remember that RX and TX are active low // then turn on VREG (PWM output) // then apply RF signal - setRfPower(100); // figure out a good default number (or don't set a default) + setRfPower(9); // figure out a good default number (or don't set a default) } // todo: make sure gpio are set correctly after this @@ -943,19 +943,12 @@ void HamShield::setRfPower(uint8_t pwr) { // (see RF6886 datasheet) // 30 is 0.5V, which is ~min loop reference voltage // 127 is 2.5V, which is ~max loop ref voltage - int max_pwr = 255; //167; // 167 is 3.3*255/5 - 1; + int max_pwr = 15; //167; // 167 is 3.3*255/5 - 1; if (pwr > max_pwr) { pwr = max_pwr; } - - // using open loop reference voltage into Vreg1/2 - /*int max_pwr = 78; // 78 = 1.58*255/5 - 1 - if (pwr > max_pwr) { - pwr = max_pwr; - }*/ - // using loop ref voltage as specified in RF6886 datasheet - // analogWrite(pwr_control_pin, pwr); + I2Cdev::writeBitsW(devAddr, A1846S_PABIAS_REG, A1846S_PADRV_BIT, A1846S_PADRV_LENGTH, pwr); } diff --git a/HamShield.h b/HamShield.h index 45949a1..5006af3 100644 --- a/HamShield.h +++ b/HamShield.h @@ -89,6 +89,9 @@ #define A1846S_PABIAS_BIT 5 // pabias_voltage<5:0> #define A1846S_PABIAS_LENGTH 6 +#define A1846S_PADRV_BIT 14 // pabias_voltage<14:11> +#define A1846S_PADRV_LENGTH 4 + // Bitfields for A1846S_BAND_SEL_REG #define A1846S_BAND_SEL_BIT 7 // band_sel<1:0> #define A1846S_BAND_SEL_LENGTH 2 diff --git a/examples/SerialTransceiver/SerialTransceiver.ino b/examples/SerialTransceiver/SerialTransceiver.ino index 3733302..ff033a0 100755 --- a/examples/SerialTransceiver/SerialTransceiver.ino +++ b/examples/SerialTransceiver/SerialTransceiver.ino @@ -17,7 +17,7 @@ Frequency F; Set the receive frequency in KHz, if offset is disabl CDCSS In G; must be a valid CDCSS code No CDCSS Out H; must be a valid CDCSS code No Print tones I Prints out all configured tones and codes, coma delimited in format: CTCSS In, CTCSS Out, CDCSS In, CDCSS Out No -Power level P; Set the power amp level, 0 = lowest, 255 = highest No +Power level P; Set the power amp level, 0 = lowest, 15 = highest No Enable Offset R; 1 turns on repeater offset mode, 0 turns off repeater offset mode No Squelch S; Set the squelch level No TX Offset T; The absolute frequency of the repeater offset to transmit on in KHz No @@ -81,7 +81,7 @@ void setup() { radio.setVolume2(0xF); radio.setModeReceive(); radio.setTxSourceMic(); - radio.setRfPower(255); // 30 is 0.5V, which corresponds to 29 dBm out (see RF6886 datasheet) + radio.setRfPower(9); radio.setSQLoThresh(80); radio.setSQOn(); }