This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RXRDY is not being set in TMS470r1b1m

Hi,

I am using the code below to set and poll on SCI1RX pin while watching RXRDY. But the RXRDY pin is always zero. Monitored SCI1RX pin using scope and the characters typed are seen at the SCI1RX pin.

What am I missing here?

   /* Setup the UART1 to send data at 57.6K to the terminal */
   SCI1CTL3 &= ~SW_NRESET;                 // Reset SCI state machine
   SCI1CCR = TIMING_MODE_ASYNC + CHAR_8;   // Async, 8-bit Char
   SCI1CTL1 |= RXENA;                      // RX enabled
   SCI1CTL2 |= TXENA;                      // TX enabled
   SCI1CTL3 |= CLOCK;                      // Internal clock
   SCI1LBAUD = 0x3F;                       // 29.4912MHz/(8*57600)-1 for 60MHz sysclk
   SCI1PC2 |= RX_FUNC;                     // SCIRX is the SCI receive pin
   SCI1PC3 |= TX_FUNC;                     // SCITX is the SCI transmit pin
   SCI1CTL3 |= SW_NRESET;                  // Configure SCI1 state machine 
/////

int WaitForKeyInput(void)
{
  int RxStatus, key_input;

  RxStatus = 0;
  while (RxStatus == 0)
  {
    RxStatus = SCI1CTL1 & RXRDY;
    if (RxStatus == RXRDY)
      key_input = SCI1RXBUF;
  }
    return (key_input);
}

I modified the this function to the following and still doesn't work

   while(!(SCI1CTL1 & RXRDY));
   key_input = SCI1RXBUF;
   while(!(SCI1CTL2 & TXRDY));
   SCI1TXBUF = key_input;
 

Thanks
Prasad

  • Prasad,

    After doing your sci init and releasing the reset to the state machine, it is necessary to wait 11 idle bit to be sure the SCI is synchronized to the network.

    To do so, you have to poll the IDLE bit (Bit 4 in SCICTL1 Here is an extract from the SCI documentation (SPNU196A):

    Bit 4 IDLE. SCI receiver in idle state. While this bit is set, the SCI looks for an idle period to resynchronize itself with the bit stream. The receiver does not
    receive any data while the bit is set. The bus must be idle for 11 bit periods to clear this bit. The SCI enters this state if one of the following events occurs:
    a system reset, an SCI software reset, power down, and if the RX pin is
    configured as a general I/O pin.
    0 = Idle period detected, the SCI is ready to receive.
    1 = Idle period not detected, the SCI will not receive any data.

    The bus being idle means high for 11 bits periods.

    Please can you check this point and let me know.

    Regards,

    Jean-Marc

  • Prasad,

    What is the status on this thread?

    Did I answered your question?

    Thanks and regards,

    Jean-Marc