- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi everybody! The project I'm currently working on requires a counter with the ability to increment or decrement its value based on two non periodic clock/count direction signals (in contrast to a generic counter that only needs to work with one clock/count direction pair). I can think of several ways to implementing this in software for the ARM core, but I don't have much of a clue when it comes to hardware design, I only know basic theory. Any tips for the hardware noob?
Thanks in advance,
Gino
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quite easy: use the UDB-based counter (v 3.0) which has got the capabilities you want.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Bob. I think the UDB counter is appropiate for the last part of the problem. However, I'm not sure of how to feed the count signals to it, as I have two signals that could either increment or decrement the stored value independently, like this: count_pulse_A,count direction_A, count_pulse_B, count_direction B.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Gino,
add a hardware MUX after inp1 and inp2 to make a single output
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the tip! I'm thinking I could have a problem if both signals try to update the counter value at once, only the one being passed by the multiplexer will affect the counter value. I need to figure a way to avoid loosing pulses when each of the inputs "take turns" at the multiplexer output.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Use a LUT component to cover some strange situations like counting up and down simultaneously. Since this component can be used registered you may use it as a hardware state-machine to control your up/down counter.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Bob. I'll take a look at the LUT documentation. I'll report back with some results as soon as possible.