Author Topic: Understanding output pins  (Read 1969 times)

0 Members and 1 Guest are viewing this topic.

Offline hedleyTopic starter

  • Contributor
  • Posts: 41
Understanding output pins
« on: March 12, 2017, 06:07:42 pm »
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 .
 

Offline dmills

  • Super Contributor
  • ***
  • Posts: 2093
  • Country: gb
Re: Understanding output pins
« Reply #1 on: March 12, 2017, 08:13:02 pm »
Which PIC? It makes a difference....

Regards, Dan.
 

Offline JPortici

  • Super Contributor
  • ***
  • Posts: 3461
  • Country: it
Re: Understanding output pins
« Reply #2 on: March 12, 2017, 08:48:14 pm »
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.
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12860
Re: Understanding output pins
« Reply #3 on: March 12, 2017, 09:28:47 pm »
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.
 

Offline hedleyTopic starter

  • Contributor
  • Posts: 41
Re: Understanding output pins
« Reply #4 on: March 13, 2017, 03:39:16 am »
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 .
 

Offline JPortici

  • Super Contributor
  • ***
  • Posts: 3461
  • Country: it
Re: Understanding output pins
« Reply #5 on: March 13, 2017, 06:46:37 am »
well, i already see this on first page of electrical characteristic

Quote
Maximum current out of VSS pin: 300 mA
Maximum current into VDD pin: 250 mA
Input clamp current, IIK (VI < 0 or VI > VDD): ±20 mA
Output clamp current, IOK (VO < 0 or VO > VDD): ±20 mA
Maximum output current sunk by PORTA<7:6> and any PORTB and PORTC I/O pins: 25 mA
Maximum output current sunk by any PORTD, PORTE and PORTJ I/O pins: 8 mA
Maximum output current sunk by PORTA<5:0> and any PORTF, PORTG and PORTH I/O pins: 2 mA
Maximum output current sourced by PORTA<7:6> and any PORTB and PORTC I/O pins: 25 mA
Maximum output current sourced by any PORTD, PORTE and PORTJ I/O pins: 8 mA
Maximum output current sourced by PORTA<5:0> and any PORTF, PORTG and PORTH I/O pins: 2 mA
Maximum current sunk by all ports combined: 200 mA

but 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
 

Offline hedleyTopic starter

  • Contributor
  • Posts: 41
Re: Understanding output pins
« Reply #6 on: March 13, 2017, 07:13:34 am »
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
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12860
Re: Understanding output pins
« Reply #7 on: March 13, 2017, 07:22:35 am »
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.
 

Offline JPortici

  • Super Contributor
  • ***
  • Posts: 3461
  • Country: it
Re: Understanding output pins
« Reply #8 on: March 13, 2017, 09:59:55 am »
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
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf