2009-01-20 06:50 PM
Connecting UART2 to RS485 (Delivery Enable problem)
2011-05-17 12:57 AM
Hi,
I'm having problems controlling the delivery-enable output while using UART2 with RS485 (working with FreeRTOS) since the RS485 is half duplex, i have to control the DE status. when i finish transmitting i turn back the DE to allow reception. i have to check when the bytes are actually TXed before i reset the output. i tried using the following code to check when the FIFO is not busy, this busy-waiting is causing problems with the FreeRTOS portENTER_CRITICAL(); { while (UART2->FR&0x0008); } portEXIT_CRITICAL(); i also tried: while (UART_GetFlagStatus(UART2, UART_FLAG_Busy)==RESET); UART_ClearFlag(UART2); and even tried using xSemaphoreHandle in the UART2_IRQHandler upon any TXed byte but that did not work. any ideas? Thanks in advanced. Avner.2011-05-17 12:57 AM
i'm in the process of implementing the loop-back method mentioned by paul smitton and verified by Mark.
one important issue about this - you must disable the FIFO otherwise you will get the ''incoming'' bytes in delay. any comments?