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.

checking for SFD bit in radio or link layer

Other Parts Discussed in Thread: CC2540

Hello,

I am using cc2540 and need to check for SFD bit of RFSTAT in lower layer in RF layer or in link layer but not in application layer.

If I check in application layer there will be some delay,so where exactly can I place my code and check for Sfd bit as soon as it goes high.

Thanking you,

Lokesh

  • Hello Ballenahalli ,

    You could try to look at the  "RFC_OBS_CTRL0 (0x61AE) RF Observation Mux Control 0" and use the one similar to the SFD. You can follow the given procedure and monitor the pin you route the signal to:

    "Determine which signal (RFC_OBS_CTRL[0–2]) to output on which GPIO pin (P1[0:5]). This is
    done using the OBSSELx control registers (OBSSEL0–OBSSEL5) that control the observation output to the
    pins P1[0:5] (overriding the standard GPIO behavior for those pins)."

    But be careful if you use an interrupt on the pin. Make sure that the priority of the pin interrupt is lower than the RF interrupt. There might be a risk to disrupt the low level BLE stack if you use an interrupt with higher priority.

  • hello Eiric,

    thank you for the replay,I have tried the below code,the P1.2 and P1.4 are high are the code execution.

    RFC_OBS_CTRL0 = RF_OBS_LLE_RX_ACTIVE | RF_OBS_POLARITY_1;

    RFC_OBS_CTRL1 = RF_OBS_LLE_TX_ACTIVE | RF_OBS_POLARITY_1;

    // map RF observable 0 to GPIO P1.2
    OBSSEL2 = RF_OBS_IO_SEL_0 | RF_OBS_IO_ENABLE;

    // map RF observable 1 to GPIO P1.4
    OBSSEL4 = RF_OBS_IO_SEL_1 | RF_OBS_IO_ENABLE;

    but I wonder where to add this code,do I need to add this code in osalInitTasks creating a new task or can I add this code in by creating my own ll.c file or in osal_run_system.

    regards,

    Lokesh

  • If it is not changed anywhere else in the code you can do it wherever you like.

  • Hello Eirik,

    yes,its not changed anywhere else.

    the bits tx_active and rx_active are high after HalDriverInit(); in simpleBLECentral_Main.c

    is this tx_active and rx_active pins goes low when stack goes to sleep mode?

    Regards,

    Lokesh

  • No, I think the GPIO state should have retention in sleep.