Speakerguy
Active Member
Hey,
I am using a PIC to control a digitally operated analog volume control (a TI PGA2310 chip). I need to take the wiper of a linear pot, read it in with the PIC's ADC module, then send the appropriate volume setting to the PGA2310 with the PIC via serial bus (I2C or SPI, I can't remember which).
I do not want to constantly poll the ADC port to detect a change in volume. Sure I can do it that way, but what a waste, right? So I am contemplating methods so that I do not have to do this.
The first idea I had was an opamp based solution. The wiper of the pot goes to two RC filters, one having a high Fc and feeds into the + input of the op amp and the other RC having a much lower Fc and feeds into the - input of the op amp. A very high value resistor provides some positive feedback directly to the + input of the op amp.
Theory of operation: Change in pot setting causes faster reaction on the + input than on the - input. Opamp goes to high or low rail depending if the wiper voltage went up or down, respectively. The slower RC eventually reaches the ~same output voltage to the - input, but the high resistance positive feedback resistor keeps the system in the state caused by the initial changes. The output of the opamp is fed into two input pins, one with a weak pull up and the other a weak pull down, with interrupts configured to happen on a change.
Downsides: It seems this would work, but it requires a fair amount of hardware, component values need to be carefully chosen and honestly polling is probably the better solution compared to this. Attached is the LTspice file. It simulates a change of 0.05 volts over a period of 1 second, both rising and falling.
Can anyone recommend a better way to do this?
I am using a PIC to control a digitally operated analog volume control (a TI PGA2310 chip). I need to take the wiper of a linear pot, read it in with the PIC's ADC module, then send the appropriate volume setting to the PGA2310 with the PIC via serial bus (I2C or SPI, I can't remember which).
I do not want to constantly poll the ADC port to detect a change in volume. Sure I can do it that way, but what a waste, right? So I am contemplating methods so that I do not have to do this.
The first idea I had was an opamp based solution. The wiper of the pot goes to two RC filters, one having a high Fc and feeds into the + input of the op amp and the other RC having a much lower Fc and feeds into the - input of the op amp. A very high value resistor provides some positive feedback directly to the + input of the op amp.
Theory of operation: Change in pot setting causes faster reaction on the + input than on the - input. Opamp goes to high or low rail depending if the wiper voltage went up or down, respectively. The slower RC eventually reaches the ~same output voltage to the - input, but the high resistance positive feedback resistor keeps the system in the state caused by the initial changes. The output of the opamp is fed into two input pins, one with a weak pull up and the other a weak pull down, with interrupts configured to happen on a change.
Downsides: It seems this would work, but it requires a fair amount of hardware, component values need to be carefully chosen and honestly polling is probably the better solution compared to this. Attached is the LTspice file. It simulates a change of 0.05 volts over a period of 1 second, both rising and falling.
Can anyone recommend a better way to do this?