Hi, I used the SPI and SPIS examples to read a type K thermocouple with a max31856, the problem is that in no example do I get any response or data from the sensor, I wanted to know if someone tried to read thermocouples with the nRF52840DK or if they have any advice How to read sensors with SPI.
Your question is quite vague. You may receive a better response if you can provide more details of your setup including how you are configuring the SPI driver.
It sounds like the 52840 is the SPI master and thermocouple is the SPI slave device. Make sure you are using the SPI master drivers in your application (not SPIS)
Yes, but, how can I write and read data from a component such as MAX31856 that is responsible for hosting the thermocouple reading data. I can write certain addresses, 0x00, 0x0A ...., and then read others that contain thermocouple reading data. In the examples of SPI I do not find one that will guide me in this case.
I'm not sure I understand your question. If the MAX31856 has a SPI interface, you write the register address you want to read/write to the device (similar to how the string "Nordic" is transmitted in the example) and continue with the data you want to write or read back the response.
This is the datasheet link datasheets.maximintegrated.com/.../MAX31856.pdf, how could I modify the example to send several data to the MAX that would be the configuration parameters and then send other parameters to obtain the values of the variables for the calculation of the temperature. I have an example that I did in a Raspberry PI3 with the WiringPI library that works to work in C. To do this use this www.maximintegrated.com/.../tb_tab2 and https: // github.com/torvalds/linux/blob/master/drivers/iio/temperature/max31856.c code, but they have something in common that is the SPI command to write and read, and I have not found how to use it in SPI of the nRF52840DK.