Hi All,
I am using "ZAP-MSP430-2.5.1" code. I have a doubt regarding cc2530 SPI write from Application processor.
CASE 1:
From zap_phy_spi.c file, SPI write is as follows..
---------------------------------------------------------------------------------------------------------------------------------------------
/**************************************************************************************************
* @fn zapPhySpiRun
*
* @brief This function forces the waiting SBL on the ZNP to run.
*
* input parameters
*
* @param port - Port Id corresponding to the ZNP to run.
*
* output parameters
*
* None.
*
* @return None.
**************************************************************************************************
*/
static void zapPhySpiRun(uint8 port)
{
HalBoardDelay(zapPhySpiDly, FALSE);
while (!HAL_ZNP_SRDY_SET() && HalBoardDelayed())
{
HAL_BOARD_WAIT_MODE();
}
if (HAL_ZNP_SRDY_SET())
{
uint8 ch = SB_FORCE_RUN;
HAL_ZNP_MRDY_SET(); // MRDY must be set before talking to the slave.
HalSpiWrite(port, &ch, 1);
HAL_ZNP_MRDY_CLR(); // MRDY must be cleared before SBL will clear SRDY.
(void)getSRDY2(port);
}
}
---------------------------------------------------------------------------------------------------------------------------------------------
1. We are waiting for SRDY to become HIGH.
2. We are making MRDY to HIGH.
3. Write 0x7 to cc2530.
4. We are clearing MRDY.
5. We are waiting for SRDY to clear.
CASE 2:
From CC2530 interface Spec, the sequence is as follows,
1. We are waiting for SRDY to become LOW.
2. We are making MRDY to LOW.
3. Write POLL command to cc2530.
4. Wait for SRDY to become HIGH.
5. Read from CC2530
6. We are making MRDY HIGH.
From the above two cases,
- in case-1 we are writing to CC2530 when SRDY is HIGH as per code.
- in case-2 we are waiting for SRDY to become LOW, to write to CC2530.