2017-04-16 12:49 AM
We have used USART1 and USART2 for communication between STM32 and two DMX512 devices it is transmitting data properly but when using same USART for receiving data from DMX512 it is not working properly. When i use different USART for transmit and receive then it works fine, so is it possible to use same USART for transmission and reception? If yes how to do it??
#stm32-f1 #stm32-stm32f4 #st #st-community #dmx512 #usart-stm32f1032017-04-17 01:40 AM
It may depend on how the data is being exchanged.
Normally the USART has TX and RX channels independent (unless using CK clock pin function).
Typically a TX can be done by polling and the RX done by interrupt. Hence, the interrupt is only needed to receive data, check if a valid packet is present and raise a flag for the main loop to process it / buffer it away.
It is assumed that the baud rate is the same for both RX and TX and the 'break' generation and detection is compatible between the UART and MX.
Thanks to give a bit more details on which STM32, and how the UART is being used (polling, DMA, interrupt, bitrate...)