Hi,
I am software engineer working in Philips.
I am trying to transmit 21 bytes of our payload data (fixed payload length).
I have the following configurations done for esb_initialize() function.
Hi,
I am software engineer working in Philips.
I am trying to transmit 21 bytes of our payload data (fixed payload length).
I have the following configurations done for esb_initialize() function.
Hello Kenneth,
Thanks for your reply. Yes we need to communicate with a legacy patient monitor device. So we need to use this NRF52840 device to send out packets and receive packets as per our legacy device protocol. The ESB protocol has some extra data fields in the packet which would not be compatible with our product. In other posts I was told to use the same ESB sample code for our legacy product.
I am using the NCS toolchain and library. Can I use the "NRF_ESB_LEGACY" definition in the current "radio_ptx" project "main.c" file?
We actually need to modify the "radio_ptx" code to receive data packets at 250ms. But I am facing a lot of issues in getting both tx and rx working together in the same code. I have explained it below.
I am using separate initialization functions for tx and rx because the transmit payload length is 21 bytes and receive payload length is 9 bytes.
I have created a timer of 1008microseconds which is as per our protocol timing requirements. Then I am calling these initialize functions and tx and rx funtions inside my timer handler function as below.
But either transmit or receive works when I run this program on the nrf52840 development kit. By default the receive works and I get "ESB_EVENT_RX_RECEIVED" event and the below mentioned debug print is displayed on the screen. But the transmit does not work and I do not receive any packet from the nrf52840 onto our legacy product.
However when I enable a print inside the "timer_callback" function the transmit works fine and we see the data that is transmitted from nrf52840 on our legacy product. But the receive does not work and I do not get the prints inside "ESB_EVENT_RX_RECEIVED" event.
could you please help me out in getting both tx and rx working in the same program? There could be some timing mismatch here as well.
Thanks and regards
Ajit S J
Hello,
Looks like you want the very old ShockBurst format of the packet, without the PID field that was introducted in the ESB protocol for dynamic payload length and acknowledge. Unfortunately we don't have any code for this, so you likely need to modify the ESB as you are doing already.
I can see you have cleared the S0LEN, S1LEN and LFLEN of NRF_RADIO->PCNF0, which should remove the PID field. In that case you will need to always update the STATLEN and MAXLEN of NRF_RADIO->PCNF1 every time before you enter transmit or receive a packet, which I can also see that you are doing.
Given your description that you are able to make this "somewhat" work in both directions (but not really at the same time), I think the problem is timing related. I suggest that you get yourself an Nordic PPK II power profiler kit, this will allow you to measure with high accuracy both receive and transmit timing: https://www.nordicsemi.com/Products/Development-hardware/Power-Profiler-Kit-2
Best regards,
Kenneth
Hi Kenneth,
Thanks for your reply. Can't we change any register settings or code in the software to make the transmit and receive work together? Why do we need to use another power profiler kit?
Thanks and regards,
Ajit S J
If you have built your application on the old ShockBurst (SB) protocol, then SB only did tx or rx, and it was up to the application what timing was done if it did switch between the two modes of operation. In this case it is not clear to me what exactly timing you have between the two modes of operation, e.g. what is the receive "window" of the peer if it switch direction. So that is why I suggested getting an PPK, since that allow you to monitor with great detail (in the us range) when the radio is operating in tx and rx (by looking at the peak current consumption), and you could then measure on the old and new implementation and found if one of the timings were off in this case.
Best regards,
Kenneth
If you have built your application on the old ShockBurst (SB) protocol, then SB only did tx or rx, and it was up to the application what timing was done if it did switch between the two modes of operation. In this case it is not clear to me what exactly timing you have between the two modes of operation, e.g. what is the receive "window" of the peer if it switch direction. So that is why I suggested getting an PPK, since that allow you to monitor with great detail (in the us range) when the radio is operating in tx and rx (by looking at the peak current consumption), and you could then measure on the old and new implementation and found if one of the timings were off in this case.
Best regards,
Kenneth