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.

CC2530: TI MAC,in RF ISR ,do we transmit ACK?

Part Number: CC2530


on macMcuInit  function    we  do  MAC_RADIO_TURN_ON_AUTO_ACK();

on rxStartIsr function, what do they do bellow?

MAC_RADIO_TX_ACK_PEND();

MAC_RADIO_TX_ACK();

MAC_RADIO_REQUEST_ACK_TX_DONE_CALLBACK();

if we need to process ack issue on RF isr, would that we miss process ack happen if we have other isr?

MAC_INTERNAL_API void macMcuInit(void)

{

……

/* Turn on autoack */
MAC_RADIO_TURN_ON_AUTO_ACK();

……

}

static void rxStartIsr(void)

……

/*-------------------------------------------------------------------------------
* Process any ACK request.
*/
if (macRxOutgoingAckFlag)
{
halIntState_t s;

/*
* This critical section ensures that the callback ISR is initiated within time
* to guarantee correlation with the strobe.
*/
HAL_ENTER_CRITICAL_SECTION(s);

/* Do not ack data packet with pending more data */
if( MAC_FRAME_TYPE(&rxBuf[1]) == MAC_FRAME_TYPE_COMMAND )
{

……

}

if( ackWithPending == MAC_RX_FLAG_ACK_PENDING )
{
MAC_RADIO_TX_ACK_PEND();
}
else
{
MAC_RADIO_TX_ACK();
}


/* request a callback to macRxAckTxDoneCallback() when the ACK transmit has finished */
MAC_RADIO_REQUEST_ACK_TX_DONE_CALLBACK();
HAL_EXIT_CRITICAL_SECTION(s);
}

}

  • Hi,

    Yes, the ACKs are sent automatically due to MAC_RADIO_TURN_ON_AUTO_ACK().

    MAC_RADIO_TX_ACK_PEND() and MAC_RADIO_TX_ACK() will set or clear the PENDING_OR bit in FRMCTRL1 (0x618A).
    This bit is taken into consideration for whether the "frame pending" bit is set in the ACK message. The "frame pending" bit notifies the receiver of the ACK whether or not a message is pending for the receiver.

    MAC_RADIO_REQUEST_ACK_TX_DONE_CALLBACK() will request an interrupt/callback when the device has finished transmitting the ACK.
    macMcuRfIsr handles all RF interrupts.

    The definitions of these macros are provided in the code (mac_mcu.h, mac_radio_defs.h, etc.), and the register descriptions are detailed in the User's Guide.

    Regards,
    Toby