This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RM44L520: Using eCAP as a deglitcher: can it be done?

Part Number: RM44L520

I believe it is possible to set up an eCAP channel as a configurable pulse deglitcher, but I wanted to confirm my thinking.

  • For the sake of this discussion, the pulse to be deglitched is normally low.
  • When a rising edge is detected, the TSCR will be loaded with a value equal to (0xFFFFFFF - the deglitch time), and the counter overflow interrupt will be enabled.
    • If the counter overflows, the input pulse time is greater than the deglitch time, and further processing would take place.
    • If a falling edge was seen, the counter overflow interrupt will be disabled, and the hardware will again sit waiting for a rising edge.

Is there any reason, when properly programmed, this will not work?

Thanks

  • Hello Richard,

    The idea makes sense. How do you distinguish and handle the two kind of falling edges:
    1. falling edge of the pulse which is greater than the deglitch time in TSCR
    2. falling edge of a glitch pulse
    What is the processing time of the overflow ISR? I assume you use ecap1 to capture rising edge and ecap2 for falling edge. Did you enable the interrupt of ECAP2?

    Regards,
    QJ
  • QJ,

    Thanks for the response.

    I am looking for an on time that is at least greater than 10 uSec. So that would be a long glitch - let's call it a pulse.

    If the falling edge of the pulse does not occur before the counter overflows, then the firmware will take remedy the cause of the pulse.

    If the falling edge of the pulse does occur before the counter overflow, the pulse can be safely ignored, and the overflow interrupt will be disabled.

    I need to do this all with a single pin/ecap. From what I can see this should be do-able, but my reason for this post is confirm my intuition.

    Regards,

    Rick Derman