My project uses ADCs at 12bit resolution to sense accels and rate gyros, and also uses hardware PWM to control a motor driver. PWM uses: pins 6 & 7 at 10khz, 16 bit resolution. An optoisolator is put in between the Arduino Due and motor driver.
The problem is that the PWM causes voltage spikes in the ADC readings. At first, I suspected the rate gyros themselves. But it turned out to be the PWM signal. When I comment out the PWM calls, the spikes disappear. What can be done about this? I read about decoupling capacitors, but not sure where they need to be and what values to use.