如何正确设计按钮计数器计数器的调试电路。按钮将用作秒表圈ROM启用圈
在开始之前,我只想说这只是设计方面。到目前为止,我的项目的这方面还没有编写任何代码。
我刚刚为秒表设计了一个计圈功能,它的功能本质上相当于一个 ROM。为此,我想确保一旦按下按钮(最多 4 次)就会存储一圈。此外,我计划使用 2 位计数器来执行此操作,其中按钮将以 2 位计数最多 4 个周期。从这里我希望 2 位数字用作 2-4 解码器的输入。 4 个输出将用作 4 个不同寄存器的使能。这些寄存器是使用的 4 圈。寄存器的输入是秒表的当前计数。这些都连接到4-1 MUX。我想使用单圈选择(2 位)作为 MUX 的选择线来推动目标单圈时间。这最终将显示在 7 段显示器上。 (我设计的显示方面没有问题)
目前,我担心如何谴责按钮,因为我的主板时钟在 200MHZ 左右。我该怎么做?我是否可以构建类似移位寄存器的东西,并以按钮作为输入,并通过与门传递所有延迟/信号?我还担心由于按下按钮的时间太长而导致重复循环。我是否还应该将其与时钟分频器结合起来,以便可以减慢计数器寄存器的时钟速度?在与我的教授交谈时,我听说使用高速时钟作为输入时时钟分频器不准确,具有高度的不确定性。
感谢您的帮助,谢谢。
Before I get started, I just want to say this is just the design aspect. So far, no code has been written for this aspect of my project.
I just designed a lap function for a stopwatch, which functions essentially as a ROM. To do this i want to make sure that once I press a push button (up to 4 times) a lap will be stored. Furthermore, I plan to execute this by using a 2 bit counter, where the push button will be count up to 4 cycles in 2 bits. From here I want the 2 bit number to be used as input to a 2-4 decoder. The 4 outputs will be used as the enables to 4 different registers. These registers are the 4 laps used. Inputs of registers is the current count of the stopwatch These are all connected to a 4-1 MUX. I want to use a lap select (2 bits) as select lines to a MUX to push through the targeted lap time. This will eventually be displayed on the 7 segment display. (No issues with this display aspect I designed)
Currently, I am worried about how to denounce the push button since the clock is at around 200MHZ for my board. How should I do this? Sould I build something resembling a shift register with the push button as the input, and pass all the delays/signals through an and gate? I'm also worried about repeated cycling due to the length the button is pressed. Should I also couple this with a clock divider so I can slow down the clock to the register of the counter? I heard something about clock dividers being innacurate with a high degree of uncertainty when using high-speed clocks as an input, while in conversation with my professor.
This is what I have designed for the counter
Any help is appreciated, thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

我得到了教授的同意使用时钟分频器,因为该应用程序只是可见的,而不是秒表本身功能的组成部分。我还收到了一些来自更高级别的注释/代码,用于在更高时钟频率(本例中为 MHz)下工作的去抖电路,
仍然想知道在这些频率下使用上面列出的移位寄存器的一些陷阱是什么使用,但除此之外我还好。
-瑞安
I was able to get the go ahead from my professor to use a clock divider since the application was only visible and not an integral part of the functionality of the stopwatch itself. I also received some notes/code from a higher class for a debounce circuit that works at a higher clock frequency (this case in the MHz)
Still am wondering what some of the pitfalls of using the shift register listed above at those frequencies are for future use, but other than that I am okay.
-Ryan