Daniel Morley

rs 485 bus

Discussion created by Daniel Morley on Feb 7, 2007
Latest reply on Oct 14, 2009 by Alex O'Donnell
I am trying to recieve a message via the Uart for a MC9S08GT16A.  The following code is my attempt to read a line of text and send it out.  I cannot seem to find any indication that I am recieving data.  
 void RecMsg() {
 byte ix=0;    // String pointer
 byte dummy;    // dummy var for reading SCIS1
 byte nxt_char;
 char msg[8] ;
    SEREN == OFF ;
  SCI1C2_RE = 1;    // enable Rx
 dummy = SCI1S1;   // 1st half of TDRE clear procedure
 msg[ix++] = dummy;
 while( msg[ix++] != 0x00) {
   nxt_char =SCI1D ; // 2nd half of TDRE clear procedure
    msg[ix++]=nxt_char ;
 } //end while((SCI1D
 SCI1C2_TE = 0;
} //end RecMsg