# CH32V003 max GPIO current

I am trying to find what current can a GPIO of CH32V003 (the 10cent MCU) output. Its noticeably chinese english datasheet states (on p.21)

GPIO (General-Purpose Input/Output Port) can sink or output up to ±8mA current, and sink or output ±20mA current (not strictly to VOL/VOH).

How to interpret this? Is this a typo and it was intended as a sink/source distinction? Later in "Absolute maximum values" it only states 20mA sink/source, so is it safe to just ignore 8ma mention?

The bracketed note is the difference here, ie: (not strictly to VOL/VOH)

VOL and VOH are guaranteed levels, so if you keep the current below 8mA, the output voltage will be no more than VOL for a LOW and no less than VOH for a HI.

If you sink/source more than 8mA but less than 20mA, then the chip will do so without damage, but the voltage at the pin is not guaranteed as much.

eg looking at Table 3-17 (also on p21) for a low output: When the sink current is 8mA, the output voltage will be a maximum of 0.4V. When the sink current is up to 20mA, the output voltage can get as high as 1.3V.

I would look at keeping to the 8mA limit unless you are interfacing with devices that you know can handle those levels. For the CH32V003, this would be the VIH and VIL levels in Table 3-16, other devices should specify VIH and VIL in their datasheets.

• huh, I overlooked that table, thanks! Commented Jul 15 at 22:38

No, it should not be understood as a typo, that is a perfectly normal way of describing IO pin features in a data sheet.

The chip can sink&source up to 8mA if you want to be within the given voltage specs. And you normally want to do that if you need to e.g. communicate with other chips that use these voltage specs.

The chip can sink&source 20mA if you want to drive some motors, relay coils, LEDs or other loads such as a base of a transistor outside the voltage specs given for 8mA.

However there can not be more than 20mA or the chip starts to degrade and permanently damage.

• yes, driving some LEDs is what I intend to do... Thank you! Commented Jul 15 at 22:39
• Another way of looking at things would be to say that an LED resistor may be safely sized to pass 20mA when the pin is pulled to the rail (assuming the LED itself can handle that much, which most LEDs nowadays could do without difficulty), but the LED might not actually get that much current. Commented Jul 16 at 18:30