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,
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.
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.
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.