Hi,
I'm need to measure how long a gate pulse in on for at high frequency (<=100 ns) between a start and stop pulse. There may be tens of gate pulses between the start and stop. When the gate is high, I want to start incrementing a counter. With it low, the counter doesn't increment.
I don't see a straight-forward way to do it with the MSP430F5522, but maybe I'm missing something simple.
One non-simple way I've thought to try is to use the DMA module as a gated counter. If I load a very large number into DMAxSZ, I can use the gate signal for DMAE0, set up DMAx for burst-block transfers and no incrementing source and destination. Then, with the start/stop pulse, I start the DMAx running. When the stop pulse happens, I can check the counts in DMAxSZ, take the difference between this value and its starting value, and know how long the gate was on for.
Will this work? IS there a simpler way?
Regards,
Scott