Dual Core Microcontroller Battle Royale - Performance and Power Efficiency

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello there my name is Gary Sims and this is Gary explained now I hope you've had a chance to look at some of my previous videos about microcontroller performance and microcontroller power efficiency now in those videos I was doing single core tests even on microcontrollers that had two CPU cores now in this video I want to concentrate just on microcontrollers with two CPU cores and see how using that second core changes the power requirements the energy that's used by those microcontroller boards so specifically I'm talking about the Raspberry Pi Pico with the rp2040 and the esp32 development boards with the esp32 and the esp32 S3 so if you want to find out more please let me explain now before we get into the numbers just want to mention I'm not going to be talking about how you can efficiently program uh systems with multi-threading multitasking multi-core usage hopefully you've seen my previous video about the how you can program both cores using the Arduino there are other videos I've got planned talking about how you do multi-processing and multi-threading on bigger desktops and on microcontrollers now I do have some other videos including one about the difference between multi-threading multi-processing and so on but in this video I'm just going to assume that you know why you want to program both cores and you know how to program both cores so what we're going to do is look at the power changes when you use that second core okay let's get cracking okay so similar to my other recent microcontroller board videos we're dealing with the Raspberry Pi 2040 processor that's in the Raspberry Pi Pico it's a dual core m0 0 plus processor and two dual core processors from expressive systems that's the esp32 we've got a dual core 10 silica extensor lx6 and the next generation one is the esp32 S3 which is a dual core tensilica extensor lx7 all these boards cost between four and seven dollars depending on where you buy them whether you buy them locally AliExpress delivery taxes all that kind of stuff and an interesting thing to note is that all these processes are built using a 40 nanometer process so the nanometer process in this case shouldn't be a point that makes a difference they should all be on a Level Playing Field so I've mentioned that all dual core processors there's nothing like a single core dual core thing we're comparing here and of course they've all got Wi-Fi on the board somehow now of course for the Raspberry Pi Pico that means there's a second chip for the Wi-Fi in fact it's even got a second president I think it's a cortex M3 for the expressive systems ones they're all built into that same system on a chip but but the overall is that they've all got Wi-Fi and dual core so fairly even playing film when it comes to what we're comparing with what here now to test it I use a CPU intensive task when I use in a previous video that's trial by division to test the first Million numbers to see which ones are prime it is worth noting the cortex m0 plus does not have a hardware integer division built into it though it does have a special piece of circuitry that will do a division in eight clock Cycles uh the esp32 boards actually do have that division in there the test is surprisingly repeatable in that you can repeat it many many times and you always get out the same answer within one millisecond I'm using Arduino 2.0 with the esp32 and the rp2040 support packages so it's the same code running on each of the boards a high level code of course the compilers and things come from the different companies and the settings and so on but we're basically starting with the same point and then building it for each of those different boards okay so this is a graph of the total time that it took to run the test to go through those million prime numbers on both causes a million prime numbers on one court and a million prime numbers on the other core of course I could have done you know half a million and half a million or two million two million whatever but I did is I made sure that both boards were loaded up with equal amount of work and this is the time that it took and we can see in last place is the Raspberry Pi P code just over 20 seconds there next comes the esp32 S3 board uh 10 and a half seconds and then about a second faster is the uh the esp32 the the previous generation that I've got here on the carbon V3 that's a board that's built here in Europe not built uh in in China obviously of course the the chip comes from China itself though but the board and everything is assembled here and so we can see it's the fastest one in terms of the Raw processing power but it's worth noting that it's running at 240 megahertz the esp32 S3 is running at 240 megahertz and the Pico is only running at 133 megahertz so you can see the difference in the time of course it's not quite double but you can see the difference there in terms of the clock frequency uh 240 133 so the Raspberry Pi Pico does run 133 the other two run at 240 now we can extrapolate I've also done some actual testing where I did actually change the clock speeds this isn't the perfect measure because other things like accessing The Flash or the ram may be slightly slower at different clock speeds however it does give us a very good idea of what would it be like if they all ran at the same one so I'm now going to say imagine they were all running 133 megahertz just like the Raspberry Pi Pico and as we see here we've got the same graph now but obviously it takes longer for the esp32 but still 20.6 seconds there for the Raspberry Pi Pico then down 90 18 seconds for the esp32 S3 17 seconds for the esp32 the previous generation so still even when running at the clock same clock speed dates the same order with the esp32 being the fastest of the three now it's possible to calculate how much current is being used by the board I want to emphasize it's the board using Ohm's law and by measuring the voltage drop across a shunt now it's only what's measured by the board so for example if we were looking at the raspberry Pico if that chip that does the Wi-Fi was activated it would also be drawing current and there are no leads on that kind of thing to try to actually get the minimum that we can out the board and see just the CPU usage uh dual core CPU usage when we are when we're running this test and so here we have how many milliamps are being used by the different boards when two cores are running if you reference my previous videos you will see that this is more than they were running before in fact I'll show you the difference in the next side so in third place we now get the carbon V3 which has got the esp32 board on it so although it is the fastest although it runs at 240 megahertz and it gets the job done the quick is it uses the most current uh in dual core mode it also use the most current in single core mode if you've seen my other videos next down we have the esp32 S3 so an interesting thing to note although the esp32 S3 wasn't faster than the esp32 it's certainly more efficient so here running those two cores we can see that actually quite a difference in the power efficiency however the one that's the most power efficient bike a significant margin at 38 up to 76.38 up to 87 more than double if you go to the Via esp32 is the Raspberry Pi Pico running at 133 megahertz so that uses the least amount of current dual core both core running there so how much extra current is needed by that second course I'm referencing my previous testing and so you need an extra 21 milliamps for the esp32 owning an extra 14 milliamps for the esp32 S3 and only a three extra milliamps for the Raspberry Pi Pico so again a very big difference and this is really really repeating a pattern that I've shown in my previous videos and that is that while the esp32 boards are very capable and very fast they do use more power and now here in dual core mode we can see that adding that second core really does use more power 21 milliamps in this case so if board a takes 38 milliamps but takes 20 seconds to complete a task but board B uses 87 milliamps but only takes nine seconds to complete a task using two cores which one is the most efficient so you know if you want the job done but you want it done in the most efficient manner okay so you don't mind if it takes longer but it's going to use less power which one do you use sometimes getting it done quick using more Powers but it could use lots of power but you get it done over and done with quickly Sometimes using less power but over a longer period of time is better which one is actually better Tortoise and the hair so let's have a look so in third place we find the esp32 ball with 1.1 milliwatt hours so that's a measure of work done so it's power over time so 1.1 uh four I thought we're gonna have to go down to the second digit here for the esp.2 so that does the job the quickest it uses more power to do it next you have the esp32 S3 which I think has been in the middle of almost every single chart that we've had here that's using 1.11 milliwatt hours and then the most efficient although it ran slower it will get the same job done uh in it with less power over time with 1.09 for the Raj papaya Pico however one thing to note these are all very very close this is all very very close so in this case the raw performance dual core rule performance of the esp32 gets it done quicker and it's slightly more power hungry to do that the Pico will really be the most efficient to do that with dual core but it will take a bit longer but overall it will use less less energy so what can we conclude from all of this well the esp32 offers the best raw performance it gets the job done the quickest the esp32 is slightly slower than the esp32 with something I spotted in my previous test a bit surprising but it's more efficient and maybe that's the important thing here it actually does it using less power using the second chord on the Raspberry Pi 2014 doesn't incur a big Power penalty that's really interesting so if you are thinking of doing two calls and you've got a Raspberry Pi uh Pico then you can kick in that extra core and it's not going to really drain the battery or use much more of the power there for you so overall the Pico is the most power efficient however the esp32 boards aren't far behind okay that's it my name is Gary Sims this is Gary explains I really hope you enjoyed this video if you did please do give it a thumbs up if you like these kind of videos why not stick around by subscribing to the channel Channel don't forget you can follow me on Twitter at Gary explained and I also have a monthly newsletter go to Gary explains.com type in your mail address no spam but you will get the newsletter okay that's it I'll see in the next one [Music]
Info
Channel: Gary Explains
Views: 18,069
Rating: undefined out of 5
Keywords: Gary Explains, Tech, Explanation, Tutorial, RP2040, Raspberry Pi Pico, ESP32, ESP32-S3, dual-core, Xtensa LX7, Xtensa LX6, Cortex-M0+, Performance, Power, Power Efficiency, dual-core microcontrollers, Arduino
Id: CD9c6UK_uis
Channel Id: undefined
Length: 11min 15sec (675 seconds)
Published: Thu Oct 06 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.