On Tuesday, September 27, 2011 6:02 PM, "Jacopo Monegato" wrote: > know WHY this happens. I know that a lot of hum comes from switching > power supplies (and since i come from italy, i think it has 220V hum ;) The EMI filtering in the power supply couples the primary to the secondary, so even though the output voltage is 12 VDC, both output terminals have a fraction of the primary voltage impressed upon them. This is through a network that is mostly capacitive, so the amount of current is small. And it is from both primary wires, so it is half the primary voltage. But the "ground" of your PIC circuit will have 100 VAC on it, and if you have it sitting close to a workbench surface, there is some coupling. And any PIC input that is open can interpret that coupling as some input. =20 > Now what i can't understand is WHY only the pwm module doesn't work.... Perhaps other things might not work also.=20 > If it's so obvious that it's not written anywhere, i am sorry ;) Inputs that are driven beyond the supply voltage or more negative than ground can cause unpredictable operation. And if the inputs are floating, almost anything can drive them out of spec. Also maybe your power supply voltage does not rise quickly enough. You should enable PWRT and BOR. Cheerful regards, Bob --=20 http://www.fastmail.fm - The professional email service --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .