Can you elaborate on wideband noise?
I don't think so. The code in this case is very predictable. There is no "effect" in play here. The code is just reading the input and outputting the same value. The code is running from a 31KHz interrupt which is triggered from the ADC complete interrupt. The interrupt first reads the ADC and then configures the PWM outputs. Because of this order it is unlikely the ADC is picking up the spike created by the PWM since it is read before the PWM is triggered.
I am beginning to doubt that any type of typical RC or RLC filter can block this noise (voltage spike). The reason being the speed at which the spike happens (and trying many different filter combinations). Given that I have a 4KHz low-pass filter on the output, how could a 86Mhz signal make it through? I think the answer is that a filter can only attenuate (not eliminate) a signal and given the magnitude of the signal spike I'm dealing with, a typical filter isn't going to work. Well, a 90% reduction would indicate that the filter is working but I'm not sure the additional 10% is achievable.
I'm not sure from where you got this idea. I have tried and implemented several things to reduce the noise (that's why it sounds as good as it does nowYou dont seem to be willing to try anything that might help though based on some guesses about where the noise might actually be coming from.
Try a ceramic directly on the MCU power pins & see if that reduces the spike.
A decent size ceramic cap directly on the MCU power and ground should reduce or eliminate any high frequency noise on the power pins.
Use a 0.1uF or even several, if the chip has multiple power connections.
I've tested the sound by shutting down both PWM's (via software) and the circuit is very quiet when the PWM's are not toggling. Of course there is no sound being output in this case but it does show that there is no noticeable noise being generated by the rest of the circuit.Just as an experiment, try disconnecting the resistor from PWm7 pin on the arduino and let me know how it sounds.
Not just to the power circuit but soldered directly to the pins on the MCU itself (or its socket).
The frequency should not be a problem with a small ceramic cap, but any lead length between the CPU pins and the capacitor is.
For anything involving even vaguely sensitive analog or for high frequency gear I only ever use ground-plane boards. That minimises ground noise and offsets before they start to cause problems in most cases, as well as vastly reducing general noise.
you do not show the CPU board and that's the source of the noise problem, so where the most critical power pin decoupling and output decoupling should be.
I would suggest You to activate the pullup of all the inputs that have no proper condition.
OK, looking at that - I'd try a real arduino board rather than a clone, or at least a better clone.
I've found a through-PCB view of what appears to be that Arduino board, in the official version. It has a large ground plane area under the CPU with a good wide power track through near the top with what looks to be provision for a ceramic cap at the left and an electrolytic just above the right side:
Those capacitors do not appear to exist on your CPU board. Or, if your board does have any obvious ground and power copper areas below the chip, soldering some ceramics caps (different values, large and small) flat to the board and directly across those may help.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?