Pablo Suarez

MC9S08SH16 SCI Problem

Discussion created by Pablo Suarez on Nov 25, 2011
Latest reply on Dec 1, 2011 by bigmac

Hi, I trying to use the SCI module in the MC9S08SH16 microcontroller with CW Development Studio, and while the transmission is working properly I can't receive anything.

 

This is the code created by Processor Expert 5.00 [04.48]:

 

/* ### Init_SCI init code */

 

/*SCIC2: TIE=0,TCIE=0,RIE=0,ILIE=0,TE=0,RE=0,RWU=0,SBK=0 */

SCIC2 = 0x00U; /* Disable the SCI module */

 

(void)(SCIS1 == 0U); /* Dummy read of the SCIS1 register to clear flags */

(void)(SCID == 0U); /* Dummy read of the SCID register to clear flags */

 

/* SCIS2: LBKDIF=1,RXEDGIF=1,RXINV=0,RWUID=0,BRK13=0,LBKDE=1,RAF=0 */

SCIS2= 0xC2U;

 

/* SCIBDH: LBKDIE=0,RXEDGIE=0,SBR12=0,SBR11=0,SBR10=0,SBR9=0,SBR8=0 */

SCIBDH= 0x00U;

 

/* SCIBDL: SBR7=0,SBR6=0,SBR5=0,SBR4=1,SBR3=1,SBR2=0,SBR1=0,SBR0=1 */

SCIBDL= 0x19U;

 

/* SCIC1: LOOPS=0,SCISWAI=0,Rsrc=1,M=0,WAKE=0,ILT=1,PE=0,PT=0 */

SCIC1= 0x24U;

 

/* SCIC3: R8=0,T8=0,TXDIR=0,TXINV=0,ORIE=0,NEIE=0,FEIE=1,PEIE=0 */

SCIC3= 0x02U;

 

/* SCIC2: TIE=0,TCIE=1,RIE=1,ILIE=0,TE=1,RE=1,RWU=0,SBK=0 */

SCIC2 = 0x6CU;

 

I made sure about Baudrate, SCI receive interrupts enable, SCI receive enable, pin conections, etc. 

If I test the port PTB0 ( If (PTBD_PTBD0 == 0) ) the data is incoming but It don't generate any interrupt.

 

Thanks for your time.

Regards.

Outcomes