This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Pulse width measurement using T3IN ONLY!

Hi,
I had a design counting pulses from pin T3IN on GPT1-T3. The design now requires a pulse width to be measured instead of pulses being counted. Our hardware has access ONLY to T3IN, not CAPIN etc.

Problem: How can I set up GPT1/2 to measure the pulse width with only T3IN pin ?

Still getting to grips with capture/reload and interrupts, but reckon someone's done this before...!

Thanks for any advice.
Rup.

Parents
  • Thanks for your note Thomas.

    The next sentence in the manual after your extract reads:
    Note: A transition of the gate signal at pin T3IN does not cause an interrupt request.

    This is the killer for me!
    Best for me would be an interrupt (or PEC transfer) to take the result into a variable. I want to avoid a timer value for both the mark and the space of the PWM signal. So triggering an IRQ on (either) a rising or falling edge would be perfect. CAPIN through CAPREL in GPT2 seems to be exactly what I need - but I don't have access to CAPIN pin!

    I think I can make a workaround by sensing the status of T3IN when I read GPT1_T3 - but this will be asynchronous with the PWM signal.

    Rup

Reply
  • Thanks for your note Thomas.

    The next sentence in the manual after your extract reads:
    Note: A transition of the gate signal at pin T3IN does not cause an interrupt request.

    This is the killer for me!
    Best for me would be an interrupt (or PEC transfer) to take the result into a variable. I want to avoid a timer value for both the mark and the space of the PWM signal. So triggering an IRQ on (either) a rising or falling edge would be perfect. CAPIN through CAPREL in GPT2 seems to be exactly what I need - but I don't have access to CAPIN pin!

    I think I can make a workaround by sensing the status of T3IN when I read GPT1_T3 - but this will be asynchronous with the PWM signal.

    Rup

Children