Hi everybody,
i have a situation with DEMO9S12XSFAME SCI interface.i'm developing an uart driver based on interrupts.When Debuging the module i've realized that during interrupt execution Flags ;either TDRE or RDRF are automatically reset by just getting the status register address .On the other hand when exiting the ISR the program fails and the debugger indicates ILLEGAL BP.
if ( ((*((TstDUart_iScisr1RegBits *)pvReg)).bTDRE) > 0 )
{
treating and writing to SCIDRL;
}
if(((*((TstDUart_iScisr1RegBits *)pvReg)).bRDRF) > 0 )
{
treating and reading SCIDRL;
}
}
Ok rigth if no one is answering i'm gonna tell you that for the second point "programm fails when exiting
the ISR" i've disassembled the source file and i've realized that ISR dosen't end with the famous RTI
instruction cause i've forgot to put "__interrupt" at the begining when declaring the routine so as
Codewarrior could recognize it as an ISR. Now the problem i'm facing is that soft is unable to
resetTDREflag.Once TDRE is set the ISR is turning in loop.i've really followed the steps listed in
Datasheet which
are: reading SCI Status register and then writing to SCI Data Low register so i wish that anyone
could tell me what to do.