Ports RG2 and RG3 on PIC24FJ64RB106

Thread Starter

dnlwltn

Joined Jul 31, 2013
5
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:

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;
 

Thread Starter

dnlwltn

Joined Jul 31, 2013
5
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.
 
Top