AN2575 Freescale Semiconductor / Motorola, AN2575 Datasheet - Page 7

no-image

AN2575

Manufacturer Part Number
AN2575
Description
MC68HC908EY16 ESCI LIN Drivers
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
if(LIN_SCIACTL & LIN_SCIA_AFIN)
{
}
MOTOROLA
if(LIN_CfgConst.LIN_BaudRate == 0)
{
}
else if(LIN_CfgConst.LIN_BaudRate==1)
{
}
LIN_SCPSC = LIN_SCIADAT - 0x20;
LIN_SCPSC = (((LIN_SCIACTL&0x03)<<7)|LIN_SCIADAT>>1) - 0x20;
The bottom five bits (PSSB) contain the fractional part in increments of
Because the integral part is five places to the left, the whole byte can be
considered as 32 times the divide ratio. The only complication is the offset of 1
in the top three bits. Because of this, the overall fractional divide prescaler
divide ratio, FD, is 1 + SCPSC ÷ 32. The integral part of the divide ratio
(PDS + 1) is referred to as PD in the MC68HC908EY16 data sheet and the
fractional part (PSSB ÷ 32) as PDFA, so the relationships are:
As shown above, FD = count ÷ 64 therefore:
From this equation, it can be seen that the arbiter count value should be divided
by two and $20 subtracted from it to get the value which should be loaded into
the SCPSC register. The code shown below has been extracted from the LIN
driver software to illustrate how this can be done.
The code includes the option of using 19,200 baud. This is simpler because
there is no need to shift the value before adding $20. Because there is no room
for the ninth bit (it will be zero anyway), it is not used. For 9600 baud, however,
the ninth bit is relevant so the count value first has to be divided by two. This is
done by shifting the ninth bit (from SCIACTL) up to bit 7 and ORing this with the
shifted down (divided by two) value of the other eight bits (from SCIADAT). The
least significant bit is discarded. After $20 is added, this gives the data required
for the SCPSC register.
Freescale Semiconductor, Inc.
For More Information On This Product,
FD = PD + PDFA = 1 + PDS + PSSB ÷ 32 = 1 + SCPSC ÷ 32
SCPSC = 32 × ((count ÷ 64) – 1) = count ÷ 2 – $20
MC68HC908EY16 ESCI LIN Drivers
Go to: www.freescale.com
// arbiter count finished ?
ESCI Prescaler Baud Rate Adjustment
// 19200 baud
// count - 32
// 9600 baud
// count/2 – 32
AN2575/D
1
/
32
.
7

Related parts for AN2575