cancel
Showing results for 
Search instead for 
Did you mean: 

Transmitting and receiving data from DMX512

sayali more
Associate
Posted on April 16, 2017 at 09:49

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-stm32f103
1 REPLY 1
S.Ma
Principal
Posted on April 17, 2017 at 10:40

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...)