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