PIC PWM Output Impedance

Discussion in 'Embedded Systems and Microcontrollers' started by jpanhalt, Nov 1, 2014.

  1. jpanhalt

    Thread Starter AAC Fanatic!

    Jan 18, 2008
    5,690
    901
    I am using the PWM output of a PIC 16F1519 to drive a simple voltage inverter at 20 KHz. For simulation, I added a 220 Ω resistor in series with the 10µ input capacitor. Of course, the max allowed current from any pin is 25 mA. Maximum current in the simulation is about 22 mA for a few mS. I would like to get rid of the resistor to speed start-up. But, I cannot find what the actual output impedance for the pins is.

    This link (http://www.microchip.com/forums/m479138.aspx) suggests that it is several hundred ohms, which would mean the pin could be shorted without damage to the chip.

    Does anyone know the output impedance? Can the pins actually be shorted without damage?

    John
     
  2. Papabravo

    Expert

    Feb 24, 2006
    10,140
    1,790
    The 25 mA figure is not the one you should focus on. Look for Vol(maximum) and Voh(minimum). Those voltages and the corresponding currents will give a better approximation to the DC resistance of the NMOS and PMOS channels of the output stage. Since these numbers are not characterized, I would not depend on them because any heat must be dissipated on very small structures and the leadframe. Better to have an external resistor to help out even if it must be a compromise. Better yet an external device or buffer could be chosen to isolate the PIC from the responsibility.
     
    Last edited: Nov 1, 2014
    jpanhalt likes this.
  3. jpanhalt

    Thread Starter AAC Fanatic!

    Jan 18, 2008
    5,690
    901
    On further reading spurred by you (Papabravo), I collected some typical comments. The subject had been discussed quite a bit online. One person commented that the transistor-level description of the output stages is typically not available, and that the assumption is is P-channel sourcing and an N-channel sinking may or may not be valid. Nevertheless, that is the model people use.

    http://electronics.stackexchange.co...is-the-typical-on-resistance-of-an-mcu-output

    Response from Microchip support (previously referenced above):
    http://www.basicmicro.com/downloads/docs/Smith_halfChp3.pdf
    The author (Smith) considers output resistance to be 85 ohms when calculating the current limiting resistor for an LED. That Smith may be the same as one of the authors in the following Google Book, which also uses the 85-ohm figure.
    http://books.google.com/books?id=s8DBXs-jIRQC&pg=PA496&lpg=PA496&dq=pic maximum output current&source=bl&ots=kp-z5kA8Zq&sig=QQAC0EyON-iVb1Nlw1U5W2htVrY&hl=en&sa=X&ei=6l5VVIjhMYmfyQSRwYGoCg&ved=0CF8Q6AEwCw#v=onepage&q=pic maximum output current&f=false

    Finally, in another Microchip thread (http://www.microchip.com/forums/m535266.aspx ):
    For the 16F1519, VOH = Vdd- 0.7 with IOH = 3.5 mA/5V, which calculates to 200 Ω sourcing and a similar calculation for VOL gives 75 Ω sinking.

    As a test, I measured the Pk-Pk voltage of the 20 KHz square wave produced by the PWM module across a series of resistors. The results were not as tight as I would have liked them. Here they are in rough form:
    Capture.PNG
    Rs is the calculated series internal resistance of the source (i.e., the output pin).

    The mean was 98 Ω with a pretty wide variation. From all of this, I feel that the current limiting resistor can be reduced to 120 Ω with minimal risk.

    As to the other question of "why", I am currently using a MAX851 to generate the negative bias for a GLCD. It is a nice chip ($4.35 at DigiKay). It requires 4 external capacitors, a pull-up resistor for enable/shutdown, plus the chip itself for a total of 6 parts. The simple bias generator has just 2 diodes and 2 capacitors. No additional parts are needed for enable/shutdown, and layout is simplified. It was also fun to see how it was done.

    Regards, John
     
  4. Papabravo

    Expert

    Feb 24, 2006
    10,140
    1,790
    Interesting research, data, and illuminating analysis.
     
Loading...