打印
[技术问答]

求一个HC32F460 TIM6或TIMA TRIG引脚PWM捕获例子

[复制链接]
2125|2
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
sf116|  楼主 | 2021-8-6 11:09 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
如题,求TIM6_TRIGA/B或者TIMA_x_TRIG PWM输入捕获例程,谢谢了

使用特权

评论回复
沙发
sf116|  楼主 | 2021-8-6 11:15 | 只看该作者
本帖最后由 sf116 于 2021-8-6 11:18 编辑

配置TIM6_TRIGA PWM捕获
1.Timer6_Init,应该配置哪个单元基础定时器?M4_TMR61\2\3?
2.Timer6_SetPeriod,Period register应该选择A\B\C?
3.PORT_SetFunc(PortE, Pin07, Func_Tim6, Disable);,Timer6_PortInputConfig,   enPortSel选择Timer6TrigA,定时器应该选择哪个单元?4.Timer6_ConfigHwCaptureA(M4_TMR61, Timer6HwTrigTimTriARise);Timer6_ConfigHwClear(M4_TMR62, Timer6HwTrigTimTriARise);    Timer6_EnableHwClear(M4_TMR61);
5.Timer6_ConfigIrq,中断类型和中断远应该选哪个?
    Timer6INTENA    = 0u,     ///< Interrupt of count equal to GCMA (or capture input A)
    Timer6INTENB    = 1u,     ///< Interrupt of count equal to GCMB (or capture input B)
    Timer6INTENC    = 2u,     ///< Interrupt of count equal to GCMC
    Timer6INTEND    = 3u,     ///< Interrupt of count equal to GCMD
    Timer6INTENE    = 4u,     ///< Interrupt of count equal to GCME
    Timer6INTENF    = 5u,     ///< Interrupt of count equal to GCMF
    Timer6INTENOVF  = 6u,     ///< Interrupt of over flow of sawtooth wave mode or peak point of triangular wave mode
    Timer6INTENUDF  = 7u,     ///< Interrupt of under flow of sawtooth wave mode or valley point of triangular wave mode
    Timer6INTENDTE  = 8u,     ///< Interrupt of dead timer error
    Timer6INTENSAU  = 16u,    ///< Interrupt of count up equally compared with SCMA
    Timer6INTENSAD  = 17u,    ///< Interrupt of count down equally compared with SCMA
    Timer6INTENSBU  = 18u,    ///< Interrupt of count up equally compared with SCMB
    Timer6INTENSBD  = 19u,    ///< Interrupt of count down equally compared with SCMB
6.以上配置完成,硬件启动即可?
Timer6_ConfigHwStart(M4_TMR61, Timer6HwTrigTimTriARise);
Timer6_EnableHwStart(M4_TMR61);

使用特权

评论回复
板凳
sf116|  楼主 | 2021-8-9 09:10 | 只看该作者
版主大佬帮个忙?

使用特权

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

本版积分规则

个人签名:承接电子产品开发

8

主题

121

帖子

4

粉丝