Build Your Own Arduino Like Board For Just a Few Dollars

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey there my name's Gary Sims and this is gary spencer from time to time I've seen videos on YouTube we explain how you can build your own Arduino microcontroller board by buying the 80 mega chip and kind of building yourself an I thought now wouldn't it be interesting if you could do that with a an arm cortex microcontroller I noticed that Adafruit sold a kit about five years ago that allowed you to do this very thing however those some of those pieces are now no longer available so I took that project as a basis and I kind of updated it here so that you could use pieces you could still buy today to allow you to build a cortex M 0 plus microcontroller board and this is it this is what you get on a breadboard when you actually build it and what I do today is show you how you can build this step by step starting with a chip that you buy the actual NXP microcontroller chip and then building together this circuit and then programming it with your own software so that we can flash an LED so if you want to find out more please let me explain [Music] before we get started I want to say one thing this is quite a long video because I do take it from the very very basics you know the bits that you need right up to the very end where we've actually got our own firmware running on this board I did think about splitting into two videos but I thought this is just one project we'll just go from the beginning to the end so if you really are engine this do stick to the very end because I cover absolutely everything you need to know okay let's get cracking okay so these are all the pieces that we're going to need to make our own microcontroller born a call to starve the show is the microcontroller itself this is a cortex M 0 plus microcontroller 16 K a flash 4 K of RAM come from NX PMS is actually the LPC 812 it comes in different packages and as you can see this is one with these 20 little pins on it so we're going to use this adapter here this is a stop 20 adapter so that we can solder this on to these pads here and then with these legs here we're going to push this into the breadboard so we need the adapter the pins and then a breadboard now for the power supply we need two capacitors these are both nought point 1 micro farad capacitors and then a 3.3 volt voltage regulator and this is a micro to MCP 1700 and again I'll leave information on all of these things and links where I can in the description below we're going to need an LED and a 220 ohm resistor so we can flash an LED to show that our microcontroller is working and then we need a USB to serial adapter I showed you one of these in my blue pill black pill video exactly the same kind of thing and we're gonna need some wires here to actually wire up the breadboard once we start plugging in all the components so that's it basically the microcontroller and its adapter so we depleted as a breadboard something for the power supply something that we can flash on and off or something to program it and the wires to connect it all together okay so whiteners i've broken off ten pins twice so that I've got these two rows of legs here and I've put them into the breadboard because that makes it much easier to solder on this a PCB now because it kind of keeps it still for you now as I've said I'm not the world's best soldier in fact when I first did this from the prototype I built I kind of had to do it two or three times to get it right I'm more of a software guy really but we will see what we can do now the first thing you do is after you've put the PCB on there is I'm going to put some flux on here so that the solder sticks well to the metal bits and doesn't stick to the other bits and all we go do now is solder these 20 joints so the PCB is are soldered to the to the pins okay so i've saw was these first ten connections here down this side now we're gonna spin it round and we're gonna solder the other ten connections maybe put some more flux on it if it's dried out by now so I'll press on and do that then afterwards were test to make sure that each of these connections are actually good connections okay now that I've got that all soldered up I wanna test each of the connections and we need to do this now because later on when we're building all the circuit if something isn't working want to make sure it's not because we've made a mistake here early on what I'm going to do is in each one of these holes I'm gonna stick this little cable okay and then what we could do is stick I've got them all to me to here which they type them you know buzz is when you would make a connection you can do that now if we've got no components on the board so that's safe but what we do is basically this pad here on the PCB should be kicking out it into this pin here which it is great and so now we move a long one and let's check the next pad that's good and you could win a test to make sure one on either side aren't buzzing as well be great and I'm not gonna do that I'm gonna test all of them to make sure that all the the solders that come through correctly okay so they all test it out okay so the next thing is we actually want to put the chip here on these pads like this now this is the most fiddly as part of the whole thing notice there's a notch here in the top of the design and there's a notch here in the top of the chip so you know which way around it's meant to go now we're gonna the way to do this is you tin each of the pads which I'll show you starting to show you how to do that in a minute and then finally you put the chip on and you heat up the leg and then it just kind of melt into the tin that you already put on this so let's tin each of these pads and then we'll get around to putting on the actual chip so first of all you want to put lots and lots of flaps on because really we only want this to stick on the pad so you in fact almost an exaggerated amount of on here because really all we want is to tend to stay on those pads and we don't want it to go anywhere else and then what you do is you take your soldering iron and you put a very small amount on each pad and this is the tricky bit to actually get this right but we'll have a go so I'm not very good at this but we'll just see what we can do heat up the pad a tiny bit of solder okay so I've lightly tinned all of those now and now comes the really tricky part the idea is to put the chip here on the pads and then you heat up very gently and press down on one of the pins and then it meat heats up the tin that you've already put on there and then actually starts to to solder on there now this takes a lot of patience and a lot of time okay and then afterwards we'll check all the connections again but take your time gently small amounts of pressure okay until you get them all stuck on there really well I'll go ahead and do that now it's easy to do it off camera than to try to do it here under the camera and then I'll come back in a moment so as I've said many times so now I'm not that very good at soldiering but it also gives a hope to other people like me if you're not very good you can still do it with patience now what we're gonna do now is we need to test each pin on the chip and make sure it comes down this cable like we did earlier on and that makes sure there's a good connection that we can start with this end pin here and we're going to touch the pin on the chip itself and then we want to actually see if there's a connection I'm not running a current through it this time I'm actually going to use just to see how many ohms are measured you don't want to run any current through this chip now and that first pin was a success I'm now going to go ahead and test all the others and make sure that all of them are connected correctly okay now that's all checked out okay what we do is we build the kind of the power supply part of this circuit and the power will come through the USB to serial converter and we'll take the five volts on the ground or but and we're going to use these little components here now we'll start with the voltage regulator with the flat side toward you there's a rounded side and there's a flat side with the flat side toward you just pop that here into three consecutive holes they go like that so that's all three holes there on that there and then what we do is we take one of these capacitors and we just stick that across two rails there like that and we take the other one and we stick that across the first and the second pin of the voltage regulator okay so that's all the components in place and now we're gonna need to actually just put a few wires in we can go from the third pin here on the voltage regulator through to our positive power rail here on the breadboard so there we go simple as that third pin through to the positive and we're also gonna go from the first pin which has also got the capacitor and the voltage regulator on it when you go from there through to our negative rail so let's just connect that up like that so that's the first pin with the capacitor and the voltage regulator through to negative the third pin through to the positive okay so that's the little power supply now we're going to be taking the power from the converter that the zero two is be converted as I say Tory did you take the USB to a converter and you just pop it in here into some spare spaces now the right-hand pin here on this board on this particular model is the ground pin be careful some of the boards are wired up differently need to check the labels but this is the ground pin on this one so we're now going to go from the ground pin here through to the ground here on our actual board so those are connected up okay and we can even push that capacitor down there like that so there we go so that's from pin number five through to the ground now the five volts is the fourth pin along so what we're going to do is we go from that fourth pin along and we're going to connect it to this middle pin here or on the voltage regulator and the other this capacitor so let's just go ahead and do that now okay so that's the fourth pin through to the middle pin I've bent this capacitor out of the way let's pick that back up there let's straighten that up there okay so that goes into the middle pin of the voltage regulator and the right hand side of the capacitor and that's coming from the fourth pin which is the five volt so that basically now will give us power to this little part of the circuit all we need to do now is to power up the board and to connect the TX and rx to the chip itself okay so the RX on the serial to USB converter is the second pin on this model and it needs to go around to pin five one two three four five okay so there it is and now we want to do the TX of a TX is the next pin next to it so the third pin there just under this jumper which makes it a little more difficult to get to let's just pop that in there okay and that needs to go round to the nineteenth pin on him of course these are all labeled which is really really handy Connect that in there okay so now we've got the five volts on the ground going into a little circuit here and we've got the TX and the RH going through to the microcontroller itself and finally the microcontroller needs some power so we need to connect two of these pins over to these two rails here so let's just do that we need to connect the positives of fire volts to pin 15 so let's just count them off here 11 12 13 14 15 and we connect that to the positive rail of our breadboard and we need to connect the ground to pin 16 the one next to it so I've got an LED here what we're going to just do is just stick that into two pins here notice that the longer leg is on the right-hand side as I'm as I'm putting this in I'm also getting it now a resistor from the left-hand leg which the shorter one and when you'll put that straight through the ground and finally we need a way to control that so we're gonna take up from pin number one that's the one we're going to use and we take that round to the positive pin on the led though pin number one just take it through to the positive here on the led okay so now that we'll be connecting through to the LED and then through the led into the resistor and then on to the ground okay that's it that's our circuit complete so the necks of of course is the software okay so we basically need two bits of software to be able to write programs and flashed them onto our microcontroller one of them is flash magic of course links will be in the description below it's basically a programming tool for microcontrollers from in experiences we're using the nxp LPC 812 this is a perfect tool for doing that so you need to download it and then you need to install it installation is pretty simple next next next next next and it will also install some drivers along the way now the other piece of software we need is MCU expresso which is an integrated development environment from in XP itself it's free of charge code size unlimited easy to use and it supports the LPC MC usage of course what we're using the only downside is that you do need to create an account at the NXP website log into that to get through to the download area so you need to do that you need áown load it and then you need to install it again a fairly easy installation Nix Nix Nix it's quite a big download quite a big place you need to install it somewhere we've got enough disk space but a pretty easy thing to actually download and install so you need to download both of those tools to flash tool and the integrate development environment so that we can write some code okay now to get the basic project outline for this microcontroller and there is a project on github which is called LPC 810 code base and that really has got the skeleton of any project that you want to run links will be in the description we need to download that so we click over here on clone or download would have download the zip file of that basic skeleton project that we need ok next of all we need to start the MCU expresso IDE and when you first start it up it asks you where you want to keep the workspace I'm going to just shorten this a lot and if you remember I installed the other program in F n XP I think it was so I'm going to put this in F n XP workspace so that's a simple users as default will do not ask this again ok so here we are inside of the MCU expresso IDE now what we want to do is import that project that we downloaded so in fact the easiest way to do that is just to click IDE over here just makes you switch to the normal IDE and then down here on the left hand side import projects from file system and then it actually says do you want the dot zip file that's why we download the dot zip file so we'll go to yes and I'll go and find that zip file there it is there and open that up ok and then we just go through it and it says what other projects will that's the projects inside of it and it just goes through that and creates the project here on the left hand side and as you can see is all the things that you would find in a C or a C++ environment and what we want is sauce and there's lots of files here that will be made for us to do yachts lots of useful things main see that's where things happen inside of C programs and so what we're going to do is scroll down here and the first thing we'll to do is change the lead location if you remember we've connected it to pin 1 if you remember from the hardware setup and if we have a quick look here at the pin out of the the chip that we have pin 1 over here is called Pio 0 that's on port 0 pin 17 so we want to change not pin 2 we're not using 2 which is down here we're using 17 3 connected it up there so in the code here we need to change this to a 17 and then we need to scroll down here a bit further into the main program now one thing to notice is I connected the the led to ground so in fact when it says off here it's actually gonna be on for us it's gonna be the other way around so what we're gonna do is we're gonna set it to be on for let's say one second okay and then we're going to make it go off very quickly let's reduce this to it's merely 250 so it stays on and blinks very quickly and that will give us a make sure that's our program that's running and not anything else that we might have already uploaded onto there or some other program we'll be sure this album because it's this long and short combination now once you've done that we can just save that so it's probably ctrl s yes it was go up to project and then say build project it's going ahead and it's building that and now it's built now what actually happens in here they've already given us a releases directory and these are the projects that we've just built and we're interested in this dot hex file I want you to do is we define that in Windows Explorer so a really easy way to find that it's a right-hand click on the source directory here go to properties and then click this little button here which basically shows it in Windows Explorer and so there it is now in Windows Explorer and we want this hex file so the next step is to fire up that flash magic tool so we can download the hex file onto our board okay so here is Flash magic we'll make this fullscreen and what the first thing we do did you change the microcontroller if you remember we're using an LPC eight one two and then that's going to find that and it's actually that won the JD twenty the other variations here are basically to do with the packages they come in so that's the one we want and then we want the board rate to be one one five two hundred now we also want to pick comm seven which is actually what the what the FTDI programmer is now the important thing is to make sure that we put this into programming mode so I'm going to cut now to show you how you put the board into programming mode and then we'll come back here okay so to put the board the microcontroller into programming mode we need to connect pin three here to ground and so these would do that is using where these other types of wires because we can very easily pull it in and out so basically pin three you've already got something in pin one of course that's we're gonna flash the LED with pin five that's the the our actual wood TX common which one it was now I needed to connect this to ground okay and then we need to connect up the power to it and it will go into programming mode so let's connect up the power okay the red LED has come on there let's see if we can just turn that around a little bit okay and now we can program it from our computer okay now that we have the board in programming mode one thing we can do is go up to here and say read signature that will make sure that it can talk correctly and it can it can talk correctly now to this chip so that's all working okay so now we want to go up and we want to say L so in here we want to go to browse and we want to find that program that we've built so that was in NXP workspace code base release and there's that hex file that I was talking about so we pick that and then all we do is that we actually we can tick verify just to make sure it loads okay and we just hit this Go button Start button here and that will program it and it does it pretty quickly and that's it it's loaded onto the firmware now we'll go back over to the board we reboot it and we should see our LED flashing okay so now that's programmed we need to disconnect the USB again take away our little enable pin here and now we connect it up again our program should be up and running so let's see there we go long-short long-short so that's power program running and that's it we've done it we've built it and we've programmed it and here it is running well done ok so there you have it I won't keep you around in your longer it's been quite a long video you know the drill if you liked it please give it a thumbs up do subscribe to the channel that's it I'll see you in the next one [Music] [Music]
Info
Channel: Gary Explains
Views: 80,845
Rating: undefined out of 5
Keywords: Gary Explains, Tech, Explanation, Tutorial, Microcontroller, Arduino, Development Board, Microcontroller Board, LPC812, NCP, Arm Cortex-M0+, MCUXpresso, FTDI, Arduino Project, Maker Project, DIY Arduno, Flash Magic, Arm, Cortex-M0+, Breadboard, Build your own Arduino
Id: 4PMj8LfR2m8
Channel Id: undefined
Length: 20min 48sec (1248 seconds)
Published: Tue Feb 25 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.