打印

STM32捕获周期问题

[复制链接]
303|0
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
STM32, TI, ic, se, TE
[table][tr][td]
不明白“ IC1的捕获寄存器捕获PWM的高电平周期”这句话在哪个里面体现了? 我只配置了通道2的输入捕获功能呀,为什么 通道1TIM_GetCapture1(TIM2)捕获了?<div class="blockcode"><div id="code_I8h">

  • /* TIM2 configuration: PWM Input mode ------------------------
  •      The external signal is connected to TIM2 CH2 pin (PA.01),
  •      The Rising edge is used as active edge,
  •      The TIM2 CCR2 is used to compute the frequency value
  •      The TIM2 CCR1 is used to compute the duty cycle value
  •   ------------------------------------------------------------ */

  •   TIM_ICInitStructure.TIM_Channel = TIM_Channel_2;
  •   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_PWMIConfig(TIM2, &TIM_ICInitStructure);

  •   /* Select the TIM2 Input Trigger: TI2FP2 */
  •   TIM_SelectInputTrigger(TIM2, TIM_TS_TI2FP2);

  •   /* Select the slave Mode: Reset Mode */
  •   TIM_SelectSlaveMode(TIM2, TIM_SlaveMode_Reset);

  •   /* Enable the Master/Slave Mode */
  •   TIM_SelectMasterSlaveMode(TIM2, TIM_MasterSlaveMode_Enable);

  •   /* TIM enable counter */
  •   TIM_Cmd(TIM2, ENABLE);

  •   /* Enable the CC2 Interrupt Request */  TIM_ITConfig(TIM2, TIM_IT_CC2, ENABLE);

使用特权

评论回复

相关帖子

发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

370

主题

370

帖子

0

粉丝