This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Need help with UART link from cc1070 to cc1020

Other Parts Discussed in Thread: CC1070, CC1020

Hi All,

I have inherited an RF transmitter project which transmits a device ID as a UART, and I have been asked to develop a receiver to detect and display the ID.

The transmitter hardware is already designed and has been in manufacture for some time. It uses the TI CC1070 and is configured to transmit a burst of RF, encoded with the ID in UART mode at 9600 baud every 2 seconds.  I have gone through the CC1070 datasheet and have re-written the device configuration table as follows:

	retlw 0x81 ;00 MAIN         [Select A, Normal operation, no power down, no reset]
	retlw 0x0A ;01 INTERFACE    Internal Osc, PA_EN enabled and active high
	retlw 0x2D ;02 RESET        Do not write '1's to this register
	retlw 0x00 ;03
	; MET 434.050 approx freq
	retlw 0x3A ;04 FREQ_2A      }
	retlw 0x1F ;05 FREQ_1A      ) FREQ=0x1D0F97, DITHER=1
	retlw 0x2F ;06 FREQ_0A      )
	retlw 0x39 ;07 CLOCK_A      REF_DIV=DIV2, MCLK_DIV1=DIV48, MCLK_DIV2=DIV2
	retlw 0x3A ;08 FREQ_2B      )
	retlw 0x1F ;09 FREQ_2A      ) FREQ=0x1D0F97, DITHER=1
	retlw 0x2F ;0A FREQ_0B      )
	retlw 0x39 ;0B CLOCK_B      REF_DIV=DIV2, MCLK_DIV1=DIV48, MCLK_DIV2=DIV2
	retlw 0x44 ;0C VCO_CUR      Both VCO_CURRENTs = 2.8mA
	retlw 0x03 ;0D MODEM        UART mode, DCLK=1
	retlw 0x9B ;0E DEVIATION    TX_SHAPING=1, TXDEV_X=1, TXDEV_M=11
	retlw 0x00 ;0F
	retlw 0x00 ;10
	retlw 0x00 ;11
	retlw 0x00 ;12
	retlw 0x00 ;13
	retlw 0x00 ;14
	retlw 0x00 ;16
	retlw 0x07 ;17 ANALOG       402-470MHz band, PD_LONG=0, PA_BOOST=1, DIV_BUFF_CURRENT=3
	retlw 0x04 ;18 BUFF_SWING   PRE_SWING=0, TX_SWING=4
	retlw 0x93 ;1A PLL_BW       PLL_BW=147
	retlw 0x0F ;1C PA_POWER     PA_HIGH=0, PA_LOW=15
	retlw 0x00 ;1D 
	retlw 0x00 ;1E
	retlw 0x00 ;1F
	retlw 0x00 ;20 POWERDOWN    All systems powered up

Using a handheld receiver, I can confirm that the transmitter is sending an RF burst every 2 seconds.

I have constructed a receiver using a microcontroller module connected to a cc1020mx module from a TI development kit, and have converted the -868MHz RF circuit to -433MHz, (values optimised for 434.050MHz using SmartRFStudio).  I configure the CC1020 as follows:

                          // MAIN         set by cc1020_reset
  spi_write(0x01, 0x0F);  // INTERFACE    int osc, DIO output, set PA and LNA control
                          // RESET        should be read only
  spi_write(0x03, 0x8F);  // SEQUENCING   PSEL power up, min RX_WAIT, max CS_WAIT
  spi_write(0x04, 0x3A);  // FREQ_2A      )
  spi_write(0x05, 0x1F);  // FREQ_1A      ) FREQ = 0x1D0F97
  spi_write(0x06, 0x2F);  // FREQ_0A      )
  spi_write(0x07, 0x39);  // CLOCK_A      REF_DIV=DIV2, MCLK_DIV1=DIV48, MCLK_DIV2=DIV2
  spi_write(0x08, 0x3A);  // FREQ_2B      )
  spi_write(0x09, 0x1F);  // FREQ_1B      ) FREQ = 0x1D0F97
  spi_write(0x0A, 0x2F);  // FREQ_0B      )
  spi_write(0x0B, 0x39);  // CLOCK_B      REF_DIV=DIV2, MCLK_DIV1=DIV48, MCLK_DIV2=DIV2
  spi_write(0x0C, 0x44);  // VCO          Both VCO_CURRENTs = 2.8mA
  spi_write(0x0D, 0x53);  // MODEM        ADC_DIV=DIV12, PN9 disabled, UART mode
  spi_write(0x0E, 0x9B);  // DEVIATION    TX_SHAPING=1, TXDEV_X=1, TXDEV_M=11
  spi_write(0x0F, 0xC6);  // AFC_CONTROL  SETTLING=3, RXDEV_X=0, RXDEV_M=6
  spi_write(0x10, 0x2F);  // FILTER       FILTER_BYPASS=0, DEC_SHIFT=1, DEC_DIV=DIV16
  spi_write(0x11, 0x61);  // VGA1         CS_SET=1, CS_RESET=1, VGA_WAIT=0, VGA_FREEZE=1
  spi_write(0x12, 0x55);  // VGA2         LNA2_MIN=0, LNA2_MAX=1, LNA2_SETTING=1, AGC_DISABLE=0, AGC_HYST=1, AGC_AVG=1
  spi_write(0x13, 0x2F);  // VGA3         VGA_DOWN=1, VGA_SETTING=31
  spi_write(0x14, 0x2D);  // VGA4         VGA_UP=1, CS_LEVEL=13
  spi_write(0x15, 0x20);  // LOCK         LOCK_SELECT=Cont, WINDOW_WIDTH=0, LOCK_MODE=0, LOCK_ACCURACY=0
  spi_write(0x17, 0x47);  // ANALOG       402-470MHz band, LO_DC=1, VGA_BLANKING=0, PD_LONG=0, PA_BOOST=1, DIV_BUFF_CURRENT=3
  spi_write(0x18, 0x14);  // BUFF_SWING   PRE_SWING=0, RX_SWING=2, TX_SWING=4
  spi_write(0x19, 0x22);  // BUFF_CURRENT PRE_CURRENT=0, RX_CURRENT=4, TX_CURRENT=2
  spi_write(0x1A, 0xAF);  // PLL_BW       PLL_BW=175
  spi_write(0x1B, 0x34);  // CALIBRATE    CAL_START=0, CAL_DUE=0, CAL_WAIT=3, CAL_ITERATE=4
  spi_write(0x1C, 0x0F);  // PA_POWER     PA_HIGH=0, PA_LOW=15
  spi_write(0x1D, 0x00);  // MATCH        RX_MATCH=0, TX_MATCH=0
  spi_write(0x1E, 0x00);  // PHASE_COMP   PHASE_COMP=0
  spi_write(0x1F, 0x00);  // GAIN_COMP    GAIN_COMP=0
  spi_write(0x20, 0x00);  // POWERDOWN    All systems powered up

