Please see images for the setup that I use. The mega is powered from a 7812 and is generating a pwm wave at pin 7 (10us on time and 100us offtime) using delayMicroseconds and toggling the pin.
I took the measurements across the 7805 output with the arduino disconnected from 7812. It has a 15mv p-p noise (see image, its on 20mv scale). Then I took measurements with the mega connected to 7812 and generating the PWM. the 7805 output has become very noisy (even at 10 times the scale of 200mv)… How do i avoid/suppress this. The 7805 is supposed to power a dac and this noise is causing issues. Both the regulators have output caps at 0.1uf. The cap bank at the trafo output is 140kuf.