+ Reply to Thread
Results 1 to 9 of 9

Thread: 8051 output prob...

  1. #1
    tariq7868 Okay
    Join Date
    Mar 2009
    Location
    Karachi, Pakistan
    Posts
    94

    Default 8051 output prob...

    hello.. i am new to microcontroller. i programmed the 8051 to blink led at port 0. Led is blinking alright but at the output port pin (i.e at all of the pins of port 0) i am getting only about 1.7-1.8 volts making the led to light much less bright. i also tried to get output from port 1 but the same results. my 5v (regulated) power supply is ok..
    is ic damaged?


  2. #2
    Super Moderator Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent
    Join Date
    Nov 2003
    Location
    Derbyshire, UK
    Posts
    29,754

    Default

    Quote Originally Posted by tariq7868 View Post
    hello.. i am new to microcontroller. i programmed the 8051 to blink led at port 0. Led is blinking alright but at the output port pin (i.e at all of the pins of port 0) i am getting only about 1.7-1.8 volts making the led to light much less bright. i also tried to get output from port 1 but the same results. my 5v (regulated) power supply is ok..
    is ic damaged?
    The antique 8051 isn't able to provide much power from the I/O's, and I presume you are using resistors in series with the LED's?.
    PIC programmer software, and PIC Tutorials at:
    http://www.winpicprog.co.uk

  3. #3
    ronsimpson Good ronsimpson Good ronsimpson Good
    Join Date
    Apr 2007
    Location
    Loveland, CO USA
    Posts
    710

    Default

    Is your LED on when you write 0 or when you write 1?
    I think these parts pull down well but do not pull up good.

  4. #4
    alphacat Okay
    Join Date
    Apr 2009
    Location
    France
    Posts
    732

    Default

    What should the voltage read when the pin it set to HIGH?
    It could happen because the LED or any other components draw too much current than the MCU or the PSU can provide.
    To my knowledge, ICs have a mechanism where their votlage drops when too much current is drawn from them.
    I suggest that you first disconnect the LED from the GPIO pin and measure the voltage then.
    If the voltage is still lower than how it should be, then there's probably something else thats overloading your system.
    Last edited by alphacat; 27th June 2009 at 06:53 PM.

  5. #5
    Papabravo Excellent Papabravo Excellent Papabravo Excellent Papabravo Excellent Papabravo Excellent Papabravo Excellent Papabravo Excellent
    Join Date
    Mar 2006
    Location
    Michigan, USA (GMT-5)
    Posts
    2,892

    Default

    They are open drain ports. In order to go high they need an external pullup resistor. A schematic of your hookup might be helpful.
    Last edited by Papabravo; 28th June 2009 at 02:57 AM.
    We never have time to do it right; but we always have time to do it over.

  6. #6
    Hayato Excellent Hayato Excellent Hayato Excellent Hayato Excellent Hayato Excellent
    Join Date
    Jun 2006
    Location
    Brasilia, Brazil
    Posts
    655
    Blog Entries
    1

    Default

    Don't forget that logic circuits are good to sink current, not source.

  7. #7
    tariq7868 Okay
    Join Date
    Mar 2009
    Location
    Karachi, Pakistan
    Posts
    94

    Default

    thnx for the help...

  8. #8
    johankrava Newbie
    Join Date
    Oct 2008
    Posts
    14

    Default

    hello.. i am new to microcontroller
    As already explained, use 8051 to sink current - LED anode to Vcc via resistor, LED cathode to 8051 pin. Put pin to 0V to turn led ON (instruction CLR Px.n)

    And if you are new to microcontrollers I would suggest you to try learning with Pascal programming language. There is a nice Pascal compiler for 8051 microcontrolelrs. Later you will probably stick to C, but to learn programming and become familiar with 8051 I would suggest to try with Pascal. Some might disagree. My proposal is to try many things and then decide for yourselves

  9. #9
    rushi53 Newbie
    Join Date
    May 2009
    Location
    Pune, India
    Posts
    77

    Default

    Quote Originally Posted by tariq7868 View Post
    hello.. i am new to microcontroller. i programmed the 8051 to blink led at port 0. Led is blinking alright but at the output port pin (i.e at all of the pins of port 0) i am getting only about 1.7-1.8 volts making the led to light much less bright. i also tried to get output from port 1 but the same results. my 5v (regulated) power supply is ok..
    is ic damaged?

    Port 0 requires external pullup registers....
    but I am not sure about the problem with Port 1...
    can you post your schematic here? so that it could help finding answers
    Thanks,
    Rushikesh
    www.projectsof8051.com

+ Reply to Thread

Similar Threads

  1. Prob with program
    By sirichinnu in forum Robotics Chat
    Replies: 8
    Latest: 24th May 2009, 01:19 PM
  2. Junebug Prob again!
    By Wond3rboy in forum General Electronics Chat
    Replies: 62
    Latest: 18th February 2009, 03:12 AM
  3. Junebug Prob Help me!!
    By Wond3rboy in forum General Electronics Chat
    Replies: 9
    Latest: 18th December 2008, 09:11 AM
  4. PC prob.
    By things in forum Chit-Chat
    Replies: 23
    Latest: 20th July 2007, 01:25 PM
  5. BIG prob
    By buland in forum General Electronics Chat
    Replies: 6
    Latest: 24th May 2005, 11:27 AM

Tags for this Thread