2015-02-09 06:06 AM
Hello to all,
I use a TIM8 of a STM32F2xx to generate a quadrature signal. This works fine no problem with toggling mode. I send a sequence of pulses out of the OC-Outputs. (a speed ramp). When the sequence is over the idle state of the OC-Outputs is unknown. How can I put the OC-Outputs to a defined state now? Or toggle them ''manually'' by single instruction? Thanks for your answers Andy2015-02-09 09:21 AM
Well you should be able to read the pin state, and generate N, or N+1 toggles to get it to a known end state.
2015-02-09 12:47 PM
> When the sequence is over the idle state of the OC-Outputs is unknown.
Why would it be unknown? Can't you count the number of updates (e.g. by chaining to another timer), then mod 2? Nevertheless, see TIM chapter's sub-chapter Forced output mode. Or, in case of TIM1/TIM8, see the OISx(N) bits in TIMx_CR2 (although, bumps may be ahead). Or, simply set them as GPIO outputs. JW2015-02-10 01:31 AM
Dear Jan,
thanks a lot for your hint with forced mode! It works great! I thought about the OISxN bits too. And I thought idle state decribes the state when the counter is not enabled. But I think this not true. Idle state in this regard has got something to do with deadtime insertion and when the MOE bit is 0. But in my application MOE must always be 1, otherwise the OC-Outputs don´t do anything. Anyway forced mode is the solution thanks a lot! Andy