‘MCU basic current’ increases after PWM operation. help me.

Post here all questions related to LibMaple core if you can't find a relevant section!
Post Reply
myksj1105
Posts: 56
Joined: Sun Jun 18, 2023 11:35 am

‘MCU basic current’ increases after PWM operation. help me.

Post by myksj1105 »

‘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.
User avatar
fpiSTM
Posts: 1756
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: ‘MCU basic current’ increases after PWM operation. help me.

Post by fpiSTM »

myksj1105
Posts: 56
Joined: Sun Jun 18, 2023 11:35 am

Re: ‘MCU basic current’ increases after PWM operation. help me.

Post by myksj1105 »

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();
Post Reply

Return to “General discussion”