Page 1 of 1

PIC24FJ64GB106 Ports RG2/RG3

Posted: Mon Apr 28, 2014 4:07 pm
by dnlwltn
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.

Here is the current code I'm trying, though I've tried many combinations:

Code: Select all

        //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;   
        TRISGbits.TRISG2 = 1;
        TRISGbits.TRISG3 = 1;

Re: PIC24FJ64GB106 Ports RG2/RG3

Posted: Tue May 06, 2014 11:13 am
by dnlwltn
After posting on many forums and dealing with Microchip directly, I have been unable to find a solution to this problem using the PIC24FJ64GB106. However, Dario G at the Microchip forums suggested switching to the PIC24FJ64GA106 which is a drop in replacement without the unnecessary USB functionality. This is the solution I will use.