I want to send packet with CC1110f32 , but when it goes to the transmit code, it never comes out of the wait loop for the pktSentFlag in this code segment:
while(!pktSentFlag) ;
pktSentFlag = FALSE;
Here is the whole code:
radioConfigure(DATA_RATE_1_CC1110, FREQUENCY_4_CC1110);
// Set up the DMA to move packet data from buffer to radio
dmaRadioSetup(RADIO_MODE_TX);
mode = RADIO_MODE_TX;
// Configure interrupt for every time a packet is sent
IEN2 |= 0x01; // Enable RF general interrupt
RFIM = IRQ_DONE; // Mask IRQ_DONE flag only
IRCON &= ~0x80; // Clear interrupt flag
WORIRQ &= ~0x01;
// Construct the packet to be transmitted in buffer
radioPktBuffer[0] = PACKET_LENGTH; // Length byte
radioPktBuffer[1] = (BYTE) (NETWORK_ID_KEY>>8); // Network identifier
radioPktBuffer[2] = (BYTE) NETWORK_ID_KEY;
IRCON &= ~0x80; // Clear interrupt flag
WORIRQ &= ~0x01;
while (TRUE) {
DATA_X= 0xAA;
DATA_Y=0xBB;
radioPktBuffer[3] = Standby; // Standby not used (Standby=0)
radioPktBuffer[4] = seqNum++; // seqNum iterating 0~255
radioPktBuffer[5] = DATA_X; // Delta X value
radioPktBuffer[6] = DATA_Y; // Delta y value
DMAARM = DMAARM_CHANNEL0; // Arm DMA channel 0
RFST = STROBE_TX; // Switch radio to TX
// Wait until the radio transfer is completed,
// and then reset pktSentFlag
while(!pktSentFlag) {PS2_CLK^=1;}
pktSentFlag = FALSE;
}