Forum Discussion
Altera_Forum
Honored Contributor
15 years agoHi Guillermo,
I think your counter or 'Comptador' is in general ok. I assume that you running your design with a 50 MHz clock and the counter should increase its output ever 1 ms. In this case you should change your line:if(cuenta= 50000) then to if(cuenta= 49999) then or you count 50001 times instead of 50000. The source of your problems is that you don't clock your state machine in the 'Llums' process in LEDsv2.vhd. By the way, what are you intending to do with this state machine? I think you intending to increase 'led_r' every 250 ms right? But then you should compare to 249 or you wait 251 ms and set the reset back to '1' or the counter is always reseted. Best Regards Mathias