Shop OBEX P1 Docs P2 Docs Learn Events
48 outs needed — Parallax Forums

48 outs needed

T ChapT Chap Posts: 4,223
edited 2007-01-08 01:47 in Propeller 1
I am finishing up a design that takes an RS232 signal and controls 48(3 banks of 16) relays independantly. Since a single Prop can't run 32 relays and still communicate on 2 pins at the same time, and the fact that a single instruction set manages 16 relays at a time, that means I will need 3 Propellers to manage 3 x 16 banks. This method is easily doable, but I was wondering if there is a more efficient way to do this using only one Propeller and some means to break out 16 pins off one serial I/O pin. Only one relay is on at a time, so some type of 1 of 16 switch would work, I am just not aware of such a device that could receive a command from the Prop off a single pin and turn on one of 16 pins. Any suggestons would be great. Thanks

Comments

  • CJCJ Posts: 470
    edited 2007-01-07 02:56
    perhaps some 74hc595 and uln2308 chips would work

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Who says you have to have knowledge to use it?

    I've killed a fly with my bare mind.
  • GavinGavin Posts: 134
    edited 2007-01-07 02:57
    Microchip has I2C expander MCP23016, look in the I2C library download for code.
    Cypress have I2C expanders up to 100pins with 16PWM.

    Gavin
  • BTXBTX Posts: 674
    edited 2007-01-07 03:07
    Originator.

    I think that, like CJ said, the 74HC595 plus some BS170 (FET), could be the best and cheap solution.
    Regards.
    Alberto.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • T ChapT Chap Posts: 4,223
    edited 2007-01-07 03:28
    Thanks for the good info guys. There will be future expansion, so considering the need to add banks of 16 later, is anyone else supportive of the i2c part? Looking at the mcp23016 demo, it sure seems like a no brainer, just plug n play. The shift reg seems like some effort to sort it out.
  • T ChapT Chap Posts: 4,223
    edited 2007-01-07 06:09
    Is Shiftout the method you would use to get the byte or word out to the the shift register? This requires two pins correct? It would be nice to see some existing code for this if an object exists to examine.
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2007-01-07 06:18
    The Allegro A6832 or A6833 have 32 open collector latched outputs that can handle 125 milliamps when on and up to 40 volts when off. That is great for driving relays. The original purpose of the chip was as a print head driver. The logic interface is SPI at up to 10 mhz and operates at 3.3 to 5 volts. The chips can be chained tin multiiples of 32 outputs on the same SPI pins.

    www.allegromicro.com/sf/6832/

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • Dennis FerronDennis Ferron Posts: 480
    edited 2007-01-07 17:11
    You could use my 8255 Spin object (available in the object exchange). It would initially require 8 Propeller pins for parallel data and 6 to 8 pins for control, but once you have those you could add up to sixteen 8255 chips on the same bus. Each time you add a chip you would get 24 more output lines. However, the 8255 can't drive the relays by itself, so you would also need one ULN2803 octal driver chip for every 8 outputs.

    The 8255 is $5 per chip. To drive 48 relays you would need two 8255's and six ULN2803's. It would work - may not be the simplest solution though.
  • IAI-CaptainIAI-Captain Posts: 33
    edited 2007-01-07 17:42
    Check out the Texas Instruments PCF8575

    16 bit remote I2C and SMBus·I/O expander.

    [*]16 individually addressable pins [*]Each pin configurable for input or output [*]Interrupt output pin

    Mouser Part# 595-PCF8575W

    you can find this same part at sparkfun.com as a Breakout Board.·With the·PCF8575 I2C Expander IC mounted to the board.

    SKU#:·Break-PCF8575

    http://www.sparkfun.com/commerce/product_info.php?products_id=8130

    Hope this helps,

    IAI-Captainscool.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    IAI (Indigenous Alien Intelligence),
    The New View on Machine Intelligence.
    Because There is nothing Artificial about it!
  • T ChapT Chap Posts: 4,223
    edited 2007-01-07 23:19
    Thanks for those extra links, some very interesting ideas. I have on hand some 74hc164's that I want to breaboard and test the idea of shifting that data which I have not done before. I have used the 164 before in a different application, and the problem with it for this app is that each output turns on (if data is high) while it is being shifted through. I would want to first disabe the out's(which the 595 does), shift in the data, then send an output enable. Is the usualy approach with the 595 to set up a serial out pin, a clock pin, an output enable pin? I need to get a board ordered asap, the i2c parts seem risky to build boards prior to any testing. Does any spin code for shifting a byte to a register exist that anyone is aware of? I am assuming the data should be sent slightly ahead of the clock so on the leading edge of the clock, the data is aleady present.

    Post Edited (originator) : 1/7/2007 11:52:35 PM GMT
  • CJCJ Posts: 470
    edited 2007-01-07 23:54
    with the 595's you put the data on the line, then pulse the clock, repeat for however many bits you have, usually a multiple of 8, then pulse the latch line to output them all at once, they can be cascaded without using any more pins on the prop

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Who says you have to have knowledge to use it?

    I've killed a fly with my bare mind.
  • T ChapT Chap Posts: 4,223
    edited 2007-01-08 01:01
    I settled on the i2c PCF8575, cheap, very few pins, chain 8 devices, addressable, digikey has plenty. Having never used i2c, if there is a similar object that could be easily modded, please let me know. Thanks all for the help.
  • BTXBTX Posts: 674
    edited 2007-01-08 01:22
    originator:
    The shifout in BS2 functions can perfectly send the data to the 595's.
    Regards.
    Alberto.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • T ChapT Chap Posts: 4,223
    edited 2007-01-08 01:47
    Thanks BTX, the requirement has hanged to 84 relays. I decided to use a minimum 16 i/o type device to do the job, there were several mentioned above and after reading all of them, I went with the part mentioned that is readily available on Digi, as I have a to place an order with them anyway. The shift reg will certain com in handy on other projects so the info is appreciated.
Sign In or Register to comment.