- I am trying to read the K-type thermocouple temperature with MAX31856 in Verilog.
- Configured the configuration registers CR0 & CR1.
- The conversion result is stored in the registers 0xC, 0XD, 0XE. I have to read these registers using a SPI state machine.
- What timings should I have to cater for?
- The only timing constraint I found in data sheet is the update rate of 100ms. Which means for cycle reads you have to wait for 100ms for new results. But the data sheet shows that conversion results are available after 110ms? Why this figure violating the update rate (100ms)?
- In SPI read for burst mode (auto increments to D and E registers) do I have to send the address of register C only? Or do I have to send ADDRESS of register 0xC with dummy bytes?
-
\$\begingroup\$ Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. \$\endgroup\$– Community BotCommented Nov 15, 2023 at 22:51
1 Answer
All of them.
Not sure which numbers you're looking at, but it isn't really important.
Figure 6 in the datasheet is fairly clear on this.
Similarly, Figure 7 is clear about the overall protocol: You wait for DRDY- to go low, then you execute the 3-byte read of registers C, D and E, during which DRDY- will go high again. The specific timing at which this happens (update rate) depends on the chip configuration, as described at the bottom of page 4.
-
\$\begingroup\$ Thanks for prompt reply. Can u please elobrate point 6? Do i need to send the address 0XC only or some dummy bytes too on mosi line? And some adafruit driver libraries are not using DRDY pin. Then how those C libraries working? \$\endgroup\$ Commented Nov 16, 2023 at 16:36
-
\$\begingroup\$ It appears that the chip simply ignores any bytes sent after the address byte when doing a read. So yes, those are "dummy" bytes. \$\endgroup\$ Commented Nov 16, 2023 at 16:58
-
\$\begingroup\$ I want to share code with you.. Can u please share your email with me. Its a model sim simulation stuck in the state machine. Not a free running state machine. \$\endgroup\$ Commented Dec 14, 2023 at 2:46
-
\$\begingroup\$ That isn't how this site works. You paste your code (or a link to it) -- preferably reduced to an MCVE -- into your question. Then everyone can take a look at it. \$\endgroup\$ Commented Dec 14, 2023 at 13:51
-
\$\begingroup\$ I moved one step forward. The state machine is free running now and working in simulation. On hardware side there is no temperature data output from chip. I am assuming tcDhh parameter in the data sheet is not satisfied. To test the spi before the temperate data state, i want to read back the configuration register CR0 which i have written at the start of state machine. If that doesnot work i will post code here \$\endgroup\$ Commented Dec 23, 2023 at 2:46