Common Cathode Seven segment display and ATmega328p GPIO pin current question
I have a common cathode 4-digit 7-seg display which i wish to connect to ATmega328p Its draws 36mA with 500 ohms current limit resistors. when every pin are on. (Vs-Vd)/R = I , 5-2.2/500 = 5.6mA * 8 = 44mA.(i have measured this)(everything is working)
Each digit is switched to GND via a GPIO current sink. i.e. connected directly.
I see all over the internet in many reputable places(blogs, tutorials) people connect the digit control pins straight to the GPIO pins. It seems to be common practice in the "arduino world" For example. here on sunfounder site
This is same display I have (.56 common cathode red ) as i got it in a sunfounder Arduino kit
If you use 220 ohm resistors as per their suggestion. This would mean 101mA is following thru GPIO pin connected to Digit. when all segments are on. Yet the current Maximum limit of GPIO is 40mA
I don't understand normally in PIC world if connecting a Common-cathode 7-seg digit to PIC you turn on via a transistor like this circuit just for example.
Whats going on? what am i missing here? How can Atmega328p survive this?
Thank you in advance.