I have attached the project. From what I can determine, this should be close to what I need. I have the hardware pin attached to capture pin and trigger pin. I have set Trgger at high going and capture at low going. I am not getting any values from the counter, there is something not correct with the use of the Timer API.
By the way, the debug pin I put on Capture Out is pulsing when I see the Signal go low on the logic analyser. It appears the hardware is runnig but I am not initiating or reading the counter properly?
Which are the variables delaing with the high time only?
I see PulsePeriodHigh appears to be when the PWM goes high. I can see pulse period start and end but not sure which is representing end of the high period.
Once I do have the start and end time of the high pulse, do I subtract difference from 65535 to get number of micorseconds?
I suppose I need to go through the generated files to see what is happening with the interrupts?
I need to measure with resolution of 1us, I suppose I should speed up the clock to 1MHz? Maximum high time will be 40,000 us in my application.