I'm trying to send packets by using CC430. For that I use the following function (copied from SLAA465 example):
void Transmit(unsigned char *buffer, unsigned charlength) {
RF1AIES |= BIT9;
RF1AIFG &= ~BIT9; // Clear pending interrupts
RF1AIE |= BIT9; // Enable TX end-of-packet interrupt
WriteBurstReg(RF_TXFIFOWR, buffer, length);Strobe( RF_STX ); // Strobe STX }
After initializing the first packet is sent regulary (I can receive it by using SmartRF Studio) but if I execute this functions twice or more often in serial it only works for the first time, only one package is sent.
If I set breakpoints before every single Transmit() function and continue manually by clicking continue every Transmit() function really transmits a packet. It seems like the radio needs time after a TX to exit TX state.
MCSM1 is in default setup, so the radio goes to Idel after a TX, I checked that.
To make sure that the radio is really in idle before executing the next Transmit() function I did the following:
Transmit((unsigned char*)TxBuffer, sizeof TxBuffer);
while(ReadSingleReg(MARCSTATE) != 0x01); // Wait for Radio to go Idle
But also in this case the second Transmit() function does not result in a sent packet if the program is executed regularly. If I set a breakpoint before the second Transmit function and continue the program manually a second packet is sent by the radio...
I think the radio just needs some cycles to be able to send another packet but I don't find information about that in the manual (or I'm blind at the moment...).
Who can help me or has similar behavior?