Datasheet
ATmega48/88/168 Automotive [DATASHEET]
7530K–AVR–07/14
264
26.6 LIN Re-synchronization Algorithm
26.7 Synchronization Algorithm
The possibility to change the value of OSCCAL during the oscillator operation allows for in-situ calibration of the slave node
to entering Master frames. The principle of operation is to measure the TBit during the SYNCH byte and to change the
calibration value of OSCCAL to recover from local frequency drifts due to local voltage or temperature deviation. The
algorithm used for the synchronization of the internal RC oscillator is depicted in Figure 26-3 on page 264.
Figure 26-3. Dichotomic Algorithm Used for LIN Slave Clock Re-synchronization
26.8 Precaution Against OSCCAL Discontinuity
The Figure 28-23 on page 281 illustrates the on-purpose discontinuity of RC frequency versus OSCCAL value. For one
correct re-synchronization, the frequency change must be kept on the same side of the discontinuity (no change of
OSCCAL[7]). Since there will be no device having frequency changed by more than 10% (see Figure 28-21 on page 280),
thus no reason to change the frequency value by more than 10%. Therefore, when calibration tries to cross the border
because of subsequent increase (or decrease) in OSCCAL values, then the routine must be stopped.
Example: For parts operating in the lower part of the curve, if new_OSCCAL >127 then new_OSCCAL = 127. Similar for
parts operating on the high side of the discontinuity.
Measuring
actual TBit
Y
STOP:
Oscillator
Calibrated
N
N
Increment
OSCCAL
Decrement
OSCCAL
-2% < Delta
(TBit) < 2%
Delta(TBit) < 2%
Delta(TBit) < -2%