I have posted a driver for the Digital potentiometers from Microchip. It is a 2.7 to 5.5V 7-bit linear digital potentiometer with SPI interface.
Pot wiper commands include write or read. This program has write and reads commands with MOSI/MISO being multiplexed in the Digital potentiometer side.
This library is broadly compatible with the other devices in this series: They are: Microchip MCP4131, MCP4132, MCP4231, MCP4232, MCP4141, MCP4142, MCP4241, MCP4242, MCP4151, MCP4152, MCP4251, MCP4252, MCP4161, MCP4162, MCP4261, MCP4262.
You can use Hardware or Software SPI. The following provides an overview of usage:
#define _MCP4XXXHardwareSPI ' remove or comment out if you want to use software SPI.#define _MCP4XXXSoftwareSPI ' remove or comment out if you want to use software SPI.Youneedtodefineforhardwareorsoftware:DigitalPot_CS<port>DigitalPot_SCK<port>DigitalPot_DO<port>DigitalPot_DI<port>Youneedtoincludetisfile#include<MCP4XXXDigitalPot.h>And,youmustcallforeitherhardwareorsoftware:MCP4XXXInitAnd,forhardwareSPIsupportyoumustcall:SPIModeMasterFast,0
I have posted sample code for a number of use cases. See the demonstration folders.
Last edit: Anobium 2015-06-15
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have posted a driver for the Digital potentiometers from Microchip. It is a 2.7 to 5.5V 7-bit linear digital potentiometer with SPI interface.
Pot wiper commands include write or read. This program has write and reads commands with MOSI/MISO being multiplexed in the Digital potentiometer side.
This library is broadly compatible with the other devices in this series: They are: Microchip MCP4131, MCP4132, MCP4231, MCP4232, MCP4141, MCP4142, MCP4241, MCP4242, MCP4151, MCP4152, MCP4251, MCP4252, MCP4161, MCP4162, MCP4261, MCP4262.
You can use Hardware or Software SPI. The following provides an overview of usage:
I have posted sample code for a number of use cases. See the demonstration folders.
Last edit: Anobium 2015-06-15
See a Youtube demo video here
I have posted a number of example programs and other related information here
Enjoy
Last edit: Anobium 2015-06-16