Tuesday, February 19, 2019

Teensy 3.6 with MCP4251 Digital Potentiometer

Connecting an MCP4251 digital potentiometer to a Teensy 3.6 is straight forward. 

MCP4251 !CS should be connected to Teensy 3.6 digital pin 0. 
MCP4251 SCK should be connected to Teensy 3.6 digital pin 13 SCK0.
MCP4251 SDI should be connected to Teensy 3.6 digital pin 11 MOSI0.
MCP4251 VSS should be connected to Teensy 3.6 ground.
MCP4251 VDD should be connected to Teensy 3.6 3V3.
MCP4251 SDO does not need to be connected. 
MCP4251 !SHDN should be connected to Teensy 3.6 3V3.
MCP4251 !WP should be connected to Teensy 3.6 3V3. 

Data is written to the chip by using an SPI transfer of B000x0000 (where x is the digital potentiometer channel) followed by Bnnnnnnnn (where nnnnnnnn is a number from 0 - 255 for the pot data). See below for an Arduino-based code example and breadboard setup.









0 comments: