Thank you so much for your kind reply.
I think that my problem is the synchronizing the S08’s Internal Clock for LIN or registers. But I set these.
This is my init function:
void AS1_Init(void)
{
/* SCI1C1: LOOPS=1,SCISWAI=0,Rsrc=1,M=0,WAKE=1,ILT=1,PE=0,PT=0 */
setReg8(SCI1C1, 0xACU); /* Configure the SCI */
/* SCI1C3: R8=0,T8=0,TXDIR=1,TXINV=0,ORIE=0,NEIE=0,FEIE=0,PEIE=0 */
setReg8(SCI1C3, 0x20U); /* Disable error interrupts */
/* SCI1C2: TIE=0,TCIE=0,RIE=0,ILIE=0,TE=0,RE=0,RWU=0,SBK=0 */
setReg8(SCI1C2, 0x00U); /* Disable all interrupts */
/* SCI1S2: LBKDIF=0,RXEDGIF=0,??=0,RXINV=0,RWUID=0,BRK13=1,LBKDE=0,RAF=0 */
setReg8(SCI1S2, 0x04U);
AS1_SetHigh(); /* Initial speed CPU mode is high */
}
and I have this function:
static void HWEnDi(void)
{
if (EnMode) { /* Enable device? */
SCI1BDH = 0x00U; /* Set high divisor register (enable device) */
SCI1BDL = 0x1AU; /* Set low divisor register (enable device) */
SCI1C2_TE = 0x01U; /* Enable transmitter */
SCI1C2_RE = 0x01U; /* Enable receiver */
} else {
SCI1C2_RE = 0x00U; /* Disable receiver */
SCI1C2_TE = 0x00U; /* Disable transmitter */
SCI1BDH = 0x00U; /* Set high divisor register to zero (disable device) */
SCI1BDL = 0x00U; /* Set low divisor register to zero (disable device) */
}
}
Is it possible for you to view the file I have attached? I really appreciate it.