# Two Designs of Automatic Embedded System Energy Consumption Measuring Platforms Using GPIO
## 5 Evaluations and Results
### STM32F4 Processor Running with Different Frequency  
According to the STM32F4 datasheet and user manual, the STM32F4 processor has a maximum frequency of 168 MHz, which can be tuned by modifying the phase locked loop (PLL) parameters. We designed a series of test cases with 40 sets of different PLL parameter combinations, setting the processor to run at different frequencies. Table 1 shows the trend of the power supply output current according to different processor frequencies by setting different PLL parameters on the STM32F4 processor. Due to space limitations, we only present the test results of some frequency points here. In this test, the power rate and the execution time were also variables. We made a comprehensive comparison of the readings of both of our designs according to the measurement method described in [10].  
In this test, we performed measurements in three groups, including our standalone and simplified auxiliary designs, with the measurement method in [10] as the control group. The test case is executed multiple times in a loop, and the execution time is about one second. For the standalone design and auxiliary design, the timestamp is marked using GPIO. For the control group, the execution time is calculated by the time register value before and after the execution. The results are shown in Table 2 and Figure 8. The difference between the readings of the two designs was around 1.35%, and this is deemed to be due to different accuracy values of the timestamp. Different designs showed impacts on the measurement results; however, according to all three test groups, the difference in readings was deemed acceptable. Both the standalone and simplified auxiliary designs of the automatic measuring platform exhibited a similar accuracy.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline \multirow{2}{*}{**Test Item**} & \multicolumn{3}{c}{**Energy Consumption (\(\mu\)J)**} \\ \cline{2-4}  & **Standalone Design** & **Simplified Auxiliary Design** & **Measurement Method in [10]** \\ \hline
1 MHz & 8.289400 & 8.3197 & 7.3645 \\
2 MHz & 8.326911 & 8.5526 & 7.7057 \\
4 MHz & 8.877227 & 9.0001 & 8.2953 \\
8 MHz & 9.948424 & 10.1476 & 9.4501 \\
16 MHz & 12.053634 & 11.7096 & 12.8616 \\
32 MHz & 17.795274 & 17.7466 & 17.2399 \\
64 MHz & 24.290318 & 24.4644 & 24.6769 \\
128 MHz & 39.492187 & 39.0114 & 40.6801 \\ \hline \hline \end{tabular}
\end{table}
Table 2: Energy consumption of the STM32F4 processor running at different clock frequencies measured using our designs and the measurement in [10].  
Figure 7: (a) Execution time of different test groups for the STM32F4 instruction types measured using the standalone design and the simplified auxiliary design. (b) Difference (%) between the standalone design and the simplified auxiliary design.  
We also noticed a consistent difference between our two designs and the manual measurements. Judging from the results, this difference was not related to the actual energy consumption and was deemed to be due to the bias introduced by the use of different wiring methods used in the automatic measurement platforms and manual measurement techniques.