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:
@ -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.
4234
build/For_stm32.hex
4234
build/For_stm32.hex
File diff suppressed because it is too large
Load Diff
1423
build/For_stm32.map
1423
build/For_stm32.map
File diff suppressed because it is too large
Load Diff
18101
build/main.lst
18101
build/main.lst
File diff suppressed because it is too large
Load Diff
BIN
build/main.o
BIN
build/main.o
Binary file not shown.
Reference in New Issue
Block a user