#152 STM32 Blue Pill - Is this a modern NANO replacement (✅)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
and welcome back this week we're going to be talking about a very very interesting device the stm32 Wow a variant of but why am I even doing this video I said to my sponsor this week I'm taking a break I'm not doing it but this is so exciting what I've discovered here I really got to tell you about it before I forget but I can get too deep in it okay so we're going to talk about that particular device there then there's a different version of that which he's hidden somewhere on this desk which I'll also talk about there it is at the back look and we'll talk about that one over there and why it's different from this and what this is and why you need one if you don't recognize this you really do need to get one it's just a couple of dollars and it just makes life so much more interesting and if we get to it my sponsor has a very special offer for you okay and we'll put that right at the end of the video if we do it this week it might be next week but we'll say okay so keep tuned more after this I want to have a big shout out from my sponsor of this video JL CPCB custom PCBs made simple now I've just ordered some PCBs and they've arrived a couple of days ago it took about three four days for them to arrive I chose the DHL shipping option because it was nice and quick let's look on the order page see what it looks like so here we are these are all my orders and there's the order that we're looking at here this one here this is the PCB that arrived just the other day brilliant excellent quality nothing I can say about it except good things and we'll be looking at this in a future video as I build up a little circuit so remember it's two dollars for five pieces five dollars for ten quick shipping but there are many options you can choose from quality second to none why don't you try them out now right so here we are then this board plugged in here now this is an STM 32 board specifically it's the f103 family of micro controllers it's in the middle there and this just has to be a C 68 now all those letters actually do mean something okay so let's just take two seconds out just to find out exactly what they mean so I don't have to keep repeating myself so it's full name then arm cortex-m three stm32 f103 c8 the bit to remember about all this I'll let you read all the other bits stm32 fine that's the 32 bit my controller and the f103 family is what we're dealing with there's lots of ARM Cortex my controllers but the F 103 is what we are really concentrating on here right I hope all that made sense we just couldn't call it the stm32 from now on because it just makes it so much easier but this this device here from STM microelectronics is often known by its nickname of the blue pill yeah yeah I know and before we have any comments about how long it's going to stay up for before it crashes we just ignore all that it's a great little board and I'm talking to you about it because I think beginners and experts alike will like it okay there's a lot to this board now on over the past few weeks we've done quite a bit about the esp8266 and the ESP 32 of course with its dual core and three artists operating system sitting on top and that's that's great I mean that they really are good micro processors but this one is sort of sitting in the middle let me draw you a little diagram just to size let me get this message across to you so if we put these onto a scale imagine this is a scale of you know ease of use complexity whatever you got the little Nano at one end that we've all come to know and love everything years now the Nano is well it's a little bit underpowered isn't it it's um it's 16 megahertz okay and it's got what's it got flash 2 K flash similar now corium remember these days and then you've got at this end ESP 32 and now the esp8266 or fits somewhere around here as well probably around this era but this is you know it's 240 megahertz and it's got 4 megabytes I think of flash as nails and I know it's just ridiculous ok so those are the sort of the extremes if I don't like that word extremes are on the scale of microcontrollers that's probably about it now this is all very simple to use because it's you know arduino ide based and all that besides this them and as you saw you can run all this in arduino ide so that's not the issue really if you do want to use this properly though the ESP 32 with dual cores and tasking and whatnot you can but you can also just say no I'm treating it exactly like a super-fast Arduino B so it brings the complexity of this way back down here doesn't it okay it might be fast turbocharged but it's still acting like a standard uno or nano at that point and then of course we come to the the STM here so the stm32 that sort of sits somewhere in the middle I think because let's face it it's it's a lot faster than a nano all right you're talking seventy-two megahertz speed you've got 64 K flash or probably 128 K will come more about into that and you can still use all of this all of this can use the standard arduino ide okay so we can use something that we know how to program yeah the Nano does what it does and it's all very good at what it does but you know there's a limit to how much you can do with there now know the stm32 is supercharged much bigger programs if you want them but at the end of the day it's a bit like in nano just running a lot faster a bit bigger bigger brother if you like and then the SP 32 can act like a super fast uno but as I showed in my previous demos it does tend to run artists by default although quite honestly you wouldn't know this running artists unless you've read up about it because you can use it exactly the same as you would nod we know with a setup in the loop and you're none the wiser but we it is running artists and you can run tasks on it and everything else you can make it as complex as you want now folly enough would you believe it stm32 can also run artists if you want not by default by default was just sitting there idly hasn't got anything on it probably not even a bootloader frankly so you can keep it nice and simple but just turbocharged or you can move it this way a little bit on the complexities go and go yeah I'm gonna run artists on it well that might be something I might experiment with this I'm not sure if I wanted a run artists I think I'd probably go to the SP 32 anyway after all it's a more capable chip it's got Wireless and Bluetooth built in dual core I mean if you do need an opera system this I think is probably where you need to go but never say never I might have a look at in it what I was going to tell you about this right the official the official mono then what what price then is the the nano from Arduino themselves well they've just released new ones haven't they well just as an example they've just released a nano every which is basically one of those but with a different chip in it it's actually got a man 18 mega for 809 chip in it and it costs about 8 euros I have to say euros because that's what they quote in but is a euro is pretty much a dollar isn't it and just under a pound so eight dollars for a nano every which has no Bluetooth or Wallis capabilities there is the ble version so you got the Bluetooth at 1750 1750 mmm getting expensive isn't it then of course we've got the nano 33 ble sense with a few more things plugged into it that's 27 euros I think you can see where I'm going with this the no no 33 IOT which is part of the ones we might be more interested in that's 16 euros now that's got a Sam D 21 m0 chip in it and actually then uses ironically an ESP 32 for wireless and Bluetooth which sort of just doesn't seem right to me but there we are so I think within the family of microcontrollers that we're currently using this is pretty much a good gauge of where the stm32 might sit okay I hope that sort of put this particular board in context of where we are between sort of the Nano one extreme and the ESP 32 the other I say extreme they're not they're not extremes are they they're just along that line of complexity and ease of use although I got to say it's really really easy to use this particular board okay there's nothing funny about it one caveat though if you're going to get this particular board the blue pill you see it has got a micro USB on it just forget any thoughts about using that okay just i've spent probably 24 hours trying to get that to work no forget it it just isn't going to you might might be lucky on an older machine a Windows 7 machine maybe a Windows 10 just does not want to play with that because this board was never designed to use that as socket as a sort of upload device or I've got other pins for that and there's even a different way of doing it altogether so forget the micro USB socket and it is easy to program when you're coding this with a sketch and you just press the upload button it just does it anyway regardless of whether they get USB socket attached or not all right so we can forget that now if you really really think no I cannot live without my USB socket then you need a slightly different version of this board now it's called the maple minion it's one on the back there so this is the maple mini and as you can see it looks a bit different than out of the board the process of example is underneath it's just a different layout entirely and it's got some extra components on there couple of transistors and whatnot so that that micro USB pool does work when you plug this into your Windows 10 machine and that's all I've done on so it's all I can say I'm it says oh I've found something and lo and behold you've got a maple Mini on port whatever and that just works however this is a little bit more expensive relatively speaking ok and I'm always trying to keep the cost down this one was about I think it's about three dollars or something so not a king's ransom but when you put that into perspective this one at the back here this blue pill ok stm32 blue pill that course I'm just got refer to my notes here so I was looking this morning make sure it hasn't changed three dollars eighty-one that one okay although funnily enough occasionally is on often I got it 179 from banggood but normally it's about between 350 and 4 dollars which is about the same price funnily enough as a nano so the Nano which you can see here that's a standard well version 3 nano cuz they've got new ones now now the version 3 Nano is roughly about 3 dollars sometimes you can get them less than a union and two dollars if you look around Aliexpress or whatever bangle as well do them cheap but uh are we comparing apples with apples here mm-hmm well we'll come on to that now other prices then just so that we know what we're talking about extra things you're going to need for this to get it working is some kind of communications when your USB port and this as I say you cannot use that USB port on there let's get this little bit closer right so you can't use that USB port or you can try and so you may be lucky I wasn't I tried it on two different machines so forget it now you can use something though I'm attached to at the moment this is called an ST link okay it's a design by us upside down but you can see what it is it's a v2 St link and it's got various pins on the end there that I've put some DuPont cables on the DuPont cables come with it and you just put onto these four here and lo and behold it goes yeah that's fine i'm i'm uploading virus tailing what's the problem well there is none there is none however that only arrived this morning and i was so excited about it i thought I've got to tell you but in the meantime I've been using this now this is a standard FTDI USB to serial converter I use this for the last two three days just uploading on there you have to connect these well four of these pins four of these pins two for the pins that way I'll say 4 is 2 to 4 power alright and then to go on here it's actually a 9 and a 10 on here go on to the TX and rx transmit and receive on it and it works just the same because this is what connects to your USB Tsakanikas yeah I found that that's not a problem and then this talks of that absolutely no problem whatsoever it's it's a no-brainer if you haven't got one of these go and buy one now for goodness think they are cheap right I hope that gave you that idea these things are inexpensive alright I mean you know two three four dollars and you've got yourself a little microprocessor board there a module that is in many ways much more capable than the poor little Nano there that slowly is being relegated to the box of history isn't it I mean yeah this is fine still for you know fridge door reminders that's what mine's running on but more than that well 16 megahertz mm-hmm well nothing wrong with the Nano but if you were to be given one of these and we're told oh yes this is a new nano from Arduino nudge-nudge and you plugged it in and according to the instructions and you used it exactly the same way as you do now and you go yeah that's great uploaded my blog did my sketch and it says a lot there's a space left and my goodness it runs like the wind this is a great nano board and then I said oh yeah it's not an animation it's an stm32 you go oh I didn't know now of course you wouldn't know the hardware is becoming more and more irrelevant really to what we're actually doing if we can use the Arduino IDE or an equivalent they all used to I mean I can run all this stuff on the Eclipse IDE no I'm not going to show you how to do it um and the Arduino as well I'll show you a sketch in a minute it just doesn't matter now does it what it actually runs on as long as the hardware that we're running on acts and reacts like a proper nano uno or esp8266 really does it matter now I mentioned esp8266 there in advisedly because obviously this has not got wireless capability I mean for that price it hasn't if you wanted the wireless capability you'd have to go up to something like well this is in fact an ESP 32 so that's got Bluetooth and wireless and it's probably about five six dollars something like that so probably about twice the price of one of these all right but if you don't need that wireless capability and you don't need the 240 megahertz that this ESP 32 runs on then the 72 megahertz that this runs at is well in today's modern world I think perfect absolutely perfect okay now there's one further thing you really really need to buy okay for this and it all cost pennies and you might even have some lying about if you've ever been involved with computers and stuff like that now as you can see on this board here it's got two jumpers right now these are known as boots but--one okay these things here and boot zero the bottom one here you leave that alone you don't ever touch that what it's got a jumper on the out don't know quite frankly I'm work that out but this top one which I'm now going to remove oh sorry for the jig now you can see that there's two positions I can move it over to here or here this is where it was there is the normal run time but when you want to upload you have to move it over to here and press the reset button to basically make it go into reset mode and accept an incoming program except when these arrive they don't come with a nice little header a jumper pin like this with a handle on it it comes with one like you're seeing there at the moment like that getting there off with this one right up next to it it's just I spent two maybe even three days tearing my hair out well look how little I got left trying to get these jumpers off it was absolutely horrendous so I went to e ban I go please please give me some jumpers with the long handle on it they go yeah here's one for a god I think it's 150 or something I'll show you and so now I've got dozens and dozens of know I've got pack of fifty year but next at nothing why why don't the manufactures put these on by default because look how much easy is a number but doing it cack-handed because I'm trying to look through the camera just a minute right so there it is on right and that's seconds work and then to take it off you just hold it by this tab pull it off and stick it on the other two positions and it's on alright its seconds work well 1 seconds work it maximum whereas previously trying to get this little tiny thing off in that position impossible so do so up a big big favor and buy a pack of them I mean I bought 50 because I think that was the you're quickly stuck you get it from a UK supply if you want to borrow from China and waited a little bit then you can probably buy 20 for a dollar something is why they don't put those under standard I will never ever know so that doesn't denigrate this chip though so let's just just show you very quickly how easy it is to put a sketch on there alright as I say this video is going to be nice and short yeah I can hear you laughing as well I'm going to use the s see link but frankly it would make no difference if I use the st-link or my little FTDI chip they both plug into the USB ports they both get enumerated except that the st-link does not end up on a port right so you don't tell it's on a port you say no no upload using my st link which appears in the USB list that's something different let me show you right so this is the Windows I'm afraid it's just windows I've got a Mac I don't know anything at all about Mac so though if you've got a Mac you'll presumably now have to do all this so this is the the ports list on Windows now as you can see there is a ports but that's got nothing to do with what we're doing here that Arduino Leonardo that's my video switcher so if I just switch that off for a moment getting there yeah so I've got nothing connected it's there's no ports at all but if we scroll down and look in us Universal Serial bus there Isla stm32 st-link how did I do that I went to the STM third or STM website I said where's the driver for this device they go here is no problem for you version two one and put it on windows head that's lovely thank you very much and it appeared three seconds I'll put the actual driver link in the video description down below and I'll put a copy of that driver in my github just so you got something and we know that works but I would highly recommend you actually go to their website and grab the latest version course for all I know they're updating it this very second I'm speaking to you and they're they're uploading a new one right so it's always best to get an uploaded one but I'll give you one in my github because we know it does work right let's get some to actually uploading a sketch then so I've connected my ST link to my USB port on my computer I've connected the four wires on here to the four wires on here to two of which are power two of which are then data in our and clock I think it is doesn't matter we'll go through the details some other time and let's look at her well at the moment what's running on here is a double blink as you can see that green LED down the bottom there okay that's the double blink program I've tried several others Oh speed speed test you remember that speed test we did with the prime numbers okay we'll come on to that in a minute let's have a look how to upload this code okay here we are there this is a simple blink program there's nothing fancy but I have given you here at the front look these bits here the details of what it looks like for your tools settings I'll give you a screenshot of those in just a sec let's get this thing up and running though setups exactly the same output okay the pin numbers a bit different PC 13 is the built-in LED on this one it's different on that maple mini that I showed you okay so you have to be aware of which pins which and on here bit like the esp8266 the LED goes on when that pin is low because is built-in it just sinks the current okay that's that's no problem at all alright so we have a quick look at the tools we see here that the board is a generic stm32 f103 c series 64k flash 20k of ram while ups i've said it's a 64 K because that's what I bought it at but frankly is almost definitely 128 K upload method know I've said Oh stealing so that's what I've connected to and he arrived this morning so I've just done a quick test but normally you'd say serial by using the FTDI module okay you the bootloader as I say via the USB I can get it we just uploaded the bootloader on it but I cannot get it to work at all and these others I have absolutely no idea CPU speed 72 48 is slow and overclocked 128 I haven't tried that I must admit optimize well this is how you generate the code you cannot have it the tiniest code which is takes a longer time to compile fast fastest fastest to compile and then debug which is really slow and inefficient and I said this bit over here is ignored because we're not uploading wire that we're uploading via this okay so that's that okay let's press the up code upload window and you'll see it working for the upload and off it goes so it's probably going to have to build everything again think that's one of the downsides at the arduino ide it just build everything more or less and scratch every time which is oh no it's done it that was a quick wasn't it the core is locked up at anyway it says that anyway it has said I've done it and lo and behold if we look at the desktop again there is running now what you can't see your course at the moment if I show you look that led is not flashing is it because we're still in upload program mode right yeah and of course if I press refresh nothing happens because we're still in upload mode hence the importance of grabbing this thing taking it off putting onto the other two pins although frankly I've notice it works quite happily you just leave it off well you shouldn't do press reset yeah and there's the double blink running quite happily cool now I'm not suggesting you leave this office should be porn there because what is doing is dragging a pin to ground I didn't even put it on I can't do this while the camera is actually important right ok so I'm gonna call a halt there now I'm gonna do some future videos now I've got a PCB here look every nice which is funny enough identical to the one there pretty much what am I gonna do with this well that's for a future video and as I say the sponsors of this bolt the PCB and my video channel today JCL PCB I've got a very special off of you for this but not gonna announce it just yet we're gonna wait until we get this thing sorted out and talk a bit more about that ok cool right speed test ok remember we put the prime number theorem --is-- code but it just takes a long time to run on both the uno and the ESP 32 in previous videos and what you haven't watched them yet you gotta watch it anyway the Nano or the uno ran in something like 10 seconds right to complete a single loop and the ESP 32 just wiped the floor 62 63 milliseconds and it's a hundred and sixty times faster or something ridiculous anyway now this chip not as fast as that of course it is only 72 megahertz compared to the 16 of the Nano or who know same chip really same board and everything but we would expect it see faster now what I've got here look I've got the FTD ice USB to serial converter hooked up you see that look for wires to which are power anyway and then you got TX and rx I'm hoping to tide you all this up for future videos but in the meantime let's upload the code and get it running and just see how fast or not it is right so this is the same code we ran before I'm not going to go through it it's meaningless it just runs through calculating prime numbers using the sieve method and a few loops thrown in there just for good measure so let's just upload this and get this running right off it goes there it is writing to the memory and before we know it right it's done it so now what we got to do is let me just take that off the screen so because we're an upload mode I'll get us flip that little editing link over and reset right now that's running so let's bring the code window back and set a serial port up so it's a serial port on Comm 8 so watch the debug window there we should see what's happening so it's connected and it's running the loop yes and 3102 milliseconds so the Arduino did it in 10 seconds this is doing it in three seconds so three and a bit times faster well I guess that's probably about right isn't it 72 megahertz and 16 megahertz that ilk anyway compared to the ESP 32 68 or with notes lesson that 64 3 milliseconds that's why the ESP 32 anything to be reckoned with but this one not too shabby at all certainly give your projects a bit of a boost wouldn't it and as I say easy to program with the FTDI serial USB to convert the USB converter easy stuff what do you reckon right that's about it for now I'm going to loads of links down below all right so you can have a look at this stuff and it really is in my mind if you're interesting this sort of stuff and you want to move away from the Nano being just get a bit more oomph into your programs then for just a few dollars I mean toolkit the whole thing everything you know the st-link and or FTDI plus a board and it's less than ten dollars including shipping because shipping is normally free okay now if you buy locally it will cost a little bit more I actually bought a couple of these things locally because I wanted them like yesterday so there are the next day that's eBay for yeah it's pretty quick but if you buy from China so if you buy from Bangalore Aliexpress is really slow what Amazon sometimes has some good offers all right I've bought some stuff remembers on a comment which ones it wasn't now but they arrived also next day if you got Prime so you can always get this stuff in advance and we'll talk about it in a video or twos time exactly what I'm doing at all this in the meantime don't forget thumbs up if you think the video is worth it and you're interested do leave your comments below because I like reading them and as you notice I do reply to pretty much everybody's unless you're rude which guys hold and that's it keep watching and see you in the next video I hope you're finding these videos useful and interesting there are plenty more videos to choose and a couple of shown below and if you'd like to subscribe to this channel just click on my picture below and enjoy the rest of the videos thanks for watching
Info
Channel: Ralph S Bacon
Views: 42,819
Rating: 4.8771534 out of 5
Keywords: STM32, STM32F103C8T6, STM32F103, Blue Pill, ARM Cortex M3, Arduino Nano, ESP32, JLCPCB, microcontrollers, programming, Arduino, electronics, Fast Nano, Beginners, C++, gadgets
Id: vzDsSdtKQXA
Channel Id: undefined
Length: 28min 14sec (1694 seconds)
Published: Fri Jul 05 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.