??? 04/21/09 06:55 Read: times |
#164748 - A new challenge! The inverse way! Responding to: ???'s previous message |
Now the inverse way! (sending Midi, receiving DMX)
I learned from Kathy's DMX receiver code a technick to receive the DMX data, I think it is a bit dirty way to do, but I already tested and works. He/she sets the serial port to 9bit mode, when receive a byte, look if the 9th bit is clear and byte is zero, if yes, should be a break! As DMX have 2 stop bits, the first will be the 9th, the second just the normal serial stop bit. The rest is just easy. Midi is 8bit. Now I think. Working with 8bit: Midi should be no problem. DMX I will lost the 9th bit which is used to detect the break. Will RI be set after receiving a break? (I think it will be) Can I look RxD state just after RI is set? (If yes I think the problem is solved) Working with 9bit: Midi will have one more bit. If I set the 9th bit it will be taken as the stop bit? (I think yes, and I think it will work, I will just lose 1 bit time every byte, should be no problem at all) DMX should be ok. Correct me if I'm wrong. Thanks. |