Hi,
I am using the PIC24FJ64GB106. I need to use pins RG2 and RG3 as INPUTS. I cannot, for the life of me get them to work. I have tried everything to disable the USB module, but I still cannot read a logic high off of either input. All other inputs are working correctly. Please help. Thanks.
Here is the current code I'm using, though I have tried many variations:
I am using the PIC24FJ64GB106. I need to use pins RG2 and RG3 as INPUTS. I cannot, for the life of me get them to work. I have tried everything to disable the USB module, but I still cannot read a logic high off of either input. All other inputs are working correctly. Please help. Thanks.
Here is the current code I'm using, though I have tried many variations:
Rich (BB code):
//Enable USB so we can change settings
U1PWRCbits.USBPWR = 1;
U1CONbits.HOSTEN = 1;//HOSTEN
U1CONbits.USBEN = 1;//USBEN
U1OTGCONbits.OTGEN = 1;//OTGEN
//Disable pullups and pulldowns
U1OTGCONbits.DMPULDWN=0;
U1OTGCONbits.DPPULDWN=0;
U1OTGCONbits.DMPULUP=0;
U1OTGCONbits.DPPULUP=0;
//Disable USB
U1CONbits.HOSTEN = 0;//HOSTEN
U1CONbits.USBEN = 0;//USBEN
U1OTGCONbits.OTGEN = 0;//OTGEN
//Turn off power to the module
U1PWRCbits.USBPWR = 0;
//Disable USB Functions
U1CNFG2bits.UTRDIS = 0;
//U1CNFG2bits.UVBUSDIS = 1;
//U1CNFG2bits.UVCMPDIS = 1;
TRISGbits.TRISG2 = 1;
TRISGbits.TRISG3 = 1;