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

SENT pulse widths changed with temperature. Did the clock change or did the data change?

A sensor produces a 36 µs interval at one temperature and about 37 µs at a higher temperature. Treating the time directly as the measured value can turn sender clock drift into an apparent measurement change. The SENT fast channel encodes data in intervals between falling edges. A synchronization interval lets the receiver estimate the sender tick for each frame. Decode subsequent intervals in ticks from that frame.

Measure the calibration interval before decoding data

Microchip's dsPIC33/PIC24 SENT manual specifies 56 ticks for the synchronization interval and 12 plus the value for a nibble from 0 to 15. With 168 µs synchronization, one tick is 3.000 µs. A 36 µs data interval therefore represents 12 ticks and a value of 0. At a later temperature, 172.48 µs synchronization gives a tick of 3.080 µs. Twelve ticks now take 36.96 µs, still a value of 0. With the same 3.080 µs tick, 40.04 µs is 13 ticks and a value of 1. Keep the matching synchronization interval with each set of raw data.

Normalization needs acceptance bounds. A long interval caused by a missed edge can also be divided by 56. Verify allowable synchronization duration for the peripheral, its settings, and the sensor. Check subsequent intervals and frame integrity. Apply the actual sensor's CRC and frame format. A reasonable-looking synchronization pulse does not make status or CRC checks optional. If temperature moves the tick outside the permitted range, record the failure and use the specified recovery. Broadening the accepted range can make abnormal edges easier to mistake for a frame.

Clock accuracy and counter resolution solve different problems

Suppose the receiver captures edges at 40 MHz, or 25 ns per count. A 3 µs tick spans about 120 counts. One count of interval resolution is about 0.83% of a tick. At a 1 MHz counter rate, each count is a third of the same tick. The difference between 36.96 µs and 40.04 µs is about 3.08 µs. Additional variation from input filtering and edge timing is now more likely to push the result across a decision boundary. A ±10 ppm reference in place of ±100 ppm changes counter scale slightly and cannot restore resolution lost to the prescaler.

A fixed scale error in the receive clock largely cancels when synchronization and data intervals use the same clock and are divided as a ratio. Changes within the frame, noisy receiver crossings and quantization remain. Hold the measured variable constant while changing sensor temperature and compare raw synchronization with decoded values. Then hold temperature constant and change the input so that known nibbles change. With a signal generator, test a slow falling edge, one stretched interval and one missing edge independently. Verify whether the receiver rejects the frame or incorrectly accepts another value.

Save raw timestamps, synchronization length, estimated tick, each nibble and its validation result. Preserve a longest-frame or pause-pulse example to check counter range. At 40 MHz, a 16-bit counter wraps in about 1.6384 ms. Longer expected intervals need a wider timestamp or explicit rollover handling. A simple subtraction cannot resolve multiple revolutions. Include prescaler, counter width and input edge quality with the MCU reference selection. The resulting records show whether a changing pulse width came from the encoded value, sensor timebase or receive timestamp.

Retain distance from each pulse to the applicable decode boundary. A high-temperature run can still pass while a few nibbles approach the edge of the acceptance window. Save pulse and frame numbers so those cases can be reproduced. A local deviation with stable synchronization points toward the corresponding edge or input filtering. Proportional change in synchronization and all data intervals is more consistent with a changed sender timebase.

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.