1.2 The DMX Adapter The PC DMX Interface Card 1512A consists of two separate, but commonly operated output drivers. The Interface Card 1512B consists of an opto-isolated output driver, which is connected to both ports. The output signal is available at two pins on the 9-pin Sub-D output connector. USUTT Standard DMX-512 and DMX DIN 56930 require a 5-pin XLR plug as standard connector. This connector is wired as follows: Pin 1: GND Pin 2: DMX- Pin 3: DMX+ Pin 4: Second link DMX- (optional) Pin 5: Second link DMX+ (optional) To prepare ana adaptor for the PC Interface Card please connect: COMPUTER DMX-Equipment Sub-D 9pin XLR 5-pin 1 <-------------> 3 DMX + 2 <-------------> 2 DMX - 3 <-------------> 5 Second link (optional) 4 <-------------> 4 Second link (optional) 5 do not use 6 <-------------> 1 Screen Masse 7-9 do not use The second link wiring is optional. They are not used with standard DMX equipment and should be omitted. 1.3 PC DMX Interface Card Adressing To be accessible by the computer each interface card in the computer needs one or more interface adresses. The required address can be set by Jumper or by DIP-switch, depneding on the type of the card. If Jumpers have to be set, make sure that all jumpers are set correctly. Adress list: Hex Decimal Jumper setting $0100 256 J1 = right J2 = right $0120 288 J1 = right J2 = left $0140 320 J1 = left J2 = right $0160 355 J1 = left J2 = left The card uses 4 addresses, beginning with the base address (for ex.: $100...$103). In most cases your DMX PC interface card 1512A will be able to operate trouble-free with any address setting. If the required interface address is already occupied with another interface card, please select the next address. The software checks all interface address settings and automatically detects the base address using the routine DMXCARD(). Interface Cards 1512B are equipped with a DIP-switch. Please use DIP-Switche 1&2 to select the card interface address. More information is availabe from the helfiles of the DESK12, DMXTG and SCROLLER test programs. Hex Decimal DIP-Switch Setting $0100 256 SW1 = ON SW2 = ON $0120 288 SW1 = OFF SW2 = ON $0140 320 SW1 = ON SW2 = OFF $0160 355 SW1 = OFF SW2 = OFF ---------------------------------------------------------------------------------------------------- The following chapters cover the programming of the card and show examples for various programming languages. If yo do not want to program the card yourself, please proceed to chapter 2.6 USER PROGRAMS. 1.4 Basic Card Function The DMX-512-Interface card should -on one hand- be a very inexpensive device, but -on the other hand- feature a very high degree of flexibility to allow for a wide range of uses and to be adaprable to any modification of the DMX standard, such as the new DMX512/2000 protocol, which is currently being defined by ESTA/USITT. Your Interface Card 1512A/1512B is prepared to fulfill the transmission requirements of the forthcoming DMX-512/2000 protocol. Looking at the card in more detail will let you notice, that this card contains a microprocessor, but no ROM or EPROM for program code. So, how can a microprocessor work without a program? The solution to this is the shared usage of RAM for both, program code and data, and at the same time this is the secret for the unlimited possibilities of this card. You may even change the card's operating system while the card is running, everything is under full control from the host PC. The disadvantage of this solution is that you have to load the card operating system software from the PC each time you start a session, but as this takes only the fraction of a second to complete this couldn't really be considered a constraint. The basic software uses the folling RAM allocation: $0000 - $03FF Card operating system $0400 - $05FF DMX-Data $0600 - $1FFF free RAM for your private data To ensure maximum compatibility to all industry standard compatible PCs, an 8-Bit slot has been selected. This again is no contraint since DMX data are always 8-Bit data as well. Regarding the card, there are two data paths: unterscheiden: - fromt the PC into the DMX-RAM - from the DMX-RAM to the RS485 output The user takes control of the data transfer from the PC into the DMX data RAM area. DMX-RAM starts at address $0400 for channel #1 and uses 512 bytes consecutively (CH 1 -> $0400, CH 2 -> $0401 ... CH 512 -> $05FF). Since data are held in the card RAM, only modified data have to be updated. After transferring all data the PC is free to take control of other tasks, now the card processor may start perparing the DMX protocol and sending the DMX data in serial format via the RS-422/RS-485 line driver. To ensure the both processors (the PC CPU and the card CPU) do not interfere when accesing the card data RAM, the card CPU is halted eacht time the PC accesses the card. It has to be restartet to initiate a new transmission. This should be done by a PC timer. Once the card CPU has been started, a complete DMX data string will be transmitted. After this, the card stops and awaits new update data from the PC. Alternatively, the card can be set to a continuous mode and then automatically repeats the last transmission endlessly. We do not recommend this mode, as this might result in asynchronously updated channels. Using combined DMX channels as for 16-bit mirror movement data for modern scanners, the full 16bit data integrity can only be ensured in timed single-transmission mode, as explained later. 2 The Software The PC card software consists of:- -ready-to use User programs for MS Windows; -fully documented sources -Exampels and object files for various programming languages: -linkable object file for Borland C -linkable object file for orland PASCAL -the C interface card operating system -programming examples in BASIC, Pascal and C -a Dynamic Link Library (DLL) for Windows, both 16Bit and 32Bit All object files and the DLL are written in machine language to ensure the full data transmission speed between PC and Interface card. Regarding Pascal: All Pascal example files have been written in Turbo Pascal 6.0. If using other compilers make sure to declare external procedures as far. Since Turbo Pascal allows to access the card directly, all access routines have been written in high-level language as well. Thus there is no need to use the predefined procedures. Regarding C: All C example files are only contained as source code and have to be compiled by the user. The syntax conforms to Turbo C++ 3.0. Please see Pascal notes above. Regarding Windows: The program DESK6 is contained in Visual Basic 3.0 source code format and must be rum from the Visual Basic programming environment. The DLL functions are available with Visual Basic 3.0 running under Windows 3.1, Windows 3.11, Windows 95 and Windows 98 verfügbar. Please check our website http://www.soundlight.de for more information or programming examples for Visual Basic 5.0, Delphi 1.0 and Delphi 2.0 2.1Theory of Basic Operation Communicating with the card The DMX PC interface card uses for addresses to communicate with your PC: BASE ADDRESS = RAM ADDRESS LOW BYTE BASE ADDRESS +1 = RAM ADDRESS HIGH BYTE BASE ADDRESS +2 = DATA READ/WRITE BASE ADDRESS +3 = CARD RESTART COMMAND Assuming the Base Address was $100 (256 dec), the adresses in use would be $0100, $0101, $0102, $0103 Detecting the card All examples for all programming languages use a routine called FINDCARD or similar to automatically detect the presence of the SOUNDLIGHT DMX-512 PC interface card. This routine checks if it can find re-writable RAM at any of the possible interface addresses $100, $120, $140, 160 For each of the possible interface addresses mentioned above, perform the folling steps: (1) Write $00 to Base Adress (2) Write $00 to Base Address +1 (3) Write $AA to Base Address +2 (4) Read Base Address +2 If returned value is other than $AA proceed with next Base adress and reapeat from step (1) (5) Write $55 to Base address +2 (6) Read Base Address +2 If returned value is other than $55 proceed with next Base adress and reapeat from step (1) (7) If successful you have found the card. Register the Base address as variable CARDADR for future use. Downloading the card operating system Until this time, the DMX PC interface card is as intelligent as a slice of bread, it does nothing. To make the card operable, we have to download the card operating system first. The card OS is contained in a file named SLHDMXnn.BIN, where nn denotes the card's crystal frequency (either 12 oder 16 MHz). Make sure you use the correct OS file for your card or it will not work! We now read the OS file byte by byte and trsnfer its contents into the card RAM, beginning at address $0000. Please make sure that even bytes containing $00 are written, that is, you must open the OS file in binary mode, not sequential mode. (1) Open the SLHDMXnn.BIN file (2) Read the first byte (3) Set RAMADRESS = $0000 (4) Write RAMADRESS High Byte to BASE ADRESS +1 (5) Write RAMADRESS Low Byte to BASE ADDRESS (6) Write Data Byte to BASE ADRESS +2 (7) If EOF, close file and exit (8) Increment RAMADDRESS (9) Read next byte from file (10) Proceed with step (4) Now we have transferred the card operating system into to card memory and may start the card CPU to transmit DMX signals. Since the card OS allows to modify timing data and channel count, these parameters should be set first. Set card parameters Up to 15 parameters can be set to control the card's behaviour. We recommend that these parameters be stored in an array of variables for easy access in case any of these parameters requires updating. The RAM Memory for parameters is $03F0...$03FF (fixed). $03F0 Start Sync Duration * 2 us typical value = 60, min. value = 44 $03F1 StartByte Value typical value = 0 $03F2 End Idle Time * 2 us + 40 us typical value = 30 $03F3 Channel Count LowByte (0-255) typical value = 100 $03F4 Channel Count HighByte (0-2) typical value = 0 Please set these bytes according to the following table: LO: 001 HI: 000 1 channel sent LO: 002 HI: 000 2 channels sent LO: 003 HI: 000 3 channels sent ... LO: 000 HI: 000 256 channels sent LO: 001 HI: 001 257 channels sent LO: 002 HI: 001 258 channels sent ... LO: 255 HI: 001 511 channels sent LO: 000 HI: 001 512 channels sent $03F5 Send Repeat 0: send once >0: send repeatedly typical value = 0 $03F6 Interdigit Time, pause between data bytes 0...44 us typical value = 0 $03F9 Card Type Read this location to detect the type of card present $01 = 16 MHz card $80 = 12 MHz card To transfer the configuration data into the card, proceed as follows: (1) Set the pointer to the first parameter (2) Read the first parameter (3) Set RAMADRESS = $03F0 (4) Write $03 (RAM ADDR High Byte) to BASE ADRESS +1 (5) Write RAMADRESS Low Byte to BASE ADDRESS (6) Write Parameter Byte to BASE ADRESS +2 (7) If all paremetrs written, exit (8) Increment parameter number (9) Read next parameter from data array (10) Proceed with step (4) Clear the DMX data RAM DMX data RAM starts at $0400 and ends at $05FF. Before you start the card we recommend you clear all data RAM locations. (1) Write $04 (RAM ADDR High Byte) to BASE ADRESS +1 (2) Set n=0 (3) Write n to BASE ADDRESS (4) Write $00 to BASE ADRESS +2 (5) increment n (6) if n <>0 repeat from step (3) (7) Write $05 (RAM ADDR High Byte) to BASE ADRESS +1 (8) Write n to BASE ADDRESS (9) Write $00 to BASE ADRESS +2 (10) increment n (11) if n <>0 repeat from step (8) Start the card - Start Command To start the card, simply (1) Read from BASE ADDRESS +3 After transmission, depending on the setting of the Send Repeat variable, the card will stop by itself and has to be restarted. Please not, that any write action to the card will halt the card CPU. Once halted, you have to issue a Start Command to restart DMX transmission. This should only be done after all write actions to the card have been completed.