I think that the PIC is in danger by that connection. If your supply is 12V and the output around 2, the rest 10 volts should be between regulators ground pin and ground. So the output of the PIC is at high voltage point through the resistor.
What exactly are the specs? What do you want to produce at the output?
My suggestion could be something like this:
1. PIC HPWM to a filter.
2. Filter to an Opamp for DC voltage amplifying.
3. Power output Transistor to give the appropriate current to the load.
You can produce a 0-12 output that way.
If you want controlled Current source then the Pass transistor could be at the feed back loop of the opamp. I'll try to scetch and scan if needed.
Ioannis
Bookmarks