Author Topic: AT89S52 Question about Ports  (Read 2830 times)

0 Members and 1 Guest are viewing this topic.

Offline KurtstaTopic starter

  • Newbie
  • Posts: 3
AT89S52 Question about Ports
« on: October 29, 2013, 05:55:26 am »
Hello,

Being relatively a beginner when it comes to electronics, there are just some things that confuse the hell out of me...
Is anyone able to explain to me what this sentence means:

"As inputs, Port 1 pins that are externally being pulled low will source current (IIL) because of the internal pull-ups."

If more context is required, the paragraph containing this sentence can be found on page 4 of the AT89S52 datasheet.
 

Offline amyk

  • Super Contributor
  • ***
  • Posts: 8276
Re: AT89S52 Question about Ports
« Reply #1 on: October 29, 2013, 05:58:48 am »
It means there are resistors from the pins to the positive supply rail, so if you connect one of the pins to ground, current will flow out of them.
 

Offline KurtstaTopic starter

  • Newbie
  • Posts: 3
Re: AT89S52 Question about Ports
« Reply #2 on: October 29, 2013, 07:10:08 am »
Ok, that makes more sense. When you say "so if you connect one of the pins to ground, current will flow out of them." do you mean it must be connected directly to ground, or can a load (perhaps a 7-segment LED display) be placed between the pin and ground?
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 9953
  • Country: nz
Re: AT89S52 Question about Ports
« Reply #3 on: October 29, 2013, 07:39:16 am »
The pin will naturally rise to VCC because of the pullup.
Any attempt to lower the voltage on the pin (like connecting a load) will cause some current to flow from VCC through the internal pullup and out of the mcu pin.

Pullup resistors inside a MCU are very large, usually around 50k,  so the max current you can get out is 5v VCC / 50,000 ohms = 0.0001A or 0.1mA

The current too small to light up an LED.
You may see a very faint glow in a dark room.

But why would you want to connect an LED to an input?
« Last Edit: October 29, 2013, 07:42:38 am by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4199
  • Country: us
Re: AT89S52 Question about Ports
« Reply #4 on: October 30, 2013, 02:08:33 am »
Quote
why would you want to connect an LED to an input?
The 8051 microprocessors don't have the sort of IO ports you're used to on more modern processors.  They're "bi-directional" open-drain outputs; you can write 0s and the pins will sink substantial current, or you can write 1s in which case the internal pullup allow the pins to be pulled down by an external signal (and read as 0.)  You don't get high-impedance, and you don't get much source current.

To connect an LED, put it between VCC and the pin, rather than between the pin and GND, and reverse your logic (outputting 0 turns the LED on.)
 

Offline amyk

  • Super Contributor
  • ***
  • Posts: 8276
Re: AT89S52 Question about Ports
« Reply #5 on: October 30, 2013, 11:21:27 am »
Pullup resistors inside a MCU are very large, usually around 50k,  so the max current you can get out is 5v VCC / 50,000 ohms = 0.0001A or 0.1mA

The current too small to light up an LED.
You may see a very faint glow in a dark room.
High brightness LEDs start glowing visbly at a few uA, and are quite noticeable at 100uA...
 

Offline KurtstaTopic starter

  • Newbie
  • Posts: 3
Re: AT89S52 Question about Ports
« Reply #6 on: October 30, 2013, 11:41:11 am »
Thanks heaps to everyone for the information that you have provided. Everything is starting to make more sense now  :)
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf