Announcement

Collapse
No announcement yet.

Question about SMD Crystal and proper capacitor placement / pin connections

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Question about SMD Crystal and proper capacitor placement / pin connections

    Hello,

    I'm making a circuit board for an Arduino project ... I opted to go with the Mega328MP for its small size and excellent capabilities.

    Anyways, I want to go with a surface mount small package 16Mhz crystal but these things have 4 pins, two are marked GND, so it seems obvious how I'm supposed to connect it up, but I have no experience with it and wanted to fly it here to make sure i'm doing this right.

    Here's what the schematic looks like:


    And here is what it looks like on the PCB:


    Here's what the final placement on the PCB looks lke:



    Are the 22pf caps on my schematic connected properly and are the pins on the crystal also connected properly?

    Thank you,
    Attached Files
    Last edited by EasyGoing1; 07-11-2019, 02:34 AM.

    #2
    Re: Question about SMD Crystal and proper capacitor placement / pin connections

    read the datasheet for the chip.

    but in short,
    keep it close to the chip - short tracks,
    keep the 2 tracks of equal length,
    keep the caps as close to the crystal as possible.

    Comment


      #3
      Re: Question about SMD Crystal and proper capacitor placement / pin connections

      Originally posted by stj View Post
      read the datasheet for the chip.

      but in short,
      keep it close to the chip - short tracks,
      keep the 2 tracks of equal length,
      keep the caps as close to the crystal as possible.
      So I'm assuming that my schematic is correct ... otherwise you would have said something ... right? I'm aware of the need to keep everything tight and close to each other ... I'm just wanting to make sure I have that crystal chip wired correctly ... thats all im lookin for here is a little confirmation ....



      I guess ill go pull up the datasheet ...

      Comment


        #4
        Re: Question about SMD Crystal and proper capacitor placement / pin connections

        The datasheet didn't have any schematic examples, but I found this project out there with this schematic so it looks like my assumptions were right...

        Attached Files

        Comment


          #5
          Re: Question about SMD Crystal and proper capacitor placement / pin connections

          It looks like WAY TOO FAR from the chip when there's lots of room around the chip to place the oscillator closer.

          Also, no input and output capacitors on the 7805? Stick a 0.1uF ceramic close to the input of the 7805 and optionally a 1-10uF ceramic on output.

          Why the DPAK 7805 ... is your board really using 500mA+ of current? Why not use a SOT223 or something similar
          You could use for example

          AP7370 : https://www.digikey.com/product-deta...CT-ND/10235831
          AP2210 : https://www.digikey.com/product-deta...CT-ND/10235831

          Comment


            #6
            Re: Question about SMD Crystal and proper capacitor placement / pin connections

            or use a 1117 - those cost penny's - literally.
            i got 70 of them for a $ from china in a kit - 7 values, 10 of each.

            Comment


              #7
              Re: Question about SMD Crystal and proper capacitor placement / pin connections

              I intentionally avoided 1117 regulators because majority of them can be unstable with low esr ceramic capacitors.
              Original 1117 LDO required esr on output between 0.1 ohm and 1 ohm...
              Some datasheets don't say it but example circuits show either tantalum or electrolytic caps (both typically above 0.1 ohm esr in low capacitance)
              Some datasheets say stable with ceramic caps but then recommend adding a 0.15..0.47ohm resistor in series with output cap. or something like that.

              The ones suggested above are ceramic caps "safe" and rated for 12v+ on input, to be safe fir. ex in case user plugs different wallwart adapter or a 9v battery etc..

              also wanted some decent current and dissiopation ability.
              I know you can get them for pennies.

              Here's for example 7805 100mA for 3 cents each / 2.2 cents in 100pcs: https://lcsc.com/product-detail/Line...5T_C90763.html

              Comment


                #8
                Re: Question about SMD Crystal and proper capacitor placement / pin connections

                You got a part number for the crystal?

                Number one when doing MCU PCB layout is having the crystal close to the MCU, shortest traces you can get away with, AND no noisy traces running next to them. XTAL IN is super sensitive.

                I don't like the 1117's I found they are only good to 15V input and not an LDO really. Cheap ones from the bowels of china have so much noise on their output voltage. Ick.
                They don't seem to care about output cap at all, like a LM317 which they seem to be a knock-off of.
                Last edited by redwire; 07-11-2019, 08:01 PM.

                Comment


                  #9
                  Re: Question about SMD Crystal and proper capacitor placement / pin connections

                  Originally posted by mariushm View Post
                  It looks like WAY TOO FAR from the chip when there's lots of room around the chip to place the oscillator closer.
                  That was just a quick throw together here is the top AND BOTTOM of the PCB in 3D image screen shot super-imposed on each other for that section of the board ... this is final layout...



                  Originally posted by mariushm View Post
                  Also, no input and output capacitors on the 7805? Stick a 0.1uF ceramic close to the input of the 7805 and optionally a 1-10uF ceramic on output.
                  PCB TOP Layers:



                  AND Bottom layers ...



                  Originally posted by mariushm View Post
                  Why the DPAK 7805 ... is your board really using 500mA+ of current? Why not use a SOT223 or something similar
                  Because I get 10 of them for less than $5 and because it will be driving - among other things - the A11117 3.3v regulator that drives the ESP8266 ... which I could not even drive that from my arduino's 3.3 volt output without pulling the arduino down to the mud to where it would not work at all ... and I had it powered from the 12 volt regulator .. I would run the 3.3 straight from the 19v power in, but im a lil paranoid to be trying that ... although I have a reel of 50 of these 3.3v regulators ... i fear that in time the 19 volts will just end up burning it out... and I don't fancy having to constantly replace regulators nor having the circuit not work on a regular basis ...
                  Attached Files
                  Last edited by EasyGoing1; 07-15-2019, 02:27 PM.

                  Comment


                    #10
                    Re: Question about SMD Crystal and proper capacitor placement / pin connections

                    Originally posted by redwire View Post
                    You got a part number for the crystal?

                    Number one when doing MCU PCB layout is having the crystal close to the MCU, shortest traces you can get away with, AND no noisy traces running next to them. XTAL IN is super sensitive.

                    I don't like the 1117's I found they are only good to 15V input and not an LDO really. Cheap ones from the bowels of china have so much noise on their output voltage. Ick.
                    They don't seem to care about output cap at all, like a LM317 which they seem to be a knock-off of.
                    Then what do you suggest I power my ESP8266 module with? It requires 3.3v and it's a tad current thirsty to boot ....

                    Comment


                      #11
                      Re: Question about SMD Crystal and proper capacitor placement / pin connections

                      According to this page : https://bbs.espressif.com/viewtopic.php?t=133
                      .. and ESP8266 consumes up to 170mA of current when transmitting. Also, another page says the start up current can be up to 320mA ... so I guess you need at least around 400mA.

                      Yeah, i guess you need at least something like 500mA for the 5v regulator.

                      Anyway... looking at your circuit boards... what else I can suggest is

                      * move the 3.3v ldo on the top side of the pcb... plenty of room, no need to have components on both sides.
                      * i'd suggest having the back side almost all ground
                      * you could have a square under the 7805 that's a bit larger than the ic cut away from the ground fill and use some vias to connect the top copper to the bottom (basically use a bottom square as extra heatsink for the regulator)
                      * when the wireless module turns on or wakes up from sleep it will consume a bunch of energy so it wouldn't hurt to have a capacitor by the input of that 3.3v ldo, maybe 100..150uF 6.3v/10v polymer? It would help if this is battery powered... if only on dc in then probably won't matter

                      * any particular reason why you're defaulting to so thin traces? Thicken them, especially Vin , Vout traces, ground. If you'll have 100+ mA to 3.3v ldo, make that 5v trace thicker.

                      * see my above comment about some 1117 regulators requiring some ESR on the output... the 1117 regulators may oscillate otherwise (cause random instability) ... and again you have the default thin traces ... thicken them you have plenty of space on pcb....

                      * may not be a good idea to have active components UNDER the area where your wifi is ... noise could affect the antenna (worse reception or transmission).

                      * seems like you could rotate 90 degrees that drv8225 header and move it near the USB ASP header ... and move that other header closer to serial header

                      Comment


                        #12
                        Re: Question about SMD Crystal and proper capacitor placement / pin connections

                        Originally posted by mariushm View Post
                        * move the 3.3v ldo on the top side of the pcb... plenty of room, no need to have components on both sides.
                        * i'd suggest having the back side almost all ground
                        * you could have a square under the 7805 that's a bit larger than the ic cut away from the ground fill and use some vias to connect the top copper to the bottom (basically use a bottom square as extra heatsink for the regulator)
                        * when the wireless module turns on or wakes up from sleep it will consume a bunch of energy so it wouldn't hurt to have a capacitor by the input of that 3.3v ldo, maybe 100..150uF 6.3v/10v polymer? It would help if this is battery powered... if only on dc in then probably won't matter

                        * any particular reason why you're defaulting to so thin traces? Thicken them, especially Vin , Vout traces, ground. If you'll have 100+ mA to 3.3v ldo, make that 5v trace thicker.

                        * see my above comment about some 1117 regulators requiring some ESR on the output... the 1117 regulators may oscillate otherwise (cause random instability) ... and again you have the default thin traces ... thicken them you have plenty of space on pcb....

                        * may not be a good idea to have active components UNDER the area where your wifi is ... noise could affect the antenna (worse reception or transmission).

                        * seems like you could rotate 90 degrees that drv8225 header and move it near the USB ASP header ... and move that other header closer to serial header
                        This traces because the damn board wouldn't route all the traces .... I literally spent hours working with it and took a lot of my traces from .8mm down to where they are now ... I wasn't hapy about it and it didn't seem to help making the board any bigger ... the only reason I have components on the bottom side was so the router could actually complete the traces... I much prefer thicker traces ... I LOVE YOUR SUGGESTION of putting a big ground pad underneath the hotter components as extra heat sync ... thats good shit right there!

                        Can you give me a little more direction on how to handle these a1117 3.3 regulators? I just bought 50 of em ... albeit cheaper than a pack of smokes ... and if they aren't worth using then what else do you suggest?

                        Comment


                          #13
                          Re: Question about SMD Crystal and proper capacitor placement / pin connections

                          they work fine with tantalum caps.
                          i dont like ceramics for that type of use anyway

                          Comment


                            #14
                            Re: Question about SMD Crystal and proper capacitor placement / pin connections

                            Originally posted by EasyGoing1 View Post
                            This traces because the damn board wouldn't route all the traces .... I literally spent hours working with it and took a lot of my traces from .8mm down to where they are now ... I wasn't hapy about it and it didn't seem to help making the board any bigger ... the only reason I have components on the bottom side was so the router could actually complete the traces... I much prefer thicker traces ... I LOVE YOUR SUGGESTION of putting a big ground pad underneath the hotter components as extra heat sync ... thats good shit right there!

                            Can you give me a little more direction on how to handle these a1117 3.3 regulators? I just bought 50 of em ... albeit cheaper than a pack of smokes ... and if they aren't worth using then what else do you suggest?
                            You can use ceramic capacitors on the output but add a tiny resistor in series with the capacitor to increase the ESR. For example, add a 0.47.. 0.68 ohm resistor (anything above 0.1 ohm, but below 1 ohm).
                            Alternatively use an electrolytic capacitor, as those by default will have at least 0.5 ohm ESR in such low capacitance values.
                            Tantalum capacitors are suggested in datasheets because by default 10-22uF tantalums typically have around 0.15..0.4 ohm esr but they're expensive and not worth it.

                            Also some more suggestions... see attached image and what I wrote on it :

                            * always try to get traces out of pads or through holes at 90 degrees, don't go diagonally right away if possible. Try to leave a few mm.
                            * also not a good idea to create Y shapes with traces. Make a trace straight and branch it at a 45 degree angle if needed.
                            When making circuit boards, there can be too little copper in the center of the Y, and in that area acid or other materials can be trapped further corroding the copper and causing some boards to be broken.
                            * you can configure the software you use to only make 45 degree bends.. use more if needed... i gave you an example with the header at the bottom. again, leave a bit more room when coming out of a chip, don't go diagonal right from the pad... leave a few mm of straight trace if possible then bend it at 45 degree.

                            * if the headers are not high speed and you don't have to match trace lengths, instead of going with a trace around a header, you could always use VIAs strategically placed near the header to move the trace on the other side of the board and connect it to that through hole.
                            Right by the header, it would be reasonable, it wouldn't break the ground fill on the bottom too much.
                            Here's an example... light green is top trace, dark green is bottom layer ... see how you can invert the traces





                            Attached Files
                            Last edited by mariushm; 07-16-2019, 04:18 AM.

                            Comment


                              #15
                              Re: Question about SMD Crystal and proper capacitor placement / pin connections

                              Originally posted by mariushm View Post
                              You can use ceramic capacitors on the output but add a tiny resistor in series with the capacitor to increase the ESR. For example, add a 0.47.. 0.68 ohm resistor (anything above 0.1 ohm, but below 1 ohm).
                              Alternatively use an electrolytic capacitor, as those by default will have at least 0.5 ohm ESR in such low capacitance values.
                              Tantalum capacitors are suggested in datasheets because by default 10-22uF tantalums typically have around 0.15..0.4 ohm esr but they're expensive and not worth it.

                              Also some more suggestions... see attached image and what I wrote on it :

                              * always try to get traces out of pads or through holes at 90 degrees, don't go diagonally right away if possible. Try to leave a few mm.
                              * also not a good idea to create Y shapes with traces. Make a trace straight and branch it at a 45 degree angle if needed.
                              When making circuit boards, there can be too little copper in the center of the Y, and in that area acid or other materials can be trapped further corroding the copper and causing some boards to be broken.
                              * you can configure the software you use to only make 45 degree bends.. use more if needed... i gave you an example with the header at the bottom. again, leave a bit more room when coming out of a chip, don't go diagonal right from the pad... leave a few mm of straight trace if possible then bend it at 45 degree.

                              * if the headers are not high speed and you don't have to match trace lengths, instead of going with a trace around a header, you could always use VIAs strategically placed near the header to move the trace on the other side of the board and connect it to that through hole.
                              Right by the header, it would be reasonable, it wouldn't break the ground fill on the bottom too much.
                              Here's an example... light green is top trace, dark green is bottom layer ... see how you can invert the traces
                              I'm using EasyEDA ... I don't recall an option to pick trace angles ... but you can customize the hell out of the trace widths ... on a per network level even ... ill have to look for the angle setting if they have it ... I normally spend a lot of time re-routing what the software does but on these images, because it took so long to find a layout that would actually route, I just left it alone ... I'll make a copy and play some more with it.

                              Comment


                                #16
                                Re: Question about SMD Crystal and proper capacitor placement / pin connections

                                Originally posted by mariushm View Post
                                * you could have a square under the 7805 that's a bit larger than the ic cut away from the ground fill and use some vias to connect the top copper to the bottom (basically use a bottom square as extra heatsink for the regulator)
                                Kinda like this?



                                Comment


                                  #17
                                  Re: Question about SMD Crystal and proper capacitor placement / pin connections

                                  like what?

                                  Comment


                                    #18
                                    Re: Question about SMD Crystal and proper capacitor placement / pin connections

                                    What the hell are you doing with that 7812 linear regulator?

                                    How are you connecting those middle pins and the tab, those are typically Vout ... you can't just wire them like that.

                                    Why don't you try recreating your circuit in DipTrace, it's free for up to 300 pins so your project should be doable in it? Here's link : https://diptrace.com/download/download-diptrace/

                                    Comment


                                      #19
                                      Re: Question about SMD Crystal and proper capacitor placement / pin connections

                                      Do you have DRC turned on while you are laying out the traces to let you know if the trace are correctly terminated, correct clearance as set in the design rules, etc?
                                      Also do the research on SMD trace layout rules.
                                      Attached Files
                                      Last edited by budm; 07-18-2019, 10:30 AM.
                                      Never stop learning
                                      Basic LCD TV and Monitor troubleshooting guides.
                                      http://www.badcaps.net/forum/showthr...956#post305956

                                      Voltage Regulator (LDO) testing:
                                      http://www.badcaps.net/forum/showthr...999#post300999

                                      Inverter testing using old CFL:
                                      http://www.badcaps.net/forum/showthr...er+testing+cfl

                                      Tear down pictures : Hit the ">" Show Albums and stories" on the left side
                                      http://s807.photobucket.com/user/budm/library/

                                      TV Factory reset codes listing:
                                      http://www.badcaps.net/forum/showthread.php?t=24809

                                      Comment


                                        #20
                                        Re: Question about SMD Crystal and proper capacitor placement / pin connections

                                        Originally posted by mariushm View Post
                                        What the hell are you doing with that 7812 linear regulator?

                                        How are you connecting those middle pins and the tab, those are typically Vout ..
                                        no, that's ground.
                                        did he link a picture??? i cant see shit - i hope it wasnt imgur - that's geo-blocked these days.

                                        Comment

                                        Working...
                                        X