Ports RG2 and RG3 on PIC24FJ64RB106

Discussion in 'Embedded Systems and Microcontrollers' started by dnlwltn, Apr 28, 2014.

  1. dnlwltn

    Thread Starter New Member

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

    Code ( (Unknown Language)):
    1.  
    2.         //Enable USB so we can change settings
    3.         U1PWRCbits.USBPWR = 1;
    4.         U1CONbits.HOSTEN = 1;//HOSTEN
    5.         U1CONbits.USBEN = 1;//USBEN
    6.         U1OTGCONbits.OTGEN = 1;//OTGEN
    7.         //Disable pullups and pulldowns
    8.         U1OTGCONbits.DMPULDWN=0;
    9.         U1OTGCONbits.DPPULDWN=0;
    10.         U1OTGCONbits.DMPULUP=0;
    11.         U1OTGCONbits.DPPULUP=0;
    12.         //Disable USB
    13.         U1CONbits.HOSTEN = 0;//HOSTEN
    14.         U1CONbits.USBEN = 0;//USBEN
    15.         U1OTGCONbits.OTGEN = 0;//OTGEN
    16.         //Turn off power to the module
    17.         U1PWRCbits.USBPWR = 0;
    18.         //Disable USB Functions
    19.         U1CNFG2bits.UTRDIS = 0;
    20.         //U1CNFG2bits.UVBUSDIS = 1;
    21.         //U1CNFG2bits.UVCMPDIS = 1;
    22.  
    23.    
    24.         TRISGbits.TRISG2 = 1;
    25.         TRISGbits.TRISG3 = 1;
    26.  
     
  2. dnlwltn

    Thread Starter New Member

    Jul 31, 2013
    5
    0
    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.
     
Loading...