MCP41010 Digital Pot

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

armagon29
Posts: 56
Joined: Thu May 07, 2009 4:40 pm
Been thanked: 2 times
Contact:

MCP41010 Digital Pot

Postby armagon29 » Wed Jul 20, 2011 5:40 am

Dear All:

I have problems with digital potentiometer MCP41010, I need to set 3 steps, 0 for 0 kOhms, 128 for 5 kohms and 3 for 10 kohms, but I not sure if pin connections and configurations are OK
PIC16F877A
XT
8 MHz

Cs RC7
Sck RC3
SDI RC5

Thanks

Flowcode1.fcf
MCP41010 Example
(6.5 KiB) Downloaded 444 times

User avatar
Benj
Matrix Staff
Posts: 14371
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4447 times
Been thanked: 4145 times
Contact:

Re: MCP41010 Digital Pot

Postby Benj » Wed Jul 20, 2011 10:00 am

Hello,

Having a quick look at your program you are not manipulating the CS output. You should use an output icon to do this as fitting with the timing diagrams on the device datasheet.

Your other pin connections look to be correct.

I would output a 1 on RC7 before the SPI init and then output a 0 just before you send the 2 bytes then output a 1 again before the 5 second delay. Hopefully this should allow the device to work.

armagon29
Posts: 56
Joined: Thu May 07, 2009 4:40 pm
Been thanked: 2 times
Contact:

Re: MCP41010 Digital Pot

Postby armagon29 » Fri Jul 22, 2011 4:12 am

I added 1 icon to control Cs pin, now it works excellent

Thanks
These users thanked the author armagon29 for the post:
petesmart (Fri Jul 22, 2011 1:11 pm)
Rating: 5.26%
 

George_B
Posts: 88
Joined: Wed Jul 04, 2012 11:21 pm
Has thanked: 37 times
Been thanked: 12 times
Contact:

Re: MCP41010 Digital Pot

Postby George_B » Mon Feb 08, 2016 4:36 pm

Hello ,

I am trying to control an MCP41010 device.

Since it is the first time i am using the SPI communication, is there any example for in flow code for this device?

I cannot understand which three pins are supposed to handle the SPI. Is it RC6 and RC7 and what is the third?

Thanks in advance
George

User avatar
Benj
Matrix Staff
Posts: 14371
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4447 times
Been thanked: 4145 times
Contact:

Re: MCP41010 Digital Pot

Postby Benj » Mon Feb 08, 2016 4:50 pm

Hello George,

This should help to get you started with SPI.
http://www.matrixtsl.com/blog/simplifie ... c-and-spi/
These users thanked the author Benj for the post:
George_B (Mon Feb 08, 2016 5:51 pm)
Rating: 5.26%
 

George_B
Posts: 88
Joined: Wed Jul 04, 2012 11:21 pm
Has thanked: 37 times
Been thanked: 12 times
Contact:

Re: MCP41010 Digital Pot

Postby George_B » Mon Feb 08, 2016 5:53 pm

Hi Benj, i finally managed to implement potentiometers wiper position control therefore i can control the output resistance.


Thank You very much!
These users thanked the author George_B for the post:
Benj (Mon Feb 08, 2016 6:09 pm)
Rating: 5.26%