Raspberry Pi RP2040 Hardware Design | Altium Designer | JLCPCB

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this video i'd like to go through a complete pcb design using the new raspberry pi rp 2040 microcontroller i've made a little pcb this is about 50 by 20 25 millimeters also cast lighted holes that you can mount on a carrier pcb for example and solder these pads down to the other pcb this pcb contains everything that the rp2040 needs to work so that includes qsbi flash memory is a buck converter to produce a 3.3 volt rail all the decoupling capacitors usb series termination resistors crystal oscillator and so on so all the minimum equipment required for this rp2040 to work and i've broken out all of the signal pins to these castellated pads i'd like to show you this design just the schematic how i did the routing and layout and i've done this in altium but of course this transfers to every other pcb design software keycad as well so i hope you enjoy the video and let's get started a big thank you also to altium for sponsoring this video i use outcome designer for my work and also in my spare time as well i find it quite easy to use a lot more powerful than keycard at least in its current state and it lets me really get quite intricate designs done example high speed or any anything more complicated and they are actually offering a free trial for you to get started so if you just follow the link i'll leave it in the description autumn.com slash altum trial dash flow again i'll leave the link in the description and it'd be cool if you just check that out now at the time of making this video the rp2040 was released not too long ago so it's a pretty new mcu and it looks pretty interesting and also how you can program it with micro python and so on in future videos i would of course like to go through also the programming of this device and see how we can actually use that in real world applications glc pcb actually stocks this part as well which is really nice it's an extended part and as you can see it's rather cheap it's a one about 1.20 and they still have a couple hundred in stock so i suggest you maybe try out your own boards after you've watched this video and try to come up with your own designs i've actually ordered this board with jlc you can see here i've put it in and it cost me i think i know just about a hundred dollars to get 10 of these boards made so that's that's really quite cheap and i'm looking forward to playing around with these when i get them in my hands but for now i just want to walk you through the design process now there are two main documents you'll need when you start designing with this rp2040 microcontroller and one of these is the datasheet itself and this is a pretty long document about 650 pages it contains everything about the registers about pin descriptions and so on which pins are multiplex like i squared c art and so on but a big help for actual hardware design is this hardware design guide a hardware design with the rp2040 so i encourage you to look through that it's a far shorter document with only 32 pages and a lot of my design is actually based on this document so you can see for example how to do the power supplies how to place the decoupling capacitors voltage regulators the storage crystal oscillator and so on but i'll walk you through this in my design one by one so let's get started so here we are in autumn designer and looking at the schematics the schematic consists of two pages which overlay borders one and two power and mcu so first thing before we get into rp2040 design is how i actually label my components when i have multi-page schematics as you can see one underscore power is what i've called the schematic page and that's why i start all my labeling with for example the capacitors at c100 then i go to c101 c102 c103 same for resistors and any other components so i start at 100 and label it on and then for example for the second page for my mcu page i will start at 200 with every component and that makes it really easy to see for example i'm debugging or when i'm rooting and doing my layout of the pcb where is the component in which schematic page just by starting a different number of course for a larger schematic you might start a thousand or two thousand so back to the power supply i chose to use a buck converter here just for efficiency and that i have a quite a large input voltage range for this i typically always go to jlc pcb.com and their parts library so if your glcb.com parts and then i search for example for dc dc converters i wanted a pretty small package so this sot 23 6 pin package is just right it's got quite a lot of output current which is overkill for this rp-2040 but maybe i want to power some other things with this board and it has an input voltage range up to about 28 volts so that's really good so the schematic is pretty much taken directly from the datasheet again the datasheet you can find uh also via the jlc pcb parts library it tells you how to calculate all the values for the inductors capacitors feedback resistors and so on and that's pretty much all i did so my output voltage is 3.3 volts and all these components inductors capacitors feedback network are chosen using the help of the data sheet it's as simple as that as you can see i also have all of these pad components here and these are actually later than going to be used for the castellated pads of this pcb so you'll see them a lot throughout this schematic i also have of course an indicator led which i always think is quite nice to indicate that at least some sort of power is being applied and this regulator maybe is working another thing i do is label each and every net in my schematic this is really really useful when you're rooting later on so for example my vcc is named even my enable pin here i put a little net label for my bootstrap capacitor switch output feedback every single net in my schematics are labeled and that really helps when you're rooting later instead of figuring out you know what is c104 pad one for example this really helps i encourage you to do that in all of your schematics and that's pretty much all there is to this buck converter design i haven't included any esd protection and so on because i assume that will be placed on the carrier pcb so moving on to the second page of this schematic this is the actual rp2040 microcontroller and it requires some external quad spi flash memory which we'll talk about again almost all of this information i'm getting from this hardware design guide with rp2040 from the raspberry pi website but i'll just go through it step by step with you in altium so as usual we have all our vdd and power supply pins at the top and our ground pins at the bottom and for every i o vdd or vdd pin we would like at least a 100 nanofarad capacitor as small package as possible so i typically with o42 because oto 1 is very hard or at least hard to hand assemble and i believe glc pcb doesn't offer it at the moment there are some special requirements for the rp2040 especially for this vreg in and v rig out pins and these vreg pins are actually an internal regulator the inputs and outputs and that steps down the input voltage for example 3.3 volts to 1.1 volts which is needed by some of the internal circuitry so that's why you need these one microfarad capacitors placed close to vrxvn and v8 v out and i just typically annotate that in the schematic to make sure okay when i'm layouting that i typically pay attention to that as well now again the 1.1 volts is generated internally by the rp 2040 and then we can use that to feed the dvd pins of this chip again 100 nano farads per dvd or i o vdd and then we have a one micro farad for the v-ray v-out and again one micro farad for the vxvn and that takes care of all the power supply now this rp2040 pretty much only has one ground pad and that's in the center this is a qfn package which we'll see later when we're doing the layout and we have this ep which is the ground pad and that's tied to ground then on the left side here we have all the gpio connections so these could be pwm outputs uart i squared cspi and so on and that's detailed in the data sheet of this chip but i've just labeled them a gpa 01 to 29 and then connected them to these casselated pads which we'll be seeing later on the other side we have the usb differential pair so this uh chip supports usb 1 i believe natively and it requires 27 ohm termination resistors which are placed close to the side of the rp2040 again this is detailed in the hardware design guide in altium again i give this net names and i have to end them in either underscore p or underscore n to make sure autumn knows okay this is differential pair but i also have to give it this directive which you see here and this is indicating to algum this is a differential pair and we'll need that later for routing and these again are broken out to calculated pads then we have all the quad spi connections we have four data input outputs the clock and the chip select and we'll see in just a second how we hook that up to the quad spi flash memory then we need a crystal oscillator i believe the rp24 can actually run just with an internal oscillator but things like uart will require an external one for more accurate timing we have a typical crystal oscillator network here we have the crystal which needs to be 12 megahertz i looked at the data sheet for this specific one and it has a load capacitance of 20 picofarads and then i can calculate these load capacitors to be 30 picofarads the way i do this i start with my load capacitance i subtract maybe four or five picofarads of stray capacitance due to b2b routing and traces so that'll give me about 15 picofarads and then i multiply that number by two to give me 30 picofarads and that's why i have 30 picofarads here and here you can see that i have this sort of feed resist over here this is just to limit the drive level into the crystal so we don't over drive this the signal and we don't generate additional harmonics you might have to play around with this value of r202 just to get it right but this should probably give you the right ballpark now the device can be programmed via usb i believe but for further debugging they have these serial wire debug pins uh the clock and data io which can be useful so i've broken those out as well run is pretty much a reset or an able signal of this chip broken that out as well and test enable is i believe a pin they use in the factory when they test this chip so they'll put it high in the factory to make sure everything in this chip works and put it low when you're actually using this in your own devices so this should always be tied to ground all right so that's pretty much all there is for the rp24 rp2040 connections and remember there was this quad spi connection over here and this connects to this quad spi flash memory down here the hardware design guide says it needs to be quite a specific bit of memory and it's this winbon eight w25q128jv iq which is quite a mouthful but this is definitely supported by the rp2040 and that's why i went with it additionally the w25q one two eight jv siq is actually a basic part of jlc pcb and they've got loads of them as stocks that's really nice so jlc has the rp 2014 stock the flash memory that's supported and all other components okay so as usual for this flash memory we have one power pin one ground pin and we need at least a hundred nano farad decoupling capacitor to make this thing function properly we have all the qsbi connections here and here and we have these two resistors now these resistors as detailed in the hardware design guide are there if you want to boot for example from this flash memory or if you want to use for example usb to boot and this is detailed in the hardware design guide but these are the recommended resistors from our supply as you can see i've ridden dnp here and that's for do not place so this indicates to me later that this should not be populated for assembly and in terms of circuitry that's pretty much all there is for this rp 2040 little breakout cascellated whole board so now we can move over to layout and routing so here we are now in the layout and routing view of our team designer this is a 3d view which i quite like an altum so you can see the front and the rear sides now you might notice that these cascellated pads don't look particularly cascalated that's the way i've done it basically i have if i switch to 2d mode i have placed the edge of the pad directly on the edge of the board outline so when i produce the manufacturing files and a glc pcb they'll know okay i need to cut they need to cut the board here and this will then produce this cast lighted pad because these are plated through holes so just imagine the board outline intersects all these holes and that gives us these cascaded pads that's the way i've done it and uh i believe that should work okay so let's go the routing one by one so if i press two on altium i go up to my 2d view and i press shift s i can cycle through which layers are visible now this is a full layer board i have my top layer as you can see in the bottom here i have an inner ground layer i have another ground layer on the other side and then i have my bottom layer this is the typical stack up i use these days for four layer boards so i have signals top and bottom with ground planes on the middle and this is really great for signal integrity and emi but i do need to stitch these two ground planes together i don't do any copper pulls or fills on the top and bottom layer that is for ground or power and i typically root my power so starting with the buck converter section which i've put up here i have my power input also up here which then goes into the first decoupling capacitor bypass capacitor for this regulated ic over here now this layout i've actually gotten from the data sheet from this particular chip from this texas instruments chip and they recommend keeping the layout like this as you can see this board is actually pretty small so it's about 25 millimeters across and i've tried to keep all the loop areas for this buck converter very very tight and very small i've used copper paws to connect the for example capacitors to the output side of the inductor and also the input and so forth with buck converters you always want to minimize the area you use for them and keep everything as tight and neat as possible another thing to pay attention to is also the feedback network so we have the feedback network of this buck converter over here and if i switch to 2d view we can see it a bit better so we have the buck feedback pin over here and this is through this resistor and capacitive divider network over here i could just route the tray straight from the 3.3 volts uh back here so this is my feedback line but what i'm doing i'm placing a via routing it on the opposite side and then coming up just on the output side of my capacitors and this is typically how you want to do it you want to do a thin trace from the output of your capacitor so not taking it from the inductor and you want to root that trace as far away as possible from your inductor so that's why i switch the board side and then route a very thin or rather thin trace and then back up again into my feedback network and back into my buck converter controller so for the buck converter design again you want to minimize the loop areas and pay extra attention to that critical feedback trace traces for example the enable trace aren't that important and can be rooted in almost any way you like so minimize loop areas and pay attention to that feedback network and feedback trace then moving on to another important part of the design it's the actual rp 2040 routing for all the gpio connections all i'm doing is breaking it out from the qfn package and to the relevant cascaded holes or classified pads on the side more importantly however is the placement and connections of all these decoupling and bypass capacitors it's quite hard with the qfn package to get them as close as possible especially if you're trying to root out all of these connections but i've sort of tried to place all of these decoupling and bypass capacitors as close as possible to the relevant power pins then i have fairly wide traces going directly into these power pins like this and on the other side for example these ground connections i have a very fat and short trace going to the via into my ground plane and we can see that a bit better in the 2d view again so you can see here for example i have my 3.3 volts going with thick traces very close to my decoupling capacitors on the other side of the decoupling capacitors very thick and wide trace going to my ground via which then connects to my ground planes and this makes sure you minimize inductance and this is really good for power delivery you can also see i haven't bridged my qfn pads just straight with a trace for example from here to here this is sometimes a bit hard to see in the assembly process and the optimal inspection might give an error showing that these pads are shorted in other words you want to route your traces for example like this as i said before in the schematic view we have this central ground pad of the qfn chip and this is pretty much all the ground connections for this chip we use some vias again into the ground planes below so again keep your decoupling capacitors close short white traces and then short white traces on the other side of the capacitors to ground for your ground planes other than that try to keep space between your traces so as soon as you can break away you should widen the space between your traces to minimize crosstalk and coupling so that's what i do of course with the q of n package is quite hard but again as soon as you can break them apart these traces do so another critical part of the routing is actually the placement and routing of this crystal network over here you can see we have the feed resistor we have the two load capacitors here and the crystal i typically try to route the traces out and then again separate them as quickly as i can and place everything in the path of this crystal so we want to minimize our trace length we want to minimize the capacitive load and we put additionally on this crystal i've put also a bit of a you can say like a guard fence these vias around it and that helps a tiny bit so these traces don't couple over into this crystal and vice versa so i just place a couple of ground views around it fairly equally spaced and then connect them to my ground points in my crystal circuit as always is the case with pcb design you want to maximize your distance between sensitive components that's why for example this crystal is on this side and the back converter is on this side also the buck converter is generally quite far away from the rp2040 and that always helps so it's all about the space as uh rick hartley i believe says keep space between sensitive components and things that might passively or inductively couple into each other which you don't want them to the qspi is over here and those are fairly easy to root you don't have to pay too much attention to them as long as you keep the traces fairly short you won't need any termination resistors so as the case here this is maybe a centimeter apart from the rp2040 and there's nothing too special here again we want to place our decoupling capacitor for this chip really close to the relevant pin this is the power pin of this device and use fat short traces to connect to the ground and power we also have these termination resistors for the usb line over here and as you can see these are the ones over here you can see i've chosen to keep these further away than decoupling capacitors in my eyes decoupling capacitors come first and then serious termination resistors if i had a bit more space on this board of course i would want to move these two termination resistors closer to the ic that's what the hardware design guide tells us as well that's fine and again this usb differential pair is rooted as you'd expect differentially to the pads over here again on the note of actually labeling your nets as we did in the schematic as you can see all of these pads have their proper net labels and this is really useful instead of suddenly just being like pad 2 of of chip u200 we actually really know what everything belongs to and that's really nice for our routing and layout in terms of power routing because i using two internal ground planes i actually just rooted power on the back so i have a large 3.3 volt trace running throughout the board and then feeding my different points in the circuit and for a low speed design like this this is absolutely fine as soon as you move into the higher speed domains you will want dedicated power planes again because we are using two ground planes we need to use stitching vias so a lot of these unconnected vias you see scattered across the board are actually just ground fears to stitch these two ground planes together and i've done that because of space constraints only in the places where i could so for example i don't have any space here so i can't place any ground vias here obviously so that was the quick run through of this rp2040 design i hope you liked the video and i'm looking forward to getting these boards back from jlc pcb in the meantime if you have any questions please leave them below in the comments and i look forward to testing out this rp2040 chip it'll be the first time for me and look forward to also making a carrier board for this and then showing it off in a future video thanks again for watching
Info
Channel: Phil’s Lab
Views: 26,092
Rating: undefined out of 5
Keywords:
Id: X00Cm5LMNQk
Channel Id: undefined
Length: 18min 51sec (1131 seconds)
Published: Wed Jul 28 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.