do {TIM1->ARR= 0x0E10;// Frequenz einstellen switch(HD_COUNTER) { case 1: { TIM1->CCMR1 = 0x07070; TIM1->CCMR2 = 0x078; TIM1->CCR1=0x04B0;// Pulsweite einstellen TIM1->CCR2=0;// Pulsweite einstellen TIM1->CCR3=0;// Pulsweite einstellen TIM1->BDTR = TIM_BDTR_MOE|TT_WERT; TIM1->CR1 = TIM_CR1_CEN|((uint32_t)0x0000);// Timer Start if(TIM1->CNT == 0x04B0) { HD_COUNTER = 2; } break; } case 2: { TIM1->CCMR1 = 0x07070; TIM1->CCMR2 = 0x078; TIM1->CCR1=0;// Pulsweite einstellen TIM1->CCR2=0x04B0;// Pulsweite einstellen TIM1->CCR3=0;// Pulsweite einstellen TIM1->BDTR = TIM_BDTR_MOE|TT_WERT; TIM1->CR1 = TIM_CR1_CEN|((uint32_t)0x0000);// Timer Start if(TIM1->CNT == 0x04B0) { HD_COUNTER = 3; } break; } case 3: { TIM1->CCMR1 = 0x07070; TIM1->CCMR2 = 0x078; TIM1->CCR1=0;// Pulsweite einstellen TIM1->CCR2=0;// Pulsweite einstellen TIM1->CCR3=0x04B0;// Pulsweite einstellen TIM1->BDTR = TIM_BDTR_MOE|TT_WERT; TIM1->CR1 = TIM_CR1_CEN|((uint32_t)0x0000);// Timer Start if(TIM1->CNT == 0x04B0) { HD_COUNTER = 1; } break; } } }while(1);