This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRf52 communication problem

Hi,

I working on nRF52 series development boards communication. I am using ESB library for data transfer. I am able to transfer the data between two microcontrollers. Now I am using internal temperature sensor so that I can transfer the temperature sensor data.

When I add the Tx temperature sensor data it is not receiving by the receiver when I send other than any character it is able to receive.

I didn't know what I am doing wrong.

Can anyone help me out here? I am attaching Tx code here

main.c

  • Hi,

    1. In NRF_ESB_CREATE_PAYLOAD(..) the first argument needs to be the pipe. You are using pipe 0, so you need NRF_ESB_CREATE_PAYLOAD(0,0x31);

    2. You are not starting the temperature measurement again after you stop it. You need to place the NRF_TEMP->TASKS_START=1; at the start of the first while-loop in main.

    3. If you want to send the temperature every 15 seconds, I recommend you to use a app timer instead of the RTC directly. Take a look at e.g. the Timer example. Here you can set the time_ms in main.c to 15000 to get the interrupt to trigger every 15 second. Then place the nrf_esb_write_payload(&tx_payload) in the interrupt handler.

Related