From 0829fd098303386461d92d24d3c0adecd9279756 Mon Sep 17 00:00:00 2001 From: Theodor Chikin Date: Tue, 15 Apr 2025 19:00:22 +0300 Subject: [PATCH] fixed modulation and ADC clocks initial phase to 0. (by TIM->CNT=0) --- Src/main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Src/main.c b/Src/main.c index a14cbda..4df5070 100644 --- a/Src/main.c +++ b/Src/main.c @@ -421,6 +421,8 @@ int main(void) uint16_t trigger_counter = 0; uint16_t trigger_step = (uint8_t )((task.max_param - task.current_param)/task.delta_param * 10); uint16_t task_sheduler = 0; + TIM11 -> CNT = 0; + TIM4 -> CNT = 0; HAL_TIM_PWM_Start(&htim11, TIM_CHANNEL_1); //start modulating by Mach-Zander modulator HAL_TIM_PWM_Start(&htim4, TIM_CHANNEL_3); //start modulating by Mach-Zander modulator while (task.current_param < task.max_param) @@ -428,8 +430,8 @@ int main(void) if (TIM10_coflag) { Set_LTEC(TT_CHANGE_CURR_1, task.current_param); - TIM11 -> CNT = 0; // to link modulator phase - TIM4 -> CNT = 0; // to link ADC clock phase + //TIM11 -> CNT = 0; // to link modulator phase + //TIM4 -> CNT = 0; // to link ADC clock phase task.current_param += task.delta_param; TO10 = 0; TIM10_coflag = 0;