Discussion in "PIC Microcontroller Discussion" started by    ponnus    Mar 29, 2014.
Sat Mar 29 2014, 04:09 pm
#1
Hai,
I am trying to use RA4 pin of PIC24F16KA101 as digital output.It is connected to one of the segments of the 7-segment display. But it is always giving a constant voltage of about 800mv. I am not able to drive this pin.

I checked the datasheet to know if it is an open drain, but that is not mentioned in the datasheet. I also tried setting it as open drain (ODCAbits.ODA4 = 1), and used a pull up resistor of 10K to Vcc(Vcc=3V). But still unable to drive it.

Does anyone faced such a problem?Any help is appreciated.....

Thank you
Mon Mar 31 2014, 12:20 pm
#2
Strange problem really... I checked datasheet to see if its an Analog pin but it is not. coz usually ports with analog function are analog by default and need to set as IO before using them. But this is not the case with RA4. Did you try replacing controller? also make sure that this pin is muxed with PDC3 so if you are in debug mode then probably it might now work.
 ponnus like this.
Tue Apr 01 2014, 10:42 am
#3
Hai,
Thank you for the reply.
Actually it is multiplexed with these ,PGC3/SOSCO/T1CK/U2CTS/CN0/RA4, but I am not using any of these peripherlals.
I am using PGC2 for debugging, and I've disconnected all external hardware devices from this port, and also checked for short.

When I was unable to drive the pin just like other pins, I thought it is an open-drain output.
So, I tried using a 10k pull up resistor,but it didn't worked.
Then I've made it open drain by setting ODCAbits.ODA4 = 1; and enabled the internal pull up by setting the corresponding CNPUE1 bit, but still the same result.
I am using LAT register for outputting.
Still this pin is giving around 800mv.
Tue Apr 01 2014, 12:43 pm
#4
Even though you've said you are not using any other function on RA4, Still can you check in your program if you have configured Peripheral Pin Select (PPS) configuration for CN0 is not configured by any chance?
LAT or PORT you can use any register. PORT can be used for input and output both. LAT is only for accessing port latch register. I do not think it has anything to do with open drain. Try replacing your controller once.
Tue Apr 01 2014, 10:06 pm
#5
Hai,
Actually, in the I/O ports section of the datasheet, it says that this family does not support PPS configuration.
Also,I've checked all the peripheral module enable registers associated with the multiplexed peripherals while debugging. None of the enable bits are set.

The pic I am using is a new one and I've already soldered it into the board. Rest everything is working fine. Fortunately, I have two more I/O pins left on my controller and so now I am using another port pin.

I'll update if I'll get something about this.

Thank you
Wed Apr 02 2014, 11:04 am
#6
I dont know.. but datasheet says look for PPS configuration. Strange! why they put this note if they do not support it

Do let me know if you find out something


[ Edited Wed Apr 02 2014, 11:05 am ]

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

ArnoldDiant
Fri Apr 26 2024, 03:53 am
RodneyKnorb
Thu Apr 25 2024, 07:08 pm
Williamjef
Thu Apr 25 2024, 02:08 pm
SamuelSmise
Thu Apr 25 2024, 09:56 am
DustinErele
Thu Apr 25 2024, 08:44 am
ztaletpzca
Wed Apr 24 2024, 11:19 pm
IrardlPex
Wed Apr 24 2024, 08:42 pm
Charlestehed
Wed Apr 24 2024, 05:20 pm