I have an issue implementing UART reading and TD_UART_GetChar function.
With SDK 6.3.2 on a TD1204
I init my uart line in TD_USER_Setup()
- Code: Select all
init_printf(TD_UART_Init( 9600, //Baudrate
true, //RX Enable
true), //Pin Shared
TD_UART_Putc,
TD_UART_Start,
TD_UART_Stop);
and I just did a first test in TD_USER_Loop() with:
- Code: Select all
while ((c = TD_UART_GetChar()) >= 0) {
tfp_printf( "char : %c - %x\r\n", c, c);
}
After the execution of TD_USER_Setup(void) I have an infinite return on serial port (without pressing any key) full of :
- Code: Select all
char : ÿ - ff
char : ÿ - ff
char : ÿ - ff
char : ÿ - ff
char : ÿ - ff
I tried to add
- Code: Select all
GPIO_PinModeSet(RX_PORT, RX_BIT, gpioModeInput, 0);
Before the uart init but it make the same issue.
For info, I have a led on the tx pin but nothing on the rx pin. That why I use the Pin Shared function. Could it be the issue?
But I have the same comportment with
- Code: Select all
init_printf(TD_UART_Init( 9600, //Baudrate
true, //RX Enable
false), //Pin Shared
TD_UART_Putc,
TD_UART_Start,
TD_UART_Stop);
Does anyone know why the TD_UART_GetChar function would always return 0xFF?