I just test again, my code is:
char ch=0;
char buf[50];
ch='a';
sprintf(buf,"%c",ch);
uart_putstr(0,buf);
//the uart_putstr function code:
/********************************************************************/
/*
* Wait for space in the UART Tx FIFO and then send a character
*/
void uart_putchar (uint8 channel, char ch)
{
/* Wait until space is available in the FIFO */
while (!(MCF_UART_USR(channel) & MCF_UART_USR_TXRDY))
{
};
/* Send the character */
MCF_UART_UTB(channel) = (uint8)ch;
}
/*********************
* send a string using poll mode
*******************/
void uart_putstr(uint8 channel, char *str)
{
while(*str!=0)
{
uart_putchar(channel,*str++);
}
}
I expect to get 'a' display in hyperterminal. but in fact , I get nothing, hyperterminal don't recieve anything.
but if i change to sprintf(buf,"%d",ch); I get correct '97' in hyperternimal.