You will need to check your comparator setting, and also double check there's no conflict with any ADC channels multiplexed on the same pins as your comparator.
On 18F, you want to write to LAT register and read from PORT register.
Bad news, here it's Melabs PicBasic Pro forum. Your question qill be better aswered on MicroChip forum.
http://www.microchip.com/forums/Default.aspx?
Bookmarks