Transmitting sensor data

Hi all,

After understanding how to port my Stm32f407 to the Evk, now, I would like to send the data I got from a sensor from one EVK to another one. Actually, I have looked at examples of simple Rx and Tx of Dw1000, however, I am a bit confused to which way I should follow. I have read the datasheet and understood the basic transmission and reception. May you please direct me to a way I should follow?

Thank you in advance.

1 Like

Hi Halil,

You can send you’re data in the UWB frame, there is a standard payload of 127 bytes.

Below is a very basic example. I read the temperature and copy it to the frame payload and transmit.

// Definition of the frame
static uint8 tx_poll_msg[] = {0x41, 0x88, 0, 0, 0xCA, 0xDE, 'W', 'A', 'V', 'E', 0xE0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};

//Define length and index of temperature field in the frame
#define POLL_TEMPT_LEN 8
#define POLL_TEMPT_IDX 11

//Reading temperature
static volatile double ref_temp = 0 ;
ref_temp = 1.13 * (double)((dwt_readtempvbat(1) & 0xFF00) >> 8) - 113.0; 

//Copying temperature in the frame
memcpy(&tx_poll_msg[POLL_TEMPT_IDX],&ref_temp,POLL_TEMPT_LEN);

// Prepare data for transmission and send the frame
dwt_writetxdata(sizeof(tx_poll_msg), tx_poll_msg, 0); /* Zero offset in TX buffer. */
dwt_writetxfctrl(sizeof(tx_poll_msg), 0, 1); /* Zero offset in TX buffer, ranging. */
dwt_starttx(DWT_START_TX_IMMEDIATE);

Hope it clarifies, let me know if you have any other question,
Regards
Yves

1 Like

Hi Bernard,

Thanks for the nice example.

Could you please tell me which file in the code(project) should be amended in this case?

Best regards,

Eranga…