MCP4131 SPI

General discussion on mikroC.
Post Reply
Author
Message
ali genidy
Posts: 54
Joined: 03 Apr 2017 09:17

MCP4131 SPI

#1 Post by ali genidy » 29 Jun 2018 14:28

hi
can anybody help me
i want write a code spi to control 3 chip MCP4131 digital pot i read the datasheet of MCP4131 but i couldn't understand the command and address and how i send a value to change the resistor value my compiler Mikroc 7.1.0 and controller PIC 18F4431
i want a sample code to understand
thank you
ALI GENIDY

User avatar
filip.grujcic
Posts: 822
Joined: 14 May 2018 08:34

Re: MCP4131 SPI

#2 Post by filip.grujcic » 02 Jul 2018 16:28

Hello,

Can you send the schematic of the connection of your MCU with MCP4131?

Kind regards,
Filip Grujcic

ali genidy
Posts: 54
Joined: 03 Apr 2017 09:17

Re: MCP4131 SPI

#3 Post by ali genidy » 03 Jul 2018 14:41

this is my schematic
can you give me a working example code to change the value of resistor
thank you very much
Attachments
Sheet1.pdf
(45.46 KiB) Downloaded 163 times

User avatar
filip.grujcic
Posts: 822
Joined: 14 May 2018 08:34

Re: MCP4131 SPI

#4 Post by filip.grujcic » 03 Jul 2018 16:03

Hello,

There is a click board called Digi Pot Click, which has an almost identical digital potentiometer to yours on board.

You can download the examples for it from the following link:
https://libstock.mikroe.com/projects/vi ... ck-example

Examine them and you will understand how to use SPI to communicate with it.

Kind regards,
Filip Grujcic

ali genidy
Posts: 54
Joined: 03 Apr 2017 09:17

Re: MCP4131 SPI

#5 Post by ali genidy » 06 Jul 2018 20:02

thank you so much i understand good after reading the code you told me about
and i wrote my code and try it on Proteus it working good
i wish a good time and health for you thank you very much
Ali

Post Reply

Return to “mikroC General”