Hot!PIC32MZ and DMX protocol

Author
ffb.boy.30
Senior Member
  • Total Posts : 150
  • Reward points : 0
  • Joined: 2016/08/31 00:59:51
  • Location: 0
  • Status: offline
2018/05/30 01:37:22 (permalink)
0

PIC32MZ and DMX protocol

Hi,
I would like to know if someone ever use this protocol with a PIC32 and Harmony .
Thanks you
#1

10 Replies Related Threads

    Mysil
    Super Member
    • Total Posts : 2758
    • Reward points : 0
    • Joined: 2012/07/01 04:19:50
    • Location: Norway
    • Status: online
    Re: PIC32MZ and DMX protocol 2018/05/30 04:28:13 (permalink)
    0
    Hi,
    I have not done anything like that.
    As I understand, DMX is a communication protocol using Asynchronous Serial communication,
    in a one way protocol.
    It use EIA-485 differential signaling, aka RS-485, with some restrictins for electrical signals.
    In PIC32MX or MZ that is done using the ordinary UART peripheral, using TX signal only, if the PIC32 is Controller.
    EIA-485 differential signaling will require a line driver component between PIC32 TX pin and DMX wiring.
     
    Harmony provide a multi-channel, multi-user UART driver.
    Using the Harmony UART driver with a specific Communication Protocol, may sometimes be tricky.
    Some communication protocols using asynchronous serial communication, rather prefer to use their own driver code, controlling the UART peripheral directly. 
     
    For DMX512 protocol signaling, you are not likely to want to share a UART module with any other communication protocol anyway.
    DMX512 use relatively fast asynchronous signaling at 250 kbits/s,
    and have some specific signaling requirements, in mandatory Break signal before each package,
    and a Timed  Stop between the break and first byte of each packet.
    Min Break 92 microseconds, minimum MAB 12 microseconds, and time between start of Break for one packet, and start of Break signal for the next packet minimum 1204 microseconds.
     
    These timing requirements may be fulfilled by chance using Harmony UART driver, but I would not rely upon that without testing.
     
       Mysil
    #2
    jcandle
    Super Member
    • Total Posts : 326
    • Reward points : 0
    • Joined: 2011/09/19 22:01:53
    • Location: 0
    • Status: offline
    Re: PIC32MZ and DMX protocol 2018/05/30 19:52:26 (permalink)
    0
    Yes, it can be done.  You need to use an RS485 transceiver with RTS used as a transmit enable.  Generating the unique 'break' is the trick.  I can't post code as it was 'for someone'.
    #3
    ffb.boy.30
    Senior Member
    • Total Posts : 150
    • Reward points : 0
    • Joined: 2016/08/31 00:59:51
    • Location: 0
    • Status: offline
    Re: PIC32MZ and DMX protocol 2018/06/13 03:09:30 (permalink)
    0
    I've put a max485 to convert the signal and it works.
    Now I've problems to configure the UART correctly .
    I've put a baudrate at 250000 and 8N2 . but the data received don't look as expected.
    Normally the first byte should be a 0x7E and I never see this byte on my log.
    I there a special UART config for the DMX
    #4
    qɥb
    Monolothic Member
    • Total Posts : 2631
    • Reward points : 0
    • Joined: 2017/09/09 05:07:30
    • Location: Jupiter
    • Status: offline
    Re: PIC32MZ and DMX protocol 2018/06/13 07:36:48 (permalink)
    0
    You don't seem to mention if you are making a DMX master (=transmitter) or slave (=receiver).
     

    This forum is mis-configured so it only works correctly if you access it via https protocol.
    The Microchip website links to it using http protocol. Will they ever catch on?
    PicForum "it just works"
    #5
    Nigle
    Super Member
    • Total Posts : 296
    • Reward points : 0
    • Joined: 2008/10/14 04:09:08
    • Location: London
    • Status: offline
    Re: PIC32MZ and DMX protocol 2018/06/13 07:46:43 (permalink)
    0
    ffb.boy.30Normally the first byte should be a 0x7E



    Why are you expecting to see that? It isn't in the DMX standard.
    #6
    ffb.boy.30
    Senior Member
    • Total Posts : 150
    • Reward points : 0
    • Joined: 2016/08/31 00:59:51
    • Location: 0
    • Status: offline
    Re: PIC32MZ and DMX protocol 2018/06/13 11:49:57 (permalink)
    0
    It is a DMX Slave.
    Yes it is the DMX standart but when I specify baud =250000 and 8N2 the data I receive are not correct.
     
    #7
    ffb.boy.30
    Senior Member
    • Total Posts : 150
    • Reward points : 0
    • Joined: 2016/08/31 00:59:51
    • Location: 0
    • Status: offline
    Re: PIC32MZ and DMX protocol 2018/06/13 13:43:33 (permalink)
    0
    Sorry I've made a mistake it is in the c# code taken here
    and it is the code for a USB/DMX converter and I tought it was the protocol, but it is only the protocol for the USB/converter.
    So now I don't know exactly what I should see .
    #8
    qɥb
    Monolothic Member
    • Total Posts : 2631
    • Reward points : 0
    • Joined: 2017/09/09 05:07:30
    • Location: Jupiter
    • Status: offline
    Re: PIC32MZ and DMX protocol 2018/06/13 13:49:35 (permalink)
    4 (2)

    TxBuffer[004] = DMX_PRO_START_CODE;

    Someone with a fetish for formatting has forgotten that in C, numbers starting with zero are treated as octal format.
    Doesn't matter when you only go up to "004", but could easily trip you up if you tried to use "010".
     

    This forum is mis-configured so it only works correctly if you access it via https protocol.
    The Microchip website links to it using http protocol. Will they ever catch on?
    PicForum "it just works"
    #9
    Nigle
    Super Member
    • Total Posts : 296
    • Reward points : 0
    • Joined: 2008/10/14 04:09:08
    • Location: London
    • Status: offline
    Re: PIC32MZ and DMX protocol 2018/06/18 14:20:13 (permalink)
    4 (1)
    ffb.boy.30now I don't know exactly what I should see

    The DMX frame begins with a break, which is a zero for 12 or more bit periods. UARTs will typically see this as data of 0x00 along with a framing error due to the stop bit being 0 instead of 1, I haven't used a PIC32 for DMX so can't tell you exactly how it reacts to the break. This is followed by the start code, this is one byte and for normal DMX is always 0x00. There then follows one byte per channel, controllers don't bother to send all 512 channels if they onlysupport a smaller number of them. The sequence then repeats with the next frame, there may be a delay between frames but it isn't required in the specification. I would strongly reccommend reading "Recommended Practice for DMX512: A guide for users and installers", it can be downloaded from http://tsp.esta.org/tsp/d...ts/published_docs.php, it is one up from the bottom of the list - you need to register on the site but I believe it is still free to do that. Although that document isn't the actual specification it includes more that enough technical information to implement a DMX receiver, and is also considerably easier to read.
    #10
    qɥb
    Monolothic Member
    • Total Posts : 2631
    • Reward points : 0
    • Joined: 2017/09/09 05:07:30
    • Location: Jupiter
    • Status: offline
    Re: PIC32MZ and DMX protocol 2018/06/18 15:11:10 (permalink)
    0
    Link doesn't work because it sucked in the following ","
    http://tsp.esta.org/tsp/documents/published_docs.php
     

    This forum is mis-configured so it only works correctly if you access it via https protocol.
    The Microchip website links to it using http protocol. Will they ever catch on?
    PicForum "it just works"
    #11
    Jump to:
    © 2018 APG vNext Commercial Version 4.5