Understanding output pins - Page 1
Forum section: electronics / general

author: hedley
author_rank: Contributor
timestamp: March 12, 2017, 06:07:42 pm
content: I spent many hours trying to drive a DC buzzer directly from an I/o pin . The buzzer datasheets verified on my rigol bench supply sounds when voltage > 2.2 v and current drawn is 12mA. The pic pin when sourcing or sinking results in no sound . I placed a dummy load on the output and then plotted a graph of out voltage at the pin vs load. To my surprise at 8-10 ma the 3.28 volts on no load went down to close to zero volts. I do realize that datasheets say 25ma maximum so this can not be expected . Can anyone cover the basics for me as datasheets I can find don't detail this condition or state the on resistance on the source or sink FET driving the output pins. It would be great if the manufacturers could set out what the chip can reliably provide eg xx ms pulse with 7ma. Any guidance much appreciated .

author: dmills
author_rank: Super Contributor
timestamp: March 12, 2017, 08:13:02 pm
content: Which PIC? It makes a difference....Regards, Dan.

author: JPortici
author_rank: Super Contributor
timestamp: March 12, 2017, 08:48:14 pm
content: state which pic.then open the datasheet and go to the electrical characteristics. there you'll find the total current sourcable and sinkable for each IO pin, port and total.

author: Ian.M
author_rank: Super Contributor
timestamp: March 12, 2017, 09:28:47 pm
content: Actually, a lot of the PIC datasheets no longer have the graphs for Voh vs Io_source and Vol vs Io_sink, so you have to make do with spot figures from the parameters section for min Voh and max Vol and the currents and Vdd they are specified at. The datasheet output parameters are specified at load currents that make Microchip look good - you can usually bet that double that current will be past the knee in the characteristic, even if its theoretically permitted by the abs. max. ratings.

author: hedley
author_rank: Contributor
timestamp: March 13, 2017, 03:39:16 am
content: Pic18f67k22 following which for sanity test I tried on an old 18f252 which seemed to source more than the first but nowhere near datasheets . I think it has something to do with vdd and the on resistance of the output FET drive circuit and lastly the non linear behavior at higher currents. Perhaps worth noting is that I am running the 18F67k22 at 3v3 not 5v .

author: JPortici
author_rank: Super Contributor
timestamp: March 13, 2017, 06:46:37 am
content: well, i already see this on first page of electrical characteristicQuotebut in any case i think you are right about the cause of the problem. VOH is then specified for much lower currents than the pin rated ones.. and at 5V only

author: hedley
author_rank: Contributor
timestamp: March 13, 2017, 07:13:34 am
content: Thanks for reply - I am using pin RC3 and RC4 . The way I understand the maximum output current of 25mA is that this ONLY means that if you draw more than this the device will break . It does not mean that this is the source or sink capability . I had the buzzer and a LED across the two pins thinking that when RC3 is High and RC 4 is low then the LED would be on ( this works ) and when I invert the outputs then the buzzer will go an and the LED off ( The buzzer is connected with reverse polarity . Internally I suspect they have a CMOS push pull configuration and the devices have an on resistance which is why the output voltage drops as more current is sourced and or sank . In my configuration I am sourcing and sinking at the same time so the reference to ground is through the negative rail FET internal to the device whilst the positive is coming from the upper fet in the push pull output . After 40 years in this business it is always the small things that catch me . Back in the day the only way I truly understood resisters , capacitors and instructors was to use a VNA and smith charts , thank goodness as years later when routing high speed PCB's with inductance and timing issues this all came back . Maybe I should just put an output transistor on the Buzzer which is what most do and be done rather than trying to understand why .All the microcontrolles manufacturers would have to do is A) document the output drive configuration and then characterize these by loading up the pins and doing a plot of what can actually be sourced and sunk . The maximum 25mA is misleading to say the least

author: Ian.M
author_rank: Super Contributor
timestamp: March 13, 2017, 07:22:35 am
content: Yes. As I said, unfortunately Microchip don't seem to bother with fully characterising their newer devices. The next family down in the PIC18F....K22 range does however have the output graphs, and as you can see, if you aren't running at 5V Vdd, the drive capability is pretty weak.

author: JPortici
author_rank: Super Contributor
timestamp: March 13, 2017, 09:59:55 am
content: I agree with you. In recent years i am seeing datasheets become more and more obscure.. and/or misleading, as you put it. Then we have 2 years old parts with "preliminary" datasheets and no guaranteed electrical specs which makes me wonder what the hell they are doing during design and test.i'm sure it's not only microchip, of course