At 09:38 AM 9/24/99 +1000, Tom wrote: >With 16 knobs that's 1MSPS per 8 knobs = 1\8th MSPS = 125000 SPS for EACH >knob. 30 samples a sec. isn't acceptable in my book. I figured out with 5 >active knobs (hands, feet, mouth :)) I can get one 7-bit message (=20bit at >31250bps) out every 3ms. Hence I would like all knob values updated in a >maximum of 2-3ms. I'd really prefer sub 1 ms delays. There's going to be >enough delays in the MIDI transmission without the box introducing more. Why do you need 1 ms updates? And, if you do, then your 'signal frequency' is going to be 1 kHz. >So with 16 knobs I could do 125000Hz sampling. You could, but it's overkill. >My noise will be the 50MHz clock, the 50\60Hz hum (like it to be suitable >for both apart from actual PSU) and frequencies generated by knob turning >which should be less than 50Hz. If the frequencies from turning the knob are 50 Hz, why do you need to sample at 1 ksps? >I gather with a sampling frequency of 125000Hz all I need to filter is the >50MHz clock. In fact as long as I sample at at least 500Hz (60Hz * 2 plus >lots of margin) I should simply need a filter somewhere between 250Hz and >50MHz, with lower being better. Wrong. The 60 Hz won't go away just because you oversample it, anymore than your pot changes do. In fact, the 60 Hz is going to lie in your signal spectrum, so if you've got a problem with it, it's going to be hard to get rid of. Start smart, and try to use good layout, cabling, ground and other design to keep it from getting in in the first place. Don't forget that clock dividing is going on inside your chip. (E.g., divide by 4), so lower frequencies will be present. >I would like the filtering to be as flexible as possible as I will basically >be allowing the ADC to free run so will not neccesarily have a fixed >sampling rate. I will simply keep sampling the ADC copntinuously in my >foreground loop with interrupts to trigger MIDI sendng. Thus the ADC section >will simply be keeping a running average which will occasionaly be sent by >the other process. Sampling at a fixed frequency will allow better digital filtering later, if you need it. >You mention digital noise. This is an area in which I am slightly confused. >ADC's always have seperate analog and digital ground to prevent clock noise >on the analog ground. I have looked at 2 application notes detailing ADC >setup. One said that the AGND and DGND's should be connected as close to the >ground source as possible. This sounded pretty reasonable. The easiest path >from ground to AGND has nothing to do with DGND. Yet another app. note (I'm >pretty sure it was an Analog Devices app note) said AGND and DGND should be >connected at the chip and one wire run to the ground. Which is correct? What this all means is that these noise problems do crop up, so much so that the ADC designers have to design carefully. This should be a tip-off to not take the issue lightly. At this point, you need to start doing some real engineering instead of fixing on a bottom-up design. If you really need pot updates at 1000 samples/sec., then put in a low-pass filter that rolls off at 500 Hz. This will take care of electronic noise plus any harmonics of the low-order signal frequencies. There's nothing useful above this frequency anyway. The gross sampling rate of the ADC is irrelevant to the filtering issue. The only thing of importance is a single pot signal. You may eventually have to do something about the 60 Hz. Normally you fix this by differential inputs. However, this probably is difficult in your situation. You can also put in a notch filter at 60 Hz, as long as this doesn't distort your signal too much. I strongly suggest you wire and test a single pot to find out if you have a noise problem at all, whether you need to sample at 10 sps, 50 sps or 1000 sps, etc. Without some validation of your design, it's fruitless to theorize about these issues. ================================================================ Robert A. LaBudde, PhD, PAS, Dpl. ACAFS e-mail: ral@lcfltd.com Least Cost Formulations, Ltd. URL: http://lcfltd.com/ 824 Timberlake Drive Tel: 757-467-0954 Virginia Beach, VA 23464-3239 Fax: 757-467-2947 "Vere scire est per causae scire" ================================================================