Hi,
I am using MC9S08AW16 for a project, and CW5.1 IDE. I create my project under MC9S08AW32 and change PRM for RAM 0x100 to 0x46F, ROM start from 0xC000.
Since I need a SCI communication, I set SCI1 as 1200-9-E-1 format, initialize code as below.
SCI1BDH=change_2.iuch[0];
SCI1BDL=change_2.iuch[1];
/* SCI1C1: LOOPS=0,SCISWAI=0,Rsrc=0,M=1,WAKE=0,ILT=0,PE=1,PT=0 */
SCI1C1=0B00010010;
/* SCI1C2: TIE=0,TCIE=0,RIE=1,ILIE=0,TE=0,RE=1,RWU=0,SBK=0 */
SCI1C2=0B00100100;
/* SCI1C3: R8=0,T8=0,TXDIR=0,ORIE=0,NEIE=0,FEIE=0,PEIE=0 */
SCI1C3 = 0x0f;
SCI1S2=0;
When I send a single charactor from PC COM to my AW16, the SCI Rx interrupts runs well, and I receive correct data, but the flag RDRF flag can not be cleared. I wrote my ISR as below:
interrupt void SCI1_rx(void)
{
uchar i,data0;
data0=SCI1S1;
data0=SCI1D;
\\\ more codes followed....
}
Most strange is, when I am string at address 0x3C(SCI1S1 register) in the memory window of Hi-Wave debugger, RDRF can be cleared, but if this address is hidden in the window, it can not be cleared.
Is this a CW bug or do I have anything incorrect in my project? Thanks in advance.
jerry