Skip to main content
SUNIL C THOMAS
Associate
April 6, 2018
Question

Input capture timer configuration

  • April 6, 2018
  • 3 replies
  • 853 views
Posted on April 06, 2018 at 13:00

Hi friends,

What are the steps to configure input capture timer?

how we give correct prescaler and period values for that? 

Have any demo video for that?

Sunil

Calixto Systems

    This topic has been closed for replies.

    3 replies

    Tesla DeLorean
    Guru
    April 6, 2018
    Posted on April 06, 2018 at 15:13

    The *Input* Prescaler will determine how many edges the TIM wants to see. The Prescaler on the TIM itself will determine the rate at which CNT increments. What you pick depends on the frequency or time displacement you want to capture, and the size of the TIM 16 or 32-bit. You don't want the CNT to cycle multiple times during your proposed measurement interval.

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    SUNIL C THOMAS
    Associate
    April 9, 2018
    Posted on April 09, 2018 at 07:02

    Turvey.Clive.002

    Thanks for the reply.

    I want to set my input capture timer to count a microseconds clock (eg 1000microseconds clock give to input, i want get my timer count 1000 ). What are the parameters i want to set for this? I used Keil SDK for my project.

    Regards

    Sunil

    Calixto Systems

    Tesla DeLorean
    Guru
    April 9, 2018
    Posted on April 09, 2018 at 16:13

    Prescaler = (SystemCoreClock / 1000000) - 1; // Clock timebase at 1 MHz (1us ticks)

    Period = 0xFFFF; // for 16-bit or 0xFFFFFFFF for 32-bit

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..