神农鼎 发表于 2023-12-25 19:45:39

可以

视频教学《USB型 1T 8051 单片机原理及应用-STC8H8K64U》,山东大学陈桂友教授 - 视频教学,《单片机原理及应用》教学改革及实践研讨会,实战技术交流会,会务通知 - 国芯论坛-STC全球32位8051爱好者互助交流社区 - STC全球32位8051爱好者互助交流社区 (stcaimcu.com)

jmg 发表于 2023-12-27 04:07:59

gjf 发表于 2023-12-25 17:01
stc8h可以用Timer3+int1来测量高电平脉冲宽度吗?
Timer3 can only be used with some limitations.

The best hardware HI-LEVEL measurement is a gated time, like T0,T1.
With GATE the count stops, when the pin is LOW.

Next best HW is a CAPTURE timer, where the pin edge gets the timer value at that instant.
You get two captures and take the difference.

Timer3 has no GATE and no capture, so you would need to use INT1 to SW start/stop/read/clear timer3. That Sw solution has more jitter, and needs a high priority interrupt.

STC8H does have TM3PS register, so T3.CLK = SysCLK/(TM3PS+1) which can nicely scale the 16 bits timer read value.
页: 1 [2]
查看完整版本: INT3测量频率信号问题 | 已解决,用 CCP 模块测量