Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 12 of 12

Thread: Making a DMX breakout board for all teensy form factors

  1. #1

    Making a DMX breakout board for all teensy form factors

    Hello,
    I am wanting to develop a breakout board or shield (still not sure of the technical difference) that will work with all version of Teensy. Specifically I am looking to make a shield that accommodates an XLR plug for adding DMX capability to the teensys. Does anyone have advice about how I could incorporate the different sizes of the 3 teensys and their different pin spacing to make a cross-compatible good board?

    Further, if anyone has any custom Eagle parts for the teensy, I'd love to have them.

    Lastly, am I correct that all I should need for the DMX board is a rs485 transceiver and a resistor?
    Thank you.

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,574
    Will your board be transmitting DMX, or receiving? That matters.

  3. #3
    Senior Member
    Join Date
    Jun 2013
    Location
    Montréal
    Posts
    467
    While we're on the subject, is there a good library that supports receiving DMX on the Teensy ?

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,574
    This is the best DMX receive code so far:

    http://forum.pjrc.com/threads/19662-...ll=1#post24993

  5. #5
    Quote Originally Posted by PaulStoffregen View Post
    Will your board be transmitting DMX, or receiving? That matters.
    It will be transmitting. I'm interested in why it matters (because I'd love to do both) but it will be transmitting DMX

  6. #6
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,574
    Transmitting is simpler. You really only need 1 signal, from the Teensy to the driver input on the RS-485 chip.

    If you use DmxSimple, any pin can transmit. I believe the default is pin 3, but it's easily changed in the code.

    Currently there's no library that uses the hardware serial port to transmit. Someone really ought to make this. Maybe I'll do it at some point? When/if this ever happens, it'll be only for Teensy 3.0, and it'll transmit from pin 1 (to leverage the FIFO, which is only on Serial1). So you might use pin 1? Or you might put a jumper on your PCB, so either pin 1 or pin 3 could connect to the RS-485 chip?


    Receiving technically only needs 1 signal also. Of course, you'll connect the RE and DE pins on the RS-485 chip so the driver is disabled and the receiver is enabled. But typically DMX receivers have 9 dip switches to set the DMX address they parse. Or some have a little 7 segment display with 3 digits to show the current address, and recessed pushbuttons to change it. Obviously the display approach has better usability. In theory, you could just embed the address into your code and upload from Arduino to change the address. But if this is going to used in any sort of project where multiple people are installing DMX gear, being able to easily set the address is pretty much essential.

  7. #7
    Senior Member
    Join Date
    Jun 2013
    Location
    Montréal
    Posts
    467
    A lot of DMX fixtures use more that 1 universe these days (led walls for instance)
    Would the Teensy 3 be powerful enough to support multiple universes via different uarts ? ?

  8. #8
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,574
    Quote Originally Posted by nlecaude View Post
    Would the Teensy 3 be powerful enough to support multiple universes via different uarts ? ?
    Again, are we talking about transmitting to connectors or receiving from them (and presumably doing something like OctoWS2811 for thousands of LEDs)?

  9. #9
    Senior Member
    Join Date
    Jun 2013
    Location
    Montréal
    Posts
    467
    Both would be useful for me At the moment though receiving would be a must. I'm working on a project with ~350 WS2811 leds where the goal would be to record sequences on an sd card via dmx. The other option would be to use artnet but I did not find any library that supports multiple universes...

  10. #10
    Quote Originally Posted by PaulStoffregen View Post

    Currently there's no library that uses the hardware serial port to transmit. Someone really ought to make this. Maybe I'll do it at some point? When/if this ever happens, it'll be only for Teensy 3.0, and it'll transmit from pin 1 (to leverage the FIFO, which is only on Serial1).
    I see...So is the advantage of using the hardware serial port that you can use the FIFO? Are there any other benefits?


    Quote Originally Posted by PaulStoffregen View Post
    Receiving technically only needs 1 signal also. Of course, you'll connect the RE and DE pins on the RS-485 chip so the driver is disabled and the receiver is enabled.
    This means the RS-485 transceiver/driver can not receive and drive at the same time? If I were to use to MAX485s could I do this?

    Quote Originally Posted by PaulStoffregen View Post
    typically DMX receivers have 9 dip switches to set the DMX address they parse.
    So a Teensy could drive 512 channels of DMX simultaneously but receive/parse only one?

    Quote Originally Posted by PaulStoffregen View Post
    But if this is going to used in any sort of project where multiple people are installing DMX gear, being able to easily set the address is pretty much essential.
    Is the point of making an Arduino compatible board a DMX receiver enabling RDM? Or is it to trigger events on the arduino with DMX from another source (another arduino or lighting board)?

    Regardless, the original question I had was about the form factor for a breakout: I believe the teensys have different spacing-obviously a different form factor. Are there suggestions on how to design a most compact breakout board (for DMX) that would work for all teensy form factors (2, ++ and 3)? Additionally, am I correct in assuming that all I need on the PCB is the driver chip and a resistor? Thanks

  11. #11
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,574
    Quote Originally Posted by computersarecool View Post
    I see...So is the advantage of using the hardware serial port that you can use the FIFO? Are there any other benefits?
    Have you actually used DmxSimple yet? Did you notice any problems or limitations?

    I could write a lengthy, highly theoretical message about concurrency, interrupt latency and other subtle software issues, but I'm going to keep this breif instead.

    This means the RS-485 transceiver/driver can not receive and drive at the same time? If I were to use to MAX485s could I do this?
    Well, this may be overly obvious, but if have the receiver enabled while you enable the driver, it's only going to receive whatever you're driving on to the wires. RS-485 isn't designed to gracefully deal with multiple conflicting chips driving on the line simultaneously (like CAN bus), so there's really no point to turning the receiver on while transmitting

    All the 8 pin RS-485 chips place those 2 control signals next to each other, and they have opposite polarity (high enables the driver, low enables the receiver), because the vast majority of applications connect those 2 pins together and drive them with the same signal, to enable either the transmitter or the receiver. You might want to shut them both off, to save power, which is the main reason the chip has 2 pins. You can turn them both on too, but there really no good reason to do so.

    DMX products are pretty much all designed to either always transmit (controllers) or always receive (dimmers).

    So a Teensy could drive 512 channels of DMX simultaneously but receive/parse only one?
    Did you run Ward's DmxReceiver code, or even look at the code yet? Really, I'm trying to respond to questions here, but at some point you've really got to take your project by the reins and dig into these technical details.

    Just a quick look at Ward's code should reveal it receives all 512 channels. You then call the getDimmer() function to look at the ones you want. It's really pretty simple.

    Have you used any commercial DMX dimmer or lighting products? Nearly all have dip switches or a display. Maybe you don't need that? But if it's going to be used by other people in some sort of production or entertainment environment, odds are good the address they might need to be reassigned if some other DMX device is already installed listening to the same address. Your code can call Ward's getDimmer() function to read any address, but if you don't design your hardware with some sort of user interface to set that number, then how will your code make use of getDimmer() in a way that's field configurable?

    Regardless, the original question I had was about the form factor for a breakout: I believe the teensys have different spacing-obviously a different form factor. Are there suggestions on how to design a most compact breakout board (for DMX) that would work for all teensy form factors (2, ++ and 3)?
    All Teensy boards have pins with 0.1 inch pitch, where the 2 sides are 0.6 inches apart. All have GND and +5V in the same positions on the left side (the side with the USB connector). Each board has a different pinout. But you could use pin 3 on Teensy3 and simply adjust to pin 2 if a Teensy++ 2.0 is plugged in.

    There are Eagle libraries here. If you're making a PCB, that's the place to start.

    http://www.pjrc.com/teensy/eagle_lib.html

    If you search, you can also find thread on these forums where the Eagle libraries have been discussed in detail.
    Last edited by PaulStoffregen; 12-04-2013 at 08:16 PM.

  12. #12
    Thank you for your help. I obviously need to learn to be a better question asker, something I will do. This forum is a great resource.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •