Различия

Здесь показаны различия между двумя версиями данной страницы.

Ссылка на это сравнение

Следующая версия
Предыдущая версия
zheleznaja_chast:dmx_512_send_dmx_data_arduino [2016/10/07 11:24]
Leo создано
zheleznaja_chast:dmx_512_send_dmx_data_arduino [2017/06/09 23:05] (текущий)
Строка 1: Строка 1:
 ====== Отправка DMX 512 данных с помощью Arduino ====== ====== Отправка DMX 512 данных с помощью Arduino ======
-Еще один простой скетч, использующий Arduino и микросхему MAX485 для отправки данных DMX+Еще один простой скетч, использующий Arduino и микросхему ​[[:​wiki:​electronnie_komponenty:​max485|MAX485]] для отправки данных ​[[:​wiki:​dmx_512|DMX]]  
 +По моему это самый простой скетч, чтобы разобраться как устроен протокол [[:​wiki:​dmx_512|DMX]] 512. На нем видно все задержки,​ где и как используется BREAK.
 ===== Скетч ===== ===== Скетч =====
 <​file>​ <​file>​
-/* DMX Shift Out for arduino - 004 and 005+/* [[:​wiki:​dmx_512|DMX]] Shift Out for arduino - 004 and 005
  * -------------  * -------------
  *  *
- * Shifts data in DMX format out to DMX enabled devices+ * Shifts data in [[:​wiki:​dmx_512|DMX]] format out to [[:​wiki:​dmx_512|DMX]] enabled devices
  * it is extremely restrictive in terms of timing. Therefore  * it is extremely restrictive in terms of timing. Therefore
  * the program will stop the interrupts when sending data  * the program will stop the interrupts when sending data
  *  *
- * The elektronic foundation for DMX is RS 485, so you have to use+ * The elektronic foundation for [[:​wiki:​dmx_512|DMX]] is RS 485, so you have to use
  * a MAX-485 or a 75176.  * a MAX-485 or a 75176.
  *  *
- * wirring for sending dmx with a MAX-485+ * wirring for sending ​[[:​wiki:​dmx_512|dmx]] with a MAX-485
  1 - RO - Receiver Output --- set to ground with a 100 ohm resistor  1 - RO - Receiver Output --- set to ground with a 100 ohm resistor
  2 - RE - Receiver Output Enable -- set to ground  2 - RE - Receiver Output Enable -- set to ground
  3 - DE - Driver Output Enable -- set to 5v  3 - DE - Driver Output Enable -- set to 5v
  4 - DI - Driver Input -- Input from Arduino  4 - DI - Driver Input -- Input from Arduino
- 5 - GnD - Ground Connection -- set to ground -- refence for the DMX singal --- (DMX pin 1) + 5 - GnD - Ground Connection -- set to ground -- refence for the [[:​wiki:​dmx_512|DMX]] singal --- ([[:​wiki:​dmx_512|DMX]] pin 1) 
- 6 - A - Driver Output / Receiver Input -- DMX Signal (hot)------------------ (DMX pin 3) + 6 - A - Driver Output / Receiver Input -- [[:​wiki:​dmx_512|DMX]] Signal (hot)------------------ ([[:​wiki:​dmx_512|DMX]] pin 3) 
- 7 - B - Driver Output / Receiver Input -- DMX Signal inversion ( cold)------ (DMX pin 2)+ 7 - B - Driver Output / Receiver Input -- [[:​wiki:​dmx_512|DMX]] Signal inversion ( cold)------ ([[:​wiki:​dmx_512|DMX]] pin 2)
  8 - Vcc - Positive Supply -- 4,75V < Vcc < 5,25V  8 - Vcc - Positive Supply -- 4,75V < Vcc < 5,25V
  
- * Every dmx packet contains 512 bytes of information (for 512 channels).+ * Every [[:​wiki:​dmx_512|dmx]] packet contains 512 bytes of information (for 512 channels).
  * The start of each packet is market by a start byte (shiftDmxOut(sig,​0);​),​  * The start of each packet is market by a start byte (shiftDmxOut(sig,​0);​),​
  * you should always send all 512 bytes even if you don*t use all 512 channels.  * you should always send all 512 bytes even if you don*t use all 512 channels.
- * The time between every dmx packet is market by a break+ * The time between every [[:​wiki:​dmx_512|dmx]] packet is market by a break
  * between 88us and 1s ( digitalWrite(sig,​ LOW); delay(10);)  * between 88us and 1s ( digitalWrite(sig,​ LOW); delay(10);)
  *  *
Строка 39: Строка 40:
  * @idea: Tomek Ness  * @idea: Tomek Ness
  * @code: D. Cuartielles and Tomek Ness  * @code: D. Cuartielles and Tomek Ness
- * @acknowledgements:​ Johny Lowgren for his DMX devices+ * @acknowledgements:​ Johny Lowgren for his [[:​wiki:​dmx_512|DMX]] devices
  *  *
  */  */
Строка 46: Строка 47:
 int swing = 0; int swing = 0;
 int updown = 0; int updown = 0;
-/* Sends a DMX byte out on a pin. Assumes a 16 MHz clock.+/* Sends a [[:​wiki:​dmx_512|DMX]] byte out on a pin. Assumes a 16 MHz clock.
  * Disables interrupts, which will disrupt the millis() function if used  * Disables interrupts, which will disrupt the millis() function if used
  * too frequently. */  * too frequently. */

Полезная статья, нажми +1 поддержи нас!