Author: dmcole | Date: June 29, 2009 | Please comment

If you’ve visited my automated Christmas lights page, the letters DMX won’t be unfamiliar to you. For those too lazy to click, it’s an electronic lighting protocol. Two wire. Used extensively in stage shows. And, in recent months, adopted by the DIY Christmas lighting community.

Henne’s DMX transceiver schematic (click to download PDF).

Henne’s DMX transceiver schematic (click to download PDF).

So, I’m working on an idea (I’ll post more when I get closer to the finish) that I want to add to my Christmas lights show, and it therefore needs to talk DMX. Numerous previous postings here will tell you that would mean I’d need to do this on an Atmel chip. Though there are a lot of DMX projects done on Microchips (PICs), fewer have been done on Atmels. And pretty much everyone who has done DMX on the Atmel has based some or all of their work on that of Hendrik Hölscher.

Fortunately for those monolinguists among us, Hendrik – who goes by “Henne” – writes in both German and English. He’s also moderately active on one of the Christmas lights forums.

My initial plans were to write my own code to get my idea off the ground; a few months(!) of fiddling around and I was never even able to pull off my main effect, no less receiving DMX.

During that fiddling, I ran across a web site in Germany that sold a bare printed circuit board for Henne’s basic DMX transceiver. It took PayPal, so I bought a couple of boards. And the next time I dropped by Jameco, I took along the bill of materials for the transceiver and bought the parts.

Then life intervened. It wasn’t until earlier this month that I got back on track on this project, which started out with a redrawing of Henne’s schematic. I then wanted to build the circuit on a breadboard. The design requires an external crystal and while I knew of the potential to “brick” the 8515, I didn’t think said bricking would be quite so easy.

So easy, in fact, that I bricked two.

The problem (for me, anyway), was a lack of understanding of terminology. While I’d started out using AVRDude on the command line, I somewhere along the line stumbled across AVRFuses, a Mac application that puts a graphical user interface on top of AVRDude.

Anway, AVRFuses uses the same terminology as FuseCalc and I find (found) both of them to be opaque. Suffice it to say, the 8MHz crystal used in Henne’s design is designated as “Ext. Crystal/Resonator Medium Freq.; Start-up time: 16K CK + 4 ms; [CSEL=1101 SUT=10].”

So, another trip to Jameco and this new-found knowledge (thanks Limor) and I had a functioning 8515.

But not a functioning circuit. The version displayed here clearly shows a ground on Pin 5 of U2, the 75176B, as well as five-volt power to Pin 8. Well, apparently some schematic-drawing programs don’t indicate such niceties and the drawing I was basing my work off of didn’t. So I sat here for almost two days, banging my head against the wall trying to figure out why the breadboarded circuit didn’t work. I wonder if I would have ever figured it out without help.

As Henne says, this is a simple circuit, with virtually all the heavy lifting happening in the software of the 8515. Suffice to say, U2 (the 75176B), an RS485 transceiver, receives the DMX signal and turns it into something the UART on the 8515 can read. The 8515, in turn, processes the signal and outputs it onto pins 32-39 (unless one of the many options is chosen, in which case signals can come out of the J4 Spare port as well).

Henne doesn’t explain why he chose the 8515 – it’s a big chip, taking up quite a bit of board real estate, and it’s not inexpensive (I’m too lazy to look it up, but I’m pretty sure that last winter when I bought the first set of these chips at Jameco, they were $4.50+/-; last week’s purchase they had gone down to $3.50. I just looked them up and at Mouser and Digi-Key, they’re $5.27). But for an eight-channel project (potentially 16-channel) that has DIP-switch control of the DMX start channel (another 10 pins), this really can’t be done in less than a 40-pin chip.

(Oh, and a note on the licensing: I had included my standard Creative Commons, Noncommercial Share-Alike license on the schematic and Henne asked that I remove it. In deference to the original author, I did. None of his schematics have licenses on them and he wrote, “You cannot license the schematic under cc since its based on my schematic / hw where unauthorized commercial production is prohibited. [This is necessary if some companies produce the boards in larger quantities...] I don’t want anyone to get into trouble…” Now you know what I know.)

Using Henne’s “board.hex” testing software, the red LED flashes a steady beat once power is applied; turning on DIP 2 (or, as in my case, shorting Pin 22 to ground), the green LED should light if the crystal fuses are set correctly.

Anyway, I finally got the circuit working on Saturday. Now, to add a couple of sub-circuits and get this idea – which I’ve been working since December 2007 – afloat.

4 Comments. Add yours!

  • Henne
    10:29 am on July 6th, 2009

    I chose the mega8515 because it was rather cheap (1,80EUR) and has many pins. (The mega8 cost 1,25EUR and has less pins. The TINY2313 has not enough flash mem for many applications.)

    best regards,
    hendrik

  • dmcole
    11:28 am on July 6th, 2009

    Thanks for the clarification Hendrik. I did realize the issue of the memory differences and should have included them in my post.

    \dmc

  • andy
    3:44 pm on November 18th, 2009

    Hi,

    I’ve built hennes dmx circuit but have never built anything like this before. How do I programme the chip to work in the circuit and what tools will i need to do this? (can it be done by tll)

    Have you got it controlling any sub circuits yet?

    Thanks in advance,

    Andy

  • dmcole
    3:58 pm on November 18th, 2009

    Andy:

    Here’s a basic how-to on programming Atmel chips:

    http://www.dmcole.net/index.php/taking-the-atmega8-for-an-introductory-spin/

    But you should be able to get way more info simply by doing a search for “programming atmel chips” or somesuch.

    I was able to get this breadboarded circuit to drive an 8 x 8 set of LEDs, but it didn’t perform the way I wanted it to and for now I have abandoned it.

    Best o’ luck.

    \dmc

Leave a reply