multirate ADC sampling
![SaucySoliton](https://forums.parallax.com/uploads/userpics/712/n7VVMHHQYJ0IB.png)
I'm not sure why I'm asking this, but I value your opinions.
I'm using the same ADC pins for multiple purposes, which operate at different sampling rates. ~1Hz for displaying performance. 48kHz for the control loops.
Application: DC to DC converter
Sysclock 24MHz
Sinc3 filtering with an interval of 500 clocks
The sinc3 sample rate is 48kHz. These samples are used for the control loops, which also run at 48kHz, The PWM is 48kHz or higher.
7 ADC pins in use. The controls need a minimum of 5 measurements, input voltage, input current, output current, and 2 for a differential measurement of the output voltage.
32768 samples are averaged together to produce measurements for human observation and coulomb counting.
The dilemma:
It would be nice to have high speed samples from the scope filter for diagnostics or cycle by cycle current limit.
Using the 68 tap Tukey filter, it is necessary to sample the scope filter output every 52 clocks to get a smooth impulse response on the averaged output. With just "rdpin" and "add" for each of 7 pins, the cog is 54% utilized. So I guess all I need to do is double the sysclock to make up for the extra load. But what if I want to do extra filtering? "rdpin", "mul/sca", "add" = 80% load.
I don't have enough spare pins to use 2 ADC pins for each signal.
Comments
And the main reason for wanting two ADC pins for each signal is ... because the Prop2 has lots of ADCs? Oh, this is the multirate thing. Want to measure in parallel ...?
And you've got 7 pins available but want 10, right? How come there is no more pins?
Why not use the 48kHz samples for the control loops directly, filter them in software for the display and use the PWM switch mode power supply smart pin mode for cycle by cycle current limiting? The PWM SMPS mode uses input B which can be driven by an adjacent pin DAC+comperator input. This is faster than any scope ADC mode.