soongkhim WROTE:I just noticed that port c bit 4 and 5 cannot be implemented as normal i/o. but y port b bit 5 cannot cannot be set?
correct, RC4 & RC5 cannot be used as digital output.
Unlike other PORTC pins, RC4 and RC5 do not have
TRISC bits associated with them. As digital ports, they
can only function as digital inputs. When configured for
USB operation, the data direction is determined by the
configuration and status of the USB module at a given
time. If an external transceiver is used, RC4 and RC5
always function as inputs from the transceiver. If the
on-chip transceiver is used, the data direction is
determined by the operation being performed by the
module at that time
RB5 should be able to use as digital output unless that port pin is either open-drain or faulty. Try to connect a 10K resistor to pull it high and see if it work.
Allen