Hola a todos. Necesito usar las patitas RC4 Y RC5 como entrada y salida digital en el PIC18F2550. Según leeí en el DATASHEET tengo que hacer lo siguiente: "To use pins RC4 and RC5 as digital inputs, the USB module must be disabled (UCON<3> = 0) and the on-chip USB transceiver must be disabled (UCFG<3> = 1)"
O sea que en el programa tengo que modificar los registros UCON, UCFG y los bits 3 respectivamente. Bueno yo lo hice de esta manera pero no me funciona, y no puedo encontrar el problema.
#include <18F2550.h>
#fuses HS,MCLR,NOWDT,NOPROTECT,NOLVP,NODEBUG,USBDIV,PLL5,CPUDIV1,VREGEN,NOPBADEN // el fuse
#device adc=10
#use delay(clock=20000000)
#use rs232(baud=9600, xmit=pin_c6, rcv=pin_c7, bits=8)
#use i2c(Master,sda=PIN_B0,scl=PIN_B1)
#BYTE UCON = 0xF6D
#BYTE UCFG = 0xF6F
/////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////
void main() {
bit_clear(UCON,3);
bit_set(UCFG,3);
do{
output_high(PIN_C4);
delay_ms(1000);
output_low(PIN_C4);
delay_ms(1000);
}while(1);
}