PIC24FJ64GB106 Ports RG2/RG3

USB PICs and the UBW

Moderator: phalanx

Post Reply
Posts: 2
Joined: Mon Apr 28, 2014 4:04 pm

PIC24FJ64GB106 Ports RG2/RG3

Post by dnlwltn » Mon Apr 28, 2014 4:07 pm

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
        //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;

Posts: 2
Joined: Mon Apr 28, 2014 4:04 pm

Re: PIC24FJ64GB106 Ports RG2/RG3

Post by dnlwltn » Tue May 06, 2014 11:13 am

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.

Post Reply