I call the initialisation routing and check for lock, (by reading the STATUS register (0x40)). STATUS returns not locked the first read after calibration, but thereafter returns 0xB2 or 0xB3, which seems to indicate it's locked successfully.

The image below shows the data sent to the DI pin of the CC1070 (top trace, yellow), and received at the DIO pin of the CC1020 (bottom trace, blue).  As you can see, there is no discernible correlation between the data sent and the data received. Indeed, the received data looks like random bit transitions, as if the receiver is not receiving the transmitted signal.

I'm about out of ideas now, and RF is not my strong field. So if anyone has any suggestions, I'd really appreciate that. Many thanks in advance.

  • I really could do with some help in this, even as a fee-paying service. Anyone out there able to contribute? I think for reasons of corporate ethics, I cannot pay a TI employee who is already paid to provide technical support, but would like to hear from any independent engineer/consultant/contractor. Post here, or email e2e at billysugger dot com.
  • Okay, I've switched the baud rate down to 4800 and checked the configuration register settings with those in the c-code for AN025, the CC1020 RF Modem. They match except for differences in frequency and the MODEM register, where AN025 uses Manchester encoding and I'm using UART. The receiver is in lock and I still get random data at the receiver which does not correlate at all with the transmitted data. Anyone used this chip set who can advise?
  • Your debugging is based on an RF link. This is not the way to do it - you need to break down the problem.

    1) Check the transmitter using a good known SW to control the chip; e.g. SmartRF Studio. Strap the SPI signals from CC1020EB to your board (disable the MCU on your board)
    Connect CC1020/CC1070 to a spectrum analyzer (or connect an antenna to the spectrum if conducted measurements are not possible). Do you transmit at the expected frequency? Is there a significant frequency offset? Apply a 0-1 sequence at the DIO pin; e.g. if the baud rate is 4.8 kBaud then the signal at DIO shall be a 2.4 kHz square wave. Use the spectrum analyzer to demodulate the transmitted signal. Is the frequency deviation at the expected value? If not, then there is an issue with the loop filter

    2) Check the receiver using a good known SW to control the chip; e.g. SmartRF Studio.
    Connect CC1020 to an RF signal generator. The carrier frequency shall be set to the same as measured in 1) above. If you do not have the equipment to send FSK modulation, you can use an RF generator with FM modulation and use an external function generator to modulate the signal with a square wave. If you are in UART mode the modulating signal should be equal to bitrate/2 (= baudrate/2) when sending alternating 0's and 1's. Monitor the CC1020 DIO pin using an oscilloscope. You should see a square wave similar to the function generator.

    3) Antenna is another source of error, and also needs to be tested separately using a network analyzer.

    When the above is found to be operating ok you are in a position to use your own SW and set up an RF link as you now know that any issues will be related to SW.
  • Thank you Sverre, I don't have easy access to a spectrum analyser but I do have a tuned receiver.  I can certainly make use of the methodical approach you suggest and if I can't validate the system elements without one, I'll have to hire an analyser.  I appreciate your helpful advice in this.