Hi, I'm trying to use CCA with CC430 and I can only get the CCA interrupt signal (RFIFG12) asserted once and then for the rest of the time, it will not get asserted again. This problem is resolved when the device is restarted however.
I'm using absolute CS threshold, I'm not sure what's the CS threshold and I don't know how to measure it. I've read on the forums that the CS threshold could be too low that the device is interpreting noise as channel being busy. So I've set everything to highest settings:
/* set threshold high */ max_dvga_gain = 0; max_lna_gain = 0; WriteSingleReg(AGCCTRL2, (max_dvga_gain << 6) | (max_lna_gain << 3) | 0x03); /* use absolute threshold instead of relative */ WriteSingleReg(AGCCTRL1, BIT6 | 7); /* AGC_LNA_PRIORITY = 1, 7dB above */
This is the transmit function:
uint8_t phy_transmit(uint8_t *buffer, uint8_t length) { phy_disableRX(); receiving = 0; wor = 0; transmitting = 1; uint8_t tx_success = 0; /* Configuring registers */ RF1AIFG &= ~(1 << 12); RF1AIES |= (1 << 12); /* CCA asserted when RSSI level is below threshold */ RF1AIE &= ~(1 << 12); /* Do not want an interrupt for it */ /* Configure TX FIFO */ WriteBurstReg(RF_TXFIFOWR, buffer, length); /* Transmit using CCA */ /* e2e.ti.com/.../implementation-of-cca-in-an-application-cc1100-cc1101-cc1110-cc1111-cc2500-cc2510-cc2511 */ __no_operation(); /* for debug */ /* 1. Strobe SRX */ Strobe(RF_SRX); /* 2. Wait for RX mode (0x0D or 13 [DEC]) to be entered (poll MARCSTATE) */ while(ReadSingleReg(MARCSTATE) != 0x0D); /* 3. Wait 500us for RSSI to be valid, 6000 cycles with 12MHz clock */ __delay_cycles(6000); if(enableUartLog) printf("RSSI: %d dBm", phy_getRSSI()); /* 3.1 If CCA is asserted, channel is free */ if(RF1AIFG & (1 << 12)) { RF1AIFG &= ~(1 << 12); if(enableUartLog) printf(" Channel free "); /* 4. STrobe STX */ RF1AIES |= BIT9; RF1AIFG &= ~BIT9; Strobe(RF_STX); /* 5. Wait for TX to completed sending */ while(!(RF1AIFG & (1 << 9))); transmitting = 0; tx_success = 1; } else { if(enableUartLog) printf(" Channel busy "); tx_success = 0; } return tx_success; }
Can I please get some help with this problem?