Sachin Surendran

JM Badge board SCI setup issue

Discussion created by Sachin Surendran on Nov 23, 2008
Latest reply on Sep 14, 2010 by kef
I am trying to get the SCI work on the JM badge board which has a MC51JM128 processor.

Following is the code snippet:

void Serial_port_Init()
{
  SCI1BDH   = 0;
  SCI1BDL   = 156;// Set baud rate to 4800 (SCI1BDLSTR = 12M/(4600x16)
  SCI1C1_LOOPS = 1;// Loopback TX - RX internally for testing
  SCI1C2_TE = 1; // Transmit enable
  SCI1C2_RE = 1; // Rx enable
 
}

void Serial_send_data(unsigned char data)
{
  unsigned char temp;
  SCI1D = data;
    /* Wait for transmission complete */
  while(!SCI1S1_TDRE)
  {
    /* Do nothing */
    ;
  }
  LEDScroll("Tx");
  while(!SCI1S1_RDRF)
  {
      ; // <<<<<<<<<<<<<<< Gets stuck here, the Rx never recieves data,
       // No Framing and Noise errors observed.
  }
  LEDScroll("RX##");
}


Any inputs as to why the above code is not able to recieve the transmitted byte?

Sachin

Outcomes