Received: from PCH.mit.edu (18.7.21.50) by mail.efplus.com (192.168.0.8) with Microsoft SMTP Server (TLS) id 8.3.485.1; Tue, 20 Oct 2020 11:34:25 -0700 Received: from PCH.MIT.EDU (localhost.localdomain [127.0.0.1]) by PCH.mit.edu (8.14.7/8.12.8) with ESMTP id 09KIPwib010475; Tue, 20 Oct 2020 14:26:07 -0400 Received: from outgoing-exchange-1.mit.edu (OUTGOING-EXCHANGE-1.MIT.EDU [18.9.28.15]) by PCH.mit.edu (8.14.7/8.12.8) with ESMTP id 09KIPvPX010472 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 20 Oct 2020 14:25:57 -0400 Received: from oc11exedge1.exchange.mit.edu (OC11EXEDGE1.EXCHANGE.MIT.EDU [18.9.3.17]) by outgoing-exchange-1.mit.edu (8.14.7/8.12.4) with ESMTP id 09KIPZnH024639 for ; Tue, 20 Oct 2020 14:25:57 -0400 Received: from w92exhyb5.exchange.mit.edu (18.7.71.110) by oc11exedge1.exchange.mit.edu (18.9.3.17) with Microsoft SMTP Server (TLS) id 15.0.1293.2; Tue, 20 Oct 2020 14:25:30 -0400 Received: from oc11exhyb4.exchange.mit.edu (18.9.1.100) by w92exhyb5.exchange.mit.edu (18.7.71.110) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 20 Oct 2020 14:25:40 -0400 Received: from NAM02-CY1-obe.outbound.protection.outlook.com (104.47.37.56) by oc11exhyb4.exchange.mit.edu (18.9.1.100) with Microsoft SMTP Server (TLS) id 15.0.1395.4 via Frontend Transport; Tue, 20 Oct 2020 14:25:40 -0400 Received: from CO1PR15CA0106.namprd15.prod.outlook.com (2603:10b6:101:21::26) by MWHPR01MB2463.prod.exchangelabs.com (2603:10b6:300:3d::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.22; Tue, 20 Oct 2020 18:25:38 +0000 Received: from CO1NAM03FT063.eop-NAM03.prod.protection.outlook.com (2603:10b6:101:21:cafe::45) by CO1PR15CA0106.outlook.office365.com (2603:10b6:101:21::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.21 via Frontend Transport; Tue, 20 Oct 2020 18:25:38 +0000 Received: from mail-io1-f41.google.com (209.85.166.41) by CO1NAM03FT063.mail.protection.outlook.com (10.152.81.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.21 via Frontend Transport; Tue, 20 Oct 2020 18:25:38 +0000 Received: by mail-io1-f41.google.com with SMTP id p15so5017887ioh.0 for ; Tue, 20 Oct 2020 11:25:38 -0700 (PDT) From: David VanHorn To: Microcontroller discussion list - Public. Sender: "piclist-bounces@mit.edu" Date: Tue, 20 Oct 2020 11:25:25 -0700 Subject: Re: [PIC] Crystal frequency selection Thread-Topic: [PIC] Crystal frequency selection Thread-Index: AdanD6NSfr4uC0fYRS256D+O8Wj4vg== Message-ID: References: <5F8EF750.1010301@narwani.org> <0480a0b2-d285-10da-1349-b6b688d850b6@nicolaperotto.it> <5F8F0FE8.2010908@narwani.org> <5F8F11A6.9040500@narwani.org> <6aad4f34-d2df-5783-a60c-b88141db6457@nicolaperotto.it> List-Help: List-Subscribe: , List-Unsubscribe: , In-Reply-To: <6aad4f34-d2df-5783-a60c-b88141db6457@nicolaperotto.it> Reply-To: Microcontroller discussion list - Public. Accept-Language: en-US X-MS-Exchange-Organization-AuthAs: Anonymous X-MS-Exchange-Organization-AuthSource: TS500.efplus4.local X-MS-Has-Attach: X-Auto-Response-Suppress: All X-MS-Exchange-Organization-SenderIdResult: Pass X-MS-Exchange-Organization-PRD: mit.edu X-MS-TNEF-Correlator: received-spf: Pass (protection.outlook.com: domain of gmail.com designates 209.85.166.41 as permitted sender) receiver=protection.outlook.com; client-ip=209.85.166.41; helo=mail-io1-f41.google.com; dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=IsftXd0Wc61B6BunOsf3L1yxj20/ywhKqTlC6lvndE0=; b=MWUlmefq2oe4A6qqg25peZka0wO/4JE7tbGWvpe5KpbRzs4kjbYVHB7r3a74dmtjio vvs6lm+2vQfzwQsMPpyasS53rsyW5LNjID+g875TLNY2cLxRTwe457Xhr7ZIHlK/bPA3 cyHVdPuu1FrLRVvQlnH6eckrB0QdxpXHJrhfog3VIuxME8NtoJ3paYxlHo83McUQXQur 7NlGrjqyTKex8fJhl09kao+GkWCDRviIItPMiTpywm6YQ29/a0nzcrGL24beaJO7I9br EHuM4CYsnIylwYMu6Yjr0ttMfCwo3ZallKKN6Og6G6sQ6Np0gFZSHsOXPX5O5tKdEx7U iGYg== authentication-results: spf=pass (sender IP is 209.85.166.41) smtp.mailfrom=gmail.com; mit.edu; dkim=pass (signature was verified) header.d=gmail.com; mit.edu; dmarc=pass action=none header.from=gmail.com; errors-to: piclist-bounces@mit.edu list-id: "Microcontroller discussion list - Public." list-post: x-beenthere: piclist@mit.edu x-mailman-version: 2.1.6 x-received: by 2002:a6b:1646:: with SMTP id 67mr3148117iow.189.1603218336453; Tue, 20 Oct 2020 11:25:36 -0700 (PDT) x-topics: [PIC] x-content-filtered-by: Mailman/MimeDel 2.1.6 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Errors have consequences. Poor designers will assume most or all the error budget is theirs to spend. In one application I am required to hold +/- 80 hz on transmit and an earlier design was typically 30 hz off. My design using correct crystal caps is 3 hz off. Receivers in this application benefit greatly from having the narrowest possible bandwidth. Which transmitter would you bet your life on? You don't get to know the bandwidth or frequency error of the other recievers.. On Tue, Oct 20, 2020, 12:06 PM Nicola Perotto wrote: > I don't understand... > 1) 0% error doesn't exists, never! > 2) crystals have error... > You have to maintain the error in a KNOWN, acceptable range! > N > > PS: with a "round" crystal it's simpler to calculate timings :-) > > > On 20/10/2020 18:34, Neil wrote: > > Okay, I found one... 14.7456Mhz crystal --> 59.9824Mhz Fosc, which is > > close enough to 64Mhz. > > Using SPBRG =3D 127 with that gives me spot-on 115,200 baud (so 0% erro= r). > > And there are 10+ suppliers for 3.2 x 2.5mm SMD crystals with that > > frequency so that's common enough to be low-cost and not have to worry > > about being discontinued in the near future. > > Wish I didn't have to trial and error this though. > > > > Cheers, > > -Neil. > > > > > > > > > > > > On 10/20/2020 12:27 PM, Neil wrote: > >> I had also created my own, but it's been trial-and-error (xtal freq > >> and SPBRG value) to find a spot-on crystal. > >> Now, if your spreadsheet runs through DIgikey's crystal frequency > >> selections and picks the spot-on option for me, then you have my > >> attention :) > >> > >> Cheers, > >> -Neil. > >> > >> > >> > >> On 10/20/2020 12:08 PM, Nicola Perotto wrote: > >>> Hi Neil & all, > >>> I use the attached spreadsheet to calculate baud and errors. > >>> Enter values in yellow cells. > >>> N > >>> > >>> > >>> On 20/10/2020 16:42, Neil wrote: > >>>> A bit academic, but this is bugging me... I was trying to get as clo= se > >>>> to 115,200 baud on a PIC18F running at 64Mhz (or thereabouts). > >>>> At 64Mhz, best I can get is 0.8% error using SPBRG=3D34. > >>>> Calculating backwards, to get exactly 115,200, I can't find an "exac= t" > >>>> crystal. > >>>> Shouldn't I be able to find one of those "odd" values to get exactly > >>>> 115,200 baud at around 64Mhz? > >>>> > >>>> Cheers, > >>>> -Neil. > >>>> > >>> > >>> > > -- > > Nicola Perotto - NP Engineering > Sistemi Informatici ed Elettronici > skype: nicolap > mob IT: +39 335 7162 582 > mob HU: +36 30 417 3780 > tel: +39 06 916 502 732 > fax: +39 0439 633 1191 > > -- > http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .