Well, post your whole code, and schematic, we could help further.