I designed and built a high voltage AC supply with LED to show when it was on. My prototype worked OK but in the production unit, the LED flickers off and on. I can't find a problem, but the layout mixes the PWM and digital grounds, which my layout did not do.