Other Parts Discussed in Thread: TMS320C6747, TMS320C6745
I am trying to initialize UART_1 of the TMS320C6747 DSP.
Neither the Transmitter nor the Receiver are working.
If I set the LOOP bit in the MCR, I can see a character transfer from the transmitter to the receiver.
I would like to poll to receive a single character, and transmit a small string.
void uartInit(void)
{
//360 MHz clock
KICK0_REGISTER = KICK0_ENABLE_KEY;
KICK1_REGISTER = KICK1_ENABLE_KEY;
PINMUX11 = 0x11101100u; /* Mcasp1 and UART1 */
DLH_1.R = 0; //Divisor Latch MSB
DLL_1.R = 49; //Divisor Latch LSB
FCR_1.R = 0x00000001; //FIFO control register bit 0 must be written to first to enable writing to other bits
FCR_1.R |= 0x0000007; // 1 byte receiver FIFO, DMA1 disabled,Clear Tx, clear Rx, FIFO enabled
LCR_1.R = 0x00000003; // 8 databits 1 stop bits
IER_1.R = 0x00000000; // Disable all interrupts
MCR_1.R = 0x00000000; //Modem Control register
IER_1.R = 0x00000000;
PWREMU_MGMT_1.R = 0x00006001; //Transmiter and receiver enabled, Uart free enabled and continues to run
}
Then
Loop
{
.
.
if((LSR_1.R & 0x0001) == 0x0001) //Check if a character is in the RxBuffer
{
LCR_1.R = LCR_1.R & 0xFF7F; //Allow access to the receive buffer
RxChar = RBR_1.R; //Remove the character from the receive buffer
if(RxChar == 'A') //If RxChar is ‘A’
{
THR_1.R = buf[indexCtr]; //Transmit the character in buf[] indexed by indexCtr
}
RxChar = 0;
}
.
.
} //End Loop

