2017-01-26 07:32 AM
Hi,
I have two freshly created projects with the STM32F407 in 100 Pin LQFP housing. I admit I didn't read the datasheet properly and found out afterwards that not all timers are 32 bit timers (which I would expect in a 32 bit micro..., lesson learned...).
In both projects I use a 16 bit timer in encoder mode. I need higher count range, overflow occurs now at 65535, I would need more like 24 bit or better the full 32bit.
For one project it's feasible to rewire the two encoder phases to one of the 32bit timers (TIM2 orTIM5) which are unused, so that would be an option, though I would prefer a software fix.
In the other project I use Ethernet in RMII mode which stupidly blocks both 32bit timers for use in encoder mode as there are not enough pin remapping options (at least CubeMX says so). So this would require a complete redesign using a TQFP144 package at least (which needs more board space and has supply chain issues).
I read about the possibility of daisy chaining two 16bit timers to get a 32bit count range, but unfortunately I don't understand if and how that would work in encoder mode. The timers are pretty complex in the datasheet and I could find an example for daisy chain in encoder mode.
If someone could give me a hint how this can be accomplished I would really appreciate it.
2017-01-26 07:47 AM
I don't understand if and how that would work in encoder mode
It wouldn't.
JW
2017-01-26 07:50 AM
Somehow when there is a overflow or underflow of the first 16bit counter in encoder mode, the 2nd counter needs to be incremented or decremented.
I'm not an expert, it was just some hope it may be possible.
2017-01-26 08:16 AM
The link between the timers is a single signal, i.e. you can link to other timer underflow/overflow (here: update) as a single signal, but not the direction.
JW