cancel
Showing results for 
Search instead for 
Did you mean: 

Maximum number of quadrature encoders supported on STM32F777

Kamal Ahmed
Associate II

I would like to know the maximum number of quadrature encoders (looking for up to 😎 that can be supported with a STM32F777ZITx. Any other STM MCU's that do better? 

Can more be supported if using LL interfaces instead of HAL?

RE: HAL

I am referring to the encoder interface mentioned in Section 4.3.4 of this application note:

https://www.st.com/content/ccc/resource/technical/document/application_note/54/0f/67/eb/47/34/45/40/DM00042534.pdf/files/DM00042534.pdf/jcr:content/translations/en.DM00042534.pdf

Cheers,

Kamal

7 REPLIES 7

The HW is the same regardless of the HAL or LL.

How many bits do you need, as I recall only TIM2 and TIM5 offer 32-bit encoder resolution.

There are perhaps 8 total TIM providing for 2 inputs.

You'd want to review the data sheet for your chosen part/pin count.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

As Clive said above, 7 or 8 is the limitation given by hardware.

In one design, we've circumvented this limitation by using several cheap STM32F0xx, connected to the main mcu using I2C.

Also, depending on the input pulses speed, multiple slower encoders may be handled by software in a periodic interrupt.

JW

HAL vs LL: The HAL interface only allows configuring input 1 and 2 for a timer in encoder mode but some timers have more than 2 channels (some have up to 6), which can all be configured as inputs or outputs, and so I thought I might be able to select another pair of channels as inputs for configuring another encoder if I had access to doing so through LL. Clearly, I need to learn a lot more about this stuff.

If I had access to 8, it might just work. I was trying to stay away from using multiple MCUs for this.

We are trying to get a reading for the position of a linear actuator being used as a pinch valve (we have 8 of them).

The hardware in timer allows to use encoder mode specifically only on CH1 and CH2.

JW

As Jan points out encoder mode only works with CH1 and CH2, but more critically the TIM only has a single counting element which limits their utility.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Thanks folks. The limitation is crystal clear now.