0

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.

Anton Stafeyev
  • 341
  • 3
  • 13
  • 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. – Hearth Nov 04 '18 at 22:53
  • @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 ? – Anton Stafeyev Nov 04 '18 at 22:56
  • 1
    @AntonStafeyev Maybe it could be because µC are usually [CMOS](https://en.wikipedia.org/wiki/CMOS) based? Meaning that **all the gates & transistors** inside the µC are also made up of "mosfets". – Harry Svensson Nov 04 '18 at 22:59
  • @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. – Anton Stafeyev Nov 04 '18 at 23:03
  • 6
    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](https://courses.cs.washington.edu/courses/csep567/10wi/lectures/Lecture6.pdf) 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. – Harry Svensson Nov 04 '18 at 23:09

1 Answers1

3

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.

TimWescott
  • 44,867
  • 1
  • 41
  • 104
  • so as far as i know mosfet has a tiny resistance ? – Anton Stafeyev Nov 05 '18 at 02:29
  • @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. – TimWescott Nov 05 '18 at 03:06