Shop OBEX P1 Docs P2 Docs Learn Events
DMX — Parallax Forums

DMX

hjansenhjansen Posts: 2
edited 2007-10-02 16:50 in Propeller 1
I would like to implement DMX ( RS-485) via propeller. Any hints what i will need and how to implement it ?

Tanks !

Comments

  • BradCBradC Posts: 2,601
    edited 2007-09-27 10:26
    I'd suggest you might need a fairly tightly coded bit banging transmit loop, and a balanced line driver. One port pin should be all you need.

    Depending on what you want to do, it should be relatively easy. I used to bit bang DMX on a PIC, and that was a much slower processor than a single
    Propeller COG.
  • hjansenhjansen Posts: 2
    edited 2007-09-27 10:36
    Thanks for your quick answer but i have only some slight ideas what you are talking about because im very new to this topic ...

    Could you provide some sample code that helps me understanding ?

    I want to build a small Light Controller with 12 channels that i can fade in/out tap some lights ...
    So i want to control a Dimmerpack via DMX ...
    Maybe much much later in version 5 i will want to add some more channels and maybe support for some more lights maybe also some intelligent lights. But this is far in the future and i would want to start with something more simple at the beginning
  • GadgetmanGadgetman Posts: 2,436
    edited 2007-09-27 10:39
    I believe that someone has already implemented a DMX Receiver on the Propeller.

    http://forums.parallax.com/forums/default.aspx?f=25&m=152364&g=152445#m152445
    (Should be some useful stuff in that thread if you want to do a transmitter)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Don't visit my new website...
  • BTXBTX Posts: 674
    edited 2007-09-27 11:44
    Hi hjansen.

    Here's a DMX object
    http://forums.parallax.com/forums/default.aspx?f=25&m=132052

    It's done by Timothy D. Swieter, it is so simple, and it works fine !!
    The driver also has a little schematic to use it directly with a SN75176 RS485 driver/reciever.

    Good luck.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Regards.

    Alberto.
  • hippyhippy Posts: 1,981
    edited 2007-09-27 13:00
    DMX transmission is far easier than reception. Conforming to the pre-1990 DMX-512 USITT specification is more difficult than post-1990. The later is nothing more than a 250,000 baud serial stream, the DMX break can be achieved by lowering the baud rate and sending $FF ( or is it $00 ? ).

    Bit-banged from a Cog, it should be remarkably easy to generate the necessary signals for either USITT spec. Ideally, provide a flag to the Cog to indicate whether 4uS or 8uS+ Mark after break bit should be used.

    Instead of having the Cog simply churn an array of up to 512 bytes of channel data out, you can have three arrays; channel level required and a cross-fade time and the third maintained by the Cog to indicate what level was last put out. It should be possible to have a single Cog not just output the channels but also handle smooth cross-fades between scenes. That could take a lot of load of your main controller.

    You can go further and add lamp pre-heat and lamp 'law' ( S-Law, linear, switched etc ) arrays as well, and let the Cog deal with them. If one Cog doesn't have the necessary' oomph', multiple Cogs could be used.

    You may also want to add a flag which indicates when the DMX transmitting Cog should run to avoid 'aliasing'. That's where the Cog continuously repeats the output and can result in an output stream with some channels having changed but others haven't. That may not be a problem in your particular application.

    If you want to deal with lamp levels of 0..100% in your array of channel outputs instead of 0..$FF, that should be easy enough to handle as well.

    The Propeller Chip is probably one of the best processors suited to DMX output.
  • Ziggy252Ziggy252 Posts: 32
    edited 2007-09-27 14:53
    I'm in the process of building a complete lighting console around the Prop. I'm having to get rather creative to make things fit well (for example a single cog does DMX and analogue output and pulls in fader settings from an ADC). So far, the trickiest bit has been coming up with a way to perform about 300,000 multiplications a second (to calculate the influence of recorded scenes being played back at different levels). I have an algorithm that works on paper - an 8x32 multiplier with an AND in the middle so that the four bytes stay separated - but I won't get to try it till tomorrow. By the time I'm finished, I should have a 48/96 channel console with scenes, sequences and chases, and probably a PS2 mouse / trackball to control moving lights. I'm using Chip's Hires VGA Text object, but I'm having to write most of the rest because of the need to use a lot of my cogs to do multiple tasks.

    I hope to get stuck into it in the morning, if I'm not interrupted by too many people tomorrow I should have at least a few cogs' worth of code to post.

    TTFN,
    Robert.


    BTW,
    Hippy:
    Are you the same Hippy from the OpenDMX widget mailing list a few years back?

    Edit: insert missing word - hey it was 1am!

    Post Edited (Ziggy252) : 9/28/2007 12:06:44 AM GMT
  • hippyhippy Posts: 1,981
    edited 2007-09-27 18:42
    Ziggy252 said...
    Hippy: Are you the same Hippy from the OpenDMX widget mailing list a few years back?
    No, that must be another one. The sixties may be over but there are a lot of us hangin' on in there smile.gif
  • big_markbig_mark Posts: 49
    edited 2007-09-27 23:15
    Hi

    I used Timothys code when I built a DMX receiver. If you are planning on using it there are a few issuses you should know about. I had a conversation with Timothy a few months back, part of which dealt with these issues. Take a look here.

    If you fancy a challenge, you could always have a go at implementing the Artnet protocol. An Xport should work well as an ethernet interface, and there should be some Prop code from the Y-box website to get you going.
  • Timothy D. SwieterTimothy D. Swieter Posts: 1,613
    edited 2007-09-28 13:09
    Thanks guys for the credit on the DMX driver.· big_mark is correct, there are a couple things I need to review in the driver to make it more robust or universal.· Believe it or not, in the next two weeks I should be dusting off the old code and reviewing it for a product that will be on display at the LDI trade show in Novemeber.· At that time I will review what was discussed in past forums and post an updated driver on the object exchange.

    I second the comments that the Propeller is a great microcontroller for DMX reception or transmission.· A single Cog has no problem handling all 512 channels with an ASM driver.· I wouldn't stop there, the Propeller is great in so many applications.

    Sorry hjansen·that I don't have any specific advice on creating a driver for transmission. The schematic is simple for the electrical portion.· From there I would say a cog needs to have a buffer of bytes for the 512 values.· A seperate Cog (or more) can then write into the buffer for performing the cross fades or other effects.

    I like you idea big_mark of doing artnet.· I looked into that a while ago (about the same time we had the conversation about LEDs in my living room) but got distracted with higher priority work.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Timothy D. Swieter
    tdswieter.com
    One little spark of imagination is all it takes for an idea to explode

    Post Edited (Timothy D. Swieter) : 9/28/2007 2:32:26 PM GMT
  • Paul Sr.Paul Sr. Posts: 435
    edited 2007-09-28 14:18
    hippy said...
    The sixties may be over but there are a lot of us hangin' on in there smile.gif

    Here, here!!
  • DynamoBenDynamoBen Posts: 366
    edited 2007-10-02 16:50
    Timothy D. Swieter said...

    I like you idea big_mark of doing artnet.· I looked into that a while ago (about the same time we had the conversation about LEDs in my living room) but got distracted with higher priority work.
    I also like the idea of ArtNet.·But recently·I've been thinking about using DMX-over-ACN instead of ArtNet. DMX-over-ACN looks to be a little easier to implement and will soon be the industry standard as opposed to·ArtNet which is proprietary.

    To check out the DMX-over-ACN spec go here: http://www.etcconnect.com/news.asp?id=20065
Sign In or Register to comment.