Leo,
Any time you have a routine or command that counts time, an interrupt will cause the timing to be off. Since the POT command times the discharge time of a cap, an interrupt in the middle of it will cause the command to give you a faulty reading when it is resumed.
There are several options;
--turn off the interrupts just before your POT command (and any other timing-specific command), and restore them just after.
--write yourself a home-made "pot" command, and use it inside the interrupts (but this only works if your interrupts are high frequency.)
--use a "real" a/d converter, either one in the PIC or off the chip.
Bookmarks