Shop OBEX P1 Docs P2 Docs Learn Events
Multiple DS1867s digital pots with the basic stamp — Parallax Forums

Multiple DS1867s digital pots with the basic stamp

GeekgirlGeekgirl Posts: 50
edited 2009-01-23 17:14 in BASIC Stamp
I'm wanting to daisy chain 3 of these as I need to control 6 op-amp gain stages and need to conserve I/O pins as much as possible.

It's the non volatile version of the DS1267 for which I did find a snippet of code for in a N&V article, but it was for a single 1267, not multiples daisy chained.

I was hoping that someone has used this before and may have some working code they might share, which·would·surely·save me hours of stumbling blindly about the keyboard.

Searches for help·(here and google)·have not been particularly encouraging thus far.

I know this has to be pretty simple stuff to some of ya'll,


Thanks in advance,

Darlene

Post Edited (Geekgirl) : 1/23/2009 3:31:32 AM GMT

Comments

  • metron9metron9 Posts: 1,100
    edited 2009-01-23 04:27
    Looks like you just connect them as the data sheet shows for stacked operation (page 4). If you have 3 then the number of bits you clock out would be (17 * 3)

    So just 3 pins are needed for any number of chips.

    http://datasheets.maxim-ic.com/en/ds/DS1267.pdf

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Think Inside the box first and if that doesn't work..
    Re-arrange what's inside the box then...
    Think outside the BOX!

    Post Edited (metron9) : 1/23/2009 4:33:26 AM GMT
  • GeekgirlGeekgirl Posts: 50
    edited 2009-01-23 12:11
    metron9 said...
    Looks like you just connect them as the data sheet shows for stacked operation (page 4). If you have 3 then the number of bits you clock out would be (17 * 3)

    So just 3 pins are needed for any number of chips.

    http://datasheets.maxim-ic.com/en/ds/DS1267.pdf

    · I've studied the data sheet, they always make it all look so simple.· Actually, the hardware setup is simple, it's the code part that's usually the sticky wicket.

    I'm waiting on the chips, expecting them from digikey today, actually, ... so I haven't had a chance to try using them yet and I'm not too experienced yet using SPI.

    They may be as easy to set up as the data sheet makes it look, but it's always nice to have or start with some working code to then customize to fit specific needs.


    Darlene
  • metron9metron9 Posts: 1,100
    edited 2009-01-23 13:34
    Yep, with you there. Hands on and a digital scope will cut through any misunderstandings in data sheets.

    They operate similar to shift registers. Think of it this way. The chip simply reads a pin level of High or Low but it reads it only when you tell it to through the clock line. So the level of High or Low is set and then the clock is toggled, the chip reads its pin and stores the bit. When it stores the bit it shifts the bit into a memory location. Since it has 17 bit positions you shift 17 bits into the chip and it takes care of putting the bits into its memory location. So the direction it stores the bits is important high to low or low to high and the timing of how short the clock signal is important to find out the maximum data rate you can send as well as shifting the correct number of bits.

    When you chain them the bits flow through from one to the other so the 18th bit when pushed into chip1 makes the first bit you sent flow out of chip1 into chip2. As you shift in the second batch of 17 bits the first batch ends up in the second chip like putting marbels in a tube push one in one end and the one near the other end falls out.

    Check out bit shifts in this link to see how the bits are actually working on the inside of the chip.
    http://en.wikipedia.org/wiki/Bitwise_operation


    Actually you dont even need a processor to communicate. Two buttons could be used to set a high or low level and toggeling the clock pin could be used to shift in the bits. Since it is SPI typically there is no minimum speed.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Think Inside the box first and if that doesn't work..
    Re-arrange what's inside the box then...
    Think outside the BOX!

    Post Edited (metron9) : 1/23/2009 1:39:55 PM GMT
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2009-01-23 17:14
    Metron was pretty clear in his description, but if you want to see an example of code that daisy-chains three 74HC595 shift registers (SPI) then please see the following link. I hope this helps. Take care.

    http://forums.parallax.com/showthread.php?p=552892

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
Sign In or Register to comment.