Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply Microsteps as a denominator rather than quotient #189

Closed
sjkelly opened this issue Apr 1, 2021 · 1 comment
Closed

Apply Microsteps as a denominator rather than quotient #189

sjkelly opened this issue Apr 1, 2021 · 1 comment

Comments

@sjkelly
Copy link
Collaborator

sjkelly commented Apr 1, 2021

We currently do this:

  // Set the increment across the phase table from the specified microsteps
  wire [7:0] abs_increment = (microsteps == 8'd0 ) ? 8'd64 :
                             (microsteps <= 8'd2 ) ? 8'd32 :
                             (microsteps <= 8'd4 ) ? 8'd16 :
                             (microsteps <= 8'd8 ) ? 8'd8  :
                             (microsteps <= 8'd16) ? 8'd4  :
                             (microsteps <= 8'd32) ? 8'd2  :
                                                     8'd1  ;

In theory non power of two increments should work in LUT traversal. so you could e.g. get 64/3 microsteps. Which might be useful for encoders and also less FPGA logic.

@sjkelly
Copy link
Collaborator Author

sjkelly commented Apr 1, 2021

This is a proposed solution for #148

@sjkelly sjkelly closed this as completed in 6635a46 Apr 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant