AN2503 Freescale Semiconductor / Motorola, AN2503 Datasheet - Page 11

no-image

AN2503

Manufacturer Part Number
AN2503
Description
Slave LIN Driver for the MC68HC908QT/QY Family
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
MOTOROLA
The calculation of the new trim value is performed using a previously read
offset and the time elapsed in the internal clock during three bit-times, based
on equation 1:
Because a change in the OSCTRIM register is equal to approximately a 0.2%
change in the internal frequency, equation 2 is derived from equation 1:
With these values, every variation from the expected value will represent a
0.2% change in the oscillator and thus a direct (1:1) change in the OSCTRIM
register.
Because EXPECTED_VAL = 500 and the internal oscillator can vary ±25%, the
possible values to be read are:
Consequently, to use only one byte, all values will be added with an offset:
In this way, the high byte can be discarded and every change from the
expected value (0x27D) will represent a direct change in the OSCTRIM
register.
EQUATION 1:
WHERE:
EQUATION 2:
USING:
Slave LIN Driver for the MC68HC908QT/QY Family
Freescale Semiconductor, Inc.
f
f
INT_COUNT IS NUMBER OF INTERRUPTS TO COUNT TO OBTAIN AN EXPECTED VALUE (IN BIT-TIMES)
PRESCALER IS TIMER PRESCALER
EXPECTED_VAL IS THE EXPECTED VALUE TO BE READ WHEN INT_COUNT IS REACHED
f
f
THE EXPECTED VALUE FOR
Bus
LIN
Bus
LIN
For More Information On This Product,
IS LIN BAUD RATE
= 9600 bps
IS MCU INTERNAL BUS FREQUENCY
= 3.2 MHz
SO: INT_COUNTER = 3
500 + 25% = 625 (0x271) — Maximum
500 – 25% = 375 (0x177) — Minimum
0x271 + 0x89 = 0x2FA — Maximum
0x177 + 0x89 = 0x200 — Minimum
0x1F4 + 0x89 = 0x27D — Expected
PRESCALER = 2
Go to: www.freescale.com
EXPECTED_VAL =
1 =
INT_COUNT
Prescaler
f
Bus
(0.002) × INT_COUNT
Prescaler × f
IS
f
Bus
Prescaler × f
LIN
× INT_COUNT
3
2
LIN
Driver Functionality
AN2503/D
11

Related parts for AN2503