wlwlwlwl 发表于 2011-6-1 09:15:21

在实践中avr单片机的定时计数器的计数引脚能接受的最高频率到底有多高

在http://218.16.124.207/bbs/bbs_content.jsp?bbs_sn=768931&bbs_page_no=1&search_mode=3&search_text=wang_xm&bbs_id=9999 看到这样的理论
为保证正确的采样,外部时钟脉冲宽度必须大于一个系统时钟周期。在占空比为50% 时
外部时钟频率必须小于系统时钟频率的一半(fExtClk < fclk_I/O/2)。由于边沿检测器使用的是
采样这一方法,它能检测到的外部时钟最多是其采样频率的一半(Nyquist 采样定理)。然
而,由于振荡器( 晶体、谐振器与电容) 本身误差带来的系统时钟频率及占空比的差异,
建议外部时钟的最高频率不要大于fclk_I/O/2.5。

可是我实践中检验远没有那么么快,我把方波信号从单片机的T0引脚引入,T0计数器采用外部时钟上升沿触发方式,一秒钟内最多能从T0采到61千个脉冲,也就是T0能检测到得外部信号频率只有122kHz,频率再高一点的话我也试了,T0就跟不上速度了。
实验条件:atmega16   7.3728M晶振

不知道有哪位大侠用T0的计数功能采集过信号的,您当时实验到的最高频率有多少呢?

machao 发表于 2011-6-10 13:41:22

理论上是系统工作频率的1/2,这个不必要质疑,因为T0对脉冲计数是硬件本身完成的。
至于实际应用中能到多高,这要看设计使用工程师的水平。不是T0跟不上,是人的水平和能力跟不上。

millwood0 发表于 2011-6-16 06:43:31

I have gone to approximately 8Mhz.

there are plenty of avr-based frequency meters capable of even higher, without the use of an external prescaler.

fsclub 发表于 2011-6-16 07:43:36

系统频率的一半。
你没试过更高频率为何说不可?

wajlh 发表于 2011-6-16 08:02:36

占空比如果不是50%,频率还要低

machao 发表于 2011-6-16 09:40:55

回复【3楼】fsclub 绿林好汉
系统频率的一半。
你没试过更高频率为何说不可?
-----------------------------------------------------------------------

如果系统工作频率16M,那么I/O的时钟也就是16M,T0硬件每个时钟检测一次输入的变化,一次高/一次低,需要2个CLK,所以外部输入信号的最高频率8M。

这个是同步模式,在手册中有解释。要证明吗?

Each half period of the external clock applied must be longer than one system clock cycle to ensure correct sampling. The external clock must be guaranteed to have less than half the system clock frequency (fExtClk < fclk_I/O/2) given a 50/50% duty cycle. Since the edge detector uses sampling, the maximum frequency of an external clock it can detect is half the sampling frequency (Nyquist sampling theorem). However, due to variation of the system clock frequency and duty cycle caused by Oscillator source (crystal, resonator, and capacitors) tolerances, it is recommended that maximum frequency of an external clock source is less than fclk_I/O/2.5.

我说理论上为系统频率的一半,实际上都做不到,手册上的建议为 系统频率/2.5 !

你愿意去测试吗?我可不用测试。你有本事你去测试。

如果你使用了其它外接的电路,如分频器等,是另外一会事

millwood0 发表于 2011-6-17 06:39:31

"我说理论上为系统频率的一半,实际上都做不到,手册上的建议为 系统频率/2.5 ! "

there is no reason for you to guess - just read the datasheet. more specifically, read the synchronization block diagram.

if you have questions understanding it, come back and we can talk.

eblc1388 发表于 2011-6-17 09:49:08

回复【2楼】millwood0
there are plenty of avr-based frequency meters capable of even higher, without the use of an external prescaler.
-----------------------------------------------------------------------
不用外部分频器?
页: [1]
查看完整版本: 在实践中avr单片机的定时计数器的计数引脚能接受的最高频率到底有多高