I've been messing around with the idea of using a digipot to control a JFET clean blend circuit. Im using a MCP41050 and an attiny13 to use to control the digipot.
Im using a pot to read 0-5v on pin 3 of the attiny to send the corresponding data through SPI.
The problem Im facing is that the resistance will never read full zero ohms, causing a little bit of the effect signal to bleed into the clean signal. like when the analog pot reads 0v, the resistance between pa0 and pw0 reads to about ~450ohm, and same on the other side when the analog pot reads full on 5v and when i read pb0 to pw0.
Im assuming that this is a limitation of the pot itself, probably some tolerance thing but I was wondering if there was anyway to mitigate this. I cant just put a pin onto ground because thatll mute the audio signals. When all audio signal lines are disconnected from the digipot, I get the same readings.
/*
ATTINY13/85
Converts analogread into data for digipot.
To be used with MCP41xxx digipots.
Might need to change library from TinySPI (13) to tinySPI(85).
*/
/* ATTINY PINS */
/* RESET 1|O |8 VCC
SL PIN 1 ON MCP41 2| |7 CLOCK/ PIN2 ON MCP41
10K POT WIPER 3| |6 EMPTY
GND 4| |5 MOSI PIN3 ON MCP41 */
#include <TinySPI.h>
byte address = 0x11;
int i = 0;
//int potINPIN = A2;
#define potINPIN A2
analog_pin_t potPIN = A2;
int potRawValue;
int potOutValue;
const int CS = 3;
void setup()
{
//Serial.begin(115200);
pinMode (CS, OUTPUT);
// pinMode (clockpin, OUTPUT);
// pinMode (datapin, OUTPUT);
SPI.begin ();
// adjust high and low resistance of potentiometer
// adjust Highest Resistance .
digitalPotWrite(0x00);
delay(1000);
}
void loop()
{
potRawValue = analogRead(potINPIN);
potOutValue = potRawValue >> 2;
digitalPotWrite(potOutValue);
delay(10); // this might be important to let the digipot respond.
//Serial.print("pot val = ");
//Serial.print(potRawValue);
//Serial.print(" digipot value = ");
//Serial.println(potOutValue);
}
int digitalPotWrite(int value)
{
digitalWrite(CS, LOW);
SPI.transfer(address);
SPI.transfer(value);
digitalWrite(CS, HIGH);
}
here is the code im using as well just to cover all bases. Im assuming its a hardware issue still though. Thank you for any input!