Connect your NPN transistor with the emitter to ground then you can calculate the resistor in this way:
R = (Vin - 0.7)/Ib
Where:
Vin = pic output (5 v)
0.7 = base/emitter diode threshold
Ib = desired base current ( 2mA is what you need for saturating 20 mA load)
Nearest value = 2,2 K
LM555 can be connected directly to 9 V PS and the output (pin 3) can drain your 20 mA load without any problem. So you can connect your led + 330 ohms directly to the IC.
Al.
Bookmarks