Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 12 of 12

Thread: Teensy 4.0 current sink/source maximum rating for digital pins

  1. #1
    Junior Member
    Join Date
    Jun 2020
    Posts
    3

    Teensy 4.0 current sink/source maximum rating for digital pins

    Hi!
    I'm considering switching from a Teensy 3.6 to a Teensy 4.0 and was wondering what the current rating for the pins is. Unfortunately the Teensy 4.0 documentation is still pretty bare-bones, so I checked the datasheet of the i.MX RT1062 (https://www.nxp.com/docs/en/nxp/data...XRT1060CEC.pdf) and in Table 22 it seems to indicate we have only 1ľA push-pull capability, and marginally more with pullups/-downs, which equals something like a 3MOhm output impedance. Other micros usually have something in the low mA range, for example the Teensy 3.6 specifies 25mA (https://www.nxp.com/docs/en/data-she...4M180SF5V2.pdf, section 1.4). Probably I'm reading the datasheet wrong and this is the expected current when a pin is configured as input, where such a high impedance would make total sense.

    I can't believe I've read the datasheet correctly that the 1062 has such a low current capability, but this thread on the NXP site seems to confirm that (https://community.nxp.com/thread/505035). In that thread and others (https://community.nxp.com/thread/380134) Table 12 is referenced for the maximum GPIO pin current, with the formula Imax = N * C * V * F/2 where N=pin count, C=pin capacitive load, V=io-voltage, F=pin change rate. This formula allows estimating how much current the whole GPIO block will additionally draw, if used with the respective parameters. But that says nothing about its capability to do so. So what's the maximum rating for current sourcing and sinking of the digital output pins on the Teensy 4.0 per pin and in total? If it's truly just 1ľA, what is the recommended buffer to make Teensy 4.0 pins usable for any realistic microcontroller scenario?
    Last edited by ecme; 06-02-2020 at 08:27 AM.

  2. #2
    Senior Member
    Join Date
    Aug 2019
    Location
    southwest USA
    Posts
    130
    Quote Originally Posted by ecme View Post
    Hi!
    I'm considering switching from a Teensy 3.6 to a Teensy 4.0 and was wondering what the current rating for the pins is. Unfortunately the Teensy 4.0 documentation is still pretty bare-bones, so I checked the datasheet of the i.MX RT1062 (https://www.nxp.com/docs/en/nxp/data...XRT1060CEC.pdf) and in Table 22 it seems to indicate we have only 1ľA push-pull capability, and marginally more with pullups/-downs, which equals something like a 3MOhm output impedance. Other micros usually have something in the low mA range, for example the Teensy 3.6 specifies 25mA (https://www.nxp.com/docs/en/data-she...4M180SF5V2.pdf, section 1.4). Probably I'm reading the datasheet wrong and this is the expected current when a pin is configured as input, where such a high impedance would make total sense.

    I can't believe I've read the datasheet correctly that the 1062 has such a low current capability, but this thread on the NXP site seems to confirm that (https://community.nxp.com/thread/505035). In that thread and others (https://community.nxp.com/thread/380134) Table 12 is referenced for the maximum GPIO pin current, with the formula Imax = N * C * V * F/2 where N=pin count, C=pin capacitive load, V=io-voltage, F=pin change rate. This formula allows estimating how much current the whole GPIO block will additionally draw, if used with the respective parameters. But that says nothing about its capability to do so. So what's the maximum rating for current sourcing and sinking of the digital output pins on the Teensy 4.0 per pin and in total? If it's truly just 1ľA, what is the recommended buffer to make Teensy 4.0 pins usable for any realistic microcontroller scenario?
    looked in ... CEC - not sure what is going on or what errors may exist in table 22 but 1 ua is absurd and impossible.
    try to calculate output swing/drop from the output resistance values in tables 26 and 27 (which look reasonable
    and are way way less than 3 megohms) and hopefully you will get reasonable max currents for say vdrop = 0.25 v
    or so.

  3. #3
    Junior Member
    Join Date
    Jun 2020
    Posts
    3
    Thanks for your reply!

    That seems like a very good hint. I had already seen that table but put it aside and forgot about it when I saw the NXP thread and table 22. But you're right, this is the right direction, thanks!

    The question now is, what the DSE (ipp_dse, the 3-bit drive strength register of the GPIO output buffers) setting is for the Teensy 4.0

    Table 22 also states in the first row that Maximum High-level output voltage for GPIO is NVCC_GPIO-0.15V at 0.1mA current with settings (001, 010) and 1mA with settings (011,100,101,110,111). That translates to 1.5kOhm and 150Ohm, respectively and is significantly above the range that Table 27 (GPIO output impedance for various DSE with NVCC_GPIO=3.3V) suggests: 157Ohm(001)...23Ohm(111).

    I will perform tests to find the true maximum currents. In the meanwhile it would be great if someone with more insight than myself into the Teensy 4.0 code could tell which DSE is configured (an whether/how it is manually configurable in user code).

  4. #4
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    15,271
    TeensyDuino installer puts all code on the system.

    See :: ...\hardware\teensy\avr\cores\teensy4\digital.c :: void pinMode(uint8_t pin, uint8_t mode)

    >> if (mode == OUTPUT) {
    *(p->pad) = IOMUXC_PAD_DSE(7);

  5. #5
    Junior Member
    Join Date
    Jun 2020
    Posts
    3
    Oh excellent, thank you both! Since 7 (0b111) is the highest drive strength, we should expect a GPIO output impedance of 23Ohm. So a voltage drop of 115mV at 5mA, 345mV at 15mA, and so on. I'll report back once/if I find maximum currents where the output buffer dies or shuts off.

  6. #6
    Senior Member
    Join Date
    Aug 2019
    Location
    southwest USA
    Posts
    130
    Quote Originally Posted by ecme View Post
    Oh excellent, thank you both! Since 7 (0b111) is the highest drive strength, we should expect a GPIO output impedance of 23Ohm. So a voltage drop of 115mV at 5mA, 345mV at 15mA, and so on. I'll report back once/if I find maximum currents where the output buffer dies or shuts off.
    please record the drop (both swing hi and swing low) - and work from the low current end so that if the internal
    driver evaporates you will already have quite a bit of data. if you have time to kill an an oscilloscope you could
    also do a pulse test where you make the output an input most of the time except for say anywhere from 1us to
    1ms (shorter is better) and have a triggered scope watching vo or vswing. the pulse numbers will likely be better
    than the DC numbers because as the pin drivers heat up (don't take long) their ron increases. keep in mind that
    as the drop goes up much beyond about half a volt three things happen - not a very practical driver and internal
    heating of the fet in question will try to create a thermal runaway which may or may not have a happy ending
    and last but not least life of the fet goes down >=2X for every 10 degrees C that it heats up over and above
    the average temperature of the T4 cpu which tends to the warm side at high clock rates.

    so you could end up w two ratings - DC and pulse - for depending on what you are doing later.

  7. #7
    Junior Member
    Join Date
    Nov 2020
    Posts
    4
    I set pin33 to logic high, 3.3V. Then connected a 10Kohm resistor to ground. Voltage dropped to 1.0V.
    100uA is thus the current. The missing 2.3V is getting lost in the internal resistance, which then would be 23Kohm.

    Ouch.

    This would mean buffers would be needed for such pins.

    However, if I set pin1 to logic high, 1Kohm changes the voltage by 55mV. ~3.3V would be 3.3mA, or 17 Ohm internal resistance.
    That's better.

    Why the difference?

  8. #8
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    9,421
    Quote Originally Posted by csv View Post
    I set pin33 to logic high, 3.3V. Then connected a 10Kohm resistor to ground. Voltage dropped to 1.0V.
    I tried that and can't confirm that. Looks like your Teensy has a defective pin.
    Last edited by Frank B; 02-26-2021 at 08:14 PM.

  9. #9
    Junior Member
    Join Date
    Nov 2020
    Posts
    4
    I also tried that on three other pins, 33, 36, 37 with the same result. I try some more.
    My normal load for the pin 5Kohm and 4.7nF(with 120 Ohm in series) to ground. The signal is a PWM.
    Peak current with the cap could be 15mA. Average much less in that RC filter. Could that smoke it?

  10. #10
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    9,421
    15ma is way too much. I think its max 4mA for static DC for a single GPIO pin.
    Not sure about PWM.

  11. #11
    Senior Member
    Join Date
    Jul 2020
    Posts
    1,365
    Depending on the drive level set, pins are rated from 1mA upto 4mA at full drive, sourcing or sinking.

    BTW csv: you did call "pinMode (..., OUTPUT);" didn't you?

  12. #12
    Junior Member
    Join Date
    Nov 2020
    Posts
    4
    Yes.
    I connected some other PWM pins to the RC filters, this time with new 2K in series with the 4.7nF cap reducing peak currents, and those pins had not been affected by the load.
    Who knows, maybe the pin got damaged somehow. I'll connect another board and see how it plays out.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •