+ Post New Thread
Results 1 to 16 of 16
  1. #1
    Full Member level 3
    Points: 2,949, Level: 12
    Achievements:
    7 years registered

    Join Date
    Jun 2007
    Location
    India
    Posts
    172
    Helped
    11 / 11
    Points
    2,949
    Level
    12

    INTERFACING MCP4162 with PIC16F886

    Dear All

    I am facing problems in Interfacing the PIC 16F886 with the Digital POT MCP4162

    Here is the code for the same if i am sending 0x00 and 0x00 my pot output should be 0 ohms but it is showing 96 Ohms and if i send any other value the pot is not changing pls help me with this

    Code:
    spiWrite(0x00);
     delay(1);
    spiWrite(0x00);
     delay(1);

  2. #2
    Super Moderator
    Points: 29,635, Level: 41
    andre_teprom's Avatar
    Join Date
    Nov 2006
    Location
    Brazil
    Posts
    8,863
    Helped
    1115 / 1115
    Points
    29,635
    Level
    41
    Blog Entries
    9

    Re: INTERFACING MCP4162 with PIC16F886

    The SPI logical specs may vary from a device to another, so giving a piece of code is not enough to assess anything.
    --------------------------------------------------------------------------------------------------
    Part of the world that you live in, You are the part that you're giving ( Renaissance )



  3. #3
    Full Member level 3
    Points: 2,949, Level: 12
    Achievements:
    7 years registered

    Join Date
    Jun 2007
    Location
    India
    Posts
    172
    Helped
    11 / 11
    Points
    2,949
    Level
    12

    Re: INTERFACING MCP4162 with PIC16F886

    The SPI Logical Specs are CKE=1,CKE=0 The Clock Frequecy is Fclock/16

    As per the data sheet of MCP4162 it says we need to send 0x00 as command byte and then the value



    •   AltAdvertisement

        
       

  4. #4
    Super Moderator
    Points: 77,800, Level: 68
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    15,765
    Helped
    3590 / 3590
    Points
    77,800
    Level
    68

    Re: INTERFACING MCP4162 with PIC16F886

    Hi,

    Wiper resustance is 75 Ohms. Don't expect to get 0 Ohms.

    Why you get 96 Ohms, I don't know.

    Klaus
    Please donīt contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



  5. #5
    Full Member level 3
    Points: 2,949, Level: 12
    Achievements:
    7 years registered

    Join Date
    Jun 2007
    Location
    India
    Posts
    172
    Helped
    11 / 11
    Points
    2,949
    Level
    12

    Re: INTERFACING MCP4162 with PIC16F886

    Quote Originally Posted by KlausST View Post
    Hi,

    Wiper resustance is 75 Ohms. Don't expect to get 0 Ohms.

    Why you get 96 Ohms, I don't know.

    Klaus
    hi i tried with various other values but still the resistance is not changing



  6. #6
    Super Moderator
    Points: 77,800, Level: 68
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    15,765
    Helped
    3590 / 3590
    Points
    77,800
    Level
    68

    Re: INTERFACING MCP4162 with PIC16F886

    Hi,

    You give not much useful informations.

    What does this mean: "CKE=1,CKE=0"
    What does this mean: "Clock Frequecy is Fclock/16"
    What does this mean: "delay(1);" one second, one millisecond, one microsecond?

    * Show the complete code.
    * show your schematic, with supply and supply voltages.
    * show a scope picture of CS, SCK, MOSI

    Klaus
    Please donīt contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



  7. #7
    Full Member level 3
    Points: 2,949, Level: 12
    Achievements:
    7 years registered

    Join Date
    Jun 2007
    Location
    India
    Posts
    172
    Helped
    11 / 11
    Points
    2,949
    Level
    12

    Re: INTERFACING MCP4162 with PIC16F886

    here is the image of the SCOPE i have sent 4C inorder to read the tcon register

    My CS is tried to GND permanently



    - - - Updated - - -

    the delay is 1mS



    •   AltAdvertisement

        
       

  8. #8
    Super Moderator
    Points: 77,800, Level: 68
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    15,765
    Helped
    3590 / 3590
    Points
    77,800
    Level
    68

    Re: INTERFACING MCP4162 with PIC16F886

    Hi,

    My CS is tried to GND permanently
    Read datasheet: Especially about Error conditions and CS function. Section 7.3.

    Klaus
    Please donīt contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



  9. #9
    Full Member level 3
    Points: 2,949, Level: 12
    Achievements:
    7 years registered

    Join Date
    Jun 2007
    Location
    India
    Posts
    172
    Helped
    11 / 11
    Points
    2,949
    Level
    12

    Re: INTERFACING MCP4162 with PIC16F886

    hi Mate thanks i missed that in the data sheet now it is working properly

    i need one more help i am trying to take a variable resistance of 10 ohms to 200 ohms using this MCP is it possible to add a parallel resistance between the two terminals



  10. #10
    Super Moderator
    Points: 77,800, Level: 68
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    15,765
    Helped
    3590 / 3590
    Points
    77,800
    Level
    68

    Re: INTERFACING MCP4162 with PIC16F886

    Hi,

    Why donīt you do a little math on your own?

    Simple idea:
    * when your wiper is in "high position" you want 200 Ohms
    * when your wiper is in "low position" you want 10 Ohms

    First calculate what parallel resistor you need to get 10 Ohms when wiper is in low position.
    Now use this resistor and calculate the resulting resistance when wiper is in high position.

    Klaus
    Please donīt contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



  11. #11
    Full Member level 3
    Points: 2,949, Level: 12
    Achievements:
    7 years registered

    Join Date
    Jun 2007
    Location
    India
    Posts
    172
    Helped
    11 / 11
    Points
    2,949
    Level
    12

    Re: INTERFACING MCP4162 with PIC16F886

    i already tried to connect 10 ohms across when the wiper is 0x00(90 Ohms) the rest can be done in coding when the wiper is 0xFF it is still showing 10 ohms only that is the problem i am facing any idea i did the math already



  12. #12
    Super Moderator
    Points: 77,800, Level: 68
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    15,765
    Helped
    3590 / 3590
    Points
    77,800
    Level
    68

    Re: INTERFACING MCP4162 with PIC16F886

    Hi,

    The change in value is not what you expect?
    --> This shows, that it is impossible. Trust your mathematics.

    Klaus
    Please donīt contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



  13. #13
    Administrator
    Points: 69,512, Level: 64
    Achievements:
    Created Album pictures Created Blog entry 7 years registered
    bigdogguru's Avatar
    Join Date
    Mar 2010
    Location
    Southwest, USA
    Posts
    9,832
    Helped
    2358 / 2358
    Points
    69,512
    Level
    64
    Blog Entries
    4

    Re: INTERFACING MCP4162 with PIC16F886

    Perhaps if you explained the intended application/system in detail, there maybe a alternative path to a viable solution.

    You also should be aware that the typical wiper resistance is 75Ω, however it can be as high as 300Ω for the MCP4162.

    Reference the table below:

    Click image for larger version. 

Name:	4162.JPG 
Views:	1 
Size:	143.0 KB 
ID:	142551
    The Edge... there is no honest way to explain it, because the only people who really know where it is are the ones who have gone over.
    -- Hunter S. Thompson



  14. #14
    Full Member level 3
    Points: 2,949, Level: 12
    Achievements:
    7 years registered

    Join Date
    Jun 2007
    Location
    India
    Posts
    172
    Helped
    11 / 11
    Points
    2,949
    Level
    12

    Re: INTERFACING MCP4162 with PIC16F886

    hi i went through the document and i am trying it with a parallel resistance is there any other IC which can give me a 10 Ohms minimum out put



  15. #15
    Full Member level 3
    Points: 2,949, Level: 12
    Achievements:
    7 years registered

    Join Date
    Jun 2007
    Location
    India
    Posts
    172
    Helped
    11 / 11
    Points
    2,949
    Level
    12

    Re: INTERFACING MCP4162 with PIC16F886

    i think it is impossible to get a 10 Ohms output even with a parallel resistor i may switch towards to a motor + pot solution thanks for your support and help regarding my project



    •   AltAdvertisement

        
       

  16. #16
    Super Moderator
    Points: 77,800, Level: 68
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    15,765
    Helped
    3590 / 3590
    Points
    77,800
    Level
    68

    Re: INTERFACING MCP4162 with PIC16F886

    Hi,

    If you show/describe why (or what for) you need 10...200 Ohms, then we may find a suitable solution for you...without motor.

    Klaus
    Please donīt contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



--[[ ]]--