I would add that the TOCS bit of the OPTION register must be a '0' for GP2 to be an output. Even if the TRIS register has the GP2 bit set to '0', the TOCS bit overrides it. This was my first curve back when I started with these chips. Michael REMOVE THE .NS (NO SPAM) FROM MY ADDRESS TO REPLY *************************************************************************When th e way of the Tao is forgotten, kindness and ethics must be taught. Men must learn to pretend to be wise and good. -- Lao Tzu *************************************************************************