 Okay now we're ready. So we had done great searchers about like buttons and USB and SPI flash but I really think we hadn't actually done a great search about crystals and oscillators and I thought that that would be a good thing to chat about because you know almost every microcontroller and also audio chipsets and some USB chipsets require a crystal oscillator and I thought it'd be good to show how to find the right crystal for your product because not having the right crystal it's really easy to get the wrong ones like you know misspeck them and then nothing's booting nothing's working and it's just like confusing and weird and frustrating so you know getting the right matching crystal for your chip is a good idea so I pulled up the the sci-fi FE 310 data sheet and you know like many chips you required to have a USB crystal now I will say that there are some chips and these are some of my favorites that when you that they have an internal oscillator that's like you know somewhat precise and when you connect them over USB they actually can synchronize with the precision 1 kilohertz pulse that comes over USB there's this 1 kilohertz like on the dot pulse that the host computer sends and the chips can synchronize with that and they tighten up their built-in resonator they PLL against it to be able to get good enough 12 megahertz or 24 megahertz or 48 megahertz internal oscillation to be able to do USB which requires pretty good timing in like the samd 21 is an example of that so really like that samd 21 can do it I think the samd 51 can only also do it famously the FT 2 3 2 RL was one and now the site Sylab's CP 210 X series historically USB to serial converters required a crystal now they don't because they synchronize over USB but in this case this chip does not connect over USB and so you do need to have a crystal driver crystal oscillator so you'll need a crystal you'll want want to look at the megahertz of course it's very important 16 megahertz and you want to find the capacitive load in this case is 12 pico fan and the ESR I will say you do not have to be you have to be on the dot for the the crystal frequency you can't do 11 you can't do 12 you can't do 20 you have to do 16 for the loading capacitance in the ESR you can you can have a little bit of variation it does not have to be like on the dot on the dot although if you can the better it is so going to dig a key now alright so let's look for a crystal this is like I feel like I'm playing Final Fantasy kind of go find the crystals so there are three well there's like crystal kids which are super cool there's crystals there's oscillators and there's resonators and it's a little bit confusing which is which so let's go to resonators first because those are like the easiest to explain so resonators are like these things and they're ceramic resonators and what's neat about them is they have three pins because they actually have like the capacitive loading built in and you can't whenever you have a crystal you can pretty much use a resonator it's not going to be nearly as precise it's going to be I think you know plus or minus point two percent plus or minus 15% but what's really nice is they often have this built-in capacitor which means they're smaller they're easier I love these for boards that don't have high precision timekeeping but you still need to have some sort of crystal so let's actually show an example because I have one on my desk so if you have I'll get real close because these things are small let's get small okay so here you've got the you can't see it but it says at mega 328 and the at mega 328 while it does have an internal resonator RC oscillator you know you want it to have really good timekeeping you want to have a crystal resonator and to keep this board inexpensive and small you'll see it's got this three pin resonator here it's I think a 16 megahertz resonator less expensive is it good enough yeah it is because the only really strong timekeeping thing that you have to do on this chip is you are and the you are plus or minus point two percent is way better than what the internal chip can match to anyways like you're not going to be able to you know for a lot of frequencies the divider for the you are peripheral isn't gonna be that good anyways it's within one percent is fine so ceramic resonator is a okay much cheaper only one component super easy to pick in place I do love them in many situations they are not high precision devices but in many cases they're good enough okay so you know think about how how accurate do you need your timekeeping that's what you have to keep in mind alright so that's our resonator okay next up is oscillators so oscillators so let's pick out you know actually I should have probably done a little more research because I want to make sure that I have the right naming let's pick out a 16 megahertz here yeah they have like every frequency no demand okay okay so this is a oscillator and an oscillator I think I think this is actually a crystal we see maximum it doesn't have the pinouts okay so in general while I don't see the pinouts here oh sorry yeah so in general oscillators when I say also there and this I don't have a pinout but I'm gonna assume this is the right thing an oscillator is is a basically it's a crystal with a little like driver inside of it and also usually has that you know capacitors inside of it it comes in it looks just like a crystal but you give it ground you give it power and it gives you a signal output so you don't need to have two pins it's for chips that require a clock in but don't have a built-in crystal driver in this case how would you know because for the sci-fi chip it tells you that there's a crystal in a crystal out if you have a crystal in a crystal out you're not gonna use an oscillator you're gonna use a crystal or if you're a cheapskate you can use a resonator but there are sometimes chips that do do not have an input and up but they only have an input and in that case you need to use an oscillator for example the WM 8960 or it's 6980 the audio driver chip that we use on the audio bonnet it's an I2S you know input output you know speaker headphone jack microphones it's intending to have a 24 megahertz M clock signal it doesn't have a crystal driver and so we use a crystal oscillator on that to give it a nice clean 24 megahertz as a square wave into the chip so now you know the difference but let's go back and we're going to go for a crystal so also just tend to be a little bit more expensive so that's the thing also there's a kind of the highest end there you know beautiful wonderful they have all in one you know you have to do almost no work you don't have to worry about loading capacitance or anything usually you give it three volts you get signal out beautiful but they're all more expensive because they have more stuff so let's look at the crystals the crystals you have two pins sometimes the package has four pins but the device itself has two pins the first thing you want to do other than of course set your active is you want to pick your frequency you know pretty much every value you could possibly want is available here but you definitely know and it's like some of them are like really weird values like 16.000312 megahertz but you know there's some there's some use for it right there's some device or you know multiplier that it works out that that's a valuable frequency in our case we want a solid 16 megahertz to match what the datasheet says next up I'm just going to look for items in stock and then you have a couple of choices the first thing is you want to maybe look at the package your case because there's pretty much two packages ish for crystals you can either have this gigantic chunky HC 49 package and they come from like this like nice belt like thin like top hat version to like they get like really tall and sometimes they get like really tall let me show you some of the really tall ones something like they're a little scary how tall they are to get like super tall you know they have surface mount versions they have through whole versions but yeah tall very tall and these are like classic crystals like if you open up your old electronics you're gonna find these in there stick you know these are the classic tin can speakers and if we go to the overhead again real fast we can look at our Arduino has one right it's got that laws and G HC 49 benefits of the HC 49 ultra generic extremely low cost but like really big so I think we're gonna pass on those so we're gonna select not those others also the cylindrical can these are like these they're also kind of like a cousin of those those chunky ones sometimes you see this also there little smaller but they're through hole only again very inexpensive the rest of them are basically you can get SMD and they all kind of look like this which is really nice it's a standard pinout they're nice and flat they come in different sizes there's like you know from 2 millimeters by 1.6 up to like 12 by 4.6 you know in general I try to I stick to the like you know 3.2 by 2.5 to 2.5 2.0 these are like the standard crystals that's what you have on this sci-fi board and then of course we're gonna look at the low capacitance and ESR if you get the low capacitance or ESR significantly off your crystals not gonna oscillate you're gonna be bummed so let's check out what they recommend 12 picofarad 80 ohms so let's go 12 picofarad 80 ohms and you know you can kind of wiggle around like it doesn't have to be exact I mean like I shouldn't say that but like it's the truth and then you have a lot of choices you know there's you're gonna pay for a wider operating temperature you're gonna pay for frequency stability 10 ppm is gonna be of course more expensive than 100 ppm also the frequency tolerance so like how closes it to the frequency and then how much does it stay within that temperature oh that frequency over the temperature range you know the better the more expensive so it's up to you to decide but you can just look at you know the the least expensive one which I think I ended up with this one the f8 238 this one is plus or minus 50 ppm 10 picofarad 80 ohms and it's got like yeah it's a this classic for pad SMD package two pans are actually connected to the crystal they're kitty cornered and the other two are just mechanical stability just watch it's symmetric you can you can flip it either way which is really nice but just make sure you get the right to kitty corner because once I didn't and it was very frustrating to solder it on the right place so you know just make sure that your package is correct doesn't that like you know you can get a crystal for like 12 20 cents and then yeah you just figure out like what is your temperature scale that you're operating at and what is the frequency requirement you have you know you will probably back calculate from the thing that's the most process you have to deal with are you generating HDMI are you connecting over high-speed USB are you doing TTL you know LVDS display driving all these things are gonna affect what your timing requirements are you know if you need you know long-term timing you'll probably have a separate RTC but for you know every day just keeping your device running at the frequency you think crystals it's where it's at and that's the great search