Specialist Supplier of Crystals & Frequency Control Componentssales@mecxtal.com.cn0755-26500570
MERLIN home / Rednote / System Validation and Replacement

Why the first MAX31856 read can time out on a 20 MHz oscillator board

A thermocouple acquisition board uses a 20 MHz active oscillator to time its host. After changing the converter to 50 Hz line rejection, steady monitoring seems fine, but the first reading after idle sometimes times out. Increasing the host's serial clock moves bytes faster without fixing the problem. Locate the start of the conversion and the moment the converter produces new data. A timeout chosen from the steady update rate may be too short for the first conversion.

Separate the trigger, data ready and the read

The host provides SCLK to move configuration and temperature bytes. In one-shot mode, the host writes the one-shot bit. The data sheet says the conversion triggers when chip select goes high after the write. For a multibyte write, that is still the rising edge at the end of the complete transaction. An empty transmit register or a DMA notification can precede that physical edge. Place the cursor on the edge seen by the sensor.

DRDY falls when a result is available in the linearized thermocouple temperature register. The data sheet also says that completion of a read of that register, or the enabled cold-junction temperature register, returns DRDY high. A diagnostic task that reads cold-junction temperature can therefore change the signal before the acquisition thread sees it. Start with one reader and verify the order of chip select, data ready and the read. Then restore the other monitoring tasks. A temperature printed on a console by itself does not identify the conversion it belongs to.

Set the timeout from the converter timing

Use the electrical-characteristics conditions for thermocouple and cold-junction conversion. At 60 Hz rejection, a one-shot or first automatic conversion takes 143 ms typically and 155 ms maximum. At 50 Hz, the corresponding figures are 169 ms and 185 ms. Keeping a 160 ms timeout after moving to 50 Hz can miss even a typical first conversion. At 50 Hz the listed maximum for the second and later automatic conversions is 110 ms. Testing only the end of a burst misses the slower first result.

Assume the 20 MHz active oscillator is the verified reference for an undivided 20 MHz host timer. Then 160 ms is 3,200,000 counts and 185 ms is 3,700,000 counts, a difference of 500,000. A trial setting of 200 ms represents 4,000,000 nominal counts under those settings. Allow for timer error, software response and any other conversion configuration before setting the application limit. The specified conversion interval covers the device under the stated conditions. The host still needs time to notice and act on data ready.

Change line rejection, averaging and open-circuit detection independently

The rejection bit selects filtering for 50 Hz or 60 Hz and harmonics. Choose it for the installed interference and change it in Normally Off mode as specified. Averaging also increases conversion time, and open-circuit detection has its own selections and timing. Changing all three settings obscures the cause. Hold averaging and diagnostics constant while comparing first results for both rejection settings, then restore the features required in production.

For a first 50 Hz conversion with four averages, the CR1 description gives a typical additional 40 ms per extra sample. Three extras add about 120 ms to 169 ms, giving about 289 ms typical. This does not establish a worst-case value for four averages. Record the actual averaging and open-circuit settings and verify the product's first-reading requirement. Read back the active mode before deciding why a task started timing out.

Use two identifiable input conditions to establish which conversion supplied the reading. With a suitable thermocouple simulator, complete a conversion with a settled input, then change to a second in-range input and let it settle before triggering again. Confirm that the host updates the value only after a new ready event. Without a simulator, first verify transaction ownership from chip select and DRDY, then do a slower functional check. The thermal response of a real thermocouple is not a measurement of digital conversion time.

Record whether rejection is changed only at installation or on every wake. For a fixed regional setting, read it back after startup and avoid ending automatic conversion before each read. If the system deliberately switches configurations, test the actual sequence and ensure an earlier buffered ready event is not attributed to the new setting. For a timer with insufficient counter width, verify how software extends the count and compare expiry with an external timebase near rollover.

Keep the 20 MHz active oscillator, effective timer rate, rejection and averaging, open-circuit configuration and measured time to the first DRDY on the acceptance record. Compare a cold start with steady measurements. Recalculate timer counts after changing the host reference. Revisit conversion timing after changing the filter. The captured sequence helps distinguish host timing and converter configuration when the next board reports a timeout.

References

WeChat

MERLIN · TIMING COMPONENTS

Scan with WeChat to contact Sales

Add our WeCom contacts from your usual WeChat app.

On desktop, scan with your phone. On mobile, save the QR image and select it from your album in WeChat Scan.