Altera_Forum
Honored Contributor
11 years agotwo counters, two clocks - loop problem!
Hello,
I hope someone can provide insight into a problem that has got me scratching my head for the past week! what i am trying to do is: Two counters from two different clock sources. When the first (slower clock) counter hits a certain count it must stop (and reset to 0 count) and immediately start the second counter.. ..when the second (faster clock) counter hits a certain count it must stop (and reset to 0 count) and immediately the first counter starts again. The two clocks are synchronized: A clock (used to drive the fast counter above) drives another counter which when that hits a certain count resets back to zero and carries on counting. When it resets this is the clock source that drives the first slower counter above. Does that make sense?! the problem: I see that the inter-relationship between the two counters is of a horrible 'loop-back' nature and this is causing any simulation of my VHDL to get so far and then show 'unknown' signal states. I have tried many different approaches, but always I can see the problem in my mind but essentially do not know how to basically approach a solution to this problem. i.e. two counter processes inter-dependent on each other. Two processes are needed due to the different clocking sources. Gaaaaaa! My brain hurts :-P For the record, I am a relative newbie to VHDL. Thanks in advance! Andy