Analogue Multiplexing / D54

EdLouth

New Member
I'm creating a lighting controller to operate stage lights. I currently have a program running in VB.net and I'd like to have an output to go to the stage dimmers to control the lights. My plan is to have serial sent out from the computer to a picaxe and then have this send a control signal to a stage dimmer.
I can get 0 to -10V control but I'd like to try D54 (http://en.wikipedia.org/wiki/D54) which requires analogue multiplexing of a signal between +-5V in the order of micro seconds. Any ideas how to achieve this either direct from the picaxe or via another chip?
An alternative I would be interested in is DMX control but getting serial at 250kBits is too fast for a picaxe? What about the new X2s ?
Thanks, Edward
 

hippy

Ex-Staff (retired)
Welcome to the PICAXE Forum.

D54 is probably over-kill and unsuited to what you actually want. It's really a mechanism for multiplexing existing analogue channels onto a single wire and demuxing them at the other end. That just needs a lot of multiplexors, a clock signal and a bit of logic. The problem is you need all the channels to be analogue to start with; that's a lot of DAC's unless you can generate the analogues on the fly and PICAXE is probably too slow for that.

A PICAXE can generate DMX-512 at 250kbps, just not at full 512 channels per 20ms update rates ( though it might be able to get close ). How many channels are you hoping to control ?

The best approach would probably be an X1 or X2 which would simply send a 'break' then sequentially churn out data from the scratchpad memory using HSEROUT ...

Do
Gosub SendBreak
ptr = 0
For channel = 1 To N
HSerOut 0,(@ptrinc)
Next
Loop

The faster you can run the X1/X2 the better, the more channels you can send in 20ms. You can actually unroll the FOR-NEXT to a long list of HSEROUT 0,(@ptrinc) for maximum speed. You might be able to get away with internal 8MHz operation but an external resonator or crystal would be better; X2 can run at up to 32MHz with a 16MHz resonator, 40MHz using a 10MHz crystal.

The challenge is getting the data to send into the scratchpad. That may be possible using HSERIN background receive on the same PICAXE if you can send from the PC also at 250kbps ( that may be possible using FTDI USB drivers ) or you could use another X1/X2, send to that at a standard baud rate, use I2C to dump the data received from that X1/X2 to the DMX transmitting X1/X2.

That's the theory anyway.

If you can get FTDI USB serial to work at 250kbps you may be able to generate the DMX-512 break signal within the PC over serial anyway, no PICAXE needed, or maybe just use the PICAXE to generate the DMX break.

If you are interested in DMX-512 using a PICAXE, the best place to start would be a PICAXE DMX transmitter as descibed earlier. Get that to work with a channel fading up and down ( just increase a scratchpad's location value at the end of each frame sent ), hook that into a dimmer and see how it goes.
 

EdLouth

New Member
Thanks for the replies. 12 channels would do, although I'll try and get one working first. If possible I'd like to be able to get more, say up to 100 channels.
I see what you mean about D54, I can generate that many analogue voltages using DACs from Maxim but I'm guessing the refresh rate isnt going to be good, DMX would be a much better bet. I'm thinking possibly send all the channel levels from the PC into the scratch pad then issue a "update DMX" command which gets the picaxe to spew the levels out. Do you know how fast the DMX has to refresh? i.e. can i just send out a signal when the levels change?
Thanks, Edward
 

hippy

Ex-Staff (retired)
You need to send a DMX packet within one second of the last according to USITT spec. Otherwise the dimmers may assume the link has failed and go to some standby setting though not all do. You can often send just the break to fool the dimmer into thinking the link is alive.
 

EdLouth

New Member
Ok DMX is sounding like a workable solution. I'm thinking of starting with 12 channels. So X2 running at high clock speed with external resonator. Then have a loop which sends out all the scratch pad values as DMX at 250kbps. I'll have to use I2C slave mode and have the data pushed into the scratch pad by another picaxe. I'll give it a go when I have some time. Thanks for your help, Edward
 
Top