Skip to main content
Visitor II
April 2, 2004
Question

How to use ICAP2 in ''one pulse mode''?

  • April 2, 2004
  • 5 replies
  • 864 views
Posted on April 02, 2004 at 11:53

How to use ICAP2 in ''one pulse mode''?

    This topic has been closed for replies.

    5 replies

    adibAuthor
    Visitor II
    March 23, 2004
    Posted on March 23, 2004 at 16:19

    Hi,

    In my application I'm using Timer A in ''one pulse mode'', ICAP1 is used to generate a pulse on OCMP1.

    I would like to use ICAP2 pin as a general purpose output (when I toggle this output it generates timer A interrupt).

    Can anyone advise how to do this?
    Visitor II
    March 29, 2004
    Posted on March 29, 2004 at 09:47

    Input Capture 2 is not implemented in Timer A. Which device are you using?

    adibAuthor
    Visitor II
    March 31, 2004
    Posted on March 31, 2004 at 14:51

    I'm using ST72F264G2.

    When I configure ICAP2 pin as output I get an interrupt when toggling it.

    I am out of ideas.......
    Visitor II
    April 1, 2004
    Posted on April 01, 2004 at 08:48

    This point is mentioned in the datasheet(page 59/168, Section 13.3.3)-

    ''The alternate inputs (ICAP1 & ICAP2) are always directly connected to the timer. So any transitions on these pins activates the input

    capture function. Moreover if one of the ICAPi pins is configured

    as an input and the second one as an output, an interrupt can be generated if the user toggles the output pin and if the ICIE bit is set.

    This can be avoided if the input capture function i is disabled by reading the ICiHR.''

    ''After reading the ICiHR register, transfer of input capture data is inhibited and ICFi will never be set until the ICiLR register is also

    read.''

    I hope, this would help!

    [ This message was edited by: Jatin on 01-04-2004 12:20 ]
    adibAuthor
    Visitor II
    April 2, 2004
    Posted on April 02, 2004 at 11:53

    Thanks very much it solved my the problem!