Windows XP 中的 100 kHz 定时器频率 [英] 100 kHz Timer Frequency in Windows XP

查看:36
本文介绍了Windows XP 中的 100 kHz 定时器频率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一种流行的业余爱好级 CNC 机床控制,它在 Windows XP 中运行,它有一个定时器,以用户可选择的频率运行,范围从 25 kHz 到 100 kHz.

There's a popular hobby level CNC machine tool control that operates in Windows XP and it has a timer that operates at a user-selectable rate ranging from 25 kHz up to 100 kHz.

碰巧我也构建了 CNC 机床控制器,但我一直在使用 Galil Motion Control Inc. DMC1800 系列 DSP 运动控制器板,我用我的上级程序控制它.有些潜在买家负担不起这种配置,因此我编写了另一个应用程序,我计划将其作为基于软件的控制包提供.该应用程序已完成,但我没有计时器.(MS 多媒体计时器是不够的.)

It just so happens that I also build CNC machine tool controllers but I have been using a Galil Motion Control Inc. DMC1800 series DSP motion controller board which I control with my upper-level program. There are prospective buyers that cannot afford that configuration so I wrote another application which I plan to offer as software-based control package. The application is complete with the exception that I have no timer. (MS Multi-Media Timer is NOT sufficient.)

为避免混淆,我指的是能够以 100 kHz 频率运行的周期性计时器,而不是秒表计时器.

To avoid any confusion I'm referring to a periodic timer that is capable of operating at a frequency of 100 kHz and not a stopwatch timer.

推荐答案

这个计时器到底需要做什么?如果它只需要输出 25 kHz 到 100 kHz 之间的方波,那么您将需要额外的硬件,但不是非常昂贵的硬件.例如,看看来自 Data Translation 的这个 DT-340.它可以比你需要的更快,我相信它甚至可以触发中断.或者这个 PCI 8255/8254 48 个 I/O.

What exactly does this timer need to do? If it just needs to output a square wave between 25 kHz up to 100 kHz, then you will need extra hardware, but not outrageously expensive hardware. For example, look at this DT-340 from Data Translation. It can go even faster than you need, and I believe it can even trigger an interrupt. Or this PCI 8255/8254 48 I/O.

如果您能负担得起 500 美元左右的预算,那么应该有很多硬件选择.实际的可编程定时器芯片应该比这便宜得多,所以如果你愿意自己制作电路并将其连接到计算机,你可能会做得比 500 美元好很多.

If you can afford USD 500 or so in your budget, there should be lots of hardware options. The actual programmable timer chip ought to be much cheaper than that, so if you are willing to roll your own circuit and interface it to the computer, you can probably do a lot better than USD 500.

我曾经围绕 Intel 8253 Programmable Interval Timer 芯片构建了一个电路,该芯片在原始 IBM PC 中用于从内部扬声器发出蜂鸣声.它连接到一个 1.193182 MHz 的晶体,并有一个 16 位的分频器.这种芯片已经存在了几十年.如果您需要更好的,我相信从那时起已经有所改进.

I once build a circuit around the Intel 8253 Programmable Interval Timer chip, which was used inside the original IBM PC for generating the beeps out of the internal speaker. It was hooked up to a 1.193182 MHz crystal and has a 16 bit divider. This chip has been around for decades. If you need better, I'm sure there have been improvements since then.

当我说 PC 内部的 8253(或 8254)芯片用于驱动内部扬声器时,我说的并不完整.维基百科中有更多关于Intel 8253的信息.其中说明输出0用于产生时钟中断,输出1用于DRAM刷新时序,输出2用于驱动内部扬声器.

When I say that the 8253 (or 8254) chip inside a PC is used for driving the internal speaker, I'm not being complete. There is a lot more about the Intel 8253 in Wikipedia. There it explains that output 0 is used to generate the clock interrupt, output 1 is used for DRAM refresh timing, and output 2 is used to drive the internal speaker.

前两个时钟输出生成中断,这正是您想要的,但以上对这些输出当前所做的描述应该让您稍作停顿,以反映更改它们的行为可能会引起 Windows XP 的注意.扬声器的第三个输出,乱七八糟几乎无害,但您需要想办法将该信号重定向到产生和中断的东西,如果这是您需要的.

The first two clock outputs generate interrupts, which is what you want, but the above descriptions of what these outputs currently do ought to give you some pause to reflect that changing their behavior might possibly cause Windows XP to notice. The third output to the speaker, is mostly harmless to mess around with, but you would need to figure out some way to redirect that signal to something that generates and interrupt, if that's what you need.

可能 Mach 3 正在使用 高性能事件计时器 (HPET),根据此处是最新英特尔芯片组的一部分.定时器 0 和 1 用于 8254 仿真.

Probably Mach 3 is using the High Performance Event Timer (HPET), which according to here is part of recent Intel chipsets. Timer 0 and 1 are used for 8254 emulation.

"ICH HPET 定时器 2 中断可能是路由到以下任何一个IRQ:11、20、21、22 和 23,通过TIM2_CONF 寄存器.(注:这寄存器在英特尔® 中称为 TIM3_CONFICH5.)"

"The ICH HPET Timer 2 interrupt may be routed to any one of the following IRQs: 11, 20, 21, 22, and 23, via the TIM2_CONF register. (Note: this register is called TIM3_CONF in Intel® ICH5.)"

这篇关于Windows XP 中的 100 kHz 定时器频率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