User Manual
By JPK Systems Limited
E-mail: info@jpk.co.nz
1. Introduction
Through the use of multiple serial ports several DMX transceivers may be
connected simultaneously to the same host computer without having to become
concerned with timing at all. Each transceiver has three microcontrollers, one
for DMX transmit, one for DMX receive, and one for host communication, all
three being linked together completely asynchronously by dual port memories.
Only 256 of the possible 512 channels have been implemented, which is
sufficient in most applications, and the transmitter may be switched to 128
channel output if faster refresh rates are required.
Receive only and transmit only versions are also available, although all versions have bi-directional communication with the host computer. Figure 1 shows the DMX transceiver viewed from the front.
Figure 1. The DMX Transceiver
2. Connection to host
|
| ||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Table 1. RS232 connection to DMX transceiver
Settings for the host computer RS232 port are in table 2, note that
although RTS/CTS and DTR/DSR handshaking appear to be implemented they are
merely linked in the DMX transceiver. This is to ensure that RTS and DTR are
high so that power can be derived from them for the isolated RS232 interface
built into the DMX transceiver.
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Table 2. RS232 port settings on host computer
All ASCII commands start with the character 'C', followed by a three ASCII
numbers that describe the channel number of interest unless a special function
command is to be accessed. The DMX512 specification describes channels numbers
as 1 to 512, the DMX transceiver accepts channel numbers from 000 to 255 which
correspond to channels 1 to 256. If an 'L' is send after the channel number
then the three ASCII numbers that follow describe the level to set the
channel, range is 000 to 255. If a question mark '?' is sent after the channel
number then the DMX transceiver will return the value of that channel as
'Lxxx' where xxx is the level (000 to 255).
ASCII Command Examples:
ASCII Special Commands:
If your application requires updating of several consecutive channels then
the block transfer protocol should be used as it is far quicker. Instead of
sending each channel and level in ASCII characters the protocol reduces this
to one byte per channel plus a start header that describes which channel to
start from and how many channels will follow. A checksum is used to provide a
simple means of detecting transmission errors.
Block transfer to the DMX transmitter:
Send the following to the DMX transceiver.
0xFF (Block transfer header)
0xFF (Block transfer header)
0xC0 (BOF)
start channel low byte (0x00 to 0xFF corresponds to DMX channels 1 to 256)
start channel high byte (0x00 for this DMX transceiver as only 256 channels are implemented)
number of channels - 1 (0x00 to 0xFF, start channel + (number of channels - 1) <= 0xFF)
first channel data byte (0x00 to 0xFF corresponds to level 0 to 255)
..
..
last channel data byte
checksum byte (add all channel data bytes, take low byte of answer)
0xC1 (EOF)
Response from the DMX transceiver is 'G' if the block was received without
error.
Block transfer request from the DMX receiver:
Send the following to the DMX transceiver.
0xFF
0x00
0xC0 (BOF)
start channel low byte (0x00 to 0xFF corresponds to DMX channels 1 to 256)
start channel high byte (0x00 for this DMX tx/rx, 256 channels implemented)
number of channels - 1
0xC1 (EOF)
Response from the DMX transceiver will be:
0xFF
0xFF
0xC0 (BOF)
first channel data byte (start channel requested)
..
..
last channel data byte (start channel + number of channels requested)
checksum byte
0xC1 (EOF)
Note that the start channel + number of channels can never exceed 0xFF as
this is outside the range of possible channels. If it is exceeded the DMX
transceiver will ignore the command. Likewise any ASCII commands that specify
channel numbers or addresses outside the range 000 to 255 will be ignored.
Standard C notation for hex numbers has been used, 0xFF means FF Hex which is
255 decimal.
Examples of block transfers:
FF FF C0 09 00 05 64 78 8C 96 FF 0A 07 C1
(Command sent)
FF 00 C0 80 00 03 C1 (Command sent to DMX
transceiver)
FF FF C0 C8 C8 00 FF 8F C1 (Response from
DMX transceiver)
It is not possible to keep up with the 250000bps data rate of DMX512
transmissions using an interface that operates at only 115200bps. Because it
is unlikely all channels will need to be altered at the same time this slower
RS232 interface can be used without any adverse effects, although some care
must be taken when writing software to ensure the desired update rate is
achieved. Due to the completely asynchronous nature of the DMX transceiver a
new channel level may not actually occur until up to one complete DMX512
transmission cycle, which is 5.78ms for 128 channel output and 11.41ms for 256
channels. These update rates are sufficient for all DMX applications including
moving lights and laser display beam control systems.
DMX512 output continues regardless of what the host computer interface is
doing, there are no breaks in transmission between channels. If the unit
becomes unplugged from the host at some stage the last channel levels will
continue to be output by the independent DMX512 transmitter as it stores the
last channel levels internally. Likewise DMX512 reception will continue
regardless of the host computer interface, all channel levels are stored and
are updated only upon reception of a new DMX512 data stream. Unplugging the
DMX receive cable will result in no further reception but the last good data
will still be held internally and returned upon request from the host
computer.
Care must be taken when writing any software for the DMX transceiver, keep
in mind that there are many different fault conditions that may exist such as
RS232 cables being unplugged during data transmission or reception. It is
recommended that regular checks be made to ensure the unit is still present
and operating, sending the 'C?' command should result in a 'G' being returned.
If it isn't then clear all serial port buffers and send 264 NULL (0x00)
characters to the serial port, this will terminate any command that may have
been corrupted due to a cable being momentarily unplugged or some other fault.
Then try the 'C?' command again, if there is no response then the unit is not
present or not powered. Be sure to check the 'G' characters being returned
after some commands, this indicates a good data transfer.
Commands send to the DMX transceiver have no special timing requirements, characters may be sent with no delay between them. Once a DMX transmit command has been sent the next one may be sent immediately following the previous one, although it is recommended that the 'G' character be received to ensure the previous command was received okay. This will introduce a 1 character delay as it will be sent immediately upon the DMX transceiver receiving the last character in the command from the host computer. After sending a DMX receive request the channel level(s) will be returned, during this period no further commands will be accepted until all bytes have been sent to the host computer.
4. Specifications
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|