For the time being, we divide the power consumption of the microcontroller into the following categories. First, we calculate the internal power consumption. The power consumption of the microcontroller is generally related to the operating frequency. At a fixed frequency, it is related to the function.
1. Internal power consumption (related to frequency)
2. Power consumption of digital input and output ports
2.1 Input port
2.2 Output High
2.3 Output Low
3. Analog input power consumption
Two calculation methods.
The first one is fixed frequency, and the increase and decrease function causes the current to change:
The second type is frequency change, regardless of the module used:
For the digital output port, the internal Rdson can be obtained according to the data in the table, and the internal power consumption of output high and output low can be calculated.
It should be noted here that the power consumption of the input port is generally not large, but the power consumption is relatively large when current is injected into the designed IO port. At this time, the embedded diode is working, so pay attention to this part of the power consumption.
P=I.inject*Vf_diode
The input power consumption is relatively small when there is no clamping. If the input voltage is too high or too low, it will cause many problems.
The total power consumption of the MCU is the sum of three parts.
P.MCU=P.internal+P.IO+P.Analog