When setting the TRIS? =%????????
0 is for output
1 is for input

This best explains about setting things to digital.
http://www.picbasic.co.uk/forum/showthread.php?t=561

And when using a resonator the config would be HS.