Hello all! This is my first post in the forum.
Well, a few years back I've designed a "DJ" controller, which only reads the value of some potentiometers (10k LIN) and scans a matrix keyboard.
I was using the 18F4550 for the main processing and interface, and 3 logic gates to demux the entire keyboard when scanning.
Since this is powered only by USB, everything is connected to the 5V rails. (filtered by a 220uF cap, and each IC has an 1nF cap near its power pins)
The keyboard scanning was an easy task, and it worked out in the first try!
But, sampling the pots was a pain in the backside!
It worked out nice, but there was a "huge" amount of noise. It wasn't the matrix keyboard demux hard (since I've disabled it to try finding the noise source).
As usual, I've discarded some bits out of the ADC value, but the problem is still there. The last thing that I've done in that project was using an average value (using 20 samples per channel).
Doing the calculations of the Datasheet of this PIC, gives me 2.87uS of Tacq (aquisition time). Working at 48MHz, and selecting the biggest Tad value, I'm way out of that time (1.33uS, and should be greater than 2.87uS), which can be a problem.
I didn't tried out selecting the internal RC clock (which offers a Tacq of 2.5uS), but I will in the meantime.
PS: The potentiometers aren't meant to change its value quicky (maybe 40 or even 60 Hz in "rage mode"
).
Right now, the cables aren't shielded, but they used to be, and the problem was still there. The potentiometers are connected directly to the 5V rails (all of them).
The main reason about this post is that I'll desing a new PCB for this beast, and I'll like to know what I should take care to accomodate the signals (and thus, remove a little bit of noise).
I know the timing MAY be the only issue, but at least designing a good quality PCB will reduce the ammount of problems later!
I'll appreciate any feedback.
Thanks!