Forum Discussion
Altera_Forum
Honored Contributor
7 years ago --- Quote Start --- I have some different opinion about this. If the stepper motor controler is supposed with PWM,the stepper motor's speed is relation with the pwm's frequency.That is to say,if I want to get the variable stepper motor speed,I should get variable frequency of pwm. If the input frequency of FPGA is 50MHz,using the counter++,may get those frequency,like 25MHz,12.5MHz,6.25Mhz,....and so on. But,there is some frequency can no be reached,like 20MHz,or 999999Hz. I do not kown how to deel with this. Do you have any opinion about those? --- Quote End --- generate clock enable using modulo accumulator. add your word non-stop. then at overflow generate a pulse The equation for frequency becomes: f = clk speed * accum word value/accum resolution e.g. if accum is 32 bits and word is 2^30 and clock is 50MHz then: f = 50 * 2^30/2^32 = 50/4 Mhz