Hi,
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 payload that we need to transmit is of length 21bytes. The payload that we need to receive is of length 9bytes as per our protocol. Also the 21byte payload has to be transmitted out from nrf52840 every 1008microseconds. The 9bytes payload has to be received in nrf52840 every 250milliseconds.
I am using the NCS toolchain and library.
We are 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.
In the "main" function we have an infinite while loop inside which we fill the "tx_payload" buffer with our proprietary data.
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 at a time 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. During this time the NRF52840 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 onto our legacy product. During this time 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