Shop OBEX P1 Docs P2 Docs Learn Events
Digital Pot Options — Parallax Forums

Digital Pot Options

Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
edited 2012-09-12 20:13 in Propeller 1
I did a search on digital POT's for the propeller chip but only found a driver for a MCP4141 which is acting a little weird( see note 1). Also there is mention of pull up resistor on the CS pin and I don't see it being used with any other micro, with that chip. Is it required for SPI? I do remember pull-ups being used on some SPI sd cards. I have to control a set of LED lights with 0 to 5VDC and I'll keep experimenting with the MCP4141 for now but would like other options in case I need it.. I'll re-test everything in the next few nights in case it was one of those late Saturday night things. :)

Note 1: if the wiper is tied to the same ground as the prop Pro Dev Board it won't move the wiper but if I keep the wiper ground tied to the MCP4141 ground but on the breadboard but separate form the Prop board ground it moves the wiper.

Note 2: Even though I can change the wiper value in the code I get erratic results testing with a volt meter .

Note 3: Pins 1 , 2, 3 look good on the Oscilloscope, however I did see some ringing.

I'm using the Propeller Professional Development Board

Pin 1 = CS(Chip select) to prop pin 16
Pin 2 = SCK (serial clock) prop pin 17
Pin 3 = SI (serial input) prop pin 18
Pin 4 = GND
Pin 5 = PA0 to GND
Pin 6 = PW0 - Output to volt meter
Pin 7 = PB0 to 3.3
Pin 8 = 3.3 volts
.

The test code is from here:
http://forums.parallax.com/showthread.php?101382-MCP41xxx-42xxx-digital-pot-meter-object

I see that someone else is having problems as well:
http://forums.parallax.com/showthread.php?141872-SPI-Digital-potentiometer-question

Comments

  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-09-10 19:14
    im not sure if there is an obex object but i have a bunch of ds1809s from maxim and the data sheet looks fairly easy, u can also use them with buttons directly to chnange the posistion. ive seen mention of them on here once or twice.

    iirc theres 1 10 50 and 100 k versions. maxim will send u free samples
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-09-10 19:28
    Bob,

    Every time I've considered a digital pot for a circuit, it seems like a better, simpler pot-less solution presents itself. What is unique about your requirements that makes a digital pot the best solution?

    -Phil
  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
    edited 2012-09-10 19:54
    @ rwgast_logicdesign I'll have a look.
    user-online.png

    thanks for the info.

    @ Phil Pilgrim (PhiPi)


    Thanks! for having a look Phil . I have to control the dimming via a serial terminal.AlI need is 0-5V Control loop to control a pin on a LED light . I thought that a digital pot would be a simple way to do it.
    PS:
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-09-10 20:22
    Bob im pretty sure if you go the pot route, as it may be unnecessary according to phil, the 1809 should be ok. it works at 5v, needs 5v supply, thats why i dislike it. But heres the beauty if you have to write a driver, you dont even have to set the wiper or any of that. Like I said the thing works with two push button for up and down! So you can just pulse those pins with a micro I would think and maybe save how many clicks through you are in eeprom or something on shut down. I originally picked them up for a volume control on a headphone amp i was building, just didnt want a knowb, I like buttons
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-09-10 21:17
    Bob,

    What kind of LED are you controlling? Typically, LED brightness is controlled via current, not voltage. But, assuming it's some kind of high-level brightness controller, here's a simple circuit that will produce 0-5V from a Prop's DUTY mode output:

    attachment.php?attachmentid=95481&d=1347336951

    The op-amp should either have rail-to-rail output or be powered from more than 5V.

    -Phil

    P.S. Oops! 'Goofed on the schematc. The cap should read 0.1uF, not 01.uF.
    480 x 220 - 2K
  • Don MDon M Posts: 1,653
    edited 2012-09-11 04:48
    Phil- what program do you use to draw those nice schematics?
  • ChrisGaddChrisGadd Posts: 310
    edited 2012-09-11 13:45
    Bob, that test code you linked to is for the MCP41xxx/MCP42xxx series, which expect an instruction of the order %xxcc_xxpp, where x is don't care, cc is a command (write or shutdown), and pp is potentiometer 0, 1, or both. Following that is 8 bits of data for the position to set the pot to.

    The MCP4141 uses a completely different message structure. It expects 4 address bits specifying a wiper, 2 bits specifying a command, then 10 bits for a position.

    %0000_00_nnnnnnnnnn - set wiper 0 to position nnnnnnnnnn ... at least if I'm reading the datasheet right
    %0001_01_xxxxxxxxxx - increments wiper 1 (x is don't care)
    %0001_10_xxxxxxxxxx - decrements wiper 1

    Also according to the datasheet, the MCP4141 has built-in pull ups, though for SPI I tend to drive the lines high and low.
  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
    edited 2012-09-12 20:13
    @Phil Pilgrim (PhiPi
    It's a SeaLite Sphere from http://www.deepsea.com/led2.php . Thanks! for the schematic. I dug out the parts to breadboard it hopefully in the next few days. I always like to try a different way to accomplish something. :) Also, before the digital pot I tried a variable regulator and it worked as well.

    @ ChrisGadd
    Thanks! for the info. I came to the same conclusion that it was the library however, I' didn't see the pull up info in the spec sheet yet but I'll read it again. Also, I used a EMBED micro and got the pot working fine and could dim a single LED no problem. . I'll try it on the LED light next. I'll still try to get it working on the Prop as well because that's what I will eventually use..
Sign In or Register to comment.