daf asdffds

SCI on Dragon12 board can't receive data.

Discussion created by daf asdffds on May 24, 2011
Latest reply on May 24, 2011 by Jim Donelson

Hey Everyone,


I hope you guys can give me a hand with this, I have been stumped for a couple days.  I am simply trying to transmit and receive data using SCI1 on my dragon 12 board(MC9S12).  I have successfully transmit data to the PC however I can't seem to receive data.  The Rx led on my board never lights up.  I know data is being sent to the board sucessfully because I have a usb/serial cord the has a  little led that blinks when I send data to the board.


Here is my code:


void main(void)



     SCI1BDH=0x00;    //48MHz/2=24Mhz, 24Mhz/16= 1.5MHz, 1.5MHz/9600=156
     SCI1BDL=156;   //baud rate

     SCI1CR1 = 0x00;

     SCI1CR2 = 0x0C;
     for( ; ; )

          if(SCI1SR1 & 0x20) //never receives data
               RXdata = SCI1DRL;       

               cl = SCI1SR1;


          SerWrite('0'); //this works



I've tried multiple different things... everything from making this interrupt driven, seperating into different functions, etc.  I've also changed the control registers to every thing but still no Rx led showing up.


Any help is GREATLY appreciated.