AnsweredAssumed Answered

How to read DMX with FreeRTOS?

Question asked by Shu-Nong Wu on Jun 28, 2018
Latest reply on Jul 5, 2018 by Mark Butcher

Hi everyone, I'm working on a DMX decoder using the FreeRTOS drivers and K21 micro controller. To give some background information about DMX, There is a BREAK(low, 88 us minimum) and then MARK AFTER BREAK(high, 8 us minimum) followed by 8N2 UART frames. My implementation of a DMX decoder involves timing the BREAK to check if it's valid. If the timing is valid then a Semaphore is passed to a task that reads UART using UART_RTOS_Receive. However there are issues that arise.

- First of all, if the packet is smaller than the buffer size then the event bit that is responsible for telling the RTOS, "OK we are done reading UART bytes" isn't triggering even if the UART line is IDLE.

- Another problem is that when the function UART_RTOS_Receive is first called, there is a framing error. What is strange is that the function gets called during the MARK AFTER BREAK when the line is IDLE so the IDLE is being interpreted as a framing error for some reason.

If anyone can shed some light on this issue then that would be greatly appreciated.


Edit: Spelling