• AVR Freaks

Hot!PIC24FJ256GB110 RA14 RA15 not working as expected

Author
omairkha
New Member
  • Total Posts : 16
  • Reward points : 0
  • Joined: 2014/05/30 16:34:05
  • Location: 0
  • Status: offline
2020/08/06 14:34:16 (permalink)
0

PIC24FJ256GB110 RA14 RA15 not working as expected

 Hi everyone, 
 
I have an application where I need to output a high on a digital pin and check if another pin is high or low. The device is almost like a cable checker and the PIC24 is on a custom PCB.
 
Everything's working fine as expected except for pins RA14 and RA15. For some reason, every time I set LATA14 high, PORTA15 goes high as well. I've checked for shorts anywhere around those pins and haven't found any. Multimeter doesn't detect any shorts either. I've tested on 3 separate PCBs and the result is the same on all 3.
 
I have turned off I2C1 and disabled open drain... did I miss something else for these pins? Below is a snippet of the code that relates to RA14 and RA15. The rest of the code is pretty much the same but checks other pins:
 

 
   //Disable I2C
   I2C1CONbits.I2CEN = 0;
   //Disable open drain
   ODCA = 0;
 
    //Test pins
    TRISAbits.TRISA14 = 0; //Set output
    TRISAbits.TRISA15 = 1; //Set INtput
    MyDelay1();
    
    LATAbits.LATA14 = 1; //Set high
    MyDelay1();
    ReadPin = PORTAbits.RA15;
    if(ReadPin) //if high then there is a short
    {
        FailAt = 10;
        return 1;
    }
    LATAbits.LATA14 = 0;

 
While debugging in IO View I can both PORTA14 and PORTA15 are 0 up untile MyDelay1(). Once LATA14 is set high, both PORTA14 and PORTA15 become high. Anyone else experienced this before?? Appreciate any help.
 
 
#1
MBedder
Circuit breaker
  • Total Posts : 6919
  • Reward points : 0
  • Joined: 2008/05/30 11:24:01
  • Location: Zelenograd, Russia
  • Status: offline
Re: PIC24FJ256GB110 RA14 RA15 not working as expected 2020/08/06 16:18:51 (permalink)
4 (1)
So your port pins are floating around while not being connected to any low impedance voltage source - then what do you expect from them?
#2
omairkha
New Member
  • Total Posts : 16
  • Reward points : 0
  • Joined: 2014/05/30 16:34:05
  • Location: 0
  • Status: offline
Re: PIC24FJ256GB110 RA14 RA15 not working as expected 2020/08/07 11:16:13 (permalink)
4 (1)
MBedder
So your port pins are floating around while not being connected to any low impedance voltage source - then what do you expect from them?


Thanks for the feedback. 
 
I'm using 52 IO lines in the exact same way and they all work as expected apart for RA14 and RA15. So this leads me to think there was a setting I may have missed for those pins. 
 
As part of the initialization I clear out all the PORT registers so there aren't any erroneous readings. Both PORTA14 and PORTA15 remain 0 until I write a 1 to LATA14. All other PORT registers remain unaffected. I thought it may have something to do with the I2C.
 
 
#3
ric
Super Member
  • Total Posts : 28378
  • Reward points : 0
  • Joined: 2003/11/07 12:41:26
  • Location: Australia, Melbourne
  • Status: offline
Re: PIC24FJ256GB110 RA14 RA15 not working as expected 2020/08/07 16:34:04 (permalink)
0
omairkha
I'm using 52 IO lines in the exact same way and they all work as expected apart for RA14 and RA15. So this leads me to think there was a setting I may have missed for those pins. 

You did not answer.
Do all the other inputs have pulldown resistors on them?
If you are assuming a floating pin will read zero, then it's good luck not good design if it works.
 
post edited by ric - 2020/08/07 16:35:13

I also post at: PicForum
Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
NEW USERS: Posting images, links and code - workaround for restrictions.
To get a useful answer, always state which PIC you are using!
#4
omairkha
New Member
  • Total Posts : 16
  • Reward points : 0
  • Joined: 2014/05/30 16:34:05
  • Location: 0
  • Status: offline
Re: PIC24FJ256GB110 RA14 RA15 not working as expected 2020/08/07 17:07:01 (permalink)
0
ric
You did not answer.
Do all the other inputs have pulldown resistors on them?
 

Sorry, no, external pull downs were not added. I have enabled the internal pull downs but that did not help.
#5
ric
Super Member
  • Total Posts : 28378
  • Reward points : 0
  • Joined: 2003/11/07 12:41:26
  • Location: Australia, Melbourne
  • Status: offline
Re: PIC24FJ256GB110 RA14 RA15 not working as expected 2020/08/07 20:43:09 (permalink)
4 (1)
Internal pulldowns are very weak, not suitable for long cable runs.
 

I also post at: PicForum
Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
NEW USERS: Posting images, links and code - workaround for restrictions.
To get a useful answer, always state which PIC you are using!
#6
omairkha
New Member
  • Total Posts : 16
  • Reward points : 0
  • Joined: 2014/05/30 16:34:05
  • Location: 0
  • Status: offline
Re: PIC24FJ256GB110 RA14 RA15 not working as expected 2020/08/11 09:54:13 (permalink)
0
So I added external 10k pulldowns on RA14 and RA15 and it works now. Looks like the internal pull downs indeed weren't enough. Something curious tho... I need to still enable the internal pull downs for these 2 pins for it to work. If I comment out the internal pull down setting code, it doesn't work with just the external 10k pulldowns. I thought 10k would have been enough.
#7
Jump to:
© 2020 APG vNext Commercial Version 4.5