View previous topic :: View next topic |
Author |
Message |
Guest Guest
|
DMX512 = RS485 |
Posted: Fri Aug 11, 2006 4:15 am |
|
|
Hi !
This is protocol known in music industry becuse it is used for lighting effects, dimmers, fog maschines etc.
Does someone knows if this protocol can be used with combination of WLAN and rs485 ? Is this protocol the same as rs485 ?.
Thanx ! |
|
|
neil
Joined: 08 Sep 2003 Posts: 128
|
|
|
Guest Guest
|
|
Posted: Fri Aug 11, 2006 4:55 am |
|
|
I saw this pages ( the dmx-online has even more infos ), but what i dont understand is :
If i use only rs485, can i make such data transmition ? |
|
|
Rocket
Joined: 29 Aug 2005 Posts: 27
|
|
Posted: Fri Aug 11, 2006 5:03 am |
|
|
Quote: | If i use only rs485, can i make such data transmition ? |
NO.
The DMX512 standard uses a serial protocol. as seen at http://www.dmx512-online.com/packt.html
It is not directly compatible with a 'normal' uart.
An implementation would require a protocol converter e.g. a PIC.
Do you need a transmitter, or a receiver? _________________ J.I.L. |
|
|
Ttelmah Guest
|
|
Posted: Fri Aug 11, 2006 5:22 am |
|
|
It is perhaps worth understanding, that 'RS232', and 'RS485' etc., are _not_ 'protocols'. They are _signalling standards_ (defining the voltages used to send the data). You can then 'talk' using these standards, using different 'protocols'. This is one reason why the '#use RS232' command, is incorrectly named (you use the same command to talk over RS485, and the PIC cannot actually generate 'RS232' voltages...).
Now, DMX, is a protocol definition, which can (just) be generated by the PIC UART. You have to use 9bit mode, and program the ninth bit to a '1'. The actual signalling standard used, is RS485.
You will need a fairly high clock speed PIC, if you intend to 'do much', while handling DMX, since the data rate is high (250Kbps).
Best Wishes |
|
|
Guest Guest
|
|
Posted: Fri Aug 11, 2006 8:29 am |
|
|
Quote: | An implementation would require a protocol converter e.g. a PIC. | Hm, like Ttelmah wrote, i need some high clock speed pic to make this work, but the question is how much of the dmx do i need and how much can be done with rs485
Quote: | Do you need a transmitter, or a receiver? |
Well, the idea was to have one transmiter ( on some control board ) from which i can send data to 5 devices ( lights ). Is this possible on this way ? |
|
|
Rocket
Joined: 29 Aug 2005 Posts: 27
|
DMX512 |
Posted: Fri Aug 11, 2006 8:34 am |
|
|
Ttelmah is correct in differentiating between a protocol and the electrical interfaces.
The challenge to generate a data stream which conforms to the DMX512 protocol standard using a PIC and its USART is to generate the �BREAK� and �MAB� signals which indicate the start of the data stream.
Best wishes _________________ J.I.L. |
|
|
Rocket
Joined: 29 Aug 2005 Posts: 27
|
DMX512 |
Posted: Fri Aug 11, 2006 9:13 am |
|
|
The PIC needs to do the whole data stream generation, the �BREAK� and �MAB� and the data . Once the �BREAK� and �MAB� signals are generated with bit banging, the rest of the signaling could be done with the USART.
A 4Mhz PIC could generate the 250Kbps needed. Faster would be better (4Mhz increments).
The 0 to 5V output from the USART is sent to a RS485 driver IC e.g. LTC485. Thus, the serial protocol (now DMX512) is placed on a pair of wires. RS485 is thus just an electrical interface standard.
Regards. _________________ J.I.L. |
|
|
Guest Guest
|
|
Posted: Fri Aug 11, 2006 12:36 pm |
|
|
Can u please bescribe me in more detail MAB and BREAK signals and "bit banging " part... |
|
|
Humberto
Joined: 08 Sep 2003 Posts: 1215 Location: Buenos Aires, La Reina del Plata
|
|
Posted: Fri Aug 11, 2006 4:47 pm |
|
|
MAB and BREAK are short names of some of the frames that belong to the DMX protocol.
If you want to implement a DMX512 with a PIC, you will need to generate every single
frame according to a predefined standard.
The different stages for a full packet are:
1) Idle
2) Break
3) Mark After Break (MAB)
4) Start Code (SC)
5) Mark Time Between Frames (MTBF)
6) Channel Data (CD)
7) Mark Time Between Packets (MTBP)
The only part of the protocol where you can use the regular CCS RS232 format (using
9bit mode as Ttelmah said) is in the frame called SC (Start Code) where at 250Kb every
single bit width should be of 4us.
Humberto |
|
|
Ttelmah Guest
|
|
Posted: Sat Aug 12, 2006 2:35 am |
|
|
I have to disagree slightly.
The whole protocol can be managed using the standard RS232 command, _with the exception of the break_.
The rest is just a matter of pausing transmisions at the right time.
MAB, requires an 8uSec pause.
SC can just be sent using the RS232 command.
MTBF, is just a matter of a pause, and the protocol allows this to be as short as 0uSec. Most modern equipment accepts this.
The channel data sends using the standard RS232 commands.
MTBP, can also be as short at 0uSec, but many systems do require a pause. For both this, and the MAB, I just used a interrupt driven timer, to allow a programmed transmission pause.
Best Wishes |
|
|
Rocket
Joined: 29 Aug 2005 Posts: 27
|
|
Posted: Sat Aug 12, 2006 3:31 am |
|
|
Hi Ttelmah
You are 100% correct..
If you have the time, and the inclination, would you please post sample code for the transmitter?
Kind regards
Rocket _________________ J.I.L. |
|
|
Ttelmah Guest
|
|
Posted: Sat Aug 12, 2006 4:07 am |
|
|
I can't unfortunately, this was done as a 'job' a while back, and the agreement requires 'non disclosure' on the sources.
Best Wishes |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Sat Aug 12, 2006 3:25 pm |
|
|
Actually the break can be generated with the RS232 as well. The trick is to set the UART speed slower and transmit a 0. Once the TSR is empty, switch back the UART speed and transmit the data. If you really want to make it simple and only use the UART, you can generate the other timing parameters by disabling the transmit and then transmitting a char.
On the receiving side, I look for a framing error to detect the break signal. The received data should be 0 as well. Once I receive the break, I look for the start code of 0 and the next data byte will be the first channel.
You do not need to transmit all 512 channels if you are only concerned with 5 channels. I would only do those and only repeat the stream as often as you need to in order to allow the tranmitter time to do its tasks.
Now it sounds as though you are only looking for a protocol to use for your own purposes. If you do not need to interface to other DMX devices, then you can certainly slow down the transmission rate. The product that I have running DMX uses a 20MHz crystal and works just fine. For the transmitting device, I did you a high priority interrupt (PIC18) since the interrupts occur about every 44us. |
|
|
Jakin Guest
|
|
Posted: Tue Aug 15, 2006 6:50 pm |
|
|
Hi, All:
I am asking if anyone has a sample code for RS485 Master and Slave. If you do, could you please post it? Thank you so much ~!
Regards,
Jakin |
|
|
|