PortA.4 problem


Closed Thread
Results 1 to 5 of 5

Thread: PortA.4 problem

  1. #1
    Join Date
    Jul 2004
    Location
    CA
    Posts
    78

    Angry PortA.4 problem

    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
    Attached Files Attached Files

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    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
    Attached Images Attached Images  
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    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.

  4. #4
    PIC Coder's Avatar
    PIC Coder Guest


    Did you find this post helpful? Yes | No

    Default PortA.4 Is Open Drain Type.

    Hi,
    This particular PortA.4 is open drain type so you have to take care it at hardware and software level.
    Bye

  5. #5
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    @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.
    Last edited by mister_e; - 28th April 2005 at 16:13.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. problem using GOSUB under interrupt
    By fobya71 in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 5th March 2010, 19:52
  2. PORTA.4 problem in PIC16F84A ?
    By iugmoh in forum General
    Replies: 4
    Last Post: - 8th May 2008, 12:07
  3. USART Problem , but don't know where, in pc? or in PIC?
    By precision in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 15th July 2007, 08:12
  4. 1 slave 1 master 1 MAX232 1 problem ?
    By SuB-ZeRo in forum mel PIC BASIC Pro
    Replies: 19
    Last Post: - 31st July 2005, 22:59
  5. PORTA.PinNo = 1 ' problem
    By frank small in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 6th May 2004, 14:30

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts