I have some (expensive) weird real time hardware with only two 12-bit ADC inputs vacant, and it needs to read 10-bit samples taken by a MCU with 8-bit PWM output ports. The ADC can take samples at around 100Hz, the PWM operates at 32KHz, and I want samples from my sensor at at least 10Hz (more is better).
I'm planning on encoding 5 bits on each analog channel by hooking the PWM outputs to RC filters, but this seems dangerous in many ways: I can't really guarantee the PWM high/low levels, and when the 5 low bits overflow I'll have a weird discontinuity. Is there a better way?