Shop OBEX P1 Docs P2 Docs Learn Events
How to daisy chain 3 wire serial interface ICs? — Parallax Forums

How to daisy chain 3 wire serial interface ICs?

lyassalyassa Posts: 52
edited 2011-10-22 17:58 in Propeller 1
I need to monitor the voltage of few batteries that are next to each other, but away from the Propeller. is it possible to daisy serial devices as the diagram below shows?
+-------+  +-------+
|mcp3208|  |mcp3208|
+-------+  +-------+
 c  d  s    c  d  s
 |  |  |    |  |  | 
 +--]--]----+..|..|....to more
 |  +--]-------+..|....3 wire serial
 |  |  +----------+....interface
 |  |  |
 to propeller

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2011-10-21 14:59
    No. You have to have a separate CS line for each device. It's a Chip Select line. You can connect the Clock and Data lines in parallel.

    If you really need to have several devices on a bus, you should use I2C or 1-Wire protocols. I2C requires a clock and a data line while the 1-Wire protocol only needs 1 line. You'll need a ground wire and power although most 1-Wire devices can get power from the single line in-between data pulses.
  • lyassalyassa Posts: 52
    edited 2011-10-21 15:03
    Thanks Mike. Is there an generic object (in object exchange) to allow me to use the 1-wire protocol with mcp3208? Appreciate your answer.
  • Cluso99Cluso99 Posts: 18,069
    edited 2011-10-21 15:03
    The MCP3208 has a 4 wire SPI interface. The fourth pin is -CS. While you can parallel up the 3 wires (clock, datain, dataout), you will need to supply a separate -CS (chip select) pin to each MCP3208. Otherwise all info will go to all MCP3208 and all will respond causing a conflict.

    It may also be possible to drive the MCP3208's in parallel using clock and datain, but use separate dataout pins. This will depend on software and you will need to write a special object to handle multiple simultaneous replies.
  • Cluso99Cluso99 Posts: 18,069
    edited 2011-10-21 15:05
    I see Mike has replied. I didn't see that the MCP3208 supports the 1 wire protocol.
  • lyassalyassa Posts: 52
    edited 2011-10-21 15:12
    Thanks Cluso99. Do you know about any ADC that support the 1 wire protocol?
  • tonyp12tonyp12 Posts: 1,951
    edited 2011-10-21 16:29
    How many do plan to use?
    it uses chipselect so you can share the other 3 lines.

    So if you need 4 A/Ds, it could be done with 7 pins.
    If you want 8 A/Ds, you could use a 74HC138 (3of8) for chip select, for a tolal of 6 pins.
    it's active low so it will work with your IC.


    If you are really low on pins, go with i2c and you can share props eeprom pins.
    But if you want to use a few of the same A/D chip make sure it have at least 2pins for address select.
    that you connect to V+ or/and Gnd so you can have 4 of them on the same bus.
  • Cluso99Cluso99 Posts: 18,069
    edited 2011-10-21 17:11
    I haven't searched for 1wire ADCs. Try searching on DIgikey's site www.digikey.com
  • kwinnkwinn Posts: 8,697
    edited 2011-10-21 17:58
    If a fifth wire is available you could add one of the 6 pin single flipflops to each adc board and shift the chip select from one board to the next.

    If the batteries are close enough to each other a '595 might also be used.
  • lyassalyassa Posts: 52
    edited 2011-10-22 16:29
    I found PCF8591 on Digikey as Cluso99 suggested. Here is the datasheet for it http://www.nxp.com/documents/data_sheet/PCF8591.pdf. I imagine I will need to write a Propeller driver to be able to use it. Hope that will not be a hard task to do.
  • Mike GreenMike Green Posts: 23,101
    edited 2011-10-22 17:58
    The Maxim/Dallas DS2450 is a 4 channel A/D converter that uses the 1-Wire protocol
Sign In or Register to comment.