TOP Contributors

  1. MIKROE (2762 codes)
  2. Alcides Ramos (374 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 codes)
  5. Bugz Bensce (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (139250 times)
  2. FAT32 Library (71747 times)
  3. Network Ethernet Library (57120 times)
  4. USB Device Library (47430 times)
  5. Network WiFi Library (43082 times)
  6. FT800 Library (42403 times)
  7. GSM click (29835 times)
  8. mikroSDK (28074 times)
  9. PID Library (26885 times)
  10. microSD click (26198 times)
Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

< Back
mikroSDK Library

DMX click

Rating:

5

Author: MIKROE

Last Updated: 2020-06-03

Package Version: 1.0.0.0

mikroSDK Library: 1.0.0.0

Category: DMX

Downloaded: 2421 times

Not followed.

License: MIT license  

DMX Click is a device used to establish communication between the MCU and equipment that uses the DMX512-A communication protocol.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "DMX click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "DMX click" changes.

Do you want to report abuse regarding "DMX click".

  • mikroSDK Library 2.0.0.0
  • Comments (0)
DOWNLOAD LINK RELATED COMPILER CONTAINS
mikroBasic PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc

mikroSDK Library Blog

DMX Click

DMX Click

Native view of the DMX Click board.

View full image
DMX Click

DMX Click

Front and back view of the DMX Click board.

View full image

Library Description

This library offers a choice to control stage lighting and effects. One master device can control one, two, or more slave devices. User can determine length of the DMX frame, speed of the DMX frame transfer, data length, start address, interrupt duration. Any DMX slave device (DMX Click board, RGB reflector) is determined by start address and data length. This data can consist of the, for example, color selection, light intensity, and many different effects. Master executes the DMX frame transfer, '0' always be transfered first, and slave receives data from the sent frame starting from the determined start address, '0' always be received first. This is a excellent solution to control stage lighting on the easy, simple and fast way. For more details check documentation.

Key functions:

  • void dmx_send_cmd( uint8_t *cmd, uint16_t cmd_len ) - This function sends a command to the DMX device.
  • void dmx_default_handler( void ( *handler )( uint8_t*, uint16_t*, uint8_t* ) ) - This function sets handler on the function which should be performed, for example function for the results logging.
  • void dmx_run( uint8_t run_mode ) - This function allows user to put device in config or run mode.

Examples description

The application is composed of three sections :

  • System Initialization - Initializes peripherals and pins.
  • Application Initialization - Initializes UART serial interface and executes a device configuration and mode setting. In our example the device is configured as master and allows 5 data bytes transfer starting from the address 8. DMX frame length is 15, starting from 0, and range can be from 1 to 512. Start address can be from 1 to 512 also. @FTMR,nnn - determines the delay between two DMX frame, range is from 000 to 007 (from 20ms to 160ms). @ITMR,nnn - determines the duration of the interrupt signal, range is from 000 to 007 (from 0.1ms to 1.28ms).
  • Application Task - (code snippet) - When device was configured as master, user can enter the desired 5 data bytes, that will be transfered to the slave every 140ms. When device was configured as slave, the device will receive 5 data bytes from the master, transfered from the address 8 to address 12, every 140ms (in this example). Note : RUN LED - DMX frame transfer indication STAT LED - interrupt indication MODE LED - indicates the device mode, when is set the device was configured as master, and when is reset the device was configured as slave.
void application_task( )
{
    if ( device_mode == DMX_SLAVE )
    {
        process( );
    }
    else if ( master_mode == DMX_MASTER_USER_CTRL )
    {
        uint8_t cmd_check;
        uint8_t tx_buff[ 6 ] = { 0 };

        mikrobus_logWrite( "> CH1 - light [0-255]: ", _LOG_TEXT );
        tx_buff[ 0 ] = enter_cmd( );

        mikrobus_logWrite( "> CH2 - red [0-255]: ", _LOG_TEXT );
        tx_buff[ 1 ] = enter_cmd( );

        mikrobus_logWrite( "> CH3 - green [0-255]: ", _LOG_TEXT );
        tx_buff[ 2 ] = enter_cmd( );

        mikrobus_logWrite( "> CH4 - blue [0-255]: ", _LOG_TEXT );
        tx_buff[ 3 ] = enter_cmd( );

        mikrobus_logWrite( "> CH5 - strobe [1-255]: ", _LOG_TEXT );
        tx_buff[ 4 ] = enter_cmd( );

        mikrobus_logWrite( "> CH6 - change colores [1-255]: ", _LOG_TEXT );
        tx_buff[ 5 ] = enter_cmd( );

        dmx_send_cmd( &tx_buff[ 0 ], 6 );
        cmd_check = dmx_check_int( );

        while ( cmd_check == DMX_INT_INACTIVE )
        {
            cmd_check = dmx_check_int( );
        }

        mikrobus_logWrite( "> command sent", _LOG_LINE );
        mikrobus_logWrite( "************************************", _LOG_LINE );
    }
    else
    {
        application_demo( );
    }
}


Other mikroE Libraries used in the example:

  • Conversions
  • C_String
  • UART

Additional notes and informations

Depending on the development board you are using, you may need USB UART clickUSB UART 2 click or RS232 click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.

ALSO FROM THIS AUTHOR

Alcohol 2 Click

0

Alcohol 2 Click is a very accurate ethanol gas (alcohol) sensor Click board™, equipped with the SPEC amperometric gas sensor which electrochemically reacts with the ethanol.

[Learn More]

BarGraph click

0

This is a demonstration example for BarGraph click. Bar Graph is representing ADC value measured on Poetntiometer P1. On Potentiometer P2 user can adjust PWM for LCD backlight.

[Learn More]

USB UART 4 Click

0

USB UART 4 Click offers a USB to asynchronous serial data (UART) interface, allowing the microcontroller based designs to communicate with the personal computer, in a very simple way. It is equipped with the FT232RL, a very popular USB to UART interface IC, used on many MikroElektronika devices - both for its reliability and simplicity. USB UART Click is used for whenever there is a need to seamlessly and effortlessly interface the UART lines to a personal computer

[Learn More]