Skip to main content
Hafsh.2
Associate II
August 11, 2021
Question

input capture

  • August 11, 2021
  • 6 replies
  • 1554 views

Hi

I launched a capture and sensitized the interrupt to both edges.

I want to recognize each edge when intraoperating.

I mean, to find out which edge was intraverted?

I use micro stm32f407vgt

    This topic has been closed for replies.

    6 replies

    waclawek.jan
    Super User
    August 11, 2021

    There is no indication, which edge was captured.

    If you need this, it's better to use two separate channels (CH1+CH2, or CH3+CH4), set them to input from the same physical pin, and set one to capture on rising edge and the other to capture on falling edge.

    JW

    Hafsh.2
    Hafsh.2Author
    Associate II
    August 11, 2021

    Thanks, but I do not want to involve another IO

    waclawek.jan
    Super User
    August 11, 2021

    You mean another pin? This does not involve another pin - for one channel you select TIMx_CCMRx.CCxS to 0b01 i.e. using "it's own" pin; and for the other 0b10, and in that way you capture signal on the same physical pin.

    JW

    TDK
    August 11, 2021

    You can read the current value of the pin to make an educated guess at the last edge that triggered it. But otherwise, as JW mentions, there's no way to know.

    "If you feel a post has answered your question, please click ""Accept as Solution""."
    Hafsh.2
    Hafsh.2Author
    Associate II
    August 11, 2021

    I can not do by guessing

    TDK
    August 11, 2021
    The only issue here is if multiple triggers happen so fast the IRQ can't be called for each one.
    "If you feel a post has answered your question, please click ""Accept as Solution""."