Aaron Wiginton

Not receiving data through SCI

Discussion created by Aaron Wiginton on May 31, 2007
Latest reply on Jun 1, 2007 by Aaron Wiginton
#include <hcs12dp256.h>#define RDRF 0x20   // Receive Data Register Full Bit#define TDRE 0x80   // Transmit Data Register Empty Bitvoid init_SCI1(void){  SCI1BDH = 0;  SCI1BDL = 156; // baud rate to 9600  SCI1CR1 = 0x20; // 8-N-1  SCI1CR2 = 0x0C;}void init_PB(void) // Setup LEDs for data verification{   DDRB=0xFF;    // Output - Port B (Specifies Direction)  PORTB=0x01;   // Enable Port B0  DDRH|=0x00;   // Input - Port H - Direction of Switches  DDRJ|=0x02;   // Output - PJ1 - Sets an output on Pin 2  PTJ&=0xFD;    // LED Enable - Forces 0 to Pin 2}main(void){  init_PB();  PTJ &= 0xFE;  init_SCI1();      while(1)      {   while((RDRF & SCI1SR1)== 0){}; // RDRF never goes high ???        PORTB = SCI1SR1;  // Trying to display the output on LEDs      }}

I'm using a mc9s12dp256 on a Dragon 12 board.  This is my code for the receiver.  It's just quick and dirty just to receive some data.  This is my first attempt at SCI communication.  I have verified that the transmitter is sending 10 bits of data (start,data,stop).  It is running through the rs485 in single-line mode.  The RDRF bit never shows that the SCI1DRL register is full.  Any insight would be super helpful.
Aaron W.