2013-03-01 06:57 AM
Hi all. I want to measure length between 2 pressure pistons but I don't know can i change the directon with changing IC1 edge align mode or IC2 edge align mode on x4 resolution mode for example
1-) TIM_EncoderInterfaceConfig(TIM2, TIM_EncoderMode_TI12, TIM_ICPolarityRising, TIM_ICPolarityRising); 2-)TIM_EncoderInterfaceConfig(TIM2, TIM_EncoderMode_TI12, TIM_ICPolarityFalling, TIM_ICPolarityRising); or TIM_EncoderInterfaceConfig(TIM2, TIM_EncoderMode_TI12, TIM_ICPolarityRising, TIM_ICPolarityFalling); while first selection is counting up/down,can one of second selection count down/up?? if this is not useful how can i change directon during the encoder timer is counting??2013-03-01 07:11 AM
May be you can diagram the system/signals so those not familiar with it might be able to suggest possible solutions?
The TIM units are pretty complex, and often inflexible. Several aspects can't be changed on the fly, which might mean you need to briefly disable to effect change. Also be aware that each TIM unit has a SINGULAR counting element, and 4 latches. Where possible you want the hardware to latch a timebase, and then compute the delta between measurements.2013-03-08 04:02 AM
yes i can measure the delta but i think i can do it with hardware when the timers count different ways i can change the channel 1 to 2 with a circuit. i'll try the both of these thank you clive1