Now PG9 toggles at the very beginning of every laser current step. Purpose: tell ADC that step started/ended for correct averaging.
This commit is contained in:
+5
-2
@@ -448,14 +448,17 @@ int main(void)
|
|||||||
if (TIM10_coflag)
|
if (TIM10_coflag)
|
||||||
{
|
{
|
||||||
Set_LTEC(TT_CHANGE_CURR_1, task.current_param);
|
Set_LTEC(TT_CHANGE_CURR_1, task.current_param);
|
||||||
|
HAL_GPIO_TogglePin(GPIOG, GPIO_PIN_9); //toggle PG9. Change indicates that current step started.
|
||||||
|
|
||||||
//TIM11 -> CNT = 0; // to link modulator phase
|
//TIM11 -> CNT = 0; // to link modulator phase
|
||||||
//TIM4 -> CNT = 0; // to link ADC clock phase
|
//TIM4 -> CNT = 0; // to link ADC clock phase
|
||||||
task.current_param += task.delta_param;
|
task.current_param += task.delta_param;
|
||||||
TO10 = 0;
|
TO10 = 0;
|
||||||
TIM10_coflag = 0;
|
TIM10_coflag = 0;
|
||||||
|
|
||||||
HAL_GPIO_WritePin(GPIOG, GPIO_PIN_9, GPIO_PIN_SET); // set the current step laser current trigger
|
|
||||||
HAL_GPIO_WritePin(GPIOG, GPIO_PIN_9, GPIO_PIN_RESET);
|
//HAL_GPIO_WritePin(GPIOG, GPIO_PIN_9, GPIO_PIN_SET); // set the current step laser current trigger
|
||||||
|
//HAL_GPIO_WritePin(GPIOG, GPIO_PIN_9, GPIO_PIN_RESET);
|
||||||
//*
|
//*
|
||||||
if (step_counter % trigger_step == 0){ //trigger at every 60 step
|
if (step_counter % trigger_step == 0){ //trigger at every 60 step
|
||||||
OUT_trigger(trigger_counter);
|
OUT_trigger(trigger_counter);
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
+2116
-2118
File diff suppressed because it is too large
Load Diff
+712
-711
File diff suppressed because it is too large
Load Diff
+9035
-9040
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Reference in New Issue
Block a user