PWM with measurement pulse between low level

Hi guys,

I got an Arduino Duemilanove Board and want to measure a certain voltage with a current pulse between the low signal of the PWM. Any ideas how that would be realized without using too many main loop and just interrupts? A complete code would save me of course all the work but code snippets and examples would be good as well. Below I have explained the situation in a picture a bit more detailed. The measurement must take place when the PWM level is 0 so any method available would help me. The conversation of the voltage would happen with the MCP3204 A/D convertor with precision external voltage reference. The result must be as good as possible with the 12Bit available.

I also have 2 situations to measure: 1. PWM on + pulse (when PWM signal is 0) 2. PWM off + pulse I can switch between those with a hardwired switch already.



yes I had that idea before but I have no more space on the circuit board now to add these additional components. I thought about the all in one solution since the microcontroller can output pulses triggered by timers and interrupts. The PWM is controlled by a timer too so it must be possible to use these interrupts to trigger a delayed pulse. Will definitely take me some time to figure that out since i was expecting a not so deep coded solution first.