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.

CC1120 address filtering and variable packet length

Other Parts Discussed in Thread: CC1120

Ok i have 2 CC1120 and i can make them talk all day long.  Iv got rx sniff mode working great.  But I am having a problem with variable packet length and address filtering.  It seems that when i transmit it sends the first byte (the packet length byte) twice making it impossible to do address filtering unless i want the address to always be the same as packet lengths....   iv changed my transmit function around a lot but ill post what I am using now.

int i = 0;


TXByteCtr = 0x10;  //TXDATA[0]+1;  
RF_PORT_OUT &= ~RF_SPI_CS;
while (UCB0STAT & UCBUSY);

UCB0TXBUF = 0x7F; 
while (UCB0STAT & UCBUSY);
CheckStatus = UCB0RXBUF; // get check status byte
while (UCB0STAT & UCBUSY);

UCB0TXBUF = 0x10; // i set ten to be the first byte 

while(UCB0STAT & UCBUSY);

while(TXByteCtr != 0)
{
while(UCB0STAT & UCBUSY);
UCB0TXBUF = TXDATA[i];    // Load TX buffer
TXByteCtr--;
i++;
}


RF_PORT_OUT |= RF_SPI_CS;

__delay_cycles(100);

this works good except it sends the first byte (0x10) twice any advice?

Also if it helps what I do to make it transmit is i run the tx function that i posted to wright to the tx FIFO

then I wright to the extended register TXFIRST and set it to zero and strobe the command strobe STX.

this transmits fine except seems to duplicate the first byte.  

  • Robert,

    I recommend pulling the TX_FIFO_LENGTH registers to see how many bytes the FIFO thinks you have entered. This is a good debug, if this does not work I also recommend getting a SPI port sniffer and verifying what you are sending on the SPI bus.

    Regards,
    /TA

  • Remember that the radio will not transmit the packet length or address for you. You manually need to write both the address and the length to the TXFIFO.

    If your length byte is 16 (0x10) and your address is for example 0x45 you need to write the following to the TX FIFO:

    0x10, 0x45, DATA1, DATA2, DATA3, DATA4, DATA5, DATA6, DATA7, DATA8, DATA9, DATA10, DATA11, DATA12, DATA13, DATA14, DATA15

    Siri