‘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();

-----------------------------------------------------------------------------------------------------------------------------

https://drive.google.com/file/d/1Zzc4RW ... Ei0S8/view

1. The video was filmed in detail.
2. to be more precise,
The summed current is the corresponding power consumption because it is two regulators and an MCU. So, the video is not wrong. The entire 0.22A is not the MCU increase. However, as the MCU current increased, the regulator current also increased.
(The regulator is 5V, 3.3V.)
Now, the reason the current is reduced compared to the previous video is because the input voltage of the regulator is lowered.
- And, the actual MCU is very hot.
- So, I installed a heat sink.

3. When I tested it,
pwmWrite(PA6, 3500); If you use , the MCU seems to get hot. What does it feel like?
1) Basic mode
2) Acceleration mode
It operates in acceleration mode.
However, what is interesting is that the ‘acceleration mode’ does not change by reinstalling the firmware or resetting the software. It only operates in 'default mode' when the power is turned on again.

-----------------------------------------------------------------------------------------------------------------------------

My assumptions are as follows:

1. As pwmWrite is used, the current in the ‘MCU’ increases.
- in terms
1) Basic mode
2) Acceleration mode
Let’s say there are two modes.
- When pwmWrite is used, it enters Acceleration mode.
- Even if pwmWrite is set to '0', it goes into Acceleration mode.
- As a result, the MCU current increases.

2. Through ‘firmware upload’ or ‘software reset’
You cannot escape ‘Acceleration mode’.

Here's what I feel right now:
Post Reply

Return to “General discussion”