PDA

View Full Version : PortA.4 problem



Srigopal007
- 28th April 2005, 00:32
Hi Forum,

I have a series of LEDs connected to several ports in the PIC18F6620. My program is very simple in that I am only turning the LEDs On and Off one at a time. I have set the correct TRIS registers to make the usable pins as Output pins, the problem I am getting is that, why does the LEDs in PortA.4 not turn On. I have attached my code below: Can you please help. thanks

Srig

mister_e
- 28th April 2005, 01:58
PORTA.4 is often an open drain type. So you can't drive a positive voltage with... well not directly as the other pins. try the append solution and post your result

Melanie
- 28th April 2005, 07:57
Crow-Baring the LED to turn it OFF is not very elegant and significantly adds to Global Warming when the LED is OFF.

A better solution would be to connect one end of the Resitor to VDD (as you have it), the other end to the LED Anode, and the LED Kathode to PIC pin RA4. Drive the pin LOW for ON, and HIGH for OFF.

PIC Coder
- 28th April 2005, 08:06
Hi,
This particular PortA.4 is open drain type so you have to take care it at hardware and software level.
Bye

mister_e
- 28th April 2005, 16:09
@Melanie,

I agree but some will absolutely prefer using the 'when the pin is high the LED is on' method to make the code more easy to understand if there's no flag that convert 0 to LedIsOn and 1 to LedIsOFF. You know what i mean!

about the warming... (5*5)/300=0.083W ... human skin will produce more heat than this IMHO. But O.K for the unusefull current need.