找回密码
 立即注册
楼主: zhangmw536

INT3测量频率信号问题 | 已解决,用 CCP 模块测量

[复制链接]
  • 打卡等级:偶尔看看III
  • 打卡总天数:55
  • 最近打卡:2025-05-02 08:32:59

718

主题

1万

回帖

1万

积分

管理员

积分
15630
发表于 2023-12-25 19:45:39 | 显示全部楼层
回复 支持 反对

使用道具 举报 送花

  • 打卡等级:初来乍到
  • 打卡总天数:4
  • 最近打卡:2025-05-01 06:58:22

5

主题

184

回帖

1333

积分

金牌会员

积分
1333
发表于 2023-12-27 04:07:59 | 显示全部楼层
gj*** 发表于 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.
回复 支持 反对

使用道具 举报 送花

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|小黑屋|深圳国芯人工智能有限公司 ( 粤ICP备2022108929号-2 )

GMT+8, 2025-5-3 00:01 , Processed in 0.138078 second(s), 53 queries .

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表