AnsweredAssumed Answered

Receiving DMX with STM32F070

Question asked by mcdowell.chris on Feb 5, 2016
Latest reply on Feb 6, 2016 by mcdowell.chris
Howdy, 

I'm working on a project that will receive DMX using the STM32F070CBT6. I have PA1, configured as USART4_RX, connected to my DMX input via an RS485 transceiver. 

Most of this is straightforward, but I have a couple of questions. DMX packets start with a 88us "Break",  followed by a 12us "Mark After Break", followed by 512 data bytes. 

What I'm working on is how to properly detect the "Break" and "Mark After Break" on the RX pin. Input capture would be the obvious choice to measure the length of incoming pulses, but I'm not sure if I can implement it on the same pin here. 

a couple of questions: 

1: Is there a standard way to detect incoming DMX packets? 
2: PA1 can also be connected to TIM15_CH1N. Can CH1N of a timer be used for input capture? 
3: Can PA1 configured as USART4_RX be read as GPIO? (I could just read the pin and count usecs to detect these signals)
4: Can PA1 configured as USART4_RX trigger an external interrupt as if it were just GPIO? 

While typing this out, I came across some folks using the "framing error" detection to detect a "break" condition. Any info or ideas on this would be great. 

I get the feeling I'm overthinking this, considering so many devices receive dmx. Engineers can't be reinventing this every time. I appreciate any pointers or info! Thanks! 





Outcomes