2021-05-21 02:05 AM
hi
any one can help me how to setup timer stm32 for encoder out put
i need convert endat encoder to incremental encoder
2021-05-21 07:36 AM
phase pin1 pin2
0 0 0
1 0 1
2 1 1
3 1 0
Perhaps the easiest is to run a periodic interrupt and keep track of the "phase" (there are 4 phases in the encoder) in a variable. In the interrupt, increment or decrement the phase depending on where do you want to move, mask the bottom 2 bits, and use those to look up the pins output values in the table above.
There are of course many ways how to tackle this.
JW
2021-05-21 07:57 AM
I NEED used timer for make encoder output
i have 32bit is my position when motor rotate this number go up or down need send out to incremental encoder old cnc system can work with this exactly same used incremental encoder
i try fined way used timer stm32 for output encoder