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
MCP41010 Digital Pot
- Benj
- Matrix Staff
- Posts: 15157
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4753 times
- Been thanked: 4285 times
- Contact:
Re: MCP41010 Digital Pot
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 97
- Joined: Wed Jul 04, 2012 11:21 pm
- Location: Greece
- Has thanked: 39 times
- Been thanked: 12 times
- Contact:
Re: MCP41010 Digital Pot
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
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
- Benj
- Matrix Staff
- Posts: 15157
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4753 times
- Been thanked: 4285 times
- Contact:
Re: MCP41010 Digital Pot
Hello George,
This should help to get you started with SPI.
http://www.matrixtsl.com/blog/simplifie ... c-and-spi/
This should help to get you started with SPI.
http://www.matrixtsl.com/blog/simplifie ... c-and-spi/
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 97
- Joined: Wed Jul 04, 2012 11:21 pm
- Location: Greece
- Has thanked: 39 times
- Been thanked: 12 times
- Contact:
Re: MCP41010 Digital Pot
Hi Benj, i finally managed to implement potentiometers wiper position control therefore i can control the output resistance.
Thank You very much!
Thank You very much!
-
- Posts: 15
- Joined: Wed Feb 19, 2020 11:32 am
- Has thanked: 4 times
- Been thanked: 2 times
- Contact:
Re: MCP41010 Digital Pot
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
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

- Attachments
-
- MCP4010_spi_loop.fcfx
- (8.55 KiB) Downloaded 70 times
- Benj
- Matrix Staff
- Posts: 15157
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4753 times
- Been thanked: 4285 times
- Contact:
Re: MCP41010 Digital Pot
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 15
- Joined: Wed Feb 19, 2020 11:32 am
- Has thanked: 4 times
- Been thanked: 2 times
- Contact:
Re: MCP41010 Digital Pot
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

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


- Attachments
-
- MCP4010_spi_loop.fcfx
- (8.54 KiB) Downloaded 72 times