3 offset calibration, Offset calibration, Cs5378 – Cirrus Logic CS5378 User Manual

Page 57

Advertising
background image

CS5378

DS639F3

57

and a maximum negative value of 0x800000. If ap-
plying an offset correction causes the final result to
exceed a 24-bit two’s complement maximum, the
output data will saturate to that maximum value.

Output Data = Input Data - Offset Correction

Max Positive Output Value = 0x7FFFFF

Max Negative Output Value = 0x800000

Once the OFFSET register is written, the USEOR
bit in the FILTCFG register enables offset correc-
tion.

15.3 Offset Calibration

An offset calibration algorithm in the CS5378 can
automatically calculate an offset correction value.
When using the offset calibration algorithm, back-
ground noise data should be used as the input signal
for calculating the offset of the measurement chan-
nel.

The offset calibration algorithm is an exponential
averaging function that places increased weight on
more recent digital filter data. The exponential
weighting factor is set by the EXP bits in the

FILTCFG register, with larger exponent values
producing a smoother averaging function that re-
quires a longer settling time, and smaller values
producing a noisier averaging function that re-
quires a shorter settling time. Typical exponential
values range from 0x05 to 0x0F, depending on the
available settling time.

The characteristic equations of the offset calibra-
tion algorithm include an input value, X, an output
value, Y, a summation value, YSUM, a sample in-
dex, n, and an exponential value, EXP.

Y(n) = X(n) - [YSUM(n-1) >> EXP]

YSUM(n) = Y(n) + YSUM(n-1)

Offset Correction = YSUM >> EXP

Once the EXP bits are written, the ORCAL bit in
the FILTCFG register is set to enable offset calibra-
tion. When enabled, an updated offset correction
value is automatically written to the OFFSET reg-
ister. When the offset calibration algorithm is fully
settled, the ORCAL bit should be cleared to main-
tain the final value in the OFFSET register.

Advertising