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

Post Reply
armagon29
Posts: 56
Joined: Thu May 07, 2009 4:40 pm
Contact:

MCP41010 Digital Pot

Post by armagon29 »

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 498 times

User avatar
Benj
Matrix Staff
Posts: 14848
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Contact:

Re: MCP41010 Digital Pot

Post by Benj »

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
Contact:

Re: MCP41010 Digital Pot

Post by armagon29 »

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

Thanks

George_B
Posts: 88
Joined: Wed Jul 04, 2012 11:21 pm
Contact:

Re: MCP41010 Digital Pot

Post by George_B »

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: 14848
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Contact:

Re: MCP41010 Digital Pot

Post by Benj »

Hello George,

This should help to get you started with SPI.
http://www.matrixtsl.com/blog/simplifie ... c-and-spi/

George_B
Posts: 88
Joined: Wed Jul 04, 2012 11:21 pm
Contact:

Re: MCP41010 Digital Pot

Post by George_B »

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


Thank You very much!

ruben_1989
Posts: 15
Joined: Wed Feb 19, 2020 11:32 am
Contact:

Re: MCP41010 Digital Pot

Post by ruben_1989 »

Hi ,

I'm using an Arduino uno and a digital pot MCP41010.
But the program doesn't work
Pin ss from the Arduino is connected to CS from MCP41010
We put CS low when sending data
we are using flow code 7

We aren't enable to let the program work with flow code ,
we used a data analyzer en the value we want to send are totally different from the one in the flow code program.

In the macro we send 17 and 55 we get on ore analyzer 8 and 178
in the properties from the spi you can select channel 1 and software what is the difference ?

thank you :D
Attachments
MCP4010_spi_loop.fcfx
(8.55 KiB) Downloaded 25 times

User avatar
Benj
Matrix Staff
Posts: 14848
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Contact:

Re: MCP41010 Digital Pot

Post by Benj »

Hello,

Channel 1 refers to a hardware SPI peripheral on-board the device normally using specific pins dictated by the peripheral, software refers to a bit banged version using software routines and is more flexible in terms of pins you can use but requires more ROM and processing power to drive.

It looks like you are outputting on the trailing edge and the analyser is sampling on the leading edge, hence the differing value readings.

ruben_1989
Posts: 15
Joined: Wed Feb 19, 2020 11:32 am
Contact:

Re: MCP41010 Digital Pot

Post by ruben_1989 »

thanks for the info .

We get the circuit and the program working know, but we changed the propertie's of the SPI and now everything worked out
I was confused about the leading edge trailing edge :oops: :lol:
Attachments
MCP4010_spi_loop.fcfx
(8.54 KiB) Downloaded 27 times

Post Reply