AnsweredAssumed Answered

SCI  just works on DEBUGGING MODE

Question asked by christian camilo franco frasser on Sep 3, 2010
Latest reply on Sep 5, 2010 by christian camilo franco frasser

Hi everyone , and thanks for your time.

 

Well my problem is that i receive data on SCI on debugging mode perfectly, but when i re-power my target the NF(noise Flag) from SCIS1 sets and i receive a bad data. 

 

This confuse me a lot cause in debugging mode works ok, but i power off and then on my target and this problem happens. This is how i initialize my SCI:

 

 

void init_SCI(void){
                      
           SCIBDH=0;
           SCIBDL=52;     // 9600 bps para 8MHz            
           SCIC2_RE=1;    // Rx enable
           SCIC2_TE=1;    // Tx enable
           SCIC2_RIE=1;   // interrupt rx enable
           SCIS1;              // clear flag        
           SCID;
}

 

 

 

I just generate an interrupt when a data is ready on Rx.

 

This is my Interrupt rutine for Rx:

 

 

interrupt 17 void ISR_SCI_RX(void){

 

           // tilt_led();

                          // Si hay Noise Flag

            if(SCIS1_NF==1){

 

                PTAD_PTAD1=1;// avisa por led

                SCIS1;   // limipa bandera de NF

                SCID;    // 

                goto out_SCI; 

 

            } else{ PTAD_PTAD1=0;

            }

            SCIS1;

            RS232_data=SCID;    // read data      

 

 

            SCID=RS232_data;

            while(!SCIS1_TDRE); // wait sent           

 

           out_SCI:

            asm NOP;

}

Outcomes