diff --git a/avrrfm.c b/avrrfm.c index 5555801..a12ab78 100644 --- a/avrrfm.c +++ b/avrrfm.c @@ -169,7 +169,7 @@ _rssi, crc, temp.quot, abs(temp.rem)); printString(buf); - snprintf(buf, sizeof (buf), "RSSI: -%d dBm, CRC: %d", _rssi, crc); + snprintf(buf, sizeof (buf), "RSSI: %4d dBm, CRC: %d", -_rssi, crc); const __flash Font *unifont = &unifontFont; writeString(0, 0, unifont, buf, WHITE, BLACK); diff --git a/mcp9808.c b/mcp9808.c index bbb8ee2..e2f0dea 100644 --- a/mcp9808.c +++ b/mcp9808.c @@ -94,11 +94,11 @@ // TA < 0°C // clear sign upper &= 0x0f; - temp = 2560 - (upper * 160 + lower * 10 / 16); + temp = -(2560 - (upper * 160 + lower * 10 / 16)); } else { // TA >= 0°C temp = (upper * 160 + lower * 10 / 16); } - + return temp; } \ No newline at end of file diff --git a/rfm69.c b/rfm69.c index 43a1605..30a89f5 100644 --- a/rfm69.c +++ b/rfm69.c @@ -94,9 +94,11 @@ // regWrite(BITRATE_MSB, 0x0d); // regWrite(BITRATE_LSB, 0x05); - // frequency deviation 5 kHz (default) - // regWrite(FDEV_MSB, 0x00); - // regWrite(FDEV_LSB, 0x52); + // frequency deviation (default 5 kHz) - increasing to 40 kHz + // completely removes suspectibility to temperature changes + // RX_BW must be increased accordingly + regWrite(FDEV_MSB, 0x02); + regWrite(FDEV_LSB, 0x80); // RC calibration, automatically done at device power-up // regWrite(OSC1, 0x80); @@ -110,20 +112,20 @@ // regWrite(PA_LEVEL, 0x7f); // LNA 200 Ohm, gain AGC (default) - // regWrite(LNA, 0x88); + regWrite(LNA, 0x88); // LNA 50 Ohm, gain AGC - regWrite(LNA, 0x08); - // max gain - // regWrite(LNA, 0x89); + // regWrite(LNA, 0x08); // LNA high sensitivity mode // regWrite(TEST_LNA, 0x2d); - // freq of DC offset canceller and channel filter bandwith (default) - regWrite(RX_BW, 0x55); + // freq of DC offset canceller and channel filter bandwith (default 10.4 kHz) + // increasing to 80.3 kHz in connection with setting FDEV_*SB to 40 kHz + // completely removes suspectibility to temperature changes + regWrite(RX_BW, 0x52); // RX_BW during AFC (default) - regWrite(AFC_BW, 0x8b); + regWrite(AFC_BW, 0x88); // AFC auto on // regWrite(AFC_FEI, 0x04);