Hey out there!
I got some problems with the QEI mode of timer 3 (Cortex-M3, Eval Board MCBSTM32). Is any body out there who got an example showing its configuration and its use inside a real application? I would be pleased, if you could post it here.
My current configuration looks like that:
Main Configuration of Timer 3: Tim3_SMCR.SMS -> Encoder Mode 3 (val 011)
Tim3_SMCR.TS -> TI1FP1 (val 101)
Tim3_CR1.URS -> Counter over-/underflow, UG BIT, Slave mode controller (val 0)
Tim3_CR1.DIR -> Coutner used as up-counter (val 0)
Tim3.ARR -> 1000
Timer 3 Channel 1 Configuration: Tim3_CCR1 -> 0
Tim3_CCMR1.CC1S -> CC1 configured as input, IC1 mapped on TI1 (val 01)
Tim3_CCER.CC1P -> non-inverted (val 0)
Timer 3 Channel 2 Configuration: Tim3_CCR2 -> 0
Tim3_CCMR1.CC2S -> CC2 configured as input, IC2 mapped on TI2 (val 01)
Tim3_CCER.CC2P -> non-inverted (val 0)
no prescaler, no filter at all Everything else stays at its default values. The Ch1 and Ch2 are defined as Input (with pull-up/-down). The Pin is defined as output. My application counts until it reachs the auto-reload value. At this point an update event is thrown. Inside this interrupt routine a pin is toggled.
Good, so far. But the interrupt doesn't come in a constant periode of time (as it is expected), it differs. Sometimes it seems that two interrupts occure instead of one. So that the pin is toggled again. Thats a bit confusing because only the update interrupt is allowed (enabled). Its flag is tested inside the corresponding routine, so that the pin toggle only occure if an update interrupt has been triggered. To avoid multi use the flag is reseted.
Now, I think I did something wrong inside the configuration. I would be proud if someone could post a correct configuration, which has worked for him (or her) or if someone could help me finding the problem.
Another question...What is about the configuration wizard (v1.20)? It seems really error-prone to me, can someone agree? If yes, is a solution already available?
I would be proud, if someone could help me. Thanks!
B.K.