Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

56 outputs

Status
Not open for further replies.

SterlingY

New Member
I am thinking of building a silly little device, but I need 56 outputs. I haven't decided if they need to be analog or if digital is okay. It's a USB controlled device, so the brains of the thing is a PIC18F4550.

What are my options for the simplest implementations?

Thanks,

Sterling :rolleyes:
 
It depend if all the outputs have to be working (ie changing) simultaneously.
If not you can look at multiplexers or analogue switches which will route the active signal(s) only to the outputs which need them at any particular time.
 
When you need that many outputs serial in parallel out shift registers are a good way to go.

Try looking at this design as a place to start. It has both digital and analog output is quanity.

**broken link removed**

This design is for use with a printer port but you could use a pic or avr instead.

Schematic
 
Last edited:
In a perfect world, each output could change seperately. I may discover, down the road, that I only need to change a smaller number of outputs at once, but they all need to be independant from one another.

the Schematic from the above thread looks interesting, but I haven't made complete sense of it yet. :confused:

-Sterling
 
SterlingY said:
In a perfect world, each output could change seperately. I may discover, down the road, that I only need to change a smaller number of outputs at once, but they all need to be independant from one another.

the Schematic from the above thread looks interesting, but I haven't made complete sense of it yet. :confused:

-Sterling

You can do all that with the 74x595 shift register. You clock in a bit at a time then toggle a line to put the shift register bits onto the outputs. To change one bit you shift out the same value as last time but with the 1 bit change. You have total control. Look at the data sheet.
 
That looks like it might work, as the above schematic is riddled with that chip. Am I correct that the chip is only digital? What if I wanted analog output?

-Sterling
 
SterlingY said:
That looks like it might work, as the above schematic is riddled with that chip. Am I correct that the chip is only digital? What if I wanted analog output?
-Sterling

You do not need to understand the schematic. If you understand the datasheet for the 595 it is very easy to string together as many as required to to get the needed bit count. (My students are doing this in class to drive an 8bit bus LCD display.) Start by looking at the datasheet.

Taking the typical Olson-595, I created a unit with 256 channels. The first 128 channels are digital (on/off). The last 128 channels are grouped together so that the output of 8 channels feeds a digital to analog converter (R2R resistor ladder). This gives a 0-5vdc output in 256 steps. An op amp then amplifies the signal giving 0-10vdc (the standard input for a commercial dimmer). Complete details (including schematic and more pictures) can be found at **broken link removed**.

If you want more then 256 steps use more bits. The 74HC595 are inexpensive. In SOIC packages they are 21 cents and about 35 cents is DIP from Newark. That is 4 cents per bit in the SOIC package.
 
okay, I looked a bit more into the 74HC595, and I pretty much understand how it works (as much as a moron can understand), but I have two concerns. One, it seems to be digital only. Two, there seems to be a power issue. I need this device to run off of batteries.
 
SterlingY said:
okay, I looked a bit more into the 74HC595, and I pretty much understand how it works (as much as a moron can understand), but I have two concerns. One, it seems to be digital only.
.
My Previous Post said:
The first 128 channels are digital (on/off). The last 128 channels are grouped together so that the output of 8 channels feeds a digital to analog converter (R2R resistor ladder). This gives a 0-5vdc output in 256 steps. An op amp then amplifies the signal giving 0-10vdc (the standard input for a commercial dimmer).
Two, there seems to be a power issue. I need this device to run off of batteries.

It all depends on how large the battery is, and how long the battery has to last. You did not provide that info. If you told us what you were building it would be easier to provide help.
 
SterlingY said:
One, it seems to be digital only.
You obviously don't understand it at all then. It's a shift register which is a digital function, you'll have a hard time looking for an analogue shift register.
 
You could use shift registers feeding DAC's, that'd work as an analog shift register. But you're talking about 56 output channels, what on earth do you need that much analog I/O for? I think you need to more clearly state EXACTLY what you're trying to do, and why. You'll get better feedback with more information. (Amazing how often that needs to be said)
 
Went back and read the thread.

I think the problem is the the OP does not understand how a DAC works.

A good starting point would be to look at a R2R resistor ladder.

However at this point it is looking like perhaps he should start with learning the basics. The project may be too complex given his apparent level of knowledge.
 
I need to control 56 small electromagnets. By controlling the power being fed, I can vary the strength, which is important.

It's true that I am a beginner, but thus far I have built a device that controls multiple stepper motors, from a PIC18F4550, which can receive instructions via USB.

The R2R ladder is good information. I actually had that on my list to investigate as I saw it on the schematic, linked from above.

-Sterling
 
When you say "small" electromagnets, how small do you mean? I am sure you will have to have some more circuitry to run them than just a TTL(or CMOS) output... Maybe some transistors? 56 outputs seem like a lot of work! ;)

May i ask what the electromagnets are for? It sounds like an interesting idea...
 
The physical size would be roughly 3/8" x 3/8" x 3/4", providing that the strength can be enough to do what I need.

I'm sorry to be vague about what it is I am doing, but until I can figure out how to do it, I need to keep it "hush hush."

Of course there will be more power than just what comes from the PIC. That's not my concern at the moment. My concern is about how to simply control 56 outputs, so I don't think the topic of this thread has changed.

From another forum:

You could use something I would call binary controlled PWM.

thought A: for one channel, you could use series of pulses, average the voltage by low pass filter, and send it to PWM or just use the voltage created for controlling the current through the magnets. For example for 0.125*maxpower resolution, sending 0000 0001 would create 1/8 of maximal power, 0000 0011 1/4 and so on.

thought B: now you use a demultiplexer 1 of 64 and an enable signal. The pic would cycle through the 56 addreses and send also the enable signal when there is a 1 in on that position for the decoder. So sending one data block to each magnet would take 8*86=512 clock cycles. You would also need to amplify the singnal of the decoder by 56 to get the same voltage like in thought A.

And that´s what I worked out after coming form a pub

Cheers,

Sterling
 
A few posts back you were concerned with the current used to drive the 595s. Now you are talking about powering 56 electromagnets?? Also not knowing the application makes it useful to give reasonable advice.

That aside.
Two ways to do this.

If it is good enough to maintain an average field strength. You can use generate PWM on the 595 outputs. The 595s can be clocked up to 50MHz. One 595 on each of 7 PIC pins resulting in a total of 56 outputs. Share the clock data and latch lines to the 595s. 10 pins total. Put the code that does the shifting and latching on a timer interrupt.

Else use DACs as we talked about earlier which would require more bits to drive it.

The PWM requires about 1/10 the hardware.
 
Nigel: Does the thread topic changing really surprise you? Especially because of the vague initial post. The last thing you want to do around here is let us 'regulars' think for a few minutes about a vague post =) Things like this happen!
 
3v0,

Thanks for your ideas. Clearly I have some things to learn but you're helping me look in the right direction. I now have some objectives, which I'm sure will create more questions, but at least they'll get me closer to where I need to be.

Cheers,

Sterling
 
Also don't forget the freewheel diodes in parallel with the coils to protect the driver transistors.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top