Shop OBEX P1 Docs P2 Docs Learn Events
Can about 6 pins on one Prop somehow control more than 60 mosfets? — Parallax Forums

Can about 6 pins on one Prop somehow control more than 60 mosfets?

ElectricAyeElectricAye Posts: 4,561
edited 2009-10-27 18:18 in Propeller 1
Hi,

I need to control about 60 mosfets (maybe more) on a system that creates a gentle thermal gradient over a span of about 24 inches, and I was wondering whether or not a single Prop could use some sort of addressable device to drive that many mosfets. The mosfets would have to take turns, of course, being switched totally on and off. I don't even know what such an addressable device might be called so I don't know what to search for. Any suggestions would be wonderful.


thanks,
Mark

smile.gif
«1

Comments

  • TimmooreTimmoore Posts: 1,031
    edited 2009-10-20 21:02
    8 74HC595 would give you 64 outputs serially controlled by prop with 3 pins. Update rate depends on the number of 595 you connect together, so whether this works depends on update rate of outputs you need.
  • StefanL38StefanL38 Posts: 2,292
    edited 2009-10-20 21:24
    the 74HC595 is a called shift-register with parallel and latched-output

    there is already a PWM-object for the 74HC595 in the obex.

    It works with one long. So without changing the PASM-driver you would start two cogs each driving 4x 74HC595-chips
    to get 64 channels

    If you adapt the PASM-driver you can shiftout two longs to 8x 74HC595-chips

    best regards

    Stefan
  • ElectricAyeElectricAye Posts: 4,561
    edited 2009-10-20 22:40
    This 74HC595 sounds interesting. Looks like I'll have to do some homework, though, to understand how it does its magic.

    thanks,
    Mark

    smile.gif
  • ElectricAyeElectricAye Posts: 4,561
    edited 2009-10-21 05:38
    Hey,

    at first glance the object for this obex.parallax.com/objects/437/ looks deliciously easy to use, employing only 3 pins to drive up to 32 outputs using PWM. Cool!

    But would it be possible to utilize 2 separate instances of this object in the same program (on a single Propeller) and get another set of 3 pins to drive yet another 32 outputs? Maybe?


    I hate to be greedy but....



    smilewinkgrin.gif
  • StefanL38StefanL38 Posts: 2,292
    edited 2009-10-21 06:10
    already mentioned that. That's what indipendent running cogs are for.
    Make a second objectname same objectfile choose a second set of IO-Pins start both objects and use both objects

    modified code from the demo-program:
      ' Set this to the pins you have connected to the 74HC595's
      'first cascade of 4  74HC595
      SR_CLOCK1 = 1
      SR_LATCH1 = 2
      SR_DATA1  = 3
    
      'second cascade of 4  74HC595
      SR_CLOCK2 = 4
      SR_LATCH2 = 5
      SR_DATA3  = 6
    
    
    OBJ
      shift :       "74HC595_MultiPWM"
      shift2:       "74HC595_MultiPWM"
      ser   :       "Simple_Serial"
      cv    :       "Simple_Numbers"
      
    PUB demo | i, on_t, off_t, on_t_r, off_t_r, f, d
    
      ' Required:  Initialize the TWO objects shift and shift2.
      shift.Start(SR_CLOCK1, SR_LATCH1, SR_DATA1)
    
      shift2.Start(SR_CLOCK2, SR_LATCH2, SR_DATA2)
    
    



    How did you ever utilise 2 different objects in one project ?
    With which intelligence should a cog recognize "oh exact same code as in my neighbour-cog ! Hey that's boring I don't execute this code !"

    best regards

    Stefan

    Post Edited (StefanL38) : 10/21/2009 7:50:50 AM GMT
  • James LongJames Long Posts: 1,181
    edited 2009-10-21 06:29
    Lectric,

    Although not as easy for PWM you could also use the PCF8575 with a basic I2C to control the mosfets. With Mike Green's I2C object from some of his items, you can get the bus to move very fast. I can flash LED's so fast they look in solid state on. But the human eye is not a good judge.

    The nice thing about the PCF is the easy control to use it. And any pins you didn't use, could be used for extra I/O.

    Just an idea........I would probably go with the shift register......just easier to code.

    James L

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    James L
    Partner/Designer

    Lil Brother SMT Assembly Services

    Please note: Due to economic conditions the light at the end of the tunnel will be turned off until further notice. Thanks for your understanding.
  • shanghai_foolshanghai_fool Posts: 149
    edited 2009-10-21 09:51
    Mark,
    You may also want to look at the MCP23S517 also. It is a 16 port addressable latch using SPI and you can run 8 devices on one SPI port for 128 outputs. The main difference is that each group of 8 bits are addressable so you don't have to send data to all bits as you would for a shift register.

    Donald
  • StefanL38StefanL38 Posts: 2,292
    edited 2009-10-21 10:28
    Hello Donald,

    couldn't find anything with googling for "MCP23S517" is there a typo in it ?

    can you post again a url and the manufacturer ?
    best regards

    Stefan
  • DroneDrone Posts: 433
    edited 2009-10-21 10:36
    Mark,

    Perhaps a different approach from those already mentioned would be to use a matrix LED driver IC. Something like the Maxim MAX7219 comes to mind . Each 7219 has a three wire SPI interface and can control up to 64 individual LEDs (or MOSFETs perhaps) in an 8x8 matrix. You can daisy-chain the 7219's as well.

    The MAX7219 isn't cheap though. You can get them for $6.50 USD each in unit quantity at www.seeedstudio.com. In contrast the 74HC595 8-bit shift register is $0.50 USD each in unit quantity from the same source; 8 of them is $4.00 vs. $6.50 for the MAX7219 of which you need only one. Tough call at first glance, but the Devil is in the details...

    I'm not sure how the MAX7219 would drive MOSFETs. The MAX7219 has constant current source/sink to drive LEDs with no current limiting resistor required. Off the top of my head, perhaps all you need is one resistor in-place of an LED per driven MOSFET. That's a fun design experiment I leave to you. It might be neat to use an LED and take the forward drop across it to drive a MOSFET, but I think the voltage would be a tad too low to work with unless you buffer it. If it did work you not only drive the MOSFET but you get a little LED indicator to tell you when it is on (or off) too.

    The MAX7219 Data sheet is here:

    www.maxim-ic.com/quick_view2.cfm/qv_pk/1339

    Enjoy, David smile.gif
  • shanghai_foolshanghai_fool Posts: 149
    edited 2009-10-21 10:59
    Sure. Here is the data sheet. I just picked up some here at 10RMB each but Digikey has them listed for $1.26 each.

    Donald
  • ElectricAyeElectricAye Posts: 4,561
    edited 2009-10-21 13:28
    StefanL38 said...
    already mentioned that....

    Oops! Yes, indeed you did. blush.gif I'm not sure why it didn't register in my brain! Thanks, Stefan, for clarifying this for me and for providing the sample code, too.

    To James Long, Drone, and Shanghai Fool : now I am suffering an embarrassment of riches. I think I'll try the shift register approach first and see how it goes. But it's great to know there are some i2c techniques and other possibilities to pick from if I run out of pins or need to modify the general approach.

    I had been dreading taking on this part of the project but thanks to you guys I'm now looking forward to working on it.

    many thanks to all for saving my day,
    Mark

    smile.gif
  • JonnyMacJonnyMac Posts: 9,211
    edited 2009-10-21 17:58
    Not sure what your current requirements are, but if your thermal devices require 350mA or less at under 50v you could use the TPIC6A595.
  • pjvpjv Posts: 1,903
    edited 2009-10-22 04:10
    Hi Alectric;

    Why not drive the mosfets with two SX48's connected serially to to Prop?

    Cheers,

    Peter (pjv)
  • ElectricAyeElectricAye Posts: 4,561
    edited 2009-10-22 06:15
    pjv said...
    ....
    Why not drive the mosfets with two SX48's connected serially to to Prop?

    Good question. The short answer is: I have no idea what I'm doing! tongue.gif

    To JonnyMac and pjv, thanks for the suggestions. I have so many options, it seems, and I'm simply overwhelmed at this point on what to do. I would like to feed the PWM signals through whatever system I go with, and since there's already an object for PWM working with the 74HC595, I'll probably try that first. It looks fairly easy to use. I am definitely bookmarking all these replies, though, so I know in the future what else I can use.

    you guys are great!

    thanks so much!


    smile.gifsmile.gifsmile.gif
  • pjvpjv Posts: 1,903
    edited 2009-10-23 02:56
    Hi Alectric;

    Unless you have some unusual requirements, it would be very simple to have each of 2 SX48's run 30 fets in PWM mode, with a master -prop or SX- sending serially which unit is to be at what duty cycle, or all together.

    The beauty of using an SX is that you can make it behave in any manner you like.... no 'rules'.

    Piece of cake, really.

    Cheers,

    Peter (pjv)
  • ElectricAyeElectricAye Posts: 4,561
    edited 2009-10-23 03:02
    pjv said...
    ....it would be very simple to have each of 2 SX48's run 30 fets in PWM mode....

    Peter, I believe you but I've never worked with the SX. You're talking about the SX from Parallax, is that right?

    smile.gif
  • pjvpjv Posts: 1,903
    edited 2009-10-23 04:00
    That's right.

    If you are interested, I can help you learn or give some pointers.... even write your code, but then you would not be learning.

    You will need to explain in some detail what you are trying to accomplish and what restrictions or challenges there might be.

    Cheers,

    Peter (pjv)
  • Cluso99Cluso99 Posts: 18,069
    edited 2009-10-23 04:16
    I am not sure of you cost sonstraints, but an easy solution maybe to use multiple props and have them communicate serially. Your pcb would be simpler and you would just stack a few small pcbs. I like simpler solutions - less IC's and simple software- even at the expense of cost, but it does depend on what you are doing it for. Just a suggestion smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
    · Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
    · Prop Tools under Development or Completed (Index)
    · Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)
    · Search the Propeller forums·(uses advanced Google search)
    My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
  • AleAle Posts: 2,363
    edited 2009-10-23 19:54
    Using AVRs is also a possibility, if you are familiar with them. An atmega8 costs 1 $ and has 24 IOs
    The issue with the shift register is that the data shifts and gets output on the outputs while it shifts. Unless that shift register has some output enable input... (The '164 has none).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Visit some of my articles at Propeller Wiki:
    MATH on the propeller propeller.wikispaces.com/MATH
    pPropQL: propeller.wikispaces.com/pPropQL
    pPropQL020: propeller.wikispaces.com/pPropQL020
    OMU for the pPropQL/020 propeller.wikispaces.com/OMU
  • LeonLeon Posts: 7,620
    edited 2009-10-23 20:27
    An Atmega8 costs more than $1.

    One XMOS XS1-L1 chip (64 I/Os) at $8.70 is another way to do it.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle

    Post Edited (Leon) : 10/23/2009 8:35:44 PM GMT
  • AleAle Posts: 2,363
    edited 2009-10-23 20:40
    I meant ATMega48 smile.gif, and yes it costs 1.25 €.

    The thing with the XMOS chip is that it needs 1V, and while it is not the only way the suggested switching regulator plus extra components rise the cost quite a bit. But some LDO that can do 1V may be available.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Visit some of my articles at Propeller Wiki:
    MATH on the propeller propeller.wikispaces.com/MATH
    pPropQL: propeller.wikispaces.com/pPropQL
    pPropQL020: propeller.wikispaces.com/pPropQL020
    OMU for the pPropQL/020 propeller.wikispaces.com/OMU
  • LeonLeon Posts: 7,620
    edited 2009-10-23 20:49
    I've got some tiny 800 mA 1V LDOs. They might need a 4-layer board to get rid of the heat when powered from 3.3V - I need to do the sums.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle

    Post Edited (Leon) : 10/23/2009 8:55:33 PM GMT
  • StefanL38StefanL38 Posts: 2,292
    edited 2009-10-24 07:01
    @ale: the 74HC595 has a latched output. This means while shifting in the bits the output-register stays as it is until you toggle the latch-input.
    Only if the latch-input is toggled the bits of the shiftregister were transferred to the outputregister.

    best regards

    Stefan
  • ElectricAyeElectricAye Posts: 4,561
    edited 2009-10-26 12:48
    I just wanted to thank everyone for all of these suggestions. I think I'll first try sticking with the Propeller and try the 74HC595, and maybe add more Props via serial communication as needs might arise. The device will be controlling a large number of small heaters (each only about 2 watts), so I'm guessing that any brief hiccups in the bit shifting, etc. won't affect the overall performance since changes in the thermal system are likely to be very slow.

    thanks again for all your help,
    Mark
    smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Watching the world pass me by, one photon at a time.
  • kwinnkwinn Posts: 8,697
    edited 2009-10-26 16:38
    Mark, you may want to take a look at the TPIC6595. It is a combination of 74HC595 and MOS driver transistors that can handle 250mA each. If your heaters run off 8V or more no other drivers are needed. With a cog dedicated to updating them 8 chips can be updated in excess of 1000 times per second. Data sheet attached.
  • ElectricAyeElectricAye Posts: 4,561
    edited 2009-10-26 19:17
    kwinn said...
    Mark, you may want to take a look at the TPIC6595. It is a combination of 74HC595 and MOS driver transistors that can handle 250mA each. If your heaters run off 8V or more no other drivers are needed. With a cog dedicated to updating them 8 chips can be updated in excess of 1000 times per second. Data sheet attached.


    kwinn,

    this looks very interesting! Wow, it's like my dream chip! However, do you happen to know if it would work with the object that is already available for the 74HC595? obex.parallax.com/objects/437/ Each of these heaters runs at 15 volts DC and stands at about 100 ohms, so it looks like it would be an excellent match. But I'm worried that I would have to write up tons of new software, and since lots of the things in the OBEX are assembly (which I still don't know), I get nervous. Any idea if this could really be the chip of my dreams?

    thanks so much!
    Mark
    smile.gif
  • T ChapT Chap Posts: 4,223
    edited 2009-10-26 19:52
    I use the PCF8575 16 i/o I2C expander on a projects and really like it. You can gang more than enough together, the code is ultra simple. You would use a pull up resistor on the output to the gate of a mosfet. This is a very simple and easy solution. Just set each device to it's own address. Use Basic I2C driver.
  • kwinnkwinn Posts: 8,697
    edited 2009-10-26 20:35
    Mark, I have used the 74HC595 and TPIC interchangeably with the same propeller software. The signals to the chips are identical although the pinouts are different.
  • ElectricAyeElectricAye Posts: 4,561
    edited 2009-10-26 20:55
    kwinn said...
    Mark, I have used the 74HC595 and TPIC interchangeably with the same propeller software. The signals to the chips are identical although the pinouts are different.

    That's excellent news! I was away from my windows PC and couldn't see if the Spin code would work the same. I'm glad you enticed me to take another look at these kinds of chips (JonnyMac suggested something similar last week but I got worried about the non-through-hole nature of the thing.) Your suggestion appears to have a through-hole version but now it's a matter of finding somebody who has them in stock.

    a thousand thanks!
    Mark
    smile.gif
  • ElectricAyeElectricAye Posts: 4,561
    edited 2009-10-26 21:00
    Todd Chapman said...
    I use the PCF8575 16 i/o I2C expander on a projects and really like it. You can gang more than enough together, the code is ultra simple. You would use a pull up resistor on the output to the gate of a mosfet. This is a very simple and easy solution. Just set each device to it's own address. Use Basic I2C driver.

    Todd,

    thanks for the suggestion. Unfortunately for me these all appear in a non-through-hole version. And I'm too much of a wimp at this point to graduate to dealing with those teensy-weenie pins. One of these days I'll get there, though.

    much obliged,
    Mark
Sign In or Register to comment.