Is the PORT C of your atmega16 not working properly? Here is an easy fix.
Read this post on avrlogic.blogspot.com