go away spammer

Author Topic: Elec flowing out of AT Mega data pins = bad right?  (Read 3234 times)

0 Members and 1 Guest are viewing this topic.

Offline HDL_CinC_DragonTopic starter

  • Supreme Robot
  • *****
  • Posts: 1,261
  • Helpful? 5
Elec flowing out of AT Mega data pins = bad right?
« on: July 29, 2007, 09:30:22 PM »
I think I read somewhere in here that the reason the $50 robot has to put PD4 to low for the LED to light up because its better if the power comes into the AT Mega from the circuit rather than from the AT Mega to the circuit.

Is this the case? And why is it bad to have power coming from the AT Mega to the peripherals? Could it overload it if its powering too many thing? Im assuming that with each thing its powering the amperage through the MCU increases?
United States Marine Corps
Infantry
Returns to society: 2014JAN11

Offline zamboniman60

  • Full Member
  • ***
  • Posts: 55
  • Helpful? 0
Re: Elec flowing out of AT Mega data pins = bad right?
« Reply #1 on: July 29, 2007, 10:44:53 PM »
I have read that same bit of advice a lot of places -- that a microcontroller should only be a current sink, and not a current source. Thinking about it, though, I don't really see why. The microcontroller is passing the same amount of current. The internal dissipation is the same, since the current is flowing through the same components... It's just as easy to put a pulldown resistor on an output pin as it is to put a pullup resistor there.

I don't really see why you can't have electricity flow out of the pins.

And is it electron flow or conventional current we're talking about here?

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Elec flowing out of AT Mega data pins = bad right?
« Reply #2 on: August 03, 2007, 10:10:51 AM »
Im really not sure myself . . . I based what I know on what Ive read too . . .

I think it has to do with how the output pin internally swaps from power to ground . . .

Anyone know?

paulstreats

  • Guest
Re: Elec flowing out of AT Mega data pins = bad right?
« Reply #3 on: August 03, 2007, 06:37:34 PM »
would using the mcu as a sink allow a greater current potential than using it as a source?

 Also if a pin is used as a sink, it may get a direct connection with the mcu's gnd bus and not travel through the mcu structure itself. If it was used as a source, the charge may have to travel through the mcu structure causing potential damage?

 Mind you , some of my first projects years ago i used to use the outputs as source pins and never had any trouble, its only the past couple of years that ive been using them as sinks because of what ive read elsewhere.

Offline HDL_CinC_DragonTopic starter

  • Supreme Robot
  • *****
  • Posts: 1,261
  • Helpful? 5
Re: Elec flowing out of AT Mega data pins = bad right?
« Reply #4 on: August 04, 2007, 02:03:19 AM »
hmmm seems its more just a rule of the trade rather than an actual practical law of robotics/electronics.... fine by me though, Ill start doing that ;)
United States Marine Corps
Infantry
Returns to society: 2014JAN11

paulstreats

  • Guest
Re: Elec flowing out of AT Mega data pins = bad right?
« Reply #5 on: August 04, 2007, 10:17:22 AM »
Another quick comment :-

 some of my older projects that used the mcu as a current source, used to power led's perfectly without needing a resistor.

 and dont forget that when using mcu's to control lcd displays, ram etc.. you use the outputs as both highs and lows..

 


Get Your Ad Here

data_list