I'm guessing from the thread title that OP is using an external DAC - so PID is not needed. The MCU's I use have a built-in (dual-channel) 12-bit DAC and I have done something similar. The DAC output is scaled to 2V full scale. An op-amp (rail-to-rail) buffer with 6x gain and a simple linear output stage gives 0-12V output with 3mV resolution.
Bookmarks