I have a 10 kHz PWM (0V (LOW) to 3V3 (HIGH)) which I wish to level shift as following; when PWM is high (3V3) the output should be 0V while when PWM is low (0V) the output should be -12V. Ideally this has to be done using discreate components (NPN/PNP transistors) while providing some sort of isolation (optical) between the 3V3 and -12V rails. In terms of current capabilities, the PWM pin can source/sink 8 to 12 mA max while I need not more than 200 mA for the -12V rail. Another requirement worth mentioning are the transient requirements, looking to have a clean 0 to -12V PWM signal.
So far, I came up with this circuit, but it is not behaving as I needed. Any recommendations/tips are much apricated. Thanks

