cancel
Showing results for 
Search instead for 
Did you mean: 

quadrature encoder values

waaizkhan
Associate II
Posted on June 07, 2015 at 19:46

hi everyone  i m going to interface encoder with motor the encoder is working perfectly and counting up to 0xFFFF in clock wise direction but when i rotate in counter clockwise direction it,s counting from 0 but from counter the value is start from 4294966870 

i know that in hex 0-1=FFFF how to change it to -1

Encoder_Reading  = TIM_GetCounter(TIM5);

Thanks in advance
2 REPLIES 2
Posted on June 07, 2015 at 21:47

hi everyone  i m going to interface encoder with motor the encoder is working perfectly and counting up to 0xFFFF in clock wise direction but when i rotate in counter clockwise direction it,s counting from 0 but from counter the value is start from 4294966870

This might have been better in a new thread, as I doubt you are using an F103 part, and that TIM5 on your part is a 32-bit timer. You could restrict it to a 16-bit count if you suitably programmed the timebase.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
waaizkhan
Associate II
Posted on June 09, 2015 at 18:48

thanks 

i m using stm32f407vg discovery board

i have restricted timer to 0xFFFF and when i m rotating the motor ,in clockwise it,s start from 0 to FFFF but in counterclockwise it,s start from FFFF and decrements  to 0 .My requirment is to start from 0 to FFFF or -1 to -65535.

Best Regards