-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Description
Arduino_Core_STM32 2.8.0 + Arduino IDE 2.3.2
STM32F303CC in custom board
I use this part of code to initialize a PWM:
HardwareTimer *timerTreatment;
[...]
pinMode(pwmPinTreatment, OUTPUT);
TIM_TypeDef *Instance = (TIM_TypeDef *)pinmap_peripheral(digitalPinToPinName(pwmPinTreatment), PinMap_PWM);
uint32_t channel = STM_PIN_CHANNEL(pinmap_function(digitalPinToPinName(pwmPinTreatment), PinMap_PWM));
timerTreatment = new HardwareTimer(Instance);
timerTreatment->setPWM(channel, pwmPinTreatment, baseFrequencyTreatment, 53);
timerTreatment->pause();
[...]
PWM works well. But when I use it in my various parts of the code, doing:
[...]
timerTreatment->resume();
[...]
timerTreatment->pause();
[...]
after pause() the PWM signal in the idle state is sometimes at a logical high level (wrong) and sometimes correctly at a low (correct) level. It should always be low when pause().
I can't use it properly.
Metadata
Metadata
Assignees
Labels
No labels