Keeping a count of user button pushes --

  • Thread starter thisguy928
  • Start date
  • Tags
    Count
In summary, you are creating a counter using a 74163 chip on an Altera DE2 Development Board to count the number of times a button is pressed. However, the counter is not working properly and you need to implement an edge detector and debounce circuit before feeding the counter. This can be achieved using a 1-shot circuit to synchronize the button input to the internal clock and generate a pulse that is 1 clock in duration. The button input must first be debounced before being fed into the circuit.
  • #1
thisguy928
1
0
Hi, I'm using an Altera DE2 Development Board. I'm creating a counter that counts the number of times a user pushes a button. I'm using 74163 counter since I need to count 0-9 and I think it's easier to control. I must have it running on an internal clock. However, my counter didn't seem to be working to perfectly. when the button is pressed, P and T are true and the counter starts counting but it counts from 0-9 changing on the edge of clock. How am I able to implement this? how can I keep the single ou out count after the button is pressed and held even if the clock is 'clockkng'?
 
Last edited by a moderator:
Engineering news on Phys.org
  • #2
You will need to implement an edge detector and debounce circuit before feeding the counter.

I'm assuming that you mean that you have implemented the logic of a 74163 inside of the FPGA but the same thing applies if you are using an external discrete 74163.

Edge detect & debounce are easy to implement in your FPGA.
 
  • #3
You are having one of 2 problems, I think, but I'm not sure which.

Either you are feeding the button into the counter clock input, in which case you are counting the mechanical bounce of the button (like emi guy said). Or, you are feeding a clock to the counter (which what I think you are doing) and want the count-enable signal to only allow 1 count per button press. For that to happen, the count enable signal can only be 1 clock in duration.

Either way, you must first debounce the switch.

Then, you must make a 1-shot circuit that causes 1 pulse that is 1 clock in duration, for each button press, to feed to the counter's enable input. It can be tricky because you have to synchronize the asynchronous input of the button to the internal clock using a meta-stable proof double synchronizer (look it up). That can be a 3 flip-flop shift register clocked off the internal clock that is fed by a high true button press signal. You use AND gate off the Q of the 2nd flop and the QN of the third flop to feed your count-enable (if it is high true). (or you can use low true and change the output detector. Or, you can detect the trailing edge of the button press, or whatever you want.)

The signal into the shift register (or, synchronizer and pulse generator as you will) must first be debounced. You can look that part up. There are lots of ways, so research it and then ask questions.
 

FAQ: Keeping a count of user button pushes --

What is the purpose of keeping a count of user button pushes?

The purpose of keeping a count of user button pushes is to track and record the number of times a specific button or feature is used by users. This information can be used for various purposes such as analyzing user behavior, measuring the popularity of a feature, and improving the user experience.

How can I keep a count of user button pushes?

There are several ways to keep a count of user button pushes, depending on the type of button or feature. One common method is to use a counter variable that increases every time the button is clicked. Another option is to use event listeners to track button clicks and update the count accordingly. Additionally, there are various tools and software available that can help with keeping a count of user button pushes.

What are the benefits of keeping a count of user button pushes?

Keeping a count of user button pushes can provide valuable insights into user behavior and preferences. This information can be used to make data-driven decisions about design and development, identify popular features, and measure the success of a product or service.

Are there any limitations to keeping a count of user button pushes?

One limitation of keeping a count of user button pushes is that it only provides quantitative data and does not give insights into the reasons behind user behavior. Additionally, if the count is not accurately tracked or if users are able to manipulate the count, the data may not be reliable.

How can I use the count of user button pushes to improve my product or service?

The count of user button pushes can be used in various ways to improve a product or service. For example, if a certain button is rarely used, it may indicate that it is not well-designed or not useful to users. On the other hand, if a button is used frequently, it may be worth investing more resources into improving its functionality and design. The count can also be used to measure the success of updates or changes made to the product or service.

Similar threads

Replies
2
Views
849
Replies
1
Views
2K
Replies
1
Views
5K
Replies
9
Views
12K
Replies
10
Views
5K
Replies
7
Views
4K
Replies
6
Views
3K
Back
Top