I am just making a wild guess, maybe PORTC.7 should be set LATC.7.
http://www.picbasic.co.uk/forum/show...57&postcount=9

If I understand this right, LATC will set the pin digital and PORTC is schmitt trigger.