I'm planning an integrated DMX512 4 channel SSR board.
Since SSR boards are boards that I'll be making many copies of, containing cost is a priority.
I'm looking for the cheapest microcontroller I can find that'll support 6 I/O pins. The cheapest I've found that might (might) work is the PIC16F54, which retails for $0.48 in single unit quantities.
I'm not at all certain that I'll be able to get the project working with this chip. Receiving serial data at 250 kbps while simultaneously dimming 4 channels, without a UART, without interrupts, and with only an 8-bit timer (with no overflow interrupt!) is going to be a challenge, to say the least.
So I'm hoping some of you might know of some dirt cheap non-Microchip parts that might interest me.
My personal opinion is that you are not going to be able to receive DMX without the use of a UART. One micro that has a built-in UART is the 89LPC903, which was mentioned in another thread here. It is an 8051-style micro from Philips. I've never used it nor read the datasheet in detail, so I can't really comment on it.
YMMV.
The problem is that a UART adds a dollar or more to the cost of the chip.
Receiving data without a UART isn't too hard (well, at least not when you can detect the start bit with an interrupt and have a timer interrupt).
The 8051 you pointed to costs over three times the cost of the 16F54. Which is no big deal if you're making one SSR board, but if you're making fifty, that money can add up.
P. Short wrote:My personal opinion is that you are not going to be able to receive DMX without the use of a UART. One micro that has a built-in UART is the 89LPC903, which was mentioned in another thread here. It is an 8051-style micro from Philips. I've never used it nor read the datasheet in detail, so I can't really comment on it.YMMV.
For what its worth, i'll be really impressed if you can reliably do DMX ( at 250kHz ) without a UART either, on a really low cost chip. Never say never, but it seems pretty unlikely..
maybe you coudl look at the PIC16F688.. Its the lowest cost PIC with a UART on it, internal clocking and enough IO pins.. mind you then you could probalby just use the code that has already been done..
My estimate is that you need to execute instructions at approximately 25 times the bit rate in order to do a software UART while doing three or four PWM outputs at the same time. That is my experience with the the PIC10F200, anyway. Using this rule you would need to be able to execute around 6 Million instructions/sec to handle DMX512 speeds. To do this with a PIC would require a clock rate of 24 MHz, which (if the PIC could handle this clock rate), which needs more pins for the resonator/crystal.
Maybe something out of the ATtiny family would work, as I think that they have a smaller internal clock divisor.
NogginBoink wrote:The problem is that a UART adds a dollar or more to the cost of the chip.Receiving data without a UART isn't too hard (well, at least not when you can detect the start bit with an interrupt and have a timer interrupt).
The 8051 you pointed to costs over three times the cost of the 16F54. Which is no big deal if you're making one SSR board, but if you're making fifty, that money can add up.
If you take a look at your BOM I suspect that you will find that the cost of the micro is not the dominating factor. In my 1-channel SSR project the micro is only about 1/3 of the cost, the rest is PCB, SCRs/Triacs, connectors and the like. I suspect that the same thing will be true of your project, with the added advantage that the microcontroller costs are divided over four channels.
This is all good input. Like I said, I'm not at all certain I could do it, but pondering the challenge is kind of fun. I'll let the board know if I go anywhere with this.
Noggin, I'm considering a similar idea, so we should talk at some point...
I also came to the conclusion that a low end chip without an uart wouldn't be able to handle the full DMX data rate, plus pwm for 4 channels, etc...
My idea to fix it was use a separate controller board with a higher spec PIC that takes the dmx signal(Via UART), processes it, then bit bangs it out in parallel down several lines - So for example if you used 8 pins of the controller chip, you would send only 64 channels down each wire. So the backside of this topology would be operating 8 times slower than the dmx front side, which seems way more feasible. The controller chip would also process the zero cross signal, and relay a zero cross pulse (on a different data line) to the downstream 'sub controllers.'
As for wiring, I was thinking about cutting people's costs by running it down either 4 or 6 conductor phone line. Each line would carry 64 channels of data on one wire, zero cross pulses on a second, then +V and ground on the remaining two. If I had trouble making the low end chips receive the data reliably, I was thinking about upgrading to 6 conductor wire, so I could add a 'clock' line, which would be used similarly to the clock that PIC programmers use during the chip's flashing.... transitioning the clock line everytime there was a new data bit available on the data line, so there would be no timing to worry about on the bit banged side of things...
My first project for the new year is probably going to be using PARTS of this idea to make a cheap intelligent pixel system... I'll post more details when I start tinkering, but a 50 cent 16F54, directly driving Red, Green, Blue, and White LEDS could make for a completely addressable pixel for around a dollar... using the 'bag of 100' LEDs from ebay... Also for this project (though not as useful for the SSR/dimmer project) I'm going to run the numbers, as one PIC with a higher pin count running 4 or 5 pixels instead of a very low end chip running just one may prove more cost effective, and give me more onboard features to work with for my money. Anyway about it, a one dollar serial data, fully adressable pixel could be quite cool. 🙂 I know it's not going to be as bright as the 12 dollar jobs, but you get what you pay for.
And before someone points it out from what I said above.... Yes, I know that the White LED should be unnecessary, as you can mix the RGB pixels to something resembling white, but in my experience (as a theatrical lighting designer) color mixing is a valuable and useful feature to have in your tool box, but is never a substitute for having the right color available in the first place. Mixing white light from saturated primary colors always leaves me wishing I hadn't, even with incandescent sources and the wide variety of primary color shades that can be bought in gels... It's even worse with LEDs, because they produce a very narrow part of the spectrum, so there's even MORE lacking when they mix to white. I'm not happy with the whites I get out of very high end (Color Blast, and Colorado 3) LED fixtures, so I'm certain that my 1 dollar 'ebay special' would leave me unhappy. So I'm including a separate white LED of the highest brightness I can drive directly from the PIC. It's worth it to me, and think about how bright a white I'll be able to achieve when I turn on all FOUR leds at full, and how I'll be able to shift the color temperature, by turning on the white LED at full, then using the blue LED to cool it off, or the red and green to warm it up....
Anyway. If any of what I spewed out helps you on your dimmer project, feel free to chat with me about it. 🙂 Best of luck, and keep soldering!
Art
It seems to me that adding a clock line makes things more difficult on the receiving end rather than easier. It takes extra instructions to deal with the clock line, harder to code and probably runs slower. It would be better in my opinion to stick with just a data line.
As far as a zero-crossing goes (if you really need it), you may be able combine it with the power line on a single wire. Connect that wire directly to the zero-crossing input pin on the PIC, and use a diode and electrolytic cap to get the power for the PIC and the output devices.
awhaley wrote:Noggin, I'm considering a similar idea, so we should talk at some point...I also came to the conclusion that a low end chip without an uart wouldn't be able to handle the full DMX data rate, plus pwm for 4 channels, etc...
My idea to fix it was use a separate controller board with a higher spec PIC that takes the dmx signal(Via UART), processes it, then bit bangs it out in parallel down several lines - So for example if you used 8 pins of the controller chip, you would send only 64 channels down each wire. So the backside of this topology would be operating 8 times slower than the dmx front side, which seems way more feasible. The controller chip would also process the zero cross signal, and relay a zero cross pulse (on a different data line) to the downstream 'sub controllers.'
As for wiring, I was thinking about cutting people's costs by running it down either 4 or 6 conductor phone line. Each line would carry 64 channels of data on one wire, zero cross pulses on a second, then +V and ground on the remaining two. If I had trouble making the low end chips receive the data reliably, I was thinking about upgrading to 6 conductor wire, so I could add a 'clock' line, which would be used similarly to the clock that PIC programmers use during the chip's flashing.... transitioning the clock line everytime there was a new data bit available on the data line, so there would be no timing to worry about on the bit banged side of things...
My first project for the new year is probably going to be using PARTS of this idea to make a cheap intelligent pixel system... I'll post more details when I start tinkering, but a 50 cent 16F54, directly driving Red, Green, Blue, and White LEDS could make for a completely addressable pixel for around a dollar... using the 'bag of 100' LEDs from ebay... Also for this project (though not as useful for the SSR/dimmer project) I'm going to run the numbers, as one PIC with a higher pin count running 4 or 5 pixels instead of a very low end chip running just one may prove more cost effective, and give me more onboard features to work with for my money. Anyway about it, a one dollar serial data, fully adressable pixel could be quite cool. 🙂 I know it's not going to be as bright as the 12 dollar jobs, but you get what you pay for.
And before someone points it out from what I said above.... Yes, I know that the White LED should be unnecessary, as you can mix the RGB pixels to something resembling white, but in my experience (as a theatrical lighting designer) color mixing is a valuable and useful feature to have in your tool box, but is never a substitute for having the right color available in the first place. Mixing white light from saturated primary colors always leaves me wishing I hadn't, even with incandescent sources and the wide variety of primary color shades that can be bought in gels... It's even worse with LEDs, because they produce a very narrow part of the spectrum, so there's even MORE lacking when they mix to white. I'm not happy with the whites I get out of very high end (Color Blast, and Colorado 3) LED fixtures, so I'm certain that my 1 dollar 'ebay special' would leave me unhappy. So I'm including a separate white LED of the highest brightness I can drive directly from the PIC. It's worth it to me, and think about how bright a white I'll be able to achieve when I turn on all FOUR leds at full, and how I'll be able to shift the color temperature, by turning on the white LED at full, then using the blue LED to cool it off, or the red and green to warm it up....
Anyway. If any of what I spewed out helps you on your dimmer project, feel free to chat with me about it. 🙂 Best of luck, and keep soldering!
Art
A $1... Good luck.
