The two pwms have to continue unaffected in the background.

What about the RC idea and using the adc to acquire the voltage?