Hi,
We have a issus about Uart0 on ADSP-21489 EZ-board.
/*Uart init code*/
void initUART(void)
{
/* Sets the Baud rate for UART0 */
*pUART0LCR = UARTDLAB; //enables access to Divisor register to set bauda rate
*pUART0DLL = 0x8B; //0x28b = 651 for divisor value and gives a baud rate of 19200 for peripheral clock of 200MHz
*pUART0DLH = 0x02;
/* Configures UART0 LCR */
*pUART0LCR = UARTWLS8; // word length 8
*pUART0RXCTL = UARTEN; //enables UART0 in receive mode
*pUART0TXCTL = UARTEN; //enables UART0 in core driven mode
}
/*send and receive*/
char getch(void)
{
char ch;
while ((*pUART0LSR & UARTDR) == 0)
{;
}
ch = *pUART0RBR;
return ch;
}
void putch(char ch)
{
while ((*pUART0LSR & UARTTEMT) == 0)
{;
}
*pUART0THR = ch;
}
void putstring(const char *str)
{
char *r = (char *)str-1;
while(*++r){
if(*r == CR) putch(LF);
else if(*r == LF) putch(CR);
putch(*r);
}
return;
}
/*Application code*/
int main( int argc, char *argv[] )
{
....
initUART();
ch = getch();
putch(ch);
if((ch == 'm') || (ch == 'M')){
sprintf((char *)UARTBuffer,"Uart Init success!! :%f\n", 1.00);
putstring(UARTBuffer);
}
....
}
When debug with CCES, we set a breakpoint at line "putstring(UARTBuffer);", If we send a 'm' by PC serials-software, program stop at breakpoint.
and then remove breakpoint, run application get nothing printed on PC serials-software。Why EZ-board can only receive character and nothing
was send.