Firstly! This line will not convert TMR1H to an int so the high val is shifted outval=(TMR1H<<8)|(TMR1L);
Secondly! Same here!!freq=(50/val);
hum=565-freq/13;
Thirdly...... What's happening here! Not sure why you need to toggle the timer?if(T1CON.TMR1ON==0)
{
T1CON.TMR1ON=1;
INTCON.INTF=0;
}
else if(T1CON.TMR1ON==1)
{
T1CON.TMR1ON=0;