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 10:53:39 -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 09KHlKHt004731; Tue, 20 Oct 2020 13:47:20 -0400 Received: from outgoing-exchange-5.mit.edu (OUTGOING-EXCHANGE-5.MIT.EDU [18.9.28.59]) by PCH.mit.edu (8.14.7/8.12.8) with ESMTP id 09KHlJsP004728 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 20 Oct 2020 13:47:19 -0400 Received: from oc11exedge1.exchange.mit.edu (OC11EXEDGE1.EXCHANGE.MIT.EDU [18.9.3.17]) by outgoing-exchange-5.mit.edu (8.14.7/8.12.4) with ESMTP id 09KHlDdW027556 for ; Tue, 20 Oct 2020 13:47:19 -0400 Received: from w92expo11.exchange.mit.edu (18.7.74.65) by oc11exedge1.exchange.mit.edu (18.9.3.17) with Microsoft SMTP Server (TLS) id 15.0.1293.2; Tue, 20 Oct 2020 13:46:44 -0400 Received: from oc11exhyb4.exchange.mit.edu (18.9.1.100) by w92expo11.exchange.mit.edu (18.7.74.65) with Microsoft SMTP Server (TLS) id 15.0.1365.1; Tue, 20 Oct 2020 13:46:54 -0400 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.173) 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 13:46:54 -0400 Received: from MWHPR11CA0014.namprd11.prod.outlook.com (2603:10b6:301:1::24) by MWHPR01MB3295.prod.exchangelabs.com (2603:10b6:300:fa::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.25; Tue, 20 Oct 2020 17:46:51 +0000 Received: from CO1NAM03FT015.eop-NAM03.prod.protection.outlook.com (2603:10b6:301:1:cafe::8) by MWHPR11CA0014.outlook.office365.com (2603:10b6:301:1::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18 via Frontend Transport; Tue, 20 Oct 2020 17:46:51 +0000 Received: from cedar.nocdirect.com (69.73.180.175) by CO1NAM03FT015.mail.protection.outlook.com (10.152.80.167) 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 17:46:49 +0000 Received: from 25.16.187.81.in-addr.arpa ([81.187.16.25]:38584 helo=[10.0.0.28]) by cedar.nocdirect.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1kUvih-0002WN-TH for piclist@mit.edu; Tue, 20 Oct 2020 13:46:48 -0400 From: John Lawton To: "piclist@mit.edu" Sender: "piclist-bounces@mit.edu" Date: Tue, 20 Oct 2020 10:46:45 -0700 Subject: Re: [PIC] Crystal frequency selection Thread-Topic: [PIC] Crystal frequency selection Thread-Index: AdanCfEcpXc9KUd7TUSICH8ct4Fgqg== Message-ID: <66c56026-a340-6005-6811-6d66b4739eca@jle.co.uk> References: <5F8EF750.1010301@narwani.org> <0480a0b2-d285-10da-1349-b6b688d850b6@nicolaperotto.it> <5F8F0FE8.2010908@narwani.org> <5F8F11A6.9040500@narwani.org> <5F8F1A34.5010500@narwani.org> List-Help: List-Subscribe: , List-Unsubscribe: , In-Reply-To: <5F8F1A34.5010500@narwani.org> Reply-To: Microcontroller discussion list - Public. Accept-Language: en-US Content-Language: en-GB 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: TempError X-MS-Exchange-Organization-PRD: mit.edu X-MS-TNEF-Correlator: received-spf: None (protection.outlook.com: jle.co.uk does not designate permitted sender hosts) dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mitprod.onmicrosoft.com; s=selector2-mitprod-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bRWONHn7xQZyus7dKsP61lE2hI4BPvTzweusBBKl8JM=; b=XJI8wEE4B7RR7kk2slHOgUAQAjSAT+s8NtQVxf1Fy0t96VJhnUoZeBEh7AqcnnCdm/3qDr5v43BGOGkTmgbMCug671ImkB3d4mq9zFXHERskkllKAOn/dQ6yUUOuHHDy0o/Zsrx+d4Q8ChFRwU7IngoJswSyecioxGcHIFfJTQ4= authentication-results: spf=none (sender IP is 69.73.180.175) smtp.mailfrom=jle.co.uk; mit.edu; dkim=none (message not signed) header.d=none;mit.edu; dmarc=none action=none header.from=jle.co.uk; user-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 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-source-args: x-source-dir: x-antiabuse: Sender Address Domain - jle.co.uk x-source: x-authenticated-sender: cedar.nocdirect.com: piclist@jle.co.uk x-topics: [PIC] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Well not that specifically, but the datasheet mentioned: 3.6864MHz, 11.0592MHz, 18.432MHz for 0% error @ 115.2kBaud J On 20/10/2020 18:11, Neil wrote: > The 14.7456 crystal? > > > > > On 10/20/2020 1:00 PM, John Lawton wrote: >> But you didn't, it's all there is the datasheets :) >> >> John >> >> On 20/10/2020 17: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. >>>>>> --=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 .