智能车制作

 找回密码
 注册

扫一扫,访问微社区

查看: 3631|回复: 5
打印 上一主题 下一主题

[编程类] 哪位高手知道PT7口的那个脉冲累加器怎么用啊??

[复制链接]

30

主题

477

帖子

0

精华

常驻嘉宾

Rank: 8Rank: 8

积分
4940

论坛元老奖章

威望
705
贡献
4087
兑换币
0
注册时间
2009-6-14
在线时间
74 小时
跳转到指定楼层
1#
发表于 2010-4-19 09:15:59 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
1贡献
我想用PT7口那噶脉冲累加器测速,不想用中断的方法,哪位高手指点一下呗

最佳答案

查看完整内容

When PAEN is set, the PACT is enabled.The PACT shares the input pin with IOC7.要注意的是这里的paen要置1,同时脉冲输入口,要接入到ioc7也就是说pt7接口详细解释下:6 PAENPulse Accumulator System Enable — PAEN is independent from TEN. With timer disabled, the pulse accumulator can function unless pulse accumulator is disabled.0 16-Bit Pulse Accumulator system disabled.1 Pulse Accumulator system enab ...

11

主题

36

帖子

0

精华

中级会员

Rank: 3Rank: 3

积分
273
威望
217
贡献
26
兑换币
0
注册时间
2009-9-30
在线时间
15 小时
2#
发表于 2010-4-19 09:16:00 | 只看该作者

When PAEN is set, the PACT is enabled.The PACT shares the input pin with IOC7.

要注意的是这里的paen要置1,同时脉冲输入口,要接入到ioc7也就是说pt7接口

详细解释下:

6
PAEN

Pulse Accumulator System Enable — PAEN is independent from TEN. With timer disabled, the pulse
accumulator can function unless pulse accumulator is disabled.

0 16-Bit Pulse Accumulator system disabled.

1 Pulse Accumulator system enabled. 打开脉冲计数,需要

5
PAMOD

Pulse Accumulator Mode — This bit is active only when the Pulse Accumulator is enabled (PAEN = 1).

0 Event counter mode.
     事件触发计数 也就是外面有脉冲来就计数,需要

1 Gated time accumulation mode.
门控时间累加方式。简单的说就是统计输入脚的高或低电平持续的时间clock数目。

4
PEDGE

Pulse Accumulator Edge Control—This bit is active only when the Pulse Accumulator is enabled (PAEN = 1).

For PAMOD bit = 0 (event counter mode). See Table 16-18.

0 Falling edges on IOC7 pin cause the count to be incremented.  下降沿

1 Rising edges on IOC7 pin cause the count to be incremented.    上升沿 这个无所谓了。

3:2

CLK[1:0]

Clock Select Bits — Refer to Table 16-19. 门控时间计数方式有效。

1
PAOVI

Pulse Accumulator Overflow Interrupt Enable

0 Interrupt inhibited.

1 Interrupt requested if PAOVF is set.  溢出中断是否有效

0
PAI

Pulse Accumulator Input Interrupt Enable

0 Interrupt inhibited.

1 Interrupt requested if PAIF is set. 输入中断是否有效

明白上述各种含义代码如下 代码如下:

PACTL = 0x40;      //脉冲计数 下降沿

// Pulse Accumulators Count Registers (PACNT)

PACNT = 0x0000;  //0计数器

回复

使用道具 举报

30

主题

477

帖子

0

精华

常驻嘉宾

Rank: 8Rank: 8

积分
4940

论坛元老奖章

威望
705
贡献
4087
兑换币
0
注册时间
2009-6-14
在线时间
74 小时
3#
 楼主| 发表于 2010-4-19 17:53:13 | 只看该作者
什么意思呢?
回复

使用道具 举报

30

主题

477

帖子

0

精华

常驻嘉宾

Rank: 8Rank: 8

积分
4940

论坛元老奖章

威望
705
贡献
4087
兑换币
0
注册时间
2009-6-14
在线时间
74 小时
4#
 楼主| 发表于 2010-4-19 19:04:42 | 只看该作者
谢谢 你了
很及时啊
今晚就可以研究测速了
回复

使用道具 举报

11

主题

36

帖子

0

精华

中级会员

Rank: 3Rank: 3

积分
273
威望
217
贡献
26
兑换币
0
注册时间
2009-9-30
在线时间
15 小时
5#
发表于 2010-4-21 17:00:07 | 只看该作者
回复 5# 王怀玉


    测得速度很容易 怎么用就是你发挥的部分了
回复

使用道具 举报

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

本版积分规则

关于我们|联系我们|小黑屋|智能车制作 ( 黑ICP备2022002344号

GMT+8, 2024-9-21 01:41 , Processed in 0.415293 second(s), 31 queries , Gzip On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

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