Hi,
I am having some issues with the UART RXBUF. I am using the FT232RL USB controller and interfacing with the MSP430AFE253 by the TX and RX lines. I am using the RX interrupt and have been successful in getting the msp430 to interrupt on new data. I am able to send data but I must append a 0x80 to my data to create the stop bit and even then I am only able to receive 0x00 - 0x07 correctly. The msp430 is reading the 0x80 as the stop bit and shifting the actual data to the left (if I send 0x90 to receive 0x10, the rxbuf outputs 0x20). One other odd thing to note is that if I send 0x91 I will receive a 0x21in the RX Buffer, so the TI is shifting the upper half of the byte to the left but does not shift the lower half of the byte. It seems to me that the MSP430 is not seeing the stop bit that is suppose to be generated by the FT232RL. I have verified that the data from the USB is being sent correctly, but does not receive correctly on the TI side. Without the appended 0x80 to the data the TI does not interrupt at all.
I have tried different clock settings and baud rates, but I am getting the same results. Any help would be appreciated.
Thank you,
Cody
void C_system_Init()
{
WDTCTL = WDTPW + WDTHOLD; /* Stop WDT */
DCOCTL |= CALDCO_12MHZ; /* DCO = 12MHz */
BCSCTL1 |= CALBC1_12MHZ;
BCSCTL2 |= DIVS_0;
}
void C_UART_Init()
{
P1SEL |= BIT3+BIT4; // P1.3,1.4 = USART0 TXD/RXD
U0CTL |= SWRST; /*Set UART reset bit*/
ME1 |= UTXE0 + URXE0; // Enable USART0 TXD/RXD
U0CTL |= CHAR; // 8-bit character
U0TCTL |= SSEL1; // UCLK = SMCLK = 12MHz
U0BR0 = 0xE2;
U0BR1 = 0x04;
U0MCTL = 0x00;
U0CTL &= ~SWRST; // Initialize USART state machine
IE1 |= URXIE0; // Enable USART0 RX/TX interrupt
}
#pragma vector=USART0RX_VECTOR
__interrupt void USART0_RX (void)
{
unsigned int outBuf = 0;
a = RXBUF0;
while (!(IFG1 & URXIFG0)); // USART0 TX buffer ready?
TXBUF0 = a;
}