Post the whole code and schematic. Maybe then...