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

DMX Transmission

rapscaLLionrapscaLLion Posts: 75
edited 2009-07-08 05:50 in Propeller 1
So I've spent the last week playing with the Propeller and the education kit (waiting for my starter kit to arrive, they where on back order).
I figured out the basics of spin, got a B420 lcd screen fired up and working, hacked a 9V 300mA adapter onto the board. Now it's time to attempt
an interface to DMX, and here is where I am running into a wall. My problem is, I don't have much experience with programming at such a low
level (granted, spin is pretty high level, but the hardware is not). I am working based off of this site: http://www.dmx512-online.com/packt.html
although I will probably buy the full DMX spec sooner or later.

I am trying to communicate with some DMX units I have, some older, some newer. However, I don't understand how to program for communication
at 250Khz, it seems that accurate timing at that speed is not possible. I'm sure I am just not understanding something here, and I have looked at the
DMXIn object from the forums, but I don't understand assembly (yet?) so that hasn't helped.

PS: I am using a SN75176.

Can anyone help with some advice?


Thanks!
«1

Comments

  • BTXBTX Posts: 674
    edited 2007-02-13 01:33
    Look at this !!
    http://forums.parallax.com/forums/default.aspx?f=25&m=132052

    There is a good DMX demo code made by Timothy D. Swieter

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

    Alberto.
  • rapscaLLionrapscaLLion Posts: 75
    edited 2007-02-13 02:00
    Thanks, but that's the DMX object I already looked at, it is for recieving only and in assembly, so it doesn't help me much [noparse]:([/noparse]
  • Timothy D. SwieterTimothy D. Swieter Posts: 1,613
    edited 2007-02-13 17:52
    rapscaLLion·-
    ·
    Glad to see you are jumping into using the Propeller for DMX.· One of the first things I thought of when I first read about the Propeller was its use in DMX because of the processing power!·
    ·
    You are correct in that the software I wrote and is found in the forums is used to receive DMX.· Do study it though because it will help you understand the method for receiving the signals - sending them out is only slightly different.· To get the proper BAUD rate I believe you have to use assembly, there may be some fancy Spin tricks, but I doubted that when I created my code last year.·
    ·
    The DMX object I created was based on the Serial Object included with the programming tool - I think maybe Chip wrote that file.· I studied the assembly code of the receive portion of the driver and wrote the other software around it to receive a DMX packet.· You too should study the serial object to understand how it sends and receives data.· Then start modifying the driver to send a DMX packet.·
    ·
    At the moment I wouldn't spend the money on the DMX Spec.· The information found on the web site you referenced should be enough for now.· There is a couple other website that may help and recently Show Control, a Yahoo Group, had a good discussion on sending DMX compatible for older instruments.· I am sure there are several tricks out there for sending DMX to make it friendlier to those companies that interrupt the standard differently.·
    ·
    Your application may have something like this
    -1 COG for sending the continuous stream of DMX
    -1 COG for general overhead
    -1 (or more)·COG managing user input, loading shows from various media, etc
    ·
    Keep trying.· If I get time I may look into doing the code for sending DMX because I have had several people request it.· I would not count on it happening soon, I just got married and in a month or two I am moving China (and taking my Propeller development tools too - I hope).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Timothy D. Swieter
    tdswieter.com
    One little spark is all it takes for an idea to explode
  • rapscaLLionrapscaLLion Posts: 75
    edited 2007-02-13 19:38
    Thanks.
    I have been looking over your DMX input code and I think I might be starting to get the drift.
    Wish me luck!
  • Teva McMillanTeva McMillan Posts: 11
    edited 2007-02-13 20:25
    rapscaLLion,
    I have already written and tested code to transmit DMX, it currently has an issue where is takes a couple mins to start working, likely waiting for the clock to roll around.
    I send the code to a friend with a scope, and much much better understanding of the propeller, he will likely have it fixed today. I will post the code sometime tonight.

    Can I ask what you are using the lighting for? and what input device you plan on using to control your lights?

    My next little project will be to make small box with input/output and usb to program the box. My hope to to be able to do much more interesting effects then I can currently with the Elation DMX operator pro controller that I have. The Operator Pro has a side for controlling moving head, scanner type lights and also a completely separate par can side. My aim is to use the propeller to take input from the par can side and change outputs of the other side to do some more interesting lighting affects. Also I am going to add some switches etc to the propeller since the dmx contoller only has on button that has direct affect, (turns all par can on full), I want to have some buttons to mash on tongue.gif

    Anyhow, I hope that the code I have written will save you time, as it was a wee bit challenging to get the assembly working correctly.
    -Teva
  • rapscaLLionrapscaLLion Posts: 75
    edited 2007-02-13 21:50
    Hi,

    Thank you so much, I would really appreciate that code. I have been fiddling around myself, and made some generic assembly code but it still isn't working. I just don't have enough assembly experience. I am actually driving some LED color changing lights to light up a room, the propeller would generate the colors and output to the dmx via four channels that correspond to R, G, B and W. There really is not input per say, although certain settings can be changed via an lcd display and three buttons, which I have working already. Pretty boring stuff lol!

    Anyways, I would greatly appreciate taking a look at that code, even if you can't solve the holding problem.

    Thanks!
  • Eric REric R Posts: 225
    edited 2007-02-13 22:16
    I would also be interested in your code. I will be driving a pair of Chauvet Intimidators and whatever else I can get my hands on·this year. Still looking for a couple DMX fog / haze units,·couple moving head spots and a couple Chauvet Scorpion lasers.
  • boeboyboeboy Posts: 301
    edited 2007-02-14 00:43
    Sorry to sound ignorent but what is DMX?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    lets see what this does... KA BOOM (note to self do not cross red and black)
  • Paul BakerPaul Baker Posts: 6,351
    edited 2007-02-14 00:45
    Its a communication protocol to control professional lighting and other scene devices.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • Eric REric R Posts: 225
    edited 2007-02-14 00:46
    boeboy said...
    Sorry to sound ignorent but what is DMX?

    It is a type of communication used to control lighting (like what is used for concerts)
  • boeboyboeboy Posts: 301
    edited 2007-02-14 00:58
    Thanks.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    lets see what this does... KA BOOM (note to self do not cross red and black)
  • rapscaLLionrapscaLLion Posts: 75
    edited 2007-02-14 06:43
    Originally, electric stage lights where controlled via large "dimming" stations, and one huge lever would operate one light. This system was bulky, loud and could be very dangerous. A system was developed whereby the electric dimmers could be hidden away in a seperate room, and operated via remote control. Originally this was done via motors that would operate the large levers, until technology advanced far enough to have electronic dimmer control. From there a few protocols where developed to interface the dimmers to the "control desk". Today the most common protocol is DMX. Many consumer level products will use MIDI, but DMX is the professional standard, and is now used to control everything from simple dimmers to strobes, fog machines and intelligent lights. Because it has minimal error checking it is not safe for use in operating any moving machinery, setpieces, etc that could cause damage or injury. It is based on serial RS485 standards, too facilitate long cable runs. As for the standard itself, it is very simple, consisting of a "start" sequence followed by a string of 8-bit values (0 - 255). A dimmer pack would take each value and assign it in order to the appropriate dimmer, an intelligent light might translate that into motion, etc.

    Highly useful for all kinds of control, as it is standardized (at least theoretically) and readily available and supported.
  • Teva McMillanTeva McMillan Posts: 11
    edited 2007-02-14 07:06
    Well, my friend did not have time today.

    I am posting it anyhow. I may have found the issue, but my test board need to be re assembled which I don't have time for.

    Try commenting out the section I mention to see if the delay goes away.

    I am really sorry about the delay, it takes a very long time due to I think needing to go through the entire 32bit counter. [noparse]:([/noparse]

    About maybe 2 mins.

    Once it starts working it should work with almost anything, the output should look perfect due to how the counter is used.

    Eric,
    Currently I have my hands on: 6 martin scx scanners, 2 roboscan 812's 3 american DJ accu rollers, 1 elation 4pack dimmer, and a martin atomic strobe. smhair.gif The strobe is insane, it uses more power then everything else.

    I have not got into lasers yet, tell me what you think of the Chauvet Scorpions when you get them maybe?

    -Teva
  • rapscaLLionrapscaLLion Posts: 75
    edited 2007-02-14 19:03
    Hi,

    Thanks for the code, for some reason I could not get it working. I have it wired up properly, and get it started succesfully,
    however no matter how long I wait it doesn't connect with the lights. I put a led across A and B and it indeed took about 30 seconds
    to light up, but no change in the lights.

    Any ideas?
  • rapscaLLionrapscaLLion Posts: 75
    edited 2007-02-14 21:57
    Ok scratch that, I got it working with some old scanners I had lying around. I'm not sure how I got it working, but I did set the packetsize to 64, not sure if that has anything to do with it. (I'll varify that later).
    There was indeed a pause before it started to work, but only about 20 seconds. I placed an led across the A/B as an indicator, it work's great.
    The other lights I am using still don't work tho... I opened them up and looked inside, the use a JPK (http://www.jpk.co.nz/) 8 channel reciever.
    I know they work, as they run fine off the various DMX controllers I have, but they simply won't communicate with your code [noparse]:([/noparse]
    Out of curiosity, what lengths did you use for MAB, MBF, etc?

    Thanks,

    Alex
  • rapscaLLionrapscaLLion Posts: 75
    edited 2007-02-14 22:42
    Ok, just to add another dimension of oddity, I have just realized that the LED light is indeed picking up the DMX signal.
    The red DMX-RX indicator light comes on, but ONLY when all the DMX levels are at zero. Any other level and the DMX
    reciever light goes out. If I set the levels with a dmx controller, then switch the cable over to the propeller board, the
    lights will zero when DMX is at zero, but any other level the light fails to recieve. What could be going wrong here?
    The other lights I have recieve no problem!
  • rapscaLLionrapscaLLion Posts: 75
    edited 2007-02-14 23:11
    Alright, to bring this saga to a close, I have finally figured out the problem. I didn't realize that the code took the value from the DMXData[noparse][[/noparse]0]
    during the start bit. This should not have been a problem, however the LED light (or more specifically the JPK reciever) only accepted input with
    a start bit of zero. I'm not sure that this conforms to DMX standards, as I thought the start bit was unspecified, but regardless I have fixed the
    problem by ensuring the start bit is always at zero.

    Thanks so much for the code Teva, it works beautifully now. The only issue is the pause before output, which for me varies between 10 and 50
    seconds for some reason. The code you said to comment had no visible effect, the hold was still there.

    Thanks,

    Alex
  • Paul BakerPaul Baker Posts: 6,351
    edited 2007-02-14 23:28
    The line which is causing the problem is the waitcnt instruction in the routine tx. CNT is a read only register but waitcnt is trying to add txticks to it, changing this to waitcnt txcnt, txticks (with the initial cnt target code left in) should get you closer to the correct solution (I say closer, because I don't know if thats the only problem with the code). Or just comment it out if you think no waiting is nessesary.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • rapscaLLionrapscaLLion Posts: 75
    edited 2007-02-14 23:46
    Thanks Paul, you where absolutely right. That one simple line has fixed it, and the whole DMX function works perfectly!

    You guys are all awesome!
  • Eric REric R Posts: 225
    edited 2007-02-15 00:17
    rapscaLLion said...
    Thanks Paul, you where absolutely right. That one simple line has fixed it, and the whole DMX function works perfectly!

    You guys are all awesome!
    Interested in posting the working code?
    I have not had a chance to sit down and work with it yet. It sure would be a time saver for all interested.
  • rapscaLLionrapscaLLion Posts: 75
    edited 2007-02-15 00:53
    The working code is attached. Only one line is changed from Teva's original posted code.

    Include this as an object, use the start command to initialize and then use the write command to set the channel values.
    Easy as pie.
  • Eric REric R Posts: 225
    edited 2007-02-15 03:50
    Teva McMillan said...
    Eric,
    Currently I have my hands on: 6 martin scx scanners, 2 roboscan 812's 3 american DJ accu rollers, 1 elation 4pack dimmer, and a martin atomic strobe. smhair.gif The strobe is insane, it uses more power then everything else.

    I have not got into lasers yet, tell me what you think of the Chauvet Scorpions when you get them maybe?

    -Teva
    It would be nice to have equipment like yours but I am going as low budget as possible. These will sit outside as part of this years Christmas display. I did pickup a Chauvet Aurora a few weeks back but on DMX I was not happy with its capabilities. It is now stripped getting a BS2 and a few HB-25s. I will post pictures on that when it is done. This will give me the control over the fixture that I was looking for. Should have used a Propeller but just haven't had the time to learn. Hope I will soon.

    I will let you know how the Scorpion works out. I have·three 532nm lasers and some mirrors here but didn't want the liability in the event of a home-brew failure.

    That atomic strobe would be awesome. I am using 16 walmart strobes this year with a modified trigger. I used 8 last year.

    Thanks for the code


    Link to last years Christmas display http://www.youtube.com/watch?v=z5VT3buv4TQ
  • Timothy D. SwieterTimothy D. Swieter Posts: 1,613
    edited 2007-02-15 15:02
    The DMX start code, the first byte, should be zero.· The DMX standard states that it should be zero.· In the early days of DMX, some manufactures just igonored the start code and listen to everything no matter the start code.· Last year the DMX standard was updated for Remote Device Managament (RDM).· RDM allows the user to use DMX to set instrument parameters such as the DMX address or read parameters like lamp life hours.· In order to use RDM, the start code is different based on the manfucaturer.· So, for transmitting channel data please do ensure the start byte is zero.

    I am glad you got your code working!!!!· It is so exciting.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Timothy D. Swieter
    tdswieter.com
    One little spark is all it takes for an idea to explode
  • Teva McMillanTeva McMillan Posts: 11
    edited 2007-02-16 01:53
    Eric,
    That is quite the show! How many dimmer packs are you using? I like Chauvet Aurora, pretty cool for how cheap it is, I am interested in how it turns out, might get and modify one myself. It uses DC motors? Most gear seems to all uses steppers..
    Well all 16 together might be close to the Atomics power. The great thing about it is the control, you can control intensity very finely.

    Timothy,
    Can I post your Input code into the Object Exchange?
    I already finished cleaning up some of the documentation.
    I just want to post them together.

    I will eventually do a complete rewrite with code that can do multi channels and input/output in the same cog and have various timing features to line up output so that delays can be minimized. For now though its works pretty well!

    Anyone reading this thread,
    Please test this code if you are interested and report any non working hardware, I would really like to find any bugs while the code is still fairly simple!
    When trying the code, and a certain device does not work, try adjusting the MAB and other timings, I have it set fairly tight some devices could require looser timings, I would love to know what devices I need this.
    -Teva
  • rapscaLLionrapscaLLion Posts: 75
    edited 2007-02-16 03:45
    Hi,

    I would hardcode the startcode as being 0, to avoid people like me making that mistake [noparse]:)[/noparse]
    Otherwise the code works like a charm! I have had no problems with it since I got it working!
  • Timothy D. SwieterTimothy D. Swieter Posts: 1,613
    edited 2007-02-16 13:16
    Feel free to post my code in the Object Exchange, I have not gotten around to it myself. Just give credit where it is due.

    If I remember correctly, in my code I had all 512 values of DMX avaliable in an array. That was one of the cool parts of the Propeller, the speed of the code, and the cog.

    Keep up the good work!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Timothy D. Swieter
    tdswieter.com
    One little spark is all it takes for an idea to explode
  • Eric REric R Posts: 225
    edited 2007-02-17 03:32
    Teva McMillan said...
    Eric,
    That is quite the show! How many dimmer packs are you using? I like Chauvet Aurora, pretty cool for how cheap it is, I am interested in how it turns out, might get and modify one myself. It uses DC motors? Most gear seems to all uses steppers..
    Well all 16 together might be close to the Atomics power. The great thing about it is the control, you can control intensity very finely.
    -Teva
    Thanks,

    This display isn't a DMX setup. It is·from another manufacturer,·it·was 96 channels for the 2006 season.
    I thought the Aurora would be steppers also but it turned out that they are DC gear motors.
  • Teva McMillanTeva McMillan Posts: 11
    edited 2007-03-08 03:23
    I have modified the transmit code to allow random packet sizes, I am hoping to have it tested (by transmitting from one cog to another) and posted next week sometime. Just thought I would update on progress.
    -Teva
  • DynamoBenDynamoBen Posts: 366
    edited 2008-01-02 01:41
    Any updates on this object. I will be doing some in-depth testing with a DMX tester in the coming weeks and want to have the most recent revision.
  • Teva McMillanTeva McMillan Posts: 11
    edited 2008-01-02 07:56
    I have some updated code I can post this week I hope.

    btw what project are you using it for?
Sign In or Register to comment.