cancel
Showing results for 
Search instead for 
Did you mean: 

The issue in stm32 encoder mode.

HPham.1590
Senior

Hi, I'm using STM32F103C8T6.

When i used encoder mode on TIM3 and 4, I found that it's really unstable, when I restart or reset the microcontroller, it often can not read the encoder data (about 3/5 times). I measured the voltage on these timers's pins, recorded in 5 times reset (or turn off, turn on again), it has 3 time when the voltage <3V and the others >=3V. I set GPIO pin mode is pull up. As my knowledge, when I supply 3.3V to Vcc pin, Low level is < 1.28V and High level is > 1.88V, the range between them is indeterminate. But in my case, it seems the high level start at 3.00V.

So can I expand this range or anyone can suggest me the way to solve this issue?

Many thanks.

2 REPLIES 2

It's the encoder which should pull the low level down, not the mcu; so if you don't have low level below 1.28V check the encoder connection.

Also, if this is a blue pill, note that many blue pills come with counterfeited mcu.

JW

Hi JW,

Thanks for your reply, I will try to pull the level down by using an Opto. About my blue pill, I agree with you that it may be a fake item. I checked the bill again and found that I bought it with the price only 4$ but there is a no different type to buy. It still works correctly until the recent day and I think that change to another microcontroller will be the last choice. 

Hieu