I want to print out 5 waveforms in 1us time.
I want to print out 5 waveforms during 1us.
So, I printed out 5 MHz period PWM from TIM3.
We tried to change the duty cycle of TIM3 to zero at interrupt time by running a 1 MHz timer counter on TIM6. However, it was confirmed that TIM6's 1 MHz timer counter interrupt failed to generate a signal for re-timing. Do you know the solution?
HAL_TIM_Base_Start_IT(&htim6);
HAL_TIM_PWM_Start(&htim3, TIM_CHANNEL_1);
while (1)
{
uint8_t dater;
HAL_UART_Receive(&huart6, &dater, sizeof(dater), 10);
if(dater=='p'){
dater=0;
a=1;
}
if(a==1){
HAL_ADC_Start_DMA(&hadc1, (uint32_t*)adc_buf, ADC_BUF_LEN);
TIM6->ARR=41;
TIM3->CCR1=7;
a=0;
}
}
}
void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim){
if(htim->Instance ==TIM6){
TIM3->CCR1=0;
TIM6->ARR=0;
}
}
