您好,我想用ch32v307的定時器同步功能來實現(xiàn)多個相位的信號。例如:
用TIM1 的OC3 啟動TIM2, 用TIM2的OC3 啟動TIM3。
然而實際實現(xiàn)里用邏輯分析儀測試,這個相位并不受OC3 的數(shù)值控制。請問正確的使用方法是什么?
? ? TIM2 代碼:
? ? TIM_SelectInputTrigger(TIM2, TIM_TS_ITR0);
? ? TIM_SelectSlaveMode(TIM2, TIM_SlaveMode_Trigger);
????TIM1 代碼:
? ? TIM_OCInitStructure.TIM_OCMode = TIM_OCMode_PWM1;
? ? TIM_OCInitStructure.TIM_OutputState = TIM_OutputState_Enable;
? ? TIM_OCInitStructure.TIM_OCPolarity = TIM_OCPolarity_Low;
? ? TIM_OCInitStructure.TIM_Pulse = 10; //輸出相位不受這個值控制
? ? TIM_OC3Init( TIM1, &TIM_OCInitStructure );
? ? TIM_SelectMasterSlaveMode(TIM1,TIM_MasterSlaveMode_Enable);
? ? TIM_SelectOutputTrigger(TIM1, TIM_TRGOSource_OC3Ref);
? ? TIM_Cmd( TIM1, ENABLE );