Menu

A driver for Digital potentiometers from Microchip

Anobium
2015-06-15
2015-06-15
  • Anobium

    Anobium - 2015-06-15

    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.
    
      You need to define for hardware or software:
                    DigitalPot_CS  <port>
                    DigitalPot_SCK  <port>
                    DigitalPot_DO  <port>
                    DigitalPot_DI  <port>
        You need to include tis file
            #include <MCP4XXXDigitalPot.h>
        And, you must call for either hardware or software:
            MCP4XXXInit
        And, for hardware SPI support you must call:
            SPIMode MasterFast, 0
    

    I have posted sample code for a number of use cases. See the demonstration folders.

     

    Last edit: Anobium 2015-06-15
  • Anobium

    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

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.