‘MCU basic current’ increases after PWM operation.
- core: https://github.com/rogerclarkmelbourne/Arduino_STM32
1. If there is no operation, the total current of 0.07A flows.
2. Turn on PWM
- (source code)pinMode(PA6, PWM); pwmWrite(PA6, 5000);
3. Turn off PWM
- (source code)pinMode(PA6, PWM); pwmWrite(PA6, 0);
4. The total current has increased.
- A total current of 0.22A flows.
- MCU power consumption has increased.
5. I wanted to restore it to its original state through soft reset, but the current remains the same.
- (source code) nvic_sys_reset();
- Total current 0.22A
6. If you turn off the entire power and turn it back on,
- Total current 0.07A
The conclusion is that after using 'pwmWrite', the power consumption of the MCU increases (increases).
Even if the pwm is turned off, the ‘MCU power consumption’ remains increased.
Moreover, even with ‘software power reset’, ‘MCU power consumption’ has increased.
Q1. I don't know why.
Q2. I want to solve it.
- I think it needs to be powered down and then turned on again. Is there a way?
video
https://drive.google.com/file/d/1O5L-9e ... sp=sharing
help me.
‘MCU basic current’ increases after PWM operation. help me.
Re: ‘MCU basic current’ increases after PWM operation. help me.
In the actual code, three PWMs are used.
const int PWM_P[] = {PB0, PA6, PA8};
for (int i=0; i<3; i++){ pinMode(PWM_P ,PWM); }
Timer1.pause(); Timer2.pause(); Timer3.pause(); Timer1.setChannel1Mode(TIMER_PWM); Timer2.setChannel2Mode(TIMER_PWM); Timer3.setChannel3Mode(TIMER_PWM);
Timer1.setPeriod(2000); Timer2.setPeriod(2000); Timer3.setPeriod(2000);
Timer1.resume(); Timer2.resume(); Timer3.resume();
const int PWM_P[] = {PB0, PA6, PA8};
for (int i=0; i<3; i++){ pinMode(PWM_P ,PWM); }
Timer1.pause(); Timer2.pause(); Timer3.pause(); Timer1.setChannel1Mode(TIMER_PWM); Timer2.setChannel2Mode(TIMER_PWM); Timer3.setChannel3Mode(TIMER_PWM);
Timer1.setPeriod(2000); Timer2.setPeriod(2000); Timer3.setPeriod(2000);
Timer1.resume(); Timer2.resume(); Timer3.resume();