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:10:38 -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 09KH0ZER029151; Tue, 20 Oct 2020 13:00:53 -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 09KH0Xvj029147 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 20 Oct 2020 13:00:33 -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 09KH0N7g024780 for ; Tue, 20 Oct 2020 13:00:33 -0400 Received: from oc11expo20.exchange.mit.edu (18.9.4.51) by oc11exedge1.exchange.mit.edu (18.9.3.17) with Microsoft SMTP Server (TLS) id 15.0.1293.2; Tue, 20 Oct 2020 13:00:08 -0400 Received: from oc11exhyb3.exchange.mit.edu (18.9.1.99) by oc11expo20.exchange.mit.edu (18.9.4.51) with Microsoft SMTP Server (TLS) id 15.0.1365.1; Tue, 20 Oct 2020 13:00:18 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.101) by oc11exhyb3.exchange.mit.edu (18.9.1.99) with Microsoft SMTP Server (TLS) id 15.0.1395.4 via Frontend Transport; Tue, 20 Oct 2020 13:00:18 -0400 Received: from MWHPR1201CA0018.namprd12.prod.outlook.com (2603:10b6:301:4a::28) by MW2PR0102MB3562.prod.exchangelabs.com (2603:10b6:302:5::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.21; Tue, 20 Oct 2020 17:00:14 +0000 Received: from CO1NAM03FT023.eop-NAM03.prod.protection.outlook.com (2603:10b6:301:4a:cafe::a3) by MWHPR1201CA0018.outlook.office365.com (2603:10b6:301:4a::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.22 via Frontend Transport; Tue, 20 Oct 2020 17:00:13 +0000 Received: from cedar.nocdirect.com (69.73.180.175) by CO1NAM03FT023.mail.protection.outlook.com (10.152.80.157) 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:00:12 +0000 Received: from 25.16.187.81.in-addr.arpa ([81.187.16.25]:46270 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 1kUuza-0000xr-0I for piclist@mit.edu; Tue, 20 Oct 2020 13:00:10 -0400 From: John Lawton To: "piclist@mit.edu" Sender: "piclist-bounces@mit.edu" Date: Tue, 20 Oct 2020 10:00:06 -0700 Subject: Re: [PIC] Crystal frequency selection Thread-Topic: [PIC] Crystal frequency selection Thread-Index: AdanA+8moVI5Mb5zQj2tE99GDL0I5Q== Message-ID: References: <5F8EF750.1010301@narwani.org> <0480a0b2-d285-10da-1349-b6b688d850b6@nicolaperotto.it> <5F8F0FE8.2010908@narwani.org> <5F8F11A6.9040500@narwani.org> List-Help: List-Subscribe: , List-Unsubscribe: , In-Reply-To: <5F8F11A6.9040500@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: Pass 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=dPAwE+3Ms0zj+iMTnv7+g3Izi0334BWAK+6ZifPzowo=; b=LG/NonnTvE+wBa3/00WpXfrMQuVWepSRtXKy6DHwxez1JwOHGpmt8aw6+AspOd8V06+197WwK8TkuXWbciRl2lnGjgmNOj6HxEHPpRhM2qiD0Mt5glF4cGoP9u7b3aIXdkv1MTmqTCJ2HSoxlUciG9YcNbqbul/qazxhkAdye2U= 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 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% error)= .. > 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 close >>>> 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 "exact" >>>> 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 .