I also thought to connect the cathodes directly to the Pins of the STM32, but i was advised to use the transistors instead, in order to get a stable circuit.
Well, ill try to do the maths
The anode peak current is 10mA * 7 segm * 2 Digits = 140 mA.
The BSS84 has the
Rds=2 Ω , so the voltage drop on it will be
2 Ω * 0.14 A = 0.28V.
On the BSS138W we have the
Rds=3 Ω , so the voltage drop will be:
3 Ω * 0.14 A = 0.42 V. So as a result we have: 3.3V - 0.28 V - 0.42 V - 2.05V =
0.55 V.
It means i have to get resistors with 0.55 V / 0.01 A = 55 Ω. Am i right?