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

Why does the ICM-42688-P's 500 Hz setting become 512 Hz with a 32.768 kHz clock?

An inertial logger originally supplies its ICM-42688-P with 32.000 kHz. A revision uses the more common 32.768 kHz source to share a reference with another circuit. SPI readout is continuous and the sensor responds, yet the acquisition timeline no longer matches the former board. A host that still multiplies every sample interval by 2 ms will find that integration error grows with record length. Check both the number of samples produced and the physical unit of the FIFO time field.

Use the full oscillator frequency in the output data rate calculation

TDK InvenSense DS-000347 Rev 1.8 defines external-clock ODR settings against a 32 kHz input. The actual ODR is the programmed rate multiplied by fCLKIN ÷ 32000. At the 500 Hz setting with a 32.000 kHz input, the nominal rate is 500 sample sets per second and the interval is 2.000 ms. With 32.768 kHz, the same setting gives 500 × 32768 ÷ 32000, or 512 Hz, with an interval of 1.953125 ms. A highly accurate clock still gives this scaling difference at its nominal frequency. Both nominal frequencies are within the applicable input range, and the ordering records still need to identify them individually. TDK InvenSense DS-000347 Rev 1.8, sections 3.7 and 12.5

Suppose the revised board generates 2560 sample intervals during a five-second window with no lost samples. The actual interval gives five seconds. Applying the former 2.000 ms per sample instead gives 5.120 s, an error of 120 ms. Applications that integrate readings over time inherit the wrong time step. This example accounts for the time base alone. A real system also needs to consider scale, bias and acquisition start phase. The configuration application can still say 500 Hz even after the elapsed time represented by that setting has changed.

Clarify what 500 Hz means in the requirement. It may be the hardware rate, the rate of data delivered to a customer, or the analysis grid on the host. For a nominal hardware rate of 500 sample sets per second with this setting, use 32.000 kHz. If the board must share 32.768 kHz and the output still needs 500 sets per second, the software can resample from accurately timestamped 512 Hz data. The nominal rate ratio is 500 ÷ 512, or 125 ÷ 128. Choose the filtering for the analysis bandwidth and test resampling latency. Arbitrarily dropping samples will not create even time spacing. A system that can use a 512 Hz time base can retain the original samples and update its analysis settings.

Identical raw FIFO numbers can represent different physical intervals

In the specified external-clock mode, set RTC_MODE to one and select CLKIN through PIN9_FUNCTION. When the FIFO field represents a time interval and TMST_RES is one, its unit is the external reference period. At 32.000 kHz one period is 31.25 µs, so a field of 64 means 2.000 ms. At 32.768 kHz each period is about 30.518 µs, so the same 64 means 1.953125 ms. The decoder should take the external frequency from the actual assembly or board configuration and use it for unit conversion. A continuous stream of identical raw interval values does not establish that the physical intervals are equal. DS-000347 section 12.7, FIFO timestamp interval scaling

When TMST_RES is zero, the datasheet gives an external-clock scale factor of 32.768 kHz divided by the actual reference frequency, with the output in microseconds. At a 32 kHz reference and a 1 kHz ODR, the datasheet example has raw intervals near 976 and 977. Multiplying their nominal 976.5 by 32.768 ÷ 32 gives about 1000 µs. With a 32.768 kHz reference the scale factor becomes one, while the physical ODR changes according to the earlier calculation. Check whether a configuration constant enters the ODR or timestamp calculation before changing it, so the same ratio is not applied twice. The datasheet has a separate scaling branch for internal clock operation. Use the branch matching the actual mode. DS-000347 sections 12.5 and 12.7

Verify which field the driver reads first. With TMST_DELTA_EN set, the datasheet describes a field giving elapsed time since the previous output data event. A different timestamp format can require accumulation, wrap handling or adjacent differences under its own settings. The time recorded when the host finishes an SPI transfer indicates when the batch reached the software. To measure sampling intervals, preserve the raw fields and data-ready edges captured against an independent reference. The open-source PX4 ICM-42688-P driver provides an implementation to inspect. Its external clock path uses the input clock period when interpreting the FIFO time delta. DS-000347 TMST_CONFIG definition PX4 ICM-42688-P FIFO implementation

Qualify the pin assignment, sample rate and exported timeline together

Pin 9 multiplexes CLKIN, FSYNC and INT2. Selecting a low-frequency clock input takes over a pin that may previously have carried sync or an interrupt. Review the schematic and register settings and choose an external clock that meets the logic supply, threshold and waveform requirements. A quartz resonator needs an oscillator circuit that can deliver a digital signal to CLKIN. An active oscillator replacement also needs the correct supply, output level, frequency accuracy and startup behaviour. Developers have asked publicly whether this input can be wired like a crystal pin or used to determine accurate intervals. Specify the reference type on the schematic so that the circuit review can answer both questions. DS-000347 pin functions and CLKIN timing Public developer discussion of data-ready and CLKIN

Write clock accuracy as a separate requirement for long-term timing. With an assumed total clock error of ±20 ppm, a 512 Hz output has a proportional error of ±0.01024 Hz and a time-scale error of about ±100 µs over five seconds. That is much smaller than the 120 ms introduced by using the wrong nominal sample rate. Allow for the reference instrument's uncertainty and segment the record after a rate change, reset or FIFO overflow. In a finite record, the interval count from first sample to last is one below the sample count.

For acceptance, compare the existing and revised assemblies using the same ODR register setting, sensor mode and readout load. Measure CLKIN against a stable external reference, count outputs over a fixed independent gate, and measure elapsed time between the first and last samples. Compare that result with the firmware's timeline. If the ordering record says only 32 kHz, establish whether the supplied part is actually 32.000 kHz or 32.768 kHz. Place the frequency, register settings, FIFO format and exported time unit in the same change record. A later oscillator substitution can then be investigated with evidence for hardware frequency, software conversion and missed reads.

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.