I am one of many that try to make a DMX receiver for RGB LED lighting , let's say. I read here some posts, but didnt find a real solution or how this problem can be solve.
But I DID IT. It took me some days because I'm not a profesional programmer, but I work with Flowcode from 10 monts ( done a lot of projects with it ), have some background knowledge of some PASCAL ( learned at 14 years age ... 12 years ago ) and verry litle C. From the begining I'm telling you that I WILL NOT GIVE THE SOURCE CODE, but I was thinking that is good to give you some advice.
So lets put the problem. DMX ??? ... you know what is DMX. Lets use PIC16F88 for example.
250000 baud rate - if you look at the PDF of PIC16F88 at the BRG ( baud rate generator ) section you will se that we will need to CLOCK the micro at 16000000 Hz. NO NEED for 20000000 Hz clock.
min 88 ms of BREAK ( 0 logic ) -> min 8 ms of MAB ( 1 logic ) -> serial frames
a serial frame is composed of 11 pulses : 1 - START BIT ( 0 logic )
2 - 9: 8 bits = DATA BITS
9 - 11 - 2 STOP BITS ( 1 logic )
between frames there is MTBF - Mark time between frames min 1 pulse ( 1 logic )
first frame is known as START CODE , wich has DATA=0, then begins the frames wich have DATA for CH1, CH2, CH3 ... CH512
First thing ... YOU CANT RECEIVE DMX only using flow charts from Flocode ( RS232 macro )... you have to use some " C code "

You have to know how to set the UART baud rate at 250000, then how to set for receiving - use the pdf of PIC. Let's suppose the hardware it is done, and you start receive the DMX.
Most important thing is to know when the BREAK starts ... this is the part wher you do the sincronization of the receiver with the transceiver. HOW can we do that?
So we know that the break is 0 logic. The USART see the first O logic of the break to be the START BIT. then the next 8 bits to be DATA - wich is O ... then? instead of 2 STOP BITS 1 logis , there is only o logic. Hmmm .. USART " say " that this is a FRAME ERROR.
So the method ao detecting the BREAK is to detect the first FRAME ERROR.
Another methos is to set the USART in 9BIT MODE ( 1 START BIT, 8 DATA BITS, 9th BIT, and 1 STOP BIT ( 1 logic also ). when the USART detects first 0 of the BREAK he thinks that is a START BIT .. then DATA then 9th BIT .. Hmmm ... CHECK if the 9th bit is 0 or 1. if it is 0 the this detection is for sure the begining of the BREAK.
OK.. we have now the START of the BREAK.. But when is it end? Of couse it's end at the begining of MAB .here is min 2 BITS 1 logic. here is a verry delicate situation.
if the BREAK consist of multiple pulses of 11 ( wich is the lenght of a frame ) the first frame that gives no error is the end of BREAK and MAB. How can we find that?
- After we find the BREAK with the first frame error we loop for finding the next errors until we find NO ERROR. there is the end of the BREAK .. and the MAB looks for the USART like that 2 STOP BITS from a frame ... so this frame has a 0 START BIT from the BREAK ... next 8 data BITS 0 from the BREAK ( here the BREAK ENDS ) and next 2 STOP BITS wich are the MAB. here is a NO ERROR frame that has DATA = 0. you have to discard this " non using " data ... leave it.
- If we use the 9th BIT mode .. and we find the first 9th BIT 0 wich tell's the beginig of the BREAk .. then we loop and chech the 9-th bit until we find the first one that is 1 logic. This is the firs BIT of the MAB .. we have an END OF THE BREAK . THIS two method are good only if BREAK + MAB are multiple of 11 pulses.
But what if the BREAK+MAB is not multiple of 11 BITS ( I relly dont know if that is alowed ). Hmmm ... we can detect the start of the BREAK. But then? ... lets say we have another FRAME ERROR ( frame has 11 BITS) so total of 22 BITS ( 0 logic ). This is the min of BREAK alowed - 22 pulses. .. SO we are in the frame error detection loop. then after MAB, it begins a 0 logic- START BIT , 8 DATA=0 and 2 STOP BITS ... here is the START CODE... no error , the 9th bit is 1 ... al is OK ... so you have to discard this data and begin receiving chanel data. But hey, up we've done the same algoritm and we didnt detect the START CODE frame. We only detect the end of the BREAK and MAB.
Let me give you another example . BREAK has 23 pulses , MAB 2 .. then the rest
fisrst frame - 11 pulses of 0 -> FRAME ERROR
2 nd frame - 11 pulses of 0 - > FRAME ERROR
3 rd frame - we had 22 o fro BREAK until now.. so 0, MAB. START CODE wich id o => 01100000000 - HEY this looks like a frame ERROR : 0 - START BIT , 11000000 - DATA , 00 2 STOP BIT or 9th BIT and STOP BIT. so this is a situation where we dont detect the START CODE frame. pfff this can get us o lot of problems
if the BREAK would be 32 pulses we will have 2 frame of 0, then 10 of LOW 0 , and 1 HIGH BIT. so we have 01 STOP BITS .. ERROR again.
Conlusion: depends of the BREAK length we can find the end of the BREAK / or the START CODE or even nothing of these two, in some situations, with the same algoritm ... Hehe ... thid can cause a lot of problems.
Solution: We use a litle hardware help. set another pin from the PIC toghether with the RX pin ( put a 4,7 K resistor between them ) to be an input pin.
we detect the BREAK ... OK easy .. then a lot of 0 begin to show until the BREAK is end.. We can find that using THIS INPUT PIN. put him in a loop and check it until you find the first HIGH BIT . This is the first BIT from MAB .. so we have an end of the BREAK here ... it is so easy and " no mistake " thing to do. Then we cand know for sure that next LOW 0 BIT is going to be the begining of the START CODE .. WE HAVE a sincronization gentelmans

After you detect the MAB with pin input you can use the RS232 macro from Flocode to get the DATA ( first one is the START CODE wich you have to discard, the is the CH1, CH2 .. etc.)
My storry ends here. And I repeat .. NO SOURCE CODE .
I hope this story will help you.