<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>pwm input mode low frequncy</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/34392/pwm-input-mode-low-frequncy</link><description> 
hi 

 
i work with stm32f107 

 
pleas answer me 

 
how i can measure frequency in 50 hz with input pwm 

 
i read about it and find out i can measure frequency with input
pwm up to 1100 
but input pwm have TIM_ICPrescaler that i think devide pwm
frequncy</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: pwm input mode low frequncy</title><link>https://community.arm.com/thread/121069?ContentTypeID=1</link><pubDate>Sat, 06 May 2017 02:16:47 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:c990a796-8b59-4fe9-83de-0ed3aa921fdc</guid><dc:creator>saba ghorbani</dc:creator><description>&lt;p&gt;&lt;p&gt;
yes&lt;/p&gt;

&lt;p&gt;
I did this work but was like befor , it didn&amp;#39;t has effect.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pwm input mode low frequncy</title><link>https://community.arm.com/thread/109160?ContentTypeID=1</link><pubDate>Wed, 26 Apr 2017 11:17:18 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:eb992ec3-2bbb-446d-ba44-5a1f9e3fe67f</guid><dc:creator>Clive Unspecified</dc:creator><description>&lt;p&gt;&lt;p&gt;
For low speeds you&amp;#39;d need to configure the timebase to run slower
so the ticks in the period you are measuring don&amp;#39;t exceed the 16-bit
counter&amp;#39;s limit.&lt;/p&gt;

&lt;p&gt;
Use the timebase prescaler to divide down the SystemCoreClock&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pwm input mode low frequncy</title><link>https://community.arm.com/thread/83609?ContentTypeID=1</link><pubDate>Wed, 26 Apr 2017 07:05:26 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:ab2b991f-4353-4eb3-b5dd-960a92a4043e</guid><dc:creator>saba ghorbani</dc:creator><description>&lt;p&gt;&lt;p&gt;
thanks for your answer&lt;/p&gt;

&lt;p&gt;
i get pwm with micero controller and i wanted measure frequncy and
duty cycle and i can measure 1100 hz&lt;/p&gt;

&lt;p&gt;
i have some problem please answer me :&lt;/p&gt;

&lt;p&gt;
this is my code :&lt;/p&gt;

&lt;pre&gt;
  NVIC_InitStructure.NVIC_IRQChannel                   = TIM2_IRQn;
  NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority =0;
  NVIC_InitStructure.NVIC_IRQChannelSubPriority        =1;
  NVIC_InitStructure.NVIC_IRQChannelCmd                = ENABLE;
  NVIC_Init(&amp;amp;NVIC_InitStructure);

        TIM_ICInitStructure.TIM_Channel       = TIM_Channel_1;
  TIM_ICInitStructure.TIM_ICPolarity    = TIM_ICPolarity_Rising;
  TIM_ICInitStructure.TIM_ICSelection   = TIM_ICSelection_DirectTI;
  TIM_ICInitStructure.TIM_ICPrescaler   = TIM_ICPSC_DIV1;
  TIM_ICInitStructure.TIM_ICFilter      = 0x0;
  TIM_ICInit(TIM3, &amp;amp;TIM_ICInitStructure);
  TIM_PWMIConfig(TIM2, &amp;amp;TIM_ICInitStructure);
  TIM_SelectInputTrigger(TIM2,TIM_TS_TI1FP1);

  TIM_SelectSlaveMode(TIM2, TIM_SlaveMode_Reset);

  TIM_SelectMasterSlaveMode(TIM2,TIM_MasterSlaveMode_Enable);

  TIM_Cmd(TIM2, ENABLE);
  TIM_ITConfig(TIM2,TIM_IT_CC1,ENABLE);


&lt;/pre&gt;

&lt;p&gt;
and this is my handler :&lt;/p&gt;

&lt;pre&gt;
{

        GPIO_SetBits(GPIOC,GPIO_Pin_2);

  TIM_ClearITPendingBit(TIM2, TIM_IT_CC2);

        IC2Value = TIM_GetCapture1(TIM2);
//      IC1=TIM_GetCapture1(TIM2);
//      IC2=TIM_GetCapture2(TIM2);
         if (IC2Value != 0)
  {
    /* Duty cycle computation */
    DutyCycle = (TIM_GetCapture2(TIM2) * 100) / IC2Value;
    /* Frequency computation */
    Frequency = SystemCoreClock / IC2Value;
                IC2Value=0;
  }
  else
  {
    DutyCycle = 0;
    Frequency = 0;
  }
}

&lt;/pre&gt;

&lt;p&gt;
please say when during the current code i go to this handler&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pwm input mode low frequncy</title><link>https://community.arm.com/thread/69994?ContentTypeID=1</link><pubDate>Wed, 26 Apr 2017 06:44:57 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:ddb1035d-fc51-494f-b637-d85a44810b7b</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;p&gt;
For a start off, forget about microcontrollers.&lt;/p&gt;

&lt;p&gt;
&lt;b&gt;Think&lt;/b&gt; about what are the basic principles of frequency
measurement:&lt;/p&gt;

&lt;p&gt;
- what do you need to detect?&lt;/p&gt;

&lt;p&gt;
- what do you need to measure?&lt;/p&gt;

&lt;p&gt;
- how do you deduce frequency from the measurement(s)?&lt;/p&gt;

&lt;p&gt;
If you don&amp;#39;t understand the fundamental principles, you won&amp;#39;t be
able to implement them - whether with a microcontroller or anything
else!&lt;/p&gt;

&lt;p&gt;
Once you &lt;i&gt;&lt;b&gt;do&lt;/b&gt;&lt;/i&gt; understand the fundamental principles,
then you can look at the features available on your microcontroller,
and see which will be useful ...&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>