You say the noise creates havoc within your PIC - are you certain it's noise & not the source voltage going over 10V? (& therefore your potentially divided 0-5V breaching 5V?).That said if the noise spikes are very high & prevelant, then in essence the voltage you're monitoring will spike up above 5V.
The reason I ask, is because just a couple of nights ago, I was getting one particular (static) AtoD reading all over the shop....& this for a simple pot arrangement with 5V across it (I spent ages going over all my register my PIC register settings with a fine tooth comb - ages) except ahem, the aforementioned Pot didn't have 5V across it...it was 6V!
The resulting PIC AtoD readings totally were crazy ....jumping about all over the show for a static pot wiper reading.....successive samples along the lines of 1024, 868, 976, 658, 950 etc etc
Moral of the story (for me!)....when you get crazy AtoD reading, double check to make sure the voltage you're AtoD'ing is never greater than the PIC's supply voltage!
Bookmarks