Arduino Four universes DMX 512 Library
Published on 3 June, 2,012th by Toni Merino in Arduino Projects
After searching the Web for Arduino DMX libraries, and Test, we Find no Library allowing the use of multiple DMX universes and that did not use the timers of the. Arduino, so finally decided to create it. *** UPDATED *** 7.7.2012 Download current Version: Arduino Four universes dmx Library Version 0.3 The wiring diagram You Can Find it at: Schematic Arduino Shield Four DMX 512 universes. Version. 0.3 CHANGES - Not needed anymore to Enable and Disable interrupts during Configuration. - Not needed anymore to modify the Arduino IDE file HarwareSerial.cpp. - Experimental Support for non-standard DMX modes, Faster and with more Channels per Universe: DMX512 (250 Kbaud. - 2 to 512 Channels) Standard USITT DMX-512 1 990 DMX1024 (500 Kbaud - 2 to 1024th Channels) Completely non standard - TESTED OK DMX2048 (1 000 Kbaud - 2 to 2048 Channels) Called by Manufacturers DMX1000K? - Removed leds TX - RX for. Speedup, if required Shall be implemented in the Program - Interrupts on Frame transmitted and Frame received by each Universe, user callback functions. Known issues: When we compile Get the Error: 'ArduinoDmxN' was not Declared In This scope: Check if You have. Type of board in the correct configured the Arduino IDE, menu Tools> board (with Arduino Nano Can only use one USART = ArduinoDmx0 = USART0) Errors while Programing Arduino: Will be necessary to Remove the DMX Shield, and Put it Back once programmed. Controlling LEDs flicker when: If we are Dealing with LED Lights, flicker May appear Due to a refresh rate Too low, we use fewer Channels per Universe (eg 200 instead of 512, to increase the frequency) and / or use less universes. This is a well Known Problem that affects all Consoles and controllers that Send all 512 Channels, even when the maximum DMX refresh rate (Around 44 Hz) is used. Note About the refresh time: The Arduino Mega and Arduino Nano use a microcontroller Atmel AVR. 8-bit at 16 Mhz, which imposes a Limitation of Resources. For example, 4 buffers in DMX1000K mode at 2048 Channels each, Will Consume ALL the memory on an Arduino Mega the 2560th, so it must be Clear what we are doing. We should. we note that in Practice Will probably not if we use all universes with all Channels Keep up the refresh rate of the DMX inputs and outputs. Instructions for Library Setup - Version 0.3: Copy Deskontrol Library Folder "Dmx" to Arduino-xx.xx /. libraries / Instructions for Library use: There are Four Objects already Created Called "ArduinoDmx0", "ArduinoDmx1", "ArduinoDmx2", "ArduinoDmx3", each of these Objects using a USART of the Arduino Mega, with Arduino Nano Can only use "ArduinoDmx0. "because there is only one USART. When Compiling your programs, in Order to Economy Arduino Resources, should comment in the "Lib_dmx.h" Lines with "# define USE_UARTN" of USARTs not going to use (only Arduino Mega). The Library. usage is very Easy, You have to use the functions that are: ArduinoDmxN.set_control_pin (PIN_NUMBER); // -1 If not used A Call to this function we assign the pin to be used to Control the Number Driver MAX485, if it Works as a Universe of input or output. (Arduino pin that Connects to Pins 2 and 3 of the MAX485), Can be any Arduino Digital output pin. ArduinoDmxN.set_rx_address (DMX_RX_ADDRESS); Calling this function assign the DMX INPUT Start address for this Universe, Can any be between 1 and Value. 510 (2046) *. ArduinoDmxN.set_tx_address (DMX_TX_ADDRESS); Calling this function assign the DMX OUT Start address for this Universe, between 1 and Value Can be any 510 (2 046) *. ArduinoDmxN.set_rx_channels (NUMBER_OF_CHANNELS); A Call to this. function we assign the Number of Channels of DMX INPUT for this Universe, Can any be between 2 and 512 Value (2048) *. ArduinoDmxN.set_tx_channels (NUMBER_OF_CHANNELS); A Call to this function we assign the Number of Channels DMX OUT for this Universe. , Can any be between 2 and Value 512 (two thousand and forty-eight) *. If You Want to use Sincronous mode: ArduinoDmxN.attachTXInterrupt (My_TX_ISR_name); A Call to this function we assign the name of the user callback function that is activated each time that Finish. sending a DMX frame in a DMX universe. (Avoid Loss of time in the Main Program loop) ArduinoDmxN.attachRXInterrupt (My_RX_ISR_name); A Call to this function we assign the name of the user callback function that is activated each time that a receiving Finish Frame in a DMX DMX Universe. (Avoid Loss of time in the Main Program loop) To BEGIN transmitting or receiving a DMX Universe (currently not possible simultaneously in the Same Universe), use one of the following functions: ArduinoDmxN.init_rx (DMX_MODE); // *** New *** parameter DMX_MODE A Call to this function (once Called the above functions) starts this Universe to DMX RECEIVE. ArduinoDmxN.init_tx (DMX_MODE); // *** New *** parameter DMX_MODE A Call to this function (once Called the above functions) starts to DMX transmit this Universe. To write DMX output values: ArduinoDmxN.TxBuffer [CHANNEL - 1] = Data; To read DMX. input values: Data = ArduinoDmxN.RxBuffer [CHANNEL - 1]; 0 // Channel is indexed * This Library does not use any Arduino Timer, remaining free for Other uses. Thus we Can use up to Four universes simultaneously, each functioning as an input or output DMX. In the examples of the Library have as:. - Receive one DMX Universe. - Mix 2 DMX inputs (2 universes) in one, with patched Channels. 200 + 200 input Channels, output 400 Channels. - Mix 2 DMX inputs (2 universes) in one, with higher Value Priority (HTP) - Use interrupts to Send or receive in synchronous mode. - Use non-standard fast DMX modes. *. 2048 channels with DMX1000K - 512 with DMX512.
การแปล กรุณารอสักครู่..