Quote Originally Posted by Melanie View Post
Most PICs only have ONE ADC which is multiplexed to a whole heap of pins. This means you have to select your Input, perform an ADC operation, select the next input etc etc...
This is an old thread of mine, but I've just revisited it on account I wanted to be sure what I'd asked previously!

Ok, I have my PIC program successful carrying out AtoD on one incoming (full wave rectified) guitar signal.

Presently I'm hard coding the 'target DC' level for the PIC AGC circuit to strive for eg (let's say I've set a raw AtoD value of 550 as the optimum incoming DC level ...but the full wave rectified guitar signal is only measuring 400 - then the PIC just sends some pulses to a volume control to increase the signal)

Now to try & save POTs/switches having to be mounted on the guitar, I'd like to design my own little board with a resident pot on it - I'd like use the DC level from this pot to set the AGC's target incoming DC level for the circuit to strive for - the thing is my PIC 16F690 is already using one channel of AtoD to sample the incoming rectified guitar signal. From Melanies post above it seems that I'll need to switch the AtoD converter to another input pin

How do I switch the AtoD pin - is that done with the ADCON0 setting? (& presumably I have to switch back & forwards between the two pins involed - each time changing the pin that the AtoD converter is connected to)

Let's say my guitar signal is AtoD'ed on AN1 ...if I then want to use AN2 in my circuitry, does this mean that everytime I want to establish the DC level on the pot, I need to invoke a ADCON0 command to change the CHS2,CHS1 and CHS0 bits (bits 3,4 & 5 of the ADCON register?) Forgive the naive line of questiong - I'm far away from even being considered an entry level programmer - this stuff doesn't come easy to me!)

Someone asked a bit further up this thread, to post a demo of the thing I'm pottering on with , well here's a link to a short video I made (albeit this video was when I was using analogue for the AGC aspect - which was not flexible enough in the end, hence returning to the scary world that is digital!)