This question already has an answer here:

I would like to know how does MCU provide it's output current. here is a little drawing of my assumption (simplified) of how a pin is functioning when it is set to output. enter image description here

Basically it is a transistor that allows current to flow or it doesn't. it cant be something else, but what actually bothers me is V in to the mcu. Does MCU provide an output using Vcc input directly or this input is going through some other internal components.

If this is a transistor and 5v goes through it, do i get that Vce drop ? which is 0.2V. and therefore i actually get 4.8 volts on my pin ?

If i am performing some calculations how would apply a Kirchhoff rules to a circuit with micro controller if i don't know nothing about its internals, only datasheet data.


marked as duplicate by Harry Svensson, SamGibson, Ale..chenski, Chris Stratton, nidhin Nov 8 '18 at 16:52

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • \$\begingroup\$ What you've drawn is what's also called an open-collector output. Some MCUs do have this type of output. Others don't. I think most MCU outputs are fairly accurately modelled as a push-pull output, though. \$\endgroup\$ – Hearth Nov 4 '18 at 22:53
  • \$\begingroup\$ @HarrySvensson i knew one Svenson, but thanks for the post. itr did actually help me. question is why it is better to use mosfets then ? \$\endgroup\$ – Anton Stafeyev Nov 4 '18 at 22:56
  • 1
    \$\begingroup\$ @AntonStafeyev Maybe it could be because µC are usually CMOS based? Meaning that all the gates & transistors inside the µC are also made up of "mosfets". \$\endgroup\$ – Harry Svensson Nov 4 '18 at 22:59
  • \$\begingroup\$ @HarrySvensson thanks a lot for your answer. that post is almost everything i was looking for, but if ti is possible could u dirrect me a source that has more information about internal construction of pins. The drawing in the post u linked explains how Output only or input only pin works. i would like to know how a pin could be input and output. \$\endgroup\$ – Anton Stafeyev Nov 4 '18 at 23:03
  • 6
    \$\begingroup\$ If only there was a thing like... a way to search on the internet for documents that you were interested in. Maybe google does that. Who knows. I managed to find a document for AVR which shows how it's done for the AVR-family of µC. Look on page 45-48, which you should've done prior to making your question. Some minor research before making a question goes a long way. \$\endgroup\$ – Harry Svensson Nov 4 '18 at 23:09

Somewhere in the literature for most processors there will be representative schematics for the pins. They can be complicated, but usually with a pin set up as an output it boils down to a push-pull CMOS output stage (sometimes open-drain).

Usually this is found in the MCU's user's manual -- the data sheets are usually at a higher level.

The reason for no drop is -- as stated -- because microprocessors these days are CMOS. I can't think of one that's not.

  • \$\begingroup\$ so as far as i know mosfet has a tiny resistance ? \$\endgroup\$ – Anton Stafeyev Nov 5 '18 at 2:29
  • \$\begingroup\$ @AntonStafeyev Tiny resistance, yes, but unless you're pulling a lot of current, not enough to get 200mV. Again, that's in the data sheet -- it should have a maximum current per pin, and it should have a voltage out for that maximum current. \$\endgroup\$ – TimWescott Nov 5 '18 at 3:06

Not the answer you're looking for? Browse other questions tagged or ask your own question.