Digital Pot Advice


Closed Thread
Results 1 to 2 of 2
  1. #1

    Default Digital Pot Advice

    I am attempting to get an AD5220 Digital Pot to work with a PIC. I have it working great with a STAMP and am now crossing over. Attached is a zip file with two screen shots. The two screen shots are from a PIC and STAMP.

    I am using a PIC16F877A. Following is the code I used for the STAMP and PIC. My question is why does the output of the POT look so different? The STAMP 'saw-toothes' and the PIC is more like a saw tooth with dull blades. I think the true saw-tooth pattern is the correct output.

    I have tried changing the pulsout length but the POT never seems to make it too 5v when I am using this with the PIC. I am thinking if I don't have something configured wrong, I need to insert a pause somewhere.

    Thanks in advance
    Toby

    ---STAMP Code---
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}

    Up_Down PIN 0
    CLK PIN 1
    counter VAR Byte

    DO
    LOW Up_Down
    FOR counter = 0 TO 128
    PULSOUT CLK, 1
    NEXT

    HIGH Up_Down
    FOR counter = 0 TO 128
    PULSOUT CLK, 1
    NEXT
    LOOP

    ----PIC Code----
    include "bs2defs.bas"
    TRISD = 00000000
    CLK VAR PortD.1 'Controls the Digital Pot
    Up_Down VAR PortD.0
    Checker VAR word
    Checker =0

    Loop:
    High Up_Down
    For Checker = 0 to 128
    PULSOUT CLK, 1
    Next Checker

    Low Up_Down
    For Checker = 0 to 128
    PULSOUT CLK, 1
    Next Checker
    Goto Loop:
    Attached Files Attached Files

  2. #2


    Did you find this post helpful? Yes | No

    Default

    I got it, bad ground to the Dig Pot when testing with a PIC

Similar Threads

  1. Digital Pot
    By TONIGALEA in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 3rd January 2012, 07:54
  2. Controlling a MCP4162 Digital Pot
    By SOTASOTA in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 6th February 2011, 18:51
  3. Advice on Input circuitry for 0-10v or Pot
    By bcd in forum Schematics
    Replies: 18
    Last Post: - 12th April 2008, 10:47
  4. Replies: 4
    Last Post: - 24th January 2007, 22:20
  5. Serial control of a digital pot?
    By TonyA in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 2nd June 2006, 23:49

Members who have read this thread : 2

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts