Skip to main content
muralij21
Associate II
December 3, 2010
Question

Timer as Counter

  • December 3, 2010
  • 14 replies
  • 2439 views
Posted on December 03, 2010 at 11:49

Timer as Counter

    This topic has been closed for replies.

    14 replies

    dsystem
    Associate II
    May 17, 2011
    Posted on May 17, 2011 at 14:17

    Dear Karakaya

    Can you give me code for counting from CH1?

    Regards

    madhu13
    Associate III
    May 17, 2011
    Posted on May 17, 2011 at 14:17

    ''dont waste your time counting pulses at ETR pin

     

     

    no matter what I tried I couldnot count ETR pulses - ( there is probably a bug in hardware )

     

    try to count pulses at CH1 of the timer - it works''

    there is no bug in hardware, TIM_CH1 and TIM_ETR share the same pin, by default TIM_CH1(i.e. PA0) is mapped to the pin, if you want to use TIM_ETR(i.e.PA15) pin remap the pin by programming AF remap and debug I/O configuration register (AFIO_MAPR) TIM2_REMAP(bits 9 & 8) then your code will work

    madhu13
    Associate III
    May 17, 2011
    Posted on May 17, 2011 at 14:17

    karakaya.mehmet, u can use TIM2_ETR pin to count pulses by using the remap, and u can not count pulse using TIM3_ETR

    mehmet.karakaya
    Associate III
    May 17, 2011
    Posted on May 17, 2011 at 14:17

    hello ,

    I tried to count ETR pulses of TIM3

    which is conected to PD2 - it didnot count - I insist that there is hardware bug

    in the manual it ''doesnot'' say that TIM3_ETR and TIM3_CH1 share the same pin

    can you please write the code here which couns TIM3_ETR pulses ?