Hi and welcome on the forum,
regardless to their size... they all have a datasheet, and few things have to be checked first. Here you want to use a specific I/O as a digital signal... but...

This specific i/o have some analog stuff multiplexed on, so you MUST check if it's enable at POR.. unless... yes it will never ever dare to work... just to ruine your whole life and loose some hair at same time. So let's open the datasheet together
http://ww1.microchip.com/downloads/e...Doc/41239D.pdf
Page 3, table 1-1, it says it has 1 comparator, page 4, pin diagram show GP0/ICSPDAT/CIN+ the comparator input. Let's scroll to page 39, Register 8-1 CMCON0 register. At power up, it show comcon0=%11111111.. BIT3 CMPON.. when = 1 comparator is on.... you don't want it. clear everything
CMCON0=0
this should cure the problem.
PS: default setting says that MCLRE is enabled, make sure you tie MCLR pin to vdd, or change the configuration fuse to disable the MCLR feature.
more info
http://www.picbasic.co.uk/forum/showthread.php?t=543
Last edited by mister_e; - 18th December 2007 at 05:09.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks