Hey Leutz, Grundverständnisfrage. Ich möchte 4KHZ PWM erzeugen. und zwischen 10% und 90% Puls eingeschaltet Variabel einstellen können. PWM_Struct.Instance=TIMx; //168MHZ/4KHz = 42 PWM_Struct.Init.Prescaler=42; PWM_Struct.Init.CounterMode=TIM_COUNTERMODE_UP; //168/168 PWM_Struct.Init.Period=168; PWM_Struct.Init.ClockDivision=TIM_CLOCKDIVISION_DIV1; PWM_Struct.Init.RepetitionCounter=0; Ich denke, das da vieleicht ein Fehler im Grundverständnis ist. //Hier meine Variable für % Anteil der Flanke=High StrOutputChannel.Pulse = (uint32_t)((1000* duty_on) / 100); HAL_TIM_PWM_ConfigChannel(&PWM_Struct,&StrOutputChannel,TIM_CHANNEL_x); HAL_TIM_PWM_Start(&PWM_Struct,TIM_CHANNEL_x);
Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.