cancel
Showing results for 
Search instead for 
Did you mean: 

When I want to output un sinewave which the points are included in the exc[z] array it is way slower if I use a timer interrupt : while(1) { HAL_GPIO_TogglePin(GPIOB,GPIO_PIN_0); //7 µS to send one point HAL_DAC_SetValue(&hdac,DAC_CHANNEL_1,DAC_A

julien12657
Associate III
Posted on September 02, 2017 at 12:01

When I want to output un sinewave which the points are included in the exc[z] array it is way slower if I use a timer interrupt :

while(1)      {       

 HAL_GPIO_TogglePin(GPIOB,GPIO_PIN_0); / / 7 µS to send one point checked on oscilloscope  HAL_DAC_SetValue(&hdac,DAC_CHANNEL_1,DAC_ALIGN_12B_R,exc[i]);       

 i++;       

 if(i==z)i=0;      }    

and

void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)

{   

           if(htim->Instance == TIM2)

                   { HAL_GPIO_TogglePin(GPIOB,GPIO_PIN_0); //32 µS to send one point checked on oscilloscope

                    HAL_DAC_SetValue(&hdac,DAC_CHANNEL_1,DAC_ALIGN_12B_R,exc[i]);

                    i++;   

                   if(i==z)i=0;  

                }

}

0 REPLIES 0