diff options
Diffstat (limited to 'software/hhd70dongle/c1101lib.c')
-rw-r--r-- | software/hhd70dongle/c1101lib.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/software/hhd70dongle/c1101lib.c b/software/hhd70dongle/c1101lib.c index a29974e..872c211 100644 --- a/software/hhd70dongle/c1101lib.c +++ b/software/hhd70dongle/c1101lib.c @@ -174,7 +174,7 @@ int spi_c1101_write_txfifo(char *buffer, int len) sb = spi_c1101_write_byte_ok_get_status(SPIC1101_ADDR_FIFO_WRITE_BURST); if (sb < 0) return -1; - uint8_t debug_sb[6]; + //~ uint8_t debug_sb[6]; while (len-- > 0 && SPIC1101_SB_FIFO_BYTES_AVAILABLE(sb) > 2) { //~ usb_rawhid_send((uint8_t*)"TXFifo bytes available",255); @@ -214,9 +214,10 @@ void c1101_init(void) // FSCTRL1 Frequency Synthesizer Control spi_c1101_write_register(SPIC1101_ADDR_FSCTRL1, 0x06); // FREQn Frequency Control Words - spi_c1101_write_register(SPIC1101_ADDR_FREQ2, 0x10); - spi_c1101_write_register(SPIC1101_ADDR_FREQ1, 0xD3); - spi_c1101_write_register(SPIC1101_ADDR_FREQ0, 0xB1); + spi_c1101_write_register(SPIC1101_ADDR_FREQ2, 0x10); //should be 435.125 mhz + spi_c1101_write_register(SPIC1101_ADDR_FREQ1, 0xBF); + spi_c1101_write_register(SPIC1101_ADDR_FREQ0, 0xEF); + spi_c1101_write_register(SPIC1101_ADDR_FSCTRL0, 0); //frequency offset // MDMCFGn Modem Configuration spi_c1101_write_register(SPIC1101_ADDR_MDMCFG4, 0xF8); spi_c1101_write_register(SPIC1101_ADDR_MDMCFG3, 0x83); @@ -241,6 +242,7 @@ void c1101_init(void) //c1101_setFrequency(1091741,0,15); } +//f_XOSC = 25,978016865 Mhz // freq: desired_carrier_freq [Hz] *2^16 / f_XOSC // freq_offset: desired frequency offset [Hz] *2^14 / f_XOSC // if_freq: desired intermidiate rx frequency [Hz] *2^10 / f_XOSC |