I'm trying to create a simple audio circuit that is able to output a sine wave at an audible frequency. I'm using an atmega328p for this because I'd like the frequency pattern to be programmable in software. It is working mostly correctly except for a mysterious ~1Hz oscillation on top of whatever frequency is being played, and I'd like to get rid of the ~1Hz noise. The code is pretty simple, just containing one interrupt to set the PWM value that is called about 30,000/s and there are no other interrupts or loop events. The circuit is simple as well containing the MCU, icsp header, reset pushbutton, audio jack and a low pass filter to get rid of high frequency noise. Here is a picture:
Originally I was using a breadboard but I found some suggestions that capacitative coupling in the breadboard could be causing this, so I moved it to the soldered protoboard above without success. Also, I've tried battery, wall and USB power with no success.
Any suggestions on things to try? Could it be related to ground loops?