KiCad STM32 + USB + Buck Converter PCB Design and JLCPCB Assembly (Update)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

Great videos by Phil! Also may have corrupted him with the 'k-eye-cad' :-D

👍︎︎ 6 👤︎︎ u/Chris_Gammell 📅︎︎ Sep 26 2020 🗫︎ replies

Thank you for sharing

👍︎︎ 1 👤︎︎ u/theawesomeviking 📅︎︎ Sep 26 2020 🗫︎ replies
Captions
it has been a couple of months now since the first kai-cad and stm32 tutorial video which discussed how to make a bare-bones stm32 pcb firstly thank you very much for the attention that it received definitely so much more than i ever expected i've decided to remake the video with a slightly different design to show jlc pcb assembly results include some more tips for example usb routing buck converter layout and more and also to improve the audio quality this will be a rather long video so as always timestamps are in the description to help you find what you are looking for these are some of my pcbs that all have been manufactured and assembled by jlc pcb they all use some form of stm32 microcontroller from low power stm32l4s to the highest power stm32h7s and anything in between hopefully with the help of this video you'll be able to incorporate stm32 microcontrollers into your own electronics projects and know how to order the pcbs at jlc pcb with assembly okay so we're going to be using jlc pcb for manufacturing assembly as i said and we'll go through the whole ordering process late in the video once we've finished the pcb but first of all i'm going to use their smt parts library so the parts they can actually assemble so we can see what parts we want on the board what parts we can actually get on the board now there are basic and extended parts of jlc pcb basic parts essentially you can use effectively an infinite amount of parts on there as much as will fit on the board and you don't pay a surcharge now extend parts they'll be about two to three euros extra per part and you can only use up to 10 extended parts so we're going to try and use basically the majority just basic parts and only extended parts that we have to so as in the first video i'll be using this stm32 f405 rgt6 which is a a pretty common 64 pin stm32 running at about 168 megahertz i've got the data sheet here which you might need later and it's always good just to browse through that have a look what this chip can do if it meets your requirements and i've used this chip many times it's great because it has on on-board usb it's pretty fast it's got enough flash and ram okay what we'll also be using to power the board is actually a buck regulator so instead of just using a simple low dropout linear regulator which is kind of power inefficient we're going to be using this mp2359 switching regulator now this isn't recommended for new designs if you go to the manufacturer's website but it's a really really common part on jlc pcb and i thought for these kind of really simple pcbs there's no harm in using this something you use in production you probably don't want to go for something that's not recommended for new designs but for our purposes here this is more than fine it's really easy to set up it works with a variety of different components around it and the data sheet which is over here tells you all you need to know about the application circuit so that's really useful okay so basically in sm3232 we're gonna have a bucket regulator and what's new in this video we're actually going to be using usb as well so for usb we're going to be using some esd protection and this is pretty much our only extended part so we're using this really common usb lc6 chip which is an esd protection chip okay with that being said we can pretty much get started one thing i'd recommend you do is either download what is called stm32 cube ide where you can set up the pins and peripherals of an stm32 chip and this also lets you program the device i also still have this stm32 cube mx installed which i'll just start right now and this i always use just to see which pins and peripherals i'd like to use for my stm32 microcontroller so i can click on access mcu selector and just wait for that to load and then we can type in what part we're looking for and we're looking for an f405 rg and you can see it's right here it tells us about the package the flash and ram size and so on double click and that'll load that into the program and this is what i typically start with just to see okay what's the layout of this device what peripherals and what connectors do i need to make available the first thing i always do is go to system call sys and then enable the debug so i'm going to be using serial wire debug swd for short but i'm going to use it use it with this swo pin enabled so you pretty much only need this swd i o and the sw clock but i'd like to include the swo pin because this means i can have some sort of trace output i can do a printf via the debugger which i'll be connecting to this what we're also going to be doing is actually using usb in combination with the boot zero switch to actually make sure um we can use for example usb dfu so device firmware upgrade okay this is just going to be a really really simple board with just a couple peripherals enabled nothing too too crazy and essentially you can decide for yourself if you want to expand this board or build on this board of course this is just to show how you can link up an stm32 really basically to get this thing running what we also want is a crystal oscillator now the scn32 has internal crystal oscillators but it's not something you really um want to use for example you want to use uart or something which requires precise timing you would like to use an external crystal or ceramic oscillator and we're going to use using the high speed external one here so for example a 16 megahertz crystal if you want to use the low speed external oscillator this one here that's used for the real-time clock but so far i haven't really found use of that so basically just the high speed external crystal okay so we've got the main things there this is pretty much all we need if we don't want to connect anything to this device it's the serial wire debug pins and it's the crystal oscillator other than that of course you wanted usb as well and that's under connectivity so let's click on here and there's an ins internal full speed usb physical layer and that's up to 12 megabits per second now this chip doesn't include a high speed one which is up to 480 megabits per second i believe you would have to connect some external ic to that but we just really want this free for debugging purposes so click on usb otg fs so on the go full speed and click on device only and you see it'll enable these two pins pa11 and pa12 this is the differential usb pair and effectively for usb in most cases you don't need anything like ev bus or an id pin or something like that if it's just a really simple device these are all the pins you need another nice thing just on the side note if you go on middleware and usb device you can actually sorry usb device class for fs you can actually choose a class so stm32 actually delivers some sort of libraries which you can use really quickly um to actually program the device so it could be anything as audio device if you want to stream audio back to the computer or from the computer mass storage and so on what i typically use is um the communication device class so this will then appear as a virtual comport so no need for any usb to uart converters so this is of course not necessary here just something i i thought i'd show you all right what we might want to connect to this um chip is i squared c so let's just see if you click on i squared c click on i switch c it's chosen these pins up here so pb7 and pb6 now there are other options which you can see in the data sheet where maybe i squared c1 is available on other pins or you can just click on one of these pins and cube ide and see uh-huh for these for this pin we can choose this peripheral so you could go through and see okay is there another i squared c maybe which is a bit better suited um yeah and so on so but this seems fine so let's just leave that up here so we have i squared c and we might want a uart for example so let's just click on one of the uarts you want the synchronous which is the most common type and let's put it over here now i don't really like it over here because it's right next to the usb it's right next to everything else and we've got so much space still on this chip so let's put that somewhere else so i'm just gonna rather unelegantly um just have a look through here if there's any other uart and you see there's uart3 over here there's no real difference i believe between you are three and you're at one for the purposes i want so i'm just going to put us three over here i'm gonna get get rid of up one again because it's too close to other pins and i'm going to enable up three yeah so that's pretty much it right we've got the zero wire debug we've got the crystal oscillator the high speed external one we've got the usb differential pair i squared c and uart and we've kind of spread things out on this chip and it this is really useful this is why i use this cube mx it's just to see initially before i even get started with keycad that um just the pin assignments and where i want these pins to be and also thinking ahead to layout already okay with that being said we can actually open keycad i already have it open and create a new project so create new project let me just navigate through to here okay okay so i've created a new project in keycard just file new project given it a name and it's created directory for me so i've just called it the stm32f4 revision2 all right this is following on from the first video so first thing to do is of course we need to make our schematic so click on schematic layout editor this will open this window here first thing you can do is up here on the left is edit page settings and here you can choose the size of your schematic page the orientation and so on what i'd like to do is just do an issue date so click on this button to transfer that this date to here revision well this is pretty much the second revision so let's just call it v 2.0 or just 2.0 title we can just fill in here stm32 um let's just call it a test board and the company i'm just going to put my youtube channel name you can click ok and you can see the bottom right here it's filled in everything for us and that's typically a good thing to do just to make sure you know when you made this schematic what it's called and so on especially have a multiplayer schematic this is really useful because you can give every schematic a different name okay so what we want of course is our centerpiece which is the sm32 microcontroller so click on the top right here play symbol and now we can search for sm32 f405 and the nice thing is kitkat already has this in its libraries so we can pop that out anywhere just left click to place it okay so this is our blank chip so to speak we have all the power pins at the top and bottom and all our peripheral pins left and right so we the first thing we do i typically move things to the side now remember we have actually used well we're going to be using the f405 rgt6 so double click on the value field and i'll just type in six just to make sure this is the pin we're using the component we're using i'm moving the component designate up here just to make things a bit more neat and we're going to divide this schematic up into sections later on as well okay but let's get started with actually connecting stuff up to this device this device is going to be running on 3.3 volts which will be deriving from the the buck regulator so the first thing i do is place a power port click anywhere and i'll just look for ground so this is our um just our zero volt reference sometimes the labels are placed a bit we're depending on grid settings so press w to root wires and i'm just connecting all the ground pins in the bottom here to ground now we can do something similar with the power pins up here click again place power port click somewhere and i'm going to look for 3 volts so 3.3 volts right here again i'm just pressing m and i can move the label because my i think i changed some some weird setting which is a bit annoying that's why the the label is always a bit off okay so we have a lot of power pins up here vbat you can use as for example a backup power source as it implies a battery but if you're not going to be using that and we're not going to be using that here you just tie that to 3.3 volts so let's do that so i move the label up here press m to move w to root wires and i'm just connecting that to all the vdd pins and you see i'm missing out the last one here which is the vdd8 the vdda pin is the analog reference and i'm actually going to give that a slightly different name so if i look for 3.3 again you can see there's a 3.3 va so i'm labeling my nets differently just to make sure i know that there is a difference now the vdda pin is actually if you look in the data sheet that is the supply voltage for the analog part of this chip so for example the adcs or the dacs now we're not going to be really using the adcs or dacs for this um for this video or for this for this pcb we're making so you could just tie it to vdd but um just for the sake of completeness because you might need this in one of your own designs we're actually going to perform some additional filtering on vdda just to remove some or try to remove some of the additional power supply noise but we'll get to that a bit later i just first will attach all the labels and nets to this device now keycard in their library have nicely arranged some of the pins on the left side here and these are kind of special pins to this device uh i typically try to not root things but just by routing wires all across the board because i don't think that looks very nice and it doesn't make your schematic very readable instead i use labels or i prefer global labels so as soon as you place a global label and you connect that to another global label with with the same name those two nets will be connected so click on the global label button click anywhere and you can give it a name i'm just going to call it end reset press enter and i connect it to here same with the boot zero and i'll tell you shortly what that actually does we have these two v cap pins here and if you look on the data sheet these are essentially for the internal regulators of this chip and they need to be decoupled or bypassed they need to be decoupled with 2.2 microfarad low esr ceramic capacitors so click on place symbol click anywhere and i typically look for c underscore small and this is a smaller footprint if we can compare them it's a smaller footprint to the typical capacitor and i typically for these kind of smaller designs and in the schematic i think it looks neater to just have them smaller okay so click m to move again click double click on for example c small to change the value so i type in 2 mu 2 to say okay this is a 2 micro 2.2 microfarad capacitor again w to route this up to the recap pins and we need one per v cap pin so let me move that over here there we go connected and the other side needs to connect to ground so i can press c to copy what i just do with the capacitor as well so c to copy this ground symbol and move it up here and move it up here now these have to be low esr capacitors according to the data sheet but i just chose pretty much the basic parts of jlc pcb 2.2 microfarad capacitors and these have worked absolutely fine so far so try to go for lowest esr but i don't think it's too critical at least from my point of view i haven't had any problems yet now these are pretty much the main parts we need to connect so far before we can kind of transfer stuff from cuba mx down here um one thing i want to mention is the the end reset is used to do essentially a hard or hardware reset of this whole chip so if you pull and reset pin low this chip will reset the internally the end reset pin actually has a pull up according to the data sheet a fairly weak pull up might be around 40 kilo ohms and that will just make sure this this this chip doesn't essentially accidentally reset but we can use this end reset pin for debugging so sometimes the debugger will require you to connect the hardware reset pin the boot zero pin essentially determines the boot mode so if we go back to the data sheet for the stm32f4 there is a section called boot modes 2.213 on page 23. so you can click on the datasheet and it'll show you how this device how this chip can be reprogrammed and what boot modes there are and there are additional application nodes that will show you that kind of stuff but essentially the takeaway message is for me at least you can pull the bootload pin either to ground or to high and it has to be one of those it can't the boot zero pin can't be left floating so pulling the boot zero pin low means the chip is essentially in a run state so the chip will just execute the program that you've put into flash memory if you pull the boot zero pin high to 3.3 volts that will essentially means that this chip is in program mode so you can program it via uart you can program it via usb and so on now if we're using serial wire debug or any sort of debugger you pretty much always just want to have the boot zero pin port low because the the debugger can override and say okay stop the program that's running i want to put it into debug mode you don't have to specifically pull this boot zero pin high okay but but because we're using usb and we might want to program this thing via uart we're actually gonna make this um this thing effectively switchable okay and we can do that by including a switch so click on place symbol and just look for single pole single throw which is spsd for short i should do one that's with no spdt sorry okay so you can look for spdt which is a single pole double throw switch so if you just include that here effectively as i said you want to pull the boot zero pin low or high and that's what the switch will be doing so but we also don't want to pull it directly high to 3.3 volts or directly load to ground so we just include a series resistor 10k is usually enough so again click on add symbol and i'm just looking for r small essentially again a small resistor click r to rotate and i want to double click and make that a 10 kilo ohm resistor again my my labels are a bit messed up so i'm just going to move that around using m and then i'm going to feed that into zero also on the other side all you want to do is press c to copy and then attach that to 3.3 volts and the other side we want to attach to ground okay and this way we can actually make the boot zero pin selectable between high and low again either run mode or in program via dfu mode is the main main things i use that for now that i believe for the stm32f4 there's another boot one pin kind of hidden at pv2 now pv2 and the boot one pin you can use to change the boot mode yet again but i believe you can just leave that floating the main pin we're interested in for programming and running is the boot zero pin all right okay so what is left to do now is to transfer everything from stm32 qrx the first thing is these ph0 and ph1 is where crystal oscillators attach to so here we go ph0 ph1 i attach global labels and i will call it high speed external in and i will call it hse out so high speed external out okay now uh go back to cuba max what else we have what's important is pa 13 which is the serial wire debug data pin so let's call swdio press r to rotate then we want sw clock pa 14 then we want sw0 which is pv3 now pb3 isn't really needed it's really nice if you want to do printf via the debugger okay now we've got that we also have usb pa12 and pa11 so pa12 is usb d plus so we type in usb underscore d plus i'm typing plus explicitly plus and minus later because that will tell key cad that this is going to be a differential pair and this is going to be really helpful when routing later on okay usb d plus and usb d minus on 11. so all i'm doing is transferring from cube mx over here the last things we need to do are of course the i squared c and the u r down here so i squared c is pb6 is scl pb6 is over here so that's i squared c1 scl just to make sure later on when i'm programming this device i know ah i use i squared c1 i didn't use i squared c3 okay pb6 is i squared c1 scl pb7 is i squared c1 sda so the data line and we're going to have to add pull ups to this later on but first of all let's add the uart so the uart was down here ur tx is pb10 pb10 is uart3tx pb11 is uart3rx your 3 rx okay and that's pretty much it now of course you can see i've got all of these unused pins here and typically in a design you'll probably use most of them anyway what we could do is actually add just an indicator or little status led to one of these pins now you have to check the data sheet for this but because some of these pins can't sync and source a lot of current in general most of these gpios can provide enough current to drive an led so let's just see what might be a good position for an led and i don't know pa00 let's say or pa2 might be a good position to connect an led to so let's do that so pa2 is up here i do just another label and let's just taller led underscore status and pi2 pa2 okay and we'll connect that later now we have all these unused pins as i said before now a lot of people say oh you could just tie them down to ground but you can actually do that in software so for stm32 a lot of the times you will have internal pull-ups or pull-downs and that will just reduce the noise and the power consumption of the device so we'll do that all in software so what's left to do in keycard is actually just do these no connect flags so click on the connect symbol and you can click on the individual pins now once you've placed that instead of just clicking around you know click on everything that's quite tedious you can actually just press the insert key after you've placed one and i'm just pressing it multiple times the insert key on the keyboard and that'll tell kicad okay on the next position downwards place the same symbol okay so you have to do a bit of a jump here so insert key again and this is what i'm just going to be doing here so for the sake of time let me just rush through this so all of the unused pins in keycard you want to just you know just use the no connect simple okay we are pretty much done there what we're missing now and very importantly are the decoupling capacitors so this ic needs decoupling capacitors very close to the power pins and we'll see that again in the layout and routing later on in general st recommends so let me just place another capacitor so i could just copy but why not do it here so we want one bulk decoupling capacitor which is really close to the stm32 microcontroller typically i put a 4.7 microfarad capacitor what we also then want is per vdd and per vbat pin we want one 100 nano farad decoupling capacitor so copy this double click 100n and we want one two three four five so let me just make five of these okay and that's for this 3.3 volt line up here so these are all the decoupling capacitors we need i copy the power flag and i hook all of this up so again w to root wires and so on okay bit boring but we're getting there now of course we want ground connect to the other side and we do the same thing again so these are all the decoupling capacitors okay and i said before we also have this vdda pin over here now this vdda pin again is for the all the analog stuff on the chip the adcs the dax and so on we're not using it here but it's good practice just to do some extra filtering on this on this on this pin as well the way you typically do this either ferro bead or an inductor so l small is a small inductor i'll just going to pop that somewhere here and typically you can use a fairly small value let's say 39 nanohenries pop that down here move my labels around and we're deriving that from the 3.3 volt rail right we're deriving that from through my throat rail so connect that to the inductor and typically i would put maybe a one micro farad in parallel with a 10 nano farad um decoupling capacitor so we want one micro farad and parallel with a 10 nano farad whoops and other side of course connected to ground okay and of course we need to connect that to 3.3 volts and in particular the analog side awesome so again 100 nanofarads per v-bat and per vdd pin a large decoupling capacitor bulk decoupling capacitor of 4.7 microfarads pretty much and that's going to be placed close to the pin uh close to the ic sorry we're doing some a very small amount of filtering on the vdda pin you could do more depending how sensitive your analog application is and that's pretty much the majority of this part done something we still need to do is of course connect some sort of crystal ceramic oscillator now if we're going back to glc pcb we can see what parts they have available i typically go for just a simple 16 megahertz crystal oscillator and you can see the first one here is a basic part and it's very very cheap so we don't pay a lot of money you can see the package here it's a full pin package and that's typically what they come in okay so back to key cad the way we can add that in again is click place symbol by symbol and we just type in crystal now there's a lot of different options here the one we want is ground to four and i'll tell you why in just a second if we go back to key sorry glc pcb we can always see that the data sheet is included with the part so i'm going to open that up and go down and as you can see here this is actually the kind of footprint the layout of this crystal package you can see the actual crystal pins are one and three over here but ground is connected at two and four and that's why in keycard i chose the symbol two and four are gonna connect to ground and one and three are the actual crystal packages pins sorry i know i'm going to be using a 16 megahertz oscillator or crystal rather okay now we need to connect this crystal somehow to this hsc in an hse out look the thing is we also need additional circuitry around this crystal now there's a really useful application note by st um if i just google it just type in stm32 crystal and it's the first result and it's called an oscillator design guide for stm32 series mcus and mpus wait for that to load and this is a pretty long document which tells you how you need to choose all the circuitry surrounding this crystal so basically all these this resistor and do these two capacitors are what we're going to need to be adding it'll tell you how this thing works and so on and it goes into huge detail how to do it you can go through that or you can just do a fairly simple method which works well i haven't had any i haven't had any problems yet first thing we need to do is add two load capacitors they're called and i for this crystal i know these are 12 picofarads and i'll tell you why in a second but let me just connect them first so let's just satisfying ocd is about about the same distance okay okay we connect those we connect the other side of these to ground so i'm just connecting the other side of these load casts to the ground remember we said um connect the crystal two and full to ground as well that's what i'm doing here now there is this thing just to branch in briefly i connected this kind of a full terminal junction and that's not something you should be doing i'm just doing it for the sake of simplicity because it's hard to see if for example this trace here is actually connected but i know it is for this one and you can use the uh electrical rules check later to see if it is connected but typically of try to avoid these these four terminal junctions right but just for the sake of time i've just done it here okay we also need a feed resistor so click on place simple and a feed resistor going into here i know that 47 ohms is a good value for these out of experience but i'll tell you what how i calculated these in just a second but before that let's let's link this up so hsc in connects to the side which is not the side of the feed resistor and hc out connects to the side which is part of the feed resistor and this is the whole crystal kind of circuit you need to connect the ph0 and ph-1 pins okay so let's talk about the load capacitors the load capacitors pretty much depend on the pcb layout it depends on the stray capacitance and it depends on the parameters that are given in the crystal data sheet now going back to the crystal data sheet um where is it over here it'll tell you about the load capacitance so for different types of this crystal for the specific one it'll it'll either be 12 peak of our 20 farads or could be more i know for the one i've chosen here because i've looked this up that it's actually 12 pico farads now the way you then determine the load capacitance again all of this is detailed in this in this document this stm32 application note is you need to do so let me just put a little text comment so place text the load capacitors have to be two times the load capacitance of the crystal i'll just call it cll minus the straight capacitance of the pcb and that's how you calculate it the load capacitance of the crystal is 12 picofarads and let's say i know the stray capacitance might be around five or six picofarads on the pcb it's a hard number to estimate but it could be anywhere from two picofarads it could be up to 10 picofarads so as a number essentially in the middle is good so we do 12 picofarads that's the load capacitance of the crystal minus the straight picofarads let's say five or six and that gives us essentially 10 to 12 picofarads per capacitor that we need to put either side of this crystal it's a really easy calculation look at the datasheet of the crystal find the load capacitance strike capacitance about five six speaker farads subtract that multiply by two there you go okay so really easy the feed resistor isn't always needed i like to include it just in case and essentially all this feed resistor does is limit the drive level from this driver included in in this stm32 chip and which will then feed this crystal oscillator if the drive level is too high you will essentially overdrive this crystal meaning you'll generate additional harmonics and effectively noise and distortion this feed resistor limits that and the way you calculate that at that is again detailed in this document so i really recommend you have a look through an2867 by st okay but effectively i've done the calculation for that and anywhere from 10 to 47 ohms for this particular crystal is fine what you can do is effectively also just make this into a zero ohm resistor so effectively this is a short but in case you need the resistor you can replace that the pads are there and you can put in a different resist to meet your needs this is a really hard thing to do in general this feed resistor because it's a matter of experimentation but i found this circuit works very well uh for the designs i do and for this chip okay that is pretty much all we need to do for um for this sm32 to pretty much get it running we'll do all the connectors and stuff shortly before we do that however let me just rearrange the schematic to maybe make it look a bit neater right because now everything's just floating about and it's not very elegant so i've moved things down here i'm going to maybe put all the decoupling close boot switch on one side over here and of course the crystal next to as well so once i've done that i can use this place graphic lines or polygons tool over here and on the schematic click and just you know just just section this off i guess section just off and right click and drawing okay really crude to be honest but something that just just this kind of works because i'm going to be reserving this part of schematic up here for the power and this section of the schematic over here for connectors and usb for example okay what you can do of course is also add text so bottom right here click add text and let's just call that stm2 microcontroller and we can just you know stick that up here just to know okay this is that section we have the decoupling capacitors we have the vdda filtering we have the chip itself we have these low esr capacitors connected to the cap we've got everything nicely labeled and so on okay so that's pretty much all you need to get this chip up and running of course you need the connectors to the to the debug interfaces and so on what we can also add is this status led so click on play symbol again led small because i like the small components are to rotate just put it somewhere where it's convenient and i typically indicate the color of my leds on the schematic i would like a blue led now blue led typically has a forward voltage drop of about three volts now i run my leds at a pretty low current about one milliamp is typically enough for me through an led to get it as bright as i want it to be so essential effectively we're running it off 3.3 volts which is a supply voltage so copy this label here because we're connecting it to the mcu and once we drive this gpio pin high pa2 will be at 3.3 volts and we're going to connect this other side via resistor to ground so effectively we're getting 3.3 volts here we're getting -3 volts so 3.3 volts here and we can use 0.3 volts divided by this current limiting resistor which we'll be putting here to determine the actual current going through this led so let me link that up copy ground over here so this point will be 3.3 volts this point here will be 0.3 volts because of the forward voltage drop now because i'm running it at such a low current we're probably not not going to get the full forward voltage drop across this diode right the forward voltage drop is when this is running at the respective forward voltage uh yeah and forward current and that's depending on the data sheet but typically i put in like a 1k 5 resistor and this will get my blue led just bright enough so it doesn't burn my eyes out but still that i can see it and also we don't want to make the drive level or the drive current too high because this pa2 gpio pin might not be able to supply the current that is actually going through this led okay so this is a pretty safe bet is making this a 1.5 k resistor okay so that is pretty much all we need for this section i believe the next thing we need to do is actual actually power this board right and we need to connect the buck regulator to this board okay so let's go back to jlc pcb we're going to be using this mp2359 uh switching regulator so this is a step down regulator which we're using to derive our 3.3 volt rail so let's do that right now uh i have the datasheet open here and effectively all i'm going to be doing is following something like this circuit schematic over here now it's always good to read the data sheets and full before you start the design and that's what i've been doing we have some sort of higher input voltage at the input pin we need this filtering and circuitry which is typical for buck regulators over here we need a feedback voltage at this pin and the feedback resistor network determines pretty much determines the voltage of the output we also have an enable pin and we need input and output decoupling and bypass capacitors the way you calculate all these inductor values capacitor values resistor values is always pretty much given in the datasheet so the feedback voltage network is given here so how do you calculate r1 and r2 depending on the required output voltages is given here how we calculate the inductors given here um how we collect select output capacitors incorporates all of that is given here and i've pretty much done everything already because i've used this chip so many times that i'm just going gonna go right ahead and copy the schematic over now i believe this chip unfortunately actually isn't part of the keycad library so if i just search for mp2359 and you can see it isn't and i've actually made my own library i have i'm kind of running my own global library for parts that aren't part of the keycad library or i can't find elsewhere and i'll show you how i made this circuit symbol so as you can see all i've done is made a really crappy looking symbol with all the relevant connections to this device so you can see that corresponds effectively to this symbol over here the way i did that just briefly you go up here to create edit and delete symbols now load the library symbol editor you scroll down to the library you want to add your um your footprint library to footprint here and then you click on create new symbol you do the symbol name uh i'll just make it test for example you drag this around what you can do then is up here and add pins to symbol you can give it the pin name pin number the type and so on so pin name i know let's just do test one and the pin numbers one you put it somewhere on the grid you do that for all the pins you see in the data sheet then you drag a little box around it right you drag a little box around it you save it in the library and you're done right that's all i did that is all i did for this little symbol over here so really really straightforward there's probably much neater ways of doing it and making it look more pretty so you can get something like this but to be honest this is more than enough all right so let's start by hooking up this um regulator over here and again all i'm going to be doing is following the data sheet what i typically do to make things neat as i did as we did with this stm32 over here is add labels to the pins which makes sure i don't work in a really cramped way and i don't have to draw wires everywhere and stuff like that so the input pin i'm going to call it back in the enable pin i'm going to call buck enable and you can see where this is going i'm just going to give everything a label now this might just be my preference of doing it but it's worked well for me so far if you have a different preference of course that's entirely up to you so you can see here this this device actually goes up to 24 volts to the input um let's say we only want to design this for about 12 volts input right we want a 12 volt input as a maximum so anything probably from 4 to 12 volts will be fine to make sure this thing turns on and can supply 3.3 volts at its output okay so we have a 12 volt input voltage let's say so let's make another net powernet and let's call it 12v and that's going to be our input what we also want to do before we feed that into the bug regulator is fuse it and also do some form of reverse polarity protection so let's do the fuse first so i type in a fuse and i would like to use a poly fuse so effectively a resettable temperature based fuse so put that in uh current that's something we need to calculate later on but it's just initially i just let's just say we put in a 250 milliamp fuse it's always good to label what can be using but we need to calculate this later on okay we connect the fuse to our input voltage and we'll get this input voltage from our connector um 12 volts of the input and then we want some form of reverse polarity protection now there's a really cool video on reverse polarity protection by afrotech mods i think a rather large youtube channel you can either do it with a diode a schottky diode but if you want a lower kind of power loss you can use a p-channel mosfet and a p-channel mosfet that is available at um jlc pcb as a basic part is an ao3401a let's have a look at the datasheet briefly so datasheet says okay it's up to four amps which is more than enough but importantly it has a really low rds on so really low drop will essentially get when we use this to just use as a reverse polarity protection okay um yeah the thing here is to note is this gate source voltage right so between the gate and the source you can only have up to uh plus or negative 12 volts and that'll also limit the input voltage the way you could get away with this is if you want a higher input voltage is actually to connect a zener diode with a resistor to the gate and the source and that distinct effectively clamps the gate source voltage but i don't really care about that for now and i'm only going to be running this up to 12 volts so i can just use uh this transistor as it is luckily if we go back to keycad the a03401a is part of the keycard library so all i need to do is select the symbol make sure it's the right way around and connect that as my reverse polarity protection there we go so we've taken from the input which we'll get from the connector later on we fed it through a fuse with the value we saw as you calculate and we're using this p channel mosfet for reverse polarity protection that then needs to feed i typically use um well i use a ferrite bead so ferro bead which you can find in the keycard library here and that will essentially act as a resistor at high frequencies so very similar to an inductor and uh if we go to glc pcb again if i type in bead you can see there's two basic parts and they'll they'll have different impedances at 100 megahertz and i typically use one which is i don't know 600 ohms at 600 megahertz let me just change the spelling here okay so far it'd be just for some additional power supply filtering i connect that after reverse polarity protection and then we need our essentially bulk input decoupling capacitor and we're going to be using a 10 microfarad capacitor for that and that's per the data sheet recommendations from the buck regulator and i'll show you that in just a second again the buck regulator data sheet recommends a 10 microfarad capacitor the input okay and then of course we want to feed that into the bucket regulator so copy my label and connect it all right so we've got fusing reverse polarity protection and a bit of filtering the next thing we need to look at is the enable pin so the enable pin needs to be i think a believe 0.4 volts for this bug regulator to turn on and we can see that here the enable input voltage is 0.4 volts or high voltage now it's 1.2 sorry it's 1.2 volts of the input to make sure this back regulator actually turns on the problem is this bug regulator the pins in particular enable pin as you can see up here has a maximum rating of plus six volts this means if we just simply connect the enable pin to the input pin this thing's going to blow up it's going to fry the chip so we actually need to step the input voltage down via a simple potential divider to make sure this enable pin doesn't exceed 6 volts so let's do that again place resistors small resistor here uh typically i make them fairly large because then they won't draw too much current if we put a 100k and a 68k for example we're going to get less quite a bit less than half the voltage at this point here so let me just connect that to back in and then we'll take that out for that and connect to buck enable and effectively this means if we have 12 volts here the the voltage at the buck enable pin here will be less than six volts so this thing won't fry but it'll turn the chip on all right so that's something we definitely want to put there so let's just put that next to the side here so i could probably make this a bit neater uh it looks like everything's going to be running up along the top here but for the sake of time and simplicity this is fine okay so that's everything to the left so to speak of this bug regulator to the right we have possibly the most more interesting part and this is stuff we take directly from the data sheet what we need to do is connect some sort of boost pin over here so boost capacitor between the boost and the switch and the value is 10 nano farad so we can do that right now so 10 nano farads so this is a bootstrap capacitor between boost and switch okay that's that done then we need this circuitry around here so the this shotgun diode and an inductor and the output capacitor and that's coming from the switch pin so a shocky diode schottky diode they'll give you recommendations what to use my go to diode because it's available jlc pcb is a b5819w as you can see it's a basic part we don't need to pay extra for it and it's a sod 123 package and just check the current and voltage capabilities as well but i've made sure this works so i type in d underscore shotkey and you can see there's a small version here put that in here i give the component name b5819w and i hook that up ground on the other side again this is just following the datasheet we need an inductor i've calculated the inductor value to be 10 micro henry hook that up here and again where's the data sheet follow the data sheet there is a section in here at the bottom selected the inductor and they recommend a one micro handy to ten micro henry it depends on the output voltage it depends on the input voltage it depends on the switching frequency depends on the load current ripple use that to calculate l really really straightforward i've calculated to be 10 micro henry um okay we need an output capacitor and that should be something like 22 micro farads i am actually going to be using two of these 10 micro farad capacitors in parallel this gives you lower esr and quite frankly it looks cooler okay and pretty much the output voltage here will then be our 3.3 volts so i can copy the flag and just attach that here now a really critical thing we're still missing is of course this feedback voltage here whatever we feed back from this output here to the feedback pin is going to determine our output voltage again follow the data sheet setting the output voltage is done by two resistors r1 and r2 yeah so we use we use our output voltage as 3.3 volts divided by 0.81 subtract 1 and we get our ratio of r1 to r2 quite nicely they've also made this table for us here for different output voltages and different values of r1 r2 the problem is r1 and r2 are very particular values in these right 49.9 and 16.2 or 9.53 values like these aren't typically standard values now they are available for jlc pcb but they'll be extended parts and as i said before we want to get away with using as few extended parts as possible the way we do that is combine resistors and series in parallel so i've done the calculation already but i'm going to be using r1 it's just going to be a 47 kilo ohm resistor so it's a ballpark similar to the magnitude of this r1 they give here so we take our 3.3 volts we feed that into a 47 kilo ohm resistor and using this formula over here we can calculate that actually r2 i believe needs to be something like 15.29 kilo ohms again that isn't a standard value i believe a standard value is 15 kilo ohms right so 15 kilo ohm resistor is a standard value so we can use that but then we just cascade that with for example a 270 ohm resistor and we get very close to the 15.29 kilo ohms we need we're just using basic parts right and so we take the output of that let me just move that down a bit we take the output of that and send that to our feedback voltage pin all right so i've used standard value parts to make sure i can use basic parts from jlc pcb and pretty much the voltage here is going to be pretty much exactly 3.3 volts so that's a way to kind of minimize the costs okay so i could try and make this a bit neater over here it doesn't look too great at the moment right um let me just move this around a tiny bit just to make sure maybe it does look a tiny bit neater but yeah just for the sake of time i'm just going to leave it like this but effectively everything in this top row over here is going to be to do with the buck converter and that's pretty much it right we've got the fusing reverse polarity projection filtering and making sure the enable pin voltage is less than six volts we've got the output circuitry we've got the feedback network and we've got this bootstrap capacitor and again follow the data sheet it everything i'm doing here is following the datasheet again section this bit off right click and drawing i can copy the text here just change it this is kind of um let's call it power circuitry okay so we've sectioned off we've got power circuitry we've got the sm32 microcontroller over here what is left to do is all the connectors and kind of the usb part of things all right okay so we can add a connector now for the power connector connectors in general it's a huge part in itself right there are so many millions of connectors available that entirely it depends up to you depends on the scenario what connectors you need so i'm just going to use fairly standard connectors that i might have lying around for the power input you might want to use something like a screw terminal so if you type in screw into choose symbol i'm just going to place one of these down here i'm going to need ground from my power supply and i'm going to use 12 volts all right so here's our screw terminal 12 volts of the input and ground at the input and that's going to power our board effectively okay what else do we need an important part is of course our debug connector so where we connect our serial wire debug to if you just go to google and type in swd pin out you can see here this is the standard layout we want for an swd connector this is pretty much what all debuggers will use if you're using this 10 pin connector and we want to follow that we have 3x3 volts top left we have various grounds and here we have all the serial wire debug stuff okay so all i'm going to do is transfer that over to keycat again place symbol we want a 10 pin connector type in con we want two columns times uh five rows now there's different versions counterclockwise odd even roller to first what you want is odd even all right pop that down somewhere and now all we need to do is follow this okay let me just move things around 3.3 volts somewhere at the top here and we want a lot of grounds let me just rename that we want grounds all over here there we go there we go and there we go again no connect to make sure kiko doesn't throw in annoying warnings and then we connect all the serial wire debug stuff from over here so swio proceed to copy try put it over here and connect now what you could do for safety as well with any type of connector is actually route this through for example uh i know a 22 ohm resistor right this makes sure if anyone were to use this and suddenly short this side to ground or to 3.3 volts while this is at a different voltage this make sure it limits the short circuit current and this is probably a good practice to do for the sake of time and simplicity i'm not going to do it but i typically do it because yeah you don't want to accidentally fry your board or a chip okay again back to this copy this over is all we need to be do and um okay trace pin the next one is not connected for swd if you're using jtag you would have to connect that but swd is typically what i use anyway and reset is the hardware reset pin we talked about earlier is the bottom here you could also again feed that via a low value resistor into a capacitor to form some sort of low-pass filter network to make sure you either de-bounce the circuit and you avoid kind of parasitic resets for the sake of simplicity in time this is all you need and this will work okay again search for swd pin out use the odd even footprint connect it up from your swd from your sm32 microcontroller and as you can see here because i've used labels i'm not drawing wires halfway across the schematic and making it look rough this is the way i like to do it if you like to do it differently that's fine but i think this looks a bit neater okay so we've got all of this pretty much sorted now the next thing is i squared c and uart one thing i forgot is actually to do the pull-ups for um the ice create c line so let's do that now pull-ups is another topics of itself what values do you use the i squared c specification gives recommended values i typically use for a low voltage is three 3.3 volts especially if you're going to be using fast mode i squared c at 400 kilohertz i use 2.2 kilo ohm resistors and that's typically a really suitable value so all i'm doing is pulling those data and clock lines high all right via 2.2 kilo ohm resistors if you're worried about power consumption you can make them 4.7 kilo ohms or if need be 10 kilo ohms 2.2 kilo ohms is certainly fine just make sure what to whatever you're connected to externally doesn't have additional pull up resistors on for example some sort of breakout board okay with that being said we can now include additional connectors so i'm just going to get generic connectors we want one column four rows now i will include a 3.3 volt at the top i will include ground at the bottom and i will just connect the clock and data lines and let's do the same thing for the ur all right we have 3.3 volts at the top we have ground at the bottom and we have our uart tx and rx okay there we go okay again you could put series resistors to kind of limit the short circuit current in the i squared c and u outlines as well sake of simplicity i'm not going to do it here but probably good practice okay so let's do something more interesting and that is the usb connection again click on symbol and type in usb and you'll see a variety of different usb connectors here my favorite usb connector is either the really chunky usb the kind of i think they call it printer connector or you use the usb micro one my favorite one is usb microphone double click inside of here unfortunately jlc pcb does not support um through-hole components yet or any of these connectors yet hopefully someday in the future but we're gonna have to hand solder this okay so what we need to do is connect the ground shield if you're not using some sort of metallic enclosure i typically just leave the shield floating i don't do any some sort of business with connecting it via a resistor and a capacitor to ground or directly to ground leave it floating is my suggestion now opinions will vary on this i'm sure i'm going to get some comments saying i should do this and that this has worked fine for me and this is what i'm gonna continue to be doing unless i will be proven wrong okay i will also be using esd protection so remember at the beginning of the video i said we will be using this part here the usb lc6 which essentially is just a collection of tvs diodes in a really convenient package specifically designed for usb and it's a very good idea to do this because usb you're going to be unplugging plugging in many many times and humans will be typically doing this humans which are charged up with static electricity and this static electricity will have the habit of discharging through your board and a way of preventing any damage is using one of these chips and luckily that's available jlc pcb and i believe in key cad it is a standard part in the library we don't have to make a footprint ourselves so plonk that down somewhere here rearrange the labels okay now we also have the option of powering this board via usb all right if we don't want to connect anything to the screw terminal we could the us use the usb power to power this board so why don't we do that the problem is we have two different power sources if they're both connected at the same time and we just link them together something's going to blow up the way you prevent that is because we effectively already have a diode-ish thing here we can use a schottky diode actually let me draw that on this side here and we link that up effectively this is kind of a really simple or gate all right we take let me just move that around here this isn't isn't very pretty okay this isn't the prettiest thing ever but it'll do this is an all gate essentially we have some sort of diode-ish thing here and a diode here and depending on which voltage is higher that'll essentially reverse bias the other diode so when this is 12 volts because usb will only have up to five volts it'll prefer to use so to speak the power source connected to the screw terminal so let's add another power flag 5 volts which will connect up here and this is the 5 volts we're getting from the usb so let's just link that up here all right so 5 volts will then go through this diode into this point here which will then feed into the bug regulator if the 12 volts aren't connected okay so we can power this board via usb which is pretty neat i find because you will only need one connector to do data and power okay the id pin we don't need in this case because we're just using this device as a device not a host what i typically tend to do is that give the connector a different name than usb uh d minus nu plus i call it usb underscore con d plus and usb con d minus all right so i can distinguish between the connector side and i can distinguish between the device side now this chip needs to be hooked up to 5 volts and ground so effectively all the spikes will be shunted back to the power supply then we need to connect the other terminals to the connector and to this stm32 over here and i believe pin one needs to be hooked up to d minus and of course because these are connected internally pin six will be connected to the device side and similarly for the d plus side on the other side so i believe this is correct we might have to flip it later but let's see so d plus and device id plus so let me just move them around a tiny bit and this pretty much i believe is all we need to do for usb so really simple normally you would have to have on the d plus line like a 1.5 kilo ohm resistor pulled up to the 3.3 volt rail but luckily all of that and all the matching network is actually included in the stm32 microcontroller in this stm32f405 there's a really useful application note for that as well uh if you just google usb um let's have a look getting started known where is it there's another page hardware and pcb guidelines there it is an4879 and this will tell you which of these stm32 microcontrollers actually include a pull-up resistors series termination resistors which ones include physical layers and so on so this application is really useful but for this f4 05 rgt6 chip uh we actually don't need it so this is pretty much all you need for usb at plus we get usb power as well okay so that is pretty much i think it for this board for the schematic the next thing we need to do is actually assign uh the labels and numbering to all of these parts so you can either do that manually by double clicking and saying like f1 this is q1 this is the first third bead and so on or you can have keycard do that for you by clicking annotate schematic symbols uh so you can sort by how you want the numbering to be done in different sheets you can start at a hundred thousand and so on uh i find it a bit annoying because my placement is sometimes a bit off so a lot of the times i'll actually do this manually so let me just do that manually and uh yeah let's just skip over that part but essentially i'm just assigning um numbers in order and in section to these component values okay okay so i've pretty much done all the annotation now so everything kind of ordered and sectioned to make sure yeah i can find the components when i switch between the layout and the schematic one thing i also forgot was that actually it's quite nice to include kind of some sort of power indicator led to make sure okay you quickly when you plug in the plug in the power supply it's generating 3.3 volts and just a really simple red led with a current limiting resistor uh driven by the 3.3 volt rail now for some sort of prototype this is absolutely fine but of course some production thing you don't want to waste power just by showing an indicator led on the board right you typically have that externally in some sort of casing or something during that okay uh one thing i started to do is of course kind of label this thing here let's just call that connectors and usb okay so this schematic could be made prettier of course it's very roughly sectioned in the for the sake of time but we can see power section synthetic microcontroller connectors and usb right really really simple and this is pretty much all you need to get this stm32 up and running with a switching regulator with usb so okay the next thing we need to do to do we finish the schematic we've animated it to the schematic the next thing you need to do is perform an erc so click on this little bug up here click run and it'll show you some sort of warnings and you can zoom in and then click on each of them until you connect to other pins not driven by any pin now in keycard you can select pins as power inputs power outputs bipolar inputs stuff like that right and keycard will then say ah this power input is not driven by a power output this is what all of this stuff is then pretty much saying these are warnings these are not errors and warnings in general will be showing this kind of stuff like like why is it's got two arrows here saying this is not driven by anything but these are kind of power pins you can turn these warnings off here and that's typically what i do i know these warnings are fine if you go through them so i typically just delete and ignore them but of course always do an erc check and make sure the warnings are ignorable warnings and if there are errors you definitely need to fix them for example it'll tell you if things aren't connected if global nets are not connected to anything else for example i believe there's a way of getting rid of them using a power flag but i typically can't be bothered uh and this has worked so far for me okay so do the erc check make sure everything's checked your schematic looks right check it several several times before you move on to layout and routing for the moment i'm going to assume this is all fine i'll check this later on um but yeah let's move on to component selection the way you do that is click up here to assign footprints it'll load all the libraries and this is actually where we choose the sizes and dimensions of all the components so let's just wait for that to load on that note what we also need to include is are actually mounting holes and you typically you can do that in the layout program but i actually do it in the schematic these days so you click on play symbol i mean although it's not strictly part of the schematic uh just type in mounting you can get the mounting hole with a pad or without a pad i typically like them with the pad and we'll just make four of them um because i typically ground my mounting holes and that makes it really easy for like oscilloscope ground clips to clip onto them so we just have a couple of mounting holes connected here again we need to annotate so click annotate and let's do one two three four not particularly pretty but let's just leave there for now okay back to assigning pcb footprints we get this huge list now of footprints we need to assign so for all the components which are available in our schematic we actually need to choose the sizes on the right here and the way you would typically do that is go for example to jlc pcb say you want a 12 microfarad capacitor you see which one of them are basic parts then you would go through and say okay this is an 0805 it's 10 microfarads and it's rated up to 25 volts so this looks pretty good uh you could and this is how you go through right some of them are only ranging at 6.3 volts so that would be no good for input stage which needs to be able to see up to 12 volts to go through and kind of see okay what are our ratings for these power parts right c1 is is our input capacitor i typically like to use like 1206 size so just double click so all my 10 microfarads will be 1206. uh 10 nanofarads i'm going to use o603 because again this c3 is a part it's highlighted so if you go here and click on one of these components it'll highlight it in the schematic this will all the power section i want to make fairly large right power sections fairly large even though they might not dissipate a lot of power it's the thought right power large okay standing under parrots o603 c5 so let's have a look c 5 is okay that's a really the next section c5 is part of the stm to do microcontroller again i could go to glc pcb and see what they have in stock as basic parts they've got 0.603 20 to 25 volts that's that's more than enough again this is not part of the power section anymore right this is part of the stm3d microcontroller 1603 all the 100 nanofarads i typically make o4 too so really nice and small and this is the smallest that jlc pcb can actually cope with now the one micro farad is here and that's part of the vdda filtering again i just use o42 now the 2.2 microfarads a special case because jlc pcb doesn't stock o402 um uh 2.2 microfarad capacitors so the smallest they have is 0.603 and that's what i'm going to be using these are the ones that were supposed to be lowest lower esr if you remember back but these i've been using these in all of my designs these ones the jlc pcb has here and they've worked absolutely fine so far the 12 picofarad capacitors here are part of the crystal i want small ones b5819w are those schottky diodes right so that's we want we use one up here and we want to use use one for the switching regulator and that was a sod 123 package if i remember correctly so scroll down and keycard over here sod123 i'm sure there's more elegant ways of assigning these footprints but this is the way i do it leds are 10603 size the fuse uh sometimes will be annoying and not show the footprints here and that's when you have to click up here get rid of the filters and just scroll down manually uh it's i think it's because it's a poly fuse it isn't like that for some reason but i'm going to be using a 1206 fuse you can put that filter thing back on again i want uh basically the the third bead is pretty much an inductor so we can use an inductor footprint and i'm going to be using 0805 mounting holes that's entirely your preference i typically are with m4 mounting holes there's also this button up here you can view the selected footprint so there's these mounting holes which also have this pad which of course we want and i typically like the look of these pad with via ones whoops right they have all these vias around them i think that looks pretty pretty cool so i'm going to be using those so those screw terminal okay so again screw terminals and connectors is a whole topic in its own right you could probably make a million hour video on it and still wouldn't have covered it i like these phoenix pt five millimeter pitch ones or these three point five millimeter pitch ones let's go with the 3.5 millimeter pitch ones we're not we don't need something that chunky okay here's something more interesting the sierra wire debug connector remember that was a two column five row connector and the correct size for the stm32 i typically use the mini connectors and i typically use an smd one so vertical smd 1.27 millimeter pitch is the one i use and it's the one that fits okay connectors again these are uh the i squared c and the uart connectors entirely your personal preference what i'm going to use are these picoblade connectors a very small 1.25 millimeter pitch i really like them when i have a couple of them in stock at home okay micro connectors um again that is entirely up to you what micro connector use even if you use a usb micro connector up to you you could use usb a b c whatever you want i have my own library made with one of these connectors and that's the one i'm going to use it's it's got this awful part number 1011 something something but it's i have they're really cheap i think they're about 20 cents each and i have loads of them in stock so that's what i'm going to use again i made my own footprint for that inductor so this is a power inductor it's not your typical 10 microannual inductor you get if you type in 10 micro henry into j into glc pcb you'll see there's loads of different inductors available here the one i'm going to be using is this sunlord one over here so pretty chunky one and this can do up to 3.2 amps so really really oversized even though it's a small inductor the current capabilities are oversized because you don't want this thing to saturate or even come close to saturating you can see the footprint is a 5.2 by 5.4 millimeter footprint and i believe keycard has that so we scroll through uh i believe it must be somewhere here so smd there we go it's not the correct model number right this is mwsa0503 and this is a slightly different name but the footprint is the same it's 5.4 by 5.2 millimeter so that's what i'm going to use the 39 nano henry inductor that's the one that feeds the vdda filtering uh so if we look back here it's this one here uh so that's going to be an o 402 i think let me just check glc pcb just make sure 39.99 yep oh 42. right this one here very tiny um so for two it's already selected the uh the p channel mosfet because it was a keycard standard part and all that is left is pretty much all the resistors uh the switch and yeah the buck regulator footprint and the crystal so let's do the resistors first again anything that's part of the power section i typed to make larger so all these r1 r2 r3 r4 r5 and anything which is part of an led circuit because the led is o603 i'm going to make the resistor 0603 so power power power power power led then a 10k was part of the boot mode select i can use 042 this 47 ohm resistor remember was part of this crystal i wanted as small as possible 042 1.5 k is the led again i'm making it a tiny bit larger at 0.603 and these two k2 resistors these two of them are part of the pull ups now you can make those small 0402 or you can make them slightly larger the reason for making them slightly larger is that you might want to exchange them and experiment with the value and it'll be harder to solder and de-solder o42s compared to o6030805 so you might want to go with the larger um size for these um well i want to probably not so i'm going with o-402 okay so that's all the kind of passive components these resistors and capacitors done all the stuff up here done now switches as well that is another thing in itself right so key cad has some switches already available for you i typically just go through them to see if the footprint matches something i have so let me just put them side by side so i can go through the footprints and see is this something i like the look of and i believe this is actually one i have at home so this is a single pole dual throw switch which we can actually use as our boot mode select switch this is one i'll be using this footprint okay so we have our boot mode select switch now we have our buck regulator remember for this i actually made this little uh symbol i didn't make a footprint and the reason why is if we search for that part again or the mp2359 the reason is because it's a really common package i don't need to make a footprint all i need to do is make the symbol and in keycad once it comes time to assigning the footprint i get rid of this stupid filter again uh scroll down to package and it's a sat23 six pin package all right slot 23 six pin and because i've done the labeling correctly i hope all the pin assignments will be correct so because there's a standard package i don't need to make the footprint double click remember the crystal oscillator is the last thing we need to do it's a four pin package and if we go back to glc pcb i look for the part again it's an smd 3225 size back in keycard 16 megahertz i put on this filter thing again and as you can see up here smd 3225 full pin that's the one i want double click apply save schematic and continue check everything's been assigned and click ok and that's all there is to to assign the footprints all right now we need to generate for that list want to generate the netlist then we can move over to pcb new up here and actually start out with a layout and routing of this design generate list uh save it and the next thing we do is then click on go to pcb new so here we are on pcb new and we're going to get started with the layout and routing of this pcb first thing we need to think about when we're doing a pcb layout and routing is how many layers we're going to have available to us in general the more layers you have the easier it is to root these days if we look at for example the jlc pcb website we pretty much have the choice between two or four layers for if we want to do assembly as well so if we're just doing like just have a look at the general prices so 100 by 100 millimeter board two layers is about two euros and a four layer board is about six euros so you're only paying a couple euros more to get a much easier or to have a much easier time when routing this board that's why typically uh i will go with a full layer board with something like a microcontroller on it because i i can have a dedicated power plane i can have a dedicated ground plane and i ha i can have two signal planes and for six euros for these boards you really can't complain so that's why we are going to go with a full layer board now of course you can do this with a two layer board and it won't be too hard you you essentially have a ground plane on the bottom and then root power with the signal uh layer as well but the sega simplicity and cost as well is not a huge factor as we just saw so the first thing you need to do is when you're on pcb news actually do kind of the design rules and stuff like that so if you click on top of here we can go to board setup on the layers tab you can click on copy layers and just change that to four and then we get these internal two layers here and uh you don't have to do this but i tend to just indicate that these are power planes one thing we also have to dude and that depends on the manufacturer you're going to get these manufactured at are the design rules so stuff like minimum track width via diameters drilled sizes the minimum and so on um typically i just keep the default settings um from from keycad because they suit jlc pcb pretty well but if you want to meet them exactly you can go on the capabilities tab over here and then you can essentially enter everything which you find on here so they'll tell you all about the minimum drill hole sizes and so on and that will vary depending on the pcb manufacturer you use okay so that really basic setup done i'm just going to leave pretty much everything as it is the only thing we've done is change the layers to full click ok and you can see we've added two layers over here uh great let's keep it on one millimeter for now we're just going to roughly lay out the parts and yeah and then we'll get started with layout and after that we'll do rooting so let's import the netlist go to load netlist choose the netlist file we just created and it'll start to load in once it's loaded in click on update pcb click close and you'll see we have all our components which you move around here so just put them somewhere on the pcb area here so first of what i'm going to do is actually just do a really rough layout of this ball just see how do things fit where which connector should go where some things are kind of determined by the pin out of the stm32 chip over here once we've done that we can kind of get a feel for the actual board size we're going to need so let me just do that i'm just going to keep the grid size as as big as it now this is kind of our centerpiece is the stm32 we have for example this is one of the connectors one of the picobay connectors you can see on the rat's nest this needs to be somewhere up here i'm using r to rotate and pressing m to move by the way here is the uart stuff so somewhere down here this is a very rough layout to begin with uh this is the kind of zero wire debug stuff and most of it is on the right side over here then we have for example the boot mode and i believe that's somewhere over here but that of course requires a resistor as well u1 u3 is the us part of the usb so the usb esd protection and yeah so here the usb pins over here and that's why i kind of put it close here and that also enables us to then put the usb connector kind of the rough area where it should be okay the remaining components are all kind of small passives and decoupling capacitors and of course we have um the large power section as well what we can already do is maybe move the crystal because that's going to take some take up some room somewhere where the crystal pins are and what else do we have so typically now i i have two monitors i'm actually working on but you can just drag these two windows next to each other and every time you click on a component keycard will then show you that in the schematic as well so you can actually move around by doing that and it'll show you the relevant component so for example we could move all the power stuff together so u1 if i click on something here the fuse is over here so i can kind of group everything together and see how things will fit and this is typically how i get started and if i don't have any mechanical constraints on the board size i will this is typically what i'll be doing so i'll just try and figure out the board size just by roughly layout layouting the the components so let me just roughly move things about again this is uh usually we'd spend maybe a bit more time on this to make sure everything seems all right but yeah let's just get all the things kind of grouped together and then we can see this will probably be a pretty small board anyway so let's just move everything together this is again just a really really rough layout just so we can determine the board size and where connectors and stuff like that needs to be often times you might want to make changes if you see that a lot of connectors on one side of the board you would again maybe rearrange the pin outs of the stm32 but since we used cuba mx right at the start we kind of figured out that out from the get-go all right so i'm just moving again stuff where it should be so boot zero okay all the connectors we've done we've done this then we also have the mounting holes and stuff like that okay we have all these these kind of this feedback network for the back regulator which we can kind of group together we can find it more easily later on we have things like the power on indicator leds we have this bootstrap capacitor have a look bootstrap raster is kind of part of that as well we have enable resistors one and two let's move that over here okay and then we have a lot of these passives still left over all right we also have a i think this is part of the led the status led so we can move that closer to the stm32 somewhere over here and then we have a couple passives let's just see our 11 is an i squared c pull up and r 10 is an i squared c pull up yeah uh part of the crystal r8 so we can really kind of move that over over here just really rough placement we have the kind of load capacitors for the crystal which i'm going to move over next to the crystal this one as well and we're kind of getting a feel for okay this this water is going to be fairly small we might even consider making these mounting holes like m3 or even smaller or maybe even getting rid of rid of this plating completely just so we save a bit of space because this is going to be a very small board i do like larger mounting holes though because it just makes things easier to work with so the boot mode selects which we can pretty much put over here that might be a bit bit easier and other than that i think we basically just have a lot of passives left over and these are mainly the decoupling and bypass capacitors for them for the mcu okay um yeah we'll figure out the board size in just a tiny bit what i would typically do now and as i've kind of placed a couple of these things together is maybe try now just work on maybe the finer placement of things right so we've kind of grouped a lot of things together we can move all the decoupling capacitors over here and yeah so c1112 is part of the analog then we just find l2 that's over there as well okay yeah so kind of get a rough feel for the layout next thing is i'll make my grid maybe a tiny bit smaller so i've used the schematic to help me lay this out a tiny bit and i'm actually going to start maybe doing putting the most important parts together so i'm going to place all my decoupling and bypass capacitors first specifically for the mcu and kind of move through the crystal and i'll do all the most important things first you know something like the boot mode select switch that's already that's basically a dc signal that's not entirely important where we placed that at the end of the day you want the decoupling capacitors first maybe root the power first to the crystal stuff first and then then do the less less interesting or less irrelevant stuff first like the connectors okay another thing i like to do a lot of people like to keep the silk screen on right r1 r2 c4 suffer that which is typically good practice as well i don't like my boards like that i like to have these things hidden on the fabrication layer so there's this fab layer here top and bottom and this is typically used what you'll send to a fab house for assembly the nice thing is jlc pcb doesn't even need this fab layer you you export another footprint position file which i'll show you in later but the main thing is i move all of my component designators to the fab layer i believe there's some shortcut to do this but i i typically move a component where it needs to be and then i delete the relevant um designate as well right so i move i basically do my crystal stuff right now which is pretty much as important as the decoupling so i double click move it to the fab layer kind of get a better position than i had before trying to get these load capacitors for the crystal close to the crystal right everything nice and tight i've placed this crystal here in a line with uh this pad of the stm32 microcontroller so i can just move the trace right in there okay yeah okay so we can actually do the coupling decoupling capacitors pretty much now we've done the crystal really briefly so here for the sn32 microcontroller we have this large well 4.7 microfarad decoupling capacitor which we'll do last the first more important ones are the ones that go really close to the power pins so c6 to c10 and we'll start off with the bat of pin one uh pin one will get this one to pin one or something over here so you want it as fairly close as close as you can reasonably get it to the relevant power pin you can see i mean basically this distance between that is what is that 0.25 millimeters so this is really close this is kind of what you want you don't want to go too close in case you have to desolder stuff and it kind of gets in the way but this i believe is a pretty good distance and i'll just do that for the remaining decoupling capacitors so c7 needs to go to pin 19 which is the first vdd pin pin 19 should be somewhere down here and just kind of smack bang in the middle between the ground and the 3.3 volts sometimes you will have for example pin 20 and pin 17 might be connected to some peripheral you want to prioritize pretty much the decoupling so you want to make sure this has enough space before these signals have enough space i'd rather use vias on on the adjacent pins for some peripheral rather than with this decoupling capacitor okay so let's just continue on with that there's another one here we also have these these two capacitors down here which which are equally as important so uh c9 needs to go to pin 48 i believe which should be up here again nice and close i'm doing all the decoupling first doing all the crystal stuff first all the critical sections first and this should always be the case in any any new pcb design all right okay i'm getting rid of the component designators as i go so i move the part remove the component designator this is already looking pretty good i of course also have my analog section over here i'm going to put my smaller capacitor closest all right there we go that's one then i'm putting my larger decoupling capacitor my bypass capacitor pretty much right next to that and then of course i have the inductor that is helping to filter the whole signal so somewhere which feeds in of course that's not entirely critical if that's if that's further away from the pins assuming that that looks pretty good right close smallest one first then the bigger one and then this inductor we still have c30 and see it's 14. that's v cap 1 and v cap 2 unfortunately as we said before these are 0.603 so they're substantially larger than the o4 2 sizes so i might have to move things around a tiny bit all right so i'm gonna make sure i could even move my 3.3 volt um decoupling capacitor over here and this gives me enough space right so this is still pretty close my 3.3 volt is still pretty close i've just moved it out of the way a tiny bit c14 is hopefully our last one and the same thing i'm going to be doing here i'm just going to move this one out of the way and then i'll have enough space to put this one in okay so this looks pretty decent for now we of course still have our 4.7 microfarad capacitor and this one effectively we still need to decide where you want to put all of this power section and of course this is going to be we're going to make this much tighter much better soon what i typically do with this bulk decoupling capacitor this 4.7 microfarad one is i put it pretty much the opposite side to the power delivery because in my eyes the power delivery will be worse further away from the actual power source and that's where i want to put my decoupling and by the looks of things i want to put my power section here next to for example one of the power sources which is the usb connector that's why i'm probably going to put the 3.3 volt multi-coupling capacitor somewhere over here close to the main microcontroller i see okay and that's that's pretty much all there is to the decoupling side of things uh now we can look what else is important at least for the mcu side of things while we're here we might as well root the other stuff or at least lay out the other stuff and then we'll move over to the power section so as you can see i'm doing this section first then the power circuitry you could start with the power circuitry you could start with sd microsections start with the most important things first decoupling as always is something you should prioritize all right so i'm moving it slightly to the left this is the boot zero resistor this 10k resist over here moving it slightly to the left so i leave space for the sda and scl lines i could also put this pretty much further away this wouldn't this wouldn't be too bad either because this is a low frequency signal boot zero it isn't critical where this resistor is or anywhere so actually let's let's put it over here that's not not too bad okay what else we have we have the i squared c pull-ups which will have to go somewhere up here and we have this blue led which is effectively our status led but let's move that somewhere so we can just put that effectively somewhere over here again this is not too critical again it's a low frequency um signal that's going to be applied to this and this is just the current limiting resistor which i put next to it what i like to do as well is use the 3d view in keycaps up here if you go view and 3d viewer shortcut is alt plus 3 and that will bring out the 3d view it's extended because we haven't drawn the board outline yet but it's really good to check just kind of visually does this look alright should the decoupling capacitors look close enough you know we might be able to move them in a tiny bit more but to me this this looks fairly decent yeah we've got them fairly close couldn't move them fairly closer and as the board progresses we can keep using this 3d viewer just to check that everything looks fairly decent of course another critical thing would be the usb even though we are using a really low speed usb line it's a full speed line of 12 megabits all right so it's not particularly fast it's not entirely critically critical how you root this but we will actually be rooting this as a kind of a controlled impedance differential pair so here's the esd protection for that and you want the esd protection as pretty much closer to the connector as close possible to the connector rather than as close as possible to the chip but we'll see about that in a in a bit later basically you want to fit this whole power section somewhere in that region as well uh the connectors we can get rid of the silk over here and move that to the fab layer with that maybe a tiny bit over here and we also have to pull up resistors yeah so all still part of the mcu circuit second pull up resistor again not too critical where these pilot resistors are in general it's recommended to put them closer to the actual host device rather than to the slave devices then again not entirely critical of these speeds we're running at up to 400 kilohertz that's not entirely fast okay so by the looks of things swd will probably be good just to put somewhere here that's our debug connector you might want to put the usb slightly higher because we also have our power terminal power connector here which we're going to put right next to the usb i know so something like here maybe along this line i think that that might be a ring that's our power screw terminal uh okay yeah so we might need to extend the space here a tiny bit all right i select everything press enter move move to the left a bit i'm trying to make space for all this this regulator stuff over here okay all right so the first thing we need to do is actually do the fusing so i'm seeing now the fuse is actually before all of this reverse polarity protection stuff like that so it probably actually is better to move maybe the fuse ahead of things right we might want to move the fuse over here because otherwise essentially the usb line is unfused we could do that we couldn't do that it's it's probably a thing a better thing to move it over here if you want to move it over there let me just create some more space let me move that here all i have to do is click m to move i put it over there just join this up i could i could decrease the distance actually let me do that let's move that down a bit as well okay look hook that up again i just click annotate just to make sure what i typically do is also just re re load the netlist to regenerate the netlist and go back to pcb new if you've made any changes in the schematic schematic like we just did now all you have to do is click this button here update pcb from schematic and click update pcb and that should have changed everything okay so now the first thing we have well we have this diode from the usb connector which is from the power which we might put over here so this is essentially our very simple power or gate we have the p channel mosfet which is going to feed from this screw terminal as our reverse polarity protection and then we're taking the output of that that junction effectively into the fuse so the fuse i try to give a bit more space because you might have to even though it's a resettable one you might have to access this if you're not using a resettable one so just give the fuse a bit of space okay uh we can just move the diode around maybe a tiny bit and just pop the fuse and this is this could we could clear this out later when we do the finer adjustments but for now this looks this looks alright okay from the fuse we've got a thorough bead so we essentially just to filter and then we are starting to get into this bug regulator territory so when i do that i'll click on this bug regulator and move it where it probably should be so the input is pin five just trying to make sure we have enough space okay so the input is pin five and generally with buck regulators or any sort of power supply you want to keep the loop area as small as possible in essence that means keep things tight uh make sure you're not making the areas larger than they need be so let's see how we can how we can do that all right where do we start how about we start with the input capacitor c1 input is somewhere here so we're gonna pretty much just make that follow this path here we're going to have to move around things so this is not fixed this is just to get a rough idea of how we want to root things right we might yeah we're going to because we're going to use a dedicated ground plane i'm not too worried if i get a direct connection back to ground here because we're going to going through vias most of the time anyway okay we have that and this enable circuitry here isn't too important yet but let's have a look at where this inductor will go and the inductor should be somewhere here now we need to see what we're going to do regarding all the space so we probably should move this down a tiny bit let's move that over here we could i'm just moving around just to see how things might fit again this is just a process of kind of guesstimating where things might be a lot of the times the data sheet will actually tell you how to do the layout of these things unfortunately the day out date to sheet for this mp2359 doesn't tell you the layout so we're just going to have to do do a best kind of guess i would say okay i'm just making sure things are fairly compact fairly neat i'm sure you could people can do this better but i've used this buck regulator several several times and i don't i've never had problems so that's that's usually what i go by if it works and i don't see any specific problems then that's great all right so okay we also have this boost capacitor i remember which is this thing here and that can fit in somewhere between these pins okay i mean it's not the not the neatest thing but i'll do for now then we have the second and we're going to readjust we're going to readjust it's always a little bit of process with the pcb design you're going to find oh i've got a bit more space here got a bit more space here can move things around and typically it depends of course on your mechanical constraints as well it depends how much space you have in your housing how much you can sacrifice and so on here i don't really care how big or small things will be ideally the smaller the better but here it's it's not entirely ruined this thing is switching at i believe about one to two megahertz so it's a fairly high frequency switcher now you might think there might be noise issues here and there could be of course if you're measuring fairly sensitive and analog signals in that kind of frequency range but for us we're not using the analog part anyway uh so you're not going to have any problems with this and layout even even if it looks rather close at the moment okay so just doing a couple fine adjustments a little bit fine tuning again 3d viewer it's really useful just to see does this look dodgy does this look kind of alright to me yeah it's not the not the prettiest but it'll do for now ideally i'd like to get this whole section just a bit tighter could do maybe like this but yeah yeah it's it's maybe i'm just spending too much time on this already something of this will be absolutely fine right we've kept things fairly compact i mean overall this is spanning i'd know a centimeter yeah centimeter centimeter half nothing too too worrisome before i do the enable pin let me do the feedback because that to me is more important so the feedback pin here get rid of silk screen and then we have the rolling parts of the feedback network we'll do finer adjustments with a smaller grid size later on but for now this should be fine oops okay and that is pretty much we just have to enable things here so these aren't too critical right this is just a very low frequency signal just telling the regulator turn on that's all these two resistors are doing and that is pretty much it we have the power led and we can pretty much put that wherever we please right we could put that any side of the board it's entirely and not it's not critical at all so we can put that somewhere up there maybe i'm not sure something on that should be fine we'll we'll try and put the mounting holes in next once we're happy with this layout let me move this get rid of the silk screen and yeah okay okay so this is a very very very basic layout what i would do now is place the mounting holes so let's have a look maybe something like that so i need to make sure the usb connector can hang off the edge a tiny bit so maybe like this okay and typically it's a good idea to space the mounting holes of course depending on mechanicals and strains but you don't have any mechanical constraints place the mounting holes a fixed number or a sensible number of millimeters apart so let's say what do we have here and i'm using the space command you might see to measure distances so i press space and down here these numbers will change so i go above this i press space and it zeros everything and then i can see how far away i am so let's say i don't know we could make a 40 millimeters 40 millimeters 40 millimeters in this axis and we'll see in kind of the x-axis what distance we want to have a part so again pop it over here space move it over where you think seems about right you do about 45 45 looks good and that means our last mounting hole is pretty much fixed as well again move it over and we want 40 millimeters in this direction awesome okay yes okay so now we can just adjust the connectors maybe a tiny bit we'll do that follow that in more detail soon see and then we can just pop this somewhere we're going to move this this thing around a bit a tiny tiny bit later okay what we need to do now is draw the board outline so even if we go to 3d viewer now kaika thinks okay this approximately everything fits in this space but i don't like sharp edges so we're gonna do make a board outline with rounded corners so let's do that so click on edge cuts click on the add graphics lines tool and then just close to your connector essentially vertically up i will leave a bit of space all right i don't know uh let's say a millimeter space and it's almost going to go to the next mounting hole at the same position exactly vertically above then i go to the next mounting hole pretty much a millimeter away from it click and go down in a straight line and next to the other one and just click okay actually that's not a straight line isn't it let's try that again okay straight down this should be good i think okay same thing again okay so now we just have to do this last side over here where we go up here make sure it's a straight line okay so now we've got these four edges here and what why i haven't connected them because i'm going to do rounded corners the way you do that we stay on the edge cuts layer click on add graphic arc click in the center click on the second point and counter clockwise is to draw just part of a circle start from zero essentially because if i click and i go uh like clockwise i start with a big circle i want to go counterclockwise so i don't start with a full circle click second click and then counterclockwise and twice more and these join up nicely awesome all right okay so now we can click 3d view and we have a nice little board with rounded corners it's fairly small we've got we've left ourselves quite a bit of space we might want to put some silk screen and other stuff around there we still need to move the connectors around to make them look a tiny bit better but yeah the rough layout for first try this is alright i think okay so as i said i'm just going to move these kind of pretty much towards the edges just before i'm just going to make sure i line these again i typically use this probably better way of doing this to use space just to make sure it's aligned and we're leaving a bit more space here there we go okay now what we can do is maybe move this whole mcu section down a tiny bit more and we can fit our boot mode select switch over there all right and i'll move the boot mode select resistor over here okay our swd we can move maybe a tiny bit up as well and we of course have our power led power led doesn't really matter where this thing goes i severely dislike the aligning mechanism some things when you import the netlist on the grid and some things aren't not my favorite thing then of course we have the usb connector again i'm always using the 3d view just to check what i'm doing check the layout looks fairly sensible of course we've got a lot of a lot of space still left over but you know as just a little showy board this is this is fine the main thing is that you know how to wire this stm32 thing up but yeah this looks this looks fairly right we can move it maybe there okay i'm just going to align this esd protection chip so the center of it is between the d plus and d minus pins that way i can make sure the lengths between the differential pairs are matched at least on this side so i get it fairly nice and close not too close because i need to solder this connect on manually and i want to leave myself enough space to get my my hot air gun in and not desolder anything else so this this is fairly good remember this esd chip needs to be closer to the usb line than the microcontroller yeah okay so we've got power input we've also got power here going through this diode we've got connectors on the outside edges we've got any switches on outside s's and we've got the majority of the critical parts close to the relevant ics and that is uh pretty much it for layout so i think we can go over to routing if we find anything wrong with a layout we will find that in routing so let's move over to that so now we're ready to start with the routing the first thing i do with routing is go to the track sizes and add several track sizes i'm probably going to be needing so click on edit predefined sizes and i typically go with 0.3 millimeters and that's really useful for the lqfp package pins of this stm32 microcontroller 0.5 and anything up to one millimeter i typically use for power so these should do you fairly well we're going to look at differential pairs later because we're going to be needing that for the usb routing but basically just enter these pairs to start with and click okay okay another thing we need to do is add the power planes because this is a four layer board i'm going to use going to be using the inner two copper layers as power and ground specifically the inner in one so this layer here is going to be a ground ground pool so click on add filled zones just click on the first corner up here i'm going to choose my ground net on in one these settings are typically fine and click ok now we just go around the board you don't have to fit it exactly to the board kycad will do that automatically for you so all you have to do is click around here and the last one once you've done that you will have a ground port which you can see over here right it's connected to places with these thermal reliefs uh where they need to be connected you can change the spoke width of these thermal reliefs by changing these values here so we could do maybe 75 millimeters and that makes these spokes a bit thicker but yeah the normal values are typically fine but why not let's just go for a thicker spoke with okay we also want a layer this layer here into so the lower copper layer just above the bottom copper layer we want that to be a power power plane specifically 3.3 volts we don't have to draw it again we click on our original copper layer press ctrl d and then left click and we've got another one so you can press e to open the properties we change it to in2 and we want 3.3 volts click okay there we go now we have two of these layers on top of each other well not on top but on separate layers and you can see here the places where it should be 3.3 volts it's filled down and to have a nice big chunky uh ground and power poor okay and this will make our routing life a lot easier because anyone time we need power i know for example 303 volts we don't have to route that all the way back to our buck regulator all we have to do is make a really short wide trace and drop a via into that power power plane and because it's a dedicated power power plane and a dedicated ground plane we're going to get really nice low inductance okay so with that being said let's start with routing so i'm going to move to my front copper layer i'm going to select my 0.3 millimeter track width and the first things i root are the first things i did in layout as well so specifically anything important such as decoupling capacitors the crystal uh stuff like that so anything high speed and critical i will root first so let's do that so i'm just gonna go around the board decoupling capacitors fairly arbitrarily i've got my crystal here just click because we've rooted because we've done the layout i think fairly nicely it makes our routing job a lot easier right i could just click and draw it out i don't have to move stuff around my routing job is a lot easier now because i just spent a little more bit more time during layout okay all the decoupling capacitors first we could move some of these closer but to be honest this is this is probably pretty pretty fine as it is all the ground and power connections you know like 3.3 volts we're all going to do later with vias so that will come fairly close to the end for some of this i could use thicker traces um for these kind of connections but to be honest i've always fared pretty well with these okay so that's already pretty much all the the kind of really critical ones with this part i could root the led here and i could maybe put a thicker track down here now now sometimes you'll have there's this thing called tombstoning which happens with with pcb assembly specifically for small smd parts something like 0.402 and the like that tombstoning occurs if you have une uneven mass distribution so you have a larger thermal mass here and a smaller thermal mass here for example and that might cause one side to heat up quicker than the other and might cause the part to kind of flick up and look like a tombstone true to be told i have never ever had a problem with that and i've done some pretty crazy mass distributions to be honest like a lot of power planes on and poured cup on one side and finished traces on the other side i haven't had a problem so far i might just be lucky uh or uh maybe jlc pcb is just doing a too good of a job or they yeah so i think um but just be aware of that be aware that you don't want to make them too uneven the mass distributions but something like this with a finished trace here and a bit of a thicker trace here absolutely fine okay so i'm just going to scout around the board and see what what stuff i can link up okay i could connect sdl and generally with track spacing you see here i went up and then i went immediately right a tiny bit to give these two signals a bit more space to avoid crosstalk interference and all that generally i know two to three times the track width is is what you should be aiming for okay i could change the track size to maybe a thicker trace but this is okay okay what else do we have we've got a lot of ground here of course we've got our uart so again i'm gonna route it out here and immediately come out same thing here give myself some good spacing between the traces so again i like to check in the 3d viewer several times that things look fairly decent okay of course i could move these two resistors in closer should i do that maybe i should do that yeah just to make it look a bit nicer there we go and then i can just connect them again i just i just really like using the 3d viewer just for kind of a reference we also want to use root our serial wire debug now serial debug you might think why didn't i root that right at the beginning it's actually really low speed protocol so only maybe i think up to four megahertz or something like that so nothing entirely critical there we go so just route it out put that in there now i could see i don't want to do this yeah i've got swo as well so i could either go through here all right and go go over here which i actually might do to be honest i could also go the other way around but that's really matter and then here i'm just going to drop a via i press the v key and i can just kind of diglet my way over here and i'm keeping all the tray i try to stay as much as possible on the top layer but i have a really short trace on the bottom layer for four layer design not too critical but it's a very small jump just so make sure i can follow the traces i also have my swo so let's root that and that can just fit nicely in between this connector here yeah so again 3d viewer just to make sure things are looking all right looks pretty fine we've got enough clearance between all the traces yeah that things look fairly fairly decent okay uh we also have the n reset line which you could do at some point as well but i think i might save that just just to the end i kind of just want to do the power stuff first so let's do the power stuff first so there's two ways i typically do that one is i either use really thick traces right i just click on a thick trace and then i start routing or you can actually use copper paws so you can add filled zones and for example if i want to do this thing here click once i want it on the front copper layer and i want one back in so i can choose that and then instead of rooting traces i can just root essentially as a copper pot right and then press b to fill the zone and you see it's kind of filled the whole zone for me and i want to make one if i want to make things thicker i could say minimum width maybe 0.4 i don't need that much of a clearance things like that right so you can either do it via traces or you can do it this way with filled zones let's save a time let's just do with with um tracks i think it looks cooler doing it with with copper paws and there's some advantages to doing it but as i said for the sake of time let's just use really chunky traces so 0.75 millimeters there's a thing in keycard called the calculator in the main menu uh over here if you're worried about how much current capabilities your traces have you can just go on track with and then you can say oh i've got a 0.5 millimeter track for 20 degree temperature rise i can carry 2.6 amps so as you can see a small really thin trace can actually carry quite a substantial amount of current without heating up too much so 0.75 millimeters for this very low power board is absolutely fine so again just rooting we've made our layout job easy easy-ish and that means our routine becomes easy as well so here i didn't just seeing not entirely aligned i believe you can use a shortcut like n or something to to make the grid smaller but i'm still very manual with a mouse okay so just link everything up again i could use wider traces here with 0.75 millimeters is as we saw more than enough if you use thicker traces of course for example for something like this i could use one millimeter um you will get of course low inductance which is something you you typically want in these kind of power circuits so yeah but but as long as you're well within the current carrying capabilities you will typically be safe okay we still have to root this directly and we also have this five volts from the usb and this little buck thing over here let me just finicky okay so we have a lot of 3.3 volts and power not connected yet and we'll come to that in just a bit remember i said we're going to do that with vias what i'd like to do now is just connect this 5 volt thing up so typically for usb these kind of fine pitch things half a milli millimeter is pretty good okay um okay we still have this power indicator led up here and other than that we've got the ssn reset signal we could do that now so again switch is 0.3 millimeters it's not a critical trace let's see how we want to root that uh yeah i mean it's not it's not really entirely critical so maybe actually let's do the usb one first now usb i said we want to use um controlled impedance differential traces now you can easily either use the keycard calculator again and the calculator will tell you all you need to know about the transmission line kind of effects so if you have a microstrip line if you have any sort of completely wave guide you can calculate all that depending on your pcb parameters luckily for us our life is a bit easier we just use the glc pcb impedance calculator if you go over here i would like to know the impedance and trace space for diff for usb you want a 90 ohm differential impedance four layers we're using a 1.6 millimeter thick board and it's rooted on the outer layer as a differential pair now we have to tell jlc pcb what trace space in mils so not millimeters we're going to be using i typically go for the widest given here which is eight mils okay so for eight mil trace space so the spacing between the differential pairs the recommended trace width is 10.28 mils awesome and this is for the certain stack up i typically use which is the default pretty much so we go back to keycard we go back to our edit pre-defined sizes in the track window go to differential pairs and we can type in mils directly you don't have to type this in as um as millimeters so it was 10.28 mil the gap was eight mil we're not going to be using vias but we're just going to fill an eight mil via gap click okay and we've added some differential pairs if you want to root those differential pairs click on root click on differential pair right click click on select differential pair dimensions width 0.26 this is our custom one we made all you have to do click and start routing and it will root as a differential pair there we go and it'll try to kind of match the lengths and stuff with that and make sure it maintains his eight mils of distance but of course when going into these ics you can't maintain that okay now we need to read the other side of the connector so again just click and go and remember because we named them d plus and d minus like this a keycat knows that these are differential pairs and they should be rooted that way if you go root differential pair and click something that isn't named that way it'll say you know it's not named properly so either np or plus and minus okay so that's looking all right what else do we need to do so basically there was the end reset thing now so how about we do that so in reset i'm just gonna move right out here again just a fairly short trace just to jump across and we can again really like this okay we still have the boot zero again another really low speed signal we don't really care too much how we root this sorry that should be more than fine okay not the prettiest but it'll definitely do the job so i think all our signal traces are pretty much rooted now unless i'm mistaken all the power stuff has been rooted yeah so all we have to do now is connect all the grounds and 3.3 volts so let's have a quick look at the 3d view again everything's pretty much rooted a very very very simple board but now we can pretty much just root uh all the power and ground so i typically stick with the normal via sizes if you want to go larger you can add them here so if you want a one millimeter and 0.6 millimeter drill you can do that if you want to do smaller it depends on what your manufacturer can do typically for most signal traces 0.8 and 0.4 is a good vrc size so how about we just stick with that so click on the little video button here add fears if you click it's all have no net to begin with but if you just drop it on something which has a net it'll actually adopt that net and what we want to do with vias is get them as close as possible but not in the pad you can do vn pad but the problem is with assembly some solder paste might get sucked through so i try to put it as close as possible to the pad you know something like this and one via pretty much next to every one of these pads if i have a bigger class like this i might put two you know one here and one here but typically one is pretty much sufficient so now i'm just going to hunt out all the 3.3 volts which need to be connected which aren't through-hole and just put them as close as possible to where they need to be of course it depends on the current capabilities you need you might need to put more down we'll come to the power section in just a bit because that's a tiny bit more interesting pop one over here and we'll then do the same thing again for all the grand stuff so here i might want to put maybe two because this is the vdda pin i might meter essentially the more va's you have and the closer the viewers are spaced together the less inductance you will have and that's that's something you should definitely be aiming for okay this is a tiny bit boring so i apologize but okay and then i use thick short traces so i switch to 0.5 millimeters and i link all of these up all right all the 0.3 sorry the 3.3 volts i link up thick short traces v is close to the pads but not entirely in the pants we'll have a look at this in the 3d view in just a second and the nice thing is because we have this there's this solid ground plane right on the second inner layer all these points are got a really nice solid ground plane uh so yeah really low inductance exactly what we want okay now i said we come back to the power section the power section i typically drop quite a boatload of fears around it right minimize inductance make sure the power handling capabilities are what we want them to be all right so just pop a couple around here and then i pop some next to here as well these large 10 microfarad capacitors and then of course the feedback pin and the feedback pin i'll put quite a number as well so all right we just want to make sure that inductance is a is as low as it can reasonably be again i'm going to use very large traces you could use a ground paw for the sake of time i'm just using very large traces you can kind of lick them up like this but basically doing with the ground pole would be much neater right okay uh i just use the 0.7 millimeter trace here okay and that means pretty much all the power here is nicely linked to the internal uh 3.3 volt copper pole yeah okay okay one note uh also regarding the crystal in the previous video i actually cleared out this area underneath the crystal so you can do this by adding in for example a keeper area so i would put a keeper area here say in one and then keep out copper paws so i would oh then i'm just gonna do it very roughly now but you could do something like this all right where you just make a this is very shabby so i advise to do it a bit cleaner than i'm doing right now oops so one thing also regarding the crystal is in the last video on the first qcad stm32 video i also put a cutout around this area and kind of attached the ground of this crystal only at one point now i've heard a lot of people did not need to do this and their boards have worked fine without this if you do want to add the cutout which some data sheets recommend you do you can add this keeper area and just draw on the front on the in the copper layer keep out copper pause click ok and just make sure under the crystal and under the crystal traces that there's no ground fill and then you would just attach the grounds via thin traces to the main ground island right so here you can see it's cut out and then you'd use just really fairly thin traces from ground into the main ground and fill now as i said just now a lot of people didn't have to do this and their crystals just worked fine so we won't do it in this video okay so let's have a look now we need to do the same thing we did for the 3.3 volt lines for the grounds so again click on via drop it somewhere where there's a ground change the grid size and we can pretty much just go go mental again close to the ground pads themselves or make sure you're keeping enough clearance from all the traces okay all right what else do we have we have these over here again this is a bit boring but unfortunately necessary but of course this is much easier than rooting ground and power on a two-layer board and as we saw it's it's really inexpensive to do this in terms of manufacturing and it just i just feel like it makes the board look look a lot cleaner as well so uh okay before you do the power section i almost got carried away there let's do these grounds so one per pad has a minimum i'd say okay i'm always just pressing ctrl d to duplicate for this power led over here i'm going to put an array here next to the usb connector again just minimize inductance because this could be a power source as well right i'm going to make sure okay so now we're pretty much back at the power section as we did with the 3.3 volts we want to pretty much scatter this with loads of ground uh va's as well ideally tightly packed and a fair number of them so that's what i'm doing right now of course you could use creative ears if you require greater current carrying capabilities but for our purposes here this is this is definitely more than enough this is my my tried and tested method and it works which is always good okay we're coming close to the end of this via placing mania because the the v is here the same net we can place them very close together you just have to watch the drill to drill distance that is that that isn't what your manufacturer can't do okay in just a couple of years from the ground pin right here okay now again white traces let's link them up so just go through all the vias we just placed thick short traces to link everything up i'm not sure did i use one millimeter here i believe i did again all right again we could we could have done this with kind of ground pause but it's all right okay now we have all of this stuff all of these did i use 0.5 i used there okay so 0.5 here again the whole tombstoning thing just be aware of that i could put another via next to the crystals of course one thing i would be aware of is that you don't want to put vias on silk screen because that just makes it look really really rough right you're gonna you're pretty much drilling a hole into the silk screen that isn't great so i don't recommend you do that of course you don't want to limit or hinder the functionality okay here i missed one of the 3.3 volt connections or vias okay so let's see everything looking alright okay this one needs to be linked and this one needs to be linked okay so that's pretty much that now of course you have to do this ground thing over here these ground connections so small trays because of the limited by this connector and then we just link all these up by thick traces again a power pole would be much neater we of course need to link this up to the internals of this i see as well might need a thinner trace actually um let's actually add another one a 0.4 millimeter track see that here oops selecting it would be good okay so just through here and here and i just did that so i can actually get out here with the ground and as soon as i'm out i'm just going to drop a video okay so we have this thing here because it always thinks these are all part of the same net i'm sure there's more elegant way of solving that but for now this is fine okay so i think we are almost done there's a couple of loose connections here but that's pretty much the routing i think done so press b again just to refill all the ground pause and then we can do the first design rules check click that and we can see run drc we can see i have zero problems so nothing's too close nothing's uh you know crossing over or anything and we have no unconnected items that's really good so we can go through 3d viewer and see okay yeah this looks fairly decent we've got power traces nice and thick we've got spaces space and clearance between the parts i need clearance or the higher frequency signal traces and we've got v is at pretty much every ground and 3.3 volt point so that's pretty good uh yeah so what's left to do now is of course you check the schematic again you check your routine you check your layout again we could add 3d components just to make this board look a bit nicer but instead let's focus on time on actually making this board a bit more usable and we have to add silk screen to do that so silk screen we need to add for example to tell people what they are actually plugging into so click on silk click on add text let's change my grid again this connect up here was an i squared c so so i could just put that over here this connector down here was a uart connector i mean it's it's kind of obvious but i'd like to put it down somewhere as well this is just the usb and this could be data anything and this is our kind of power connector right power what else do we have this is our boot mode switch so boot mode over here again 3d viewer just to see we want to label everything pretty much that's all i'm doing now i'm just adding silk screen to label stuff and i'm sure you can do a much nicer job than i'm doing here sake of time you can either call this swd or debug and put it next to the header here we want to indicate that this is the power led or we could say this is a 3.3 volt led for example and we could indicate that this led down here of course is our status led all right so you just want to make sure the user who's ever going to be using this board you've marked the relevant things so you've got the power input the usb all the terminals are doing that one of them is zero wire debug and stuff like that all right uh also see this is currently a socket but we actually want that to be a header so that's why the 3d view is useful as well because i selected the wrong footprint now way to remedy that is just go back to the schematic double click here and change footprint and i want it to be not a pin socket i want it to be a pin header a pin header and 1.27 millimeter pitch a pin header and it's a two by five yeah so that was my mistake vertical smd okay again i'm just going to re-export the netlist go back to here and again update pcb from schematic so now unfortunately that was my mistake the pin assignments have kind of gone out the window this is actually what it should be like so uh we kind of have to do a tiny bit of rework on the re-routing okay so the end reset line i'm just going to over here again once i switch to other layer i don't like staying there for long so as soon as i can i'm going to come up again with a via and then just route myself to the n reset pin over here uh the swo we need to connect i saw your clock i saw vdio okay uh okay now we just need to do the the ground and the 3.3 volts okay well so this is a lot of the still screen already done what we're missing now is maybe a logo which you could put somewhere here and we could also indicate the polarities of everything and also the pin one locations and that's something i think you should always do so to do that i go to the silk screen layer and i click on this add graphic circle and then let's go to my pinned ones and just draw a circle you might need a smaller grid for this but it doesn't have to be very large this is just to indicate essentially to the assembly house make sure this is pin one right so all my ics let's see here's another ic i will just draw a little circle right next to pin one to indicate yes this is pin one i know keycard has some internal kind of marking system but i don't think it's immediately obvious which one's a pin one and which things aren't it doesn't really matter what they look like just make sure there's a little dot there indicating pin one okay so i typically just draw an arrow just to indicate for something like a zero wire debug connector yes this indeed is pin one and i should orient my connector correctly so you need to do it just by drawing silk lines if you want the arrow filled in you can use this add graphic polygon tool over here other than that we also need to annotate the polarities of the diodes so light emitting diodes and normal diodes i just use the silk screen layer click on text and i just put in a little plus typically i make it 0.8 0.8 and not very thick i don't want this to be too visible just visible enough that the manufacturer gets it correct okay so we have one diode here and we have one diode here again you don't want to put the silkscreen directly on the whole of the the via otherwise you're going to something that doesn't look very nice so in this case i've kind of put it next to it right also you don't want to make it too confusing this plus looks like the connector might actually be the plus side here where's the plus side of the connectors over there but that's something we should indicate as well so next to my connectors i typically make a much larger sign saying here this is actually the positive terminal okay and this will be visible even when the connector is then mounted on top and then from that it's fairly clear that the other side must then be the negative terminal at least one would hope it would be we also of course want the light emitting diodes to have polarity markers one here and one on this side okay is there anything i've forgotten is the question of course we also have the boot mode switch up here and it would of course be nice to know as a user which way do i need to push this to make sure i'm actually putting into it the mode i want it to right so we could just call it boot or we could just move another one down here and call that run because remember when this thing is low uh when this which is pulled low we're on run mode if the switch is pulled higher in boot mode so that way you can quickly see uh-huh this is how to how to set this switch okay so just just i would always recommend just be clear on your silk screen as clear as you can be another thing i typically do but i typically do that on the back sill screen is uh just say what what pins are what right i just might just put a minus sign here this is ground i might put a plus sign here this is a 3.3 volts and the rest you know sda sel but for the sake of time uh i'm not going to put that on now this is just again the majority of this video should be just focused on this s1032 and possibly this back regulator as you can see i've also added some extra still screen that includes a logo a little little logo here and just the name of the board you can also of course put the day to the board when you made it and that's probably a good idea but every revision number i think is a minimum is what you should do in the previous video i told you how to make these um silk screen logos but i won't go into too much detail essentially all you need to do is get a graphic you have preferably black and white and then all you need to do is use that bitmap to component converter and create a library footprint import the library and then then it'll appear as a footprint here to make sure this footprint doesn't disappear double click and click lock footprint so anytime you click update pc from schematic this sill screen won't disappear what we want to do now is actually get this thing ready for manufacturing and assembly so let's do that the first thing we need to do is because you want to hide the order number jlcpcb typically adds an order number or you can pay to remove it but we can also place it underneath a component to hide it completely the way you do that is go to the f silk layer click on text and type in jlc four times make sure it fits so let's make it a tiny bit smaller all right so we've kind of just hidden it under this component so in the 3d viewer we can see this the number is now hidden and that's where the actual order number will get printed instead of getting printed on the middle of your board or somewhere if we're doing a new assembly we should also add tooling holes as well now there's two ways of doing this either you add effectively a like a mounting hole or footprint of a certain size or you can use the edge cut slate layer and draw a circle of a certain radius so we can do that uh just click anywhere edge cuts layer and we want a radius of a 0.576 i believe and you want about two or three of these holes scattered across the board so that's one way of doing it i think i've actually made a footprint of the tooling hole yeah so glcp pcb mounting hole i've just made it have a little footprint and i'm just going to put four of these in convenient locations now you can get glc pcb to do this for you but you know might as well might as well do it ourselves so just two or three you could do more but they don't really need too many of them okay again it's probably advisable either to put these in your schematic or to click lock footprint on all of them all right so lock footprint lock footprint and lock footprint and that's pretty much all we need we need a couple of these tooling holes and we need to hide the order number by doing this and once we've done that we're pretty much ready to export the files uh to so we can send that off to jlc pcb okay so here's my folder which contains my kicad project what i'm going to do is create two additional folders one is called gerber and the other is called assembly so once i've done that we need to create the gerber files and all the assembly files the first thing to do is the gerber files so click up here file plot and then we choose our output directory which will be gerber and yes i would like to use a relative path first of all let's generate the gel files essentially all these settings are absolutely fine click generate jira file all these settings are absolutely fine and click plot maybe actually let's get rid of generate gerber's job file it'll ask us if you want to refill the zones let's do that awesome again you might want to check again the dlc is okay and so on but we've already done that before okay so now we've got all the gerber files we can go back into the folder and we'll need to zip these so obviously right click and add to gerber.ra and let's just call that a sensible name to driver how about that because that's what then we'll upload to jlc pcb okay next thing we need because for the pick and place machines we need to put the centroids of each of these components the way we do that is via footprint position file so click on file fabrication output footprint position file but now let's just put in the gerber file we'll move down a second i typically include this as well all of these are fine and click generic position file okay now let's move that over to the assembly part i typically rename it you don't have to i'll add this in notepad because there's a couple changes we need to make um for glc pcb to recognize this because they have some sort of automated system so change ref to designator change valve to value package i believe you should change footprint pause x change to mid blank x and pause y to mid blank y rot to rotation and side to layer all of this is on jlc pcb's website as well after this is just in condensed form so we have everything here uh yeah so that's pretty much all good now we actually need to go to the to the schematic again because we've created the position file and we created the gerber files we need to create a bill of materials now so let's go back to the schematic which is here and we're also going to give all of these components essentially part numbers and this is a bit boring but you can click up here click edit symbol fields and we're going to add a field here i'm going to call it lcsc blank part blank hashtag or number and this will create an additional column here and what we need to do now is essentially go to jlcpcb click on this link here click on in stock parts and essentially the short link is glc pcb.com parts now for all the parts we have here we essentially need to find the lcsc part number so i will just show you a couple uh how i do this and then uh i'll just skip over it because it's always just repetitive so if i want to find a 10 micro farad to 1206 i go to geosys 10 microfarad 1206 it'll load and you can see i've got one basic part which is exactly the one i want 1206 it's 10 micro farad it's 50 volts perfect so i copy this lcsc part number put it in there and so on so i do that for the passives i do that for everything else so i could do another one for example this stm32 i'll copy the name paste it over here it's a basic part which is great open it up copy the part number and that's that's pretty much all you have to do so i'll just do that and then i'll get back to you so i filled in all the gaps or the ones that could be filled in in the lcc part number as you can see there's still some empty spaces here and these are things for example like the mounting holes of course they're not gonna have a part number but also things for example like these all these connectors and through-hole components unfortunately jlcpcb doesn't offer that yet they might do the future i hope um but yeah so all of these these through-hole things we're gonna have to solder ourselves uh but yeah but all the all the kind of smd parts we found at the library we can put in the part number so once you're done with that click apply saves command and continue and click ok next thing you want to do is actually export the bill of materials we do that is click on bom and there's actually uh someone wrote a qcad kaicad jlc pcb assembly service bom i believe you just google it you'll find who did that downloaded that and that'll then export the relevant fields and we don't have to do any more editing so i just click on generate and then i look back in my folder here it's put it over here and i move that into my assembly folder and the structure of that we can just have a brief look at looks like this right it's just the designators the footprint part numbers and kind of a comment of what the value is so now we can go ahead with ordering on the jlc pcb website you can just click quote now it'll take us to this next site we want to upload our zipped file of the gerbers which is right here double click on that it'll upload and process the gop files and we'll also have another chance to look at the gerber files using their online gerber viewer i'd also recommend in general with most pcbs just use the overview up here just to check sure make check and make sure that your ground fills are okay your copper poles are okay all the traces look good the clearances and so on but you can also do that in the in the keycard kind of sorry in the jlc pcb go overview it'll import how many layers we have it'll import the correct dimensions what we now need to choose is the quantity there's only one different design all this is pretty much fixed one thing we do want is impedance control so click on yes here and this is the stack up we want this is the one we we designed the differential pair for for assembly we can only choose green at the moment and i would urge you to either get lead free hot air surface leveling or this enig over here so let's go with lit three and yeah remove order number is important remember we specified an order number location to click on specify location next thing you need to do is we want smt assembly so click on that we put all the components on the top side for a reason and this is the reason because well on the top side assembled here we go we want five assembled you can get up to 30 assemble at the moment i believe we've added tooling holes ourselves so click on add by customer click confirm and just wait a tiny bit then once it saved that you can click next okay so here we have to upload all our kind of assembly information that's the bill of materials and the footprint position file so click add bomb navigate to the assembly folder upload the bom same thing for the position file and then we can just click next the next step is we actually need to verify our data with what uh the automated system of jsc pcb has found out so we compare this left side with this right side to see everything matches up so make sure 10 micro henry and the footprint is the same as time micro hair and henry in the footprint here and you would go through this list check left and right and make sure everything is okay i've already done this for you some parts will not be selected of course for example these through-hole parts of course there's nothing in the library we actually chose but yeah but check that and then click on next so here we can actually verify the parts placement to see if everything is kind of the correct position if the orientations are correct and so on it'll actually also show you the total price and for me this is about 56 euros for five boards of course it gets cheaper per board the more boards you order but still about 11 11ish euros per board excluding shipping is pretty pretty good okay one thing that is left to do is actually correct the parts placement uh there is also some tiny bug in the jlcp gober viewer sometimes where these pads are drawn a bit weird but you can typically ignore that and the boards come out as you send them off but yeah one thing is we need to connect correct the orientations now you don't have to do this essentially glc pcb will do this for you because we've marked all the pin one locations as well as anodes and cathodes of the diodes so but i typically do it anyway i just i guess close my conscience so we open footprint position files and we kind of put these two things next to each other let's start with u2 u2 is 90 degrees off now the the system the coordinate system they use essentially the rotation is positive counterclockwise so that means we have to rotate u2 backwards counterclockwise by 90 degrees so you can see on the left here we this is our rotation so we have to subtract 90 degrees and it wraps around to 360. so that's 270. so let's have a look at u1 and u3 u1 is 180 degrees off so that's easy that becomes 270 and u3 is the usb thing over here that's also 180 degrees off so you just make that zero and i believe it's because keycad and glc bcp use different standards of rotation okay we also need q1 to be rotated by 180 degrees what else do we have the diodes seem to be correct inductor doesn't have an orientation uh the diodes i think are typically correct so i think that's all we had to rotate is these three ics and this component over here so we can go back because we've saved this in notepad and we can re-upload the data so we can re-upload the footprint position file click next and then click next again and with any luck everything's correctly rotated right everything's lined up with the pin one locations and everything is looking good again ignore the pads looking like this that's just i think some little bug in their viewer once you're happy with that all that is left to do after of course you've checked everything is click save to cart you'll have to of course solder these kind of through-hole parts yourself but to be honest for that price and yeah this is this is pretty cool that this is available these days that being said click save to cart you can choose your shipping option and that's pretty much it so i i do hope you enjoyed this video i hope you learned a tiny bit even though it's a fairly long video if you haven't subscribed already please do subscribe and leave a like if you like the video if you have any if you have any questions please leave them in the comments thank you very much for watching and until next time
Info
Channel: Phil’s Lab
Views: 668,522
Rating: 4.8431816 out of 5
Keywords:
Id: C7-8nUU6e3E
Channel Id: undefined
Length: 170min 28sec (10228 seconds)
Published: Sat Sep 26 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.