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:50:31 -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 09KIhb6v012937; Tue, 20 Oct 2020 14:43:46 -0400 Received: from outgoing-exchange-7.mit.edu (OUTGOING-EXCHANGE-7.MIT.EDU [18.9.28.58]) by PCH.mit.edu (8.14.7/8.12.8) with ESMTP id 09KIhZCp012928 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 20 Oct 2020 14:43:35 -0400 Received: from oc11exedge2.exchange.mit.edu (OC11EXEDGE2.EXCHANGE.MIT.EDU [18.9.3.18]) by outgoing-exchange-7.mit.edu (8.14.7/8.12.4) with ESMTP id 09KIhB0L021475 for ; Tue, 20 Oct 2020 14:43:35 -0400 Received: from w92expo21.exchange.mit.edu (18.7.74.75) by oc11exedge2.exchange.mit.edu (18.9.3.18) with Microsoft SMTP Server (TLS) id 15.0.1293.2; Tue, 20 Oct 2020 14:43:01 -0400 Received: from oc11exhyb5.exchange.mit.edu (18.9.1.110) by w92expo21.exchange.mit.edu (18.7.74.75) with Microsoft SMTP Server (TLS) id 15.0.1365.1; Tue, 20 Oct 2020 14:43:07 -0400 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.104) by oc11exhyb5.exchange.mit.edu (18.9.1.110) with Microsoft SMTP Server (TLS) id 15.0.1395.4 via Frontend Transport; Tue, 20 Oct 2020 14:43:07 -0400 Received: from DM5PR12CA0070.namprd12.prod.outlook.com (2603:10b6:3:103::32) by BYAPR01MB5496.prod.exchangelabs.com (2603:10b6:a03:123::26) 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 18:43:05 +0000 Received: from DM3NAM03FT056.eop-NAM03.prod.protection.outlook.com (2603:10b6:3:103:cafe::40) by DM5PR12CA0070.outlook.office365.com (2603:10b6:3:103::32) 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 18:43:05 +0000 Received: from premium47-1.web-hosting.com (68.65.123.241) by DM3NAM03FT056.mail.protection.outlook.com (10.152.83.158) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.23 via Frontend Transport; Tue, 20 Oct 2020 18:43:05 +0000 Received: from 107-145-246-199.res.spectrum.com ([107.145.246.199]:58590 helo=[192.168.10.107]) by premium47.web-hosting.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1kUwb5-0014Ge-1l; Tue, 20 Oct 2020 14:43:04 -0400 From: Neil To: Microcontroller discussion list - Public. Sender: "piclist-bounces@mit.edu" Date: Tue, 20 Oct 2020 11:42:58 -0700 Subject: Re: [PIC] Crystal frequency selection Thread-Topic: [PIC] Crystal frequency selection Thread-Index: AdanEeM91rzOAScqS02lH1Zm44XJRw== Message-ID: <5F8F2FB2.8030802@narwani.org> 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: None (protection.outlook.com: narwani.org does not designate permitted sender hosts) dkim-signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=narwani.org ; s=default; h=Content-Transfer-Encoding:Content-Type:In-Reply-To: MIME-Version:Date:Message-ID:From:Reply-To:To:References:Subject:Sender:Cc: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=mcUk0zBmuVH4+W7+F2Abl1iUqayhPdfWa/4trCP+cb4=; b=O/ZT6Scg1BHRYvjQ1m+Ha+doYj S284HUdOxbtLG1GD13w2QRDUJsBXb9AHQXadonPvxpWuTFg5XrCVZLdmrgpH7dJWdKdUXLTEdwusg QLwU0NlmjvpOy+c02ZeoIk61J5ZJcopZWCZ4JHgMZjqC0KyUfjFg91e01wjfV5di01RXUpH406dTB PT1MzsDXcvuHg5KpKyWp90VNTw9mgZ5gbLFThdYahsjnvqYOkd5k3qcJ9hIC6VJQI8n+Ap5UtqlxD +AiAyjxcGC5m5efSKotDSxQA3StlbrNb2Pon8OG0KPDBwbK85b3m8Mga0kU0gQnGO2UDb1K/T5KtI NrwdaL1g==; authentication-results: spf=none (sender IP is 68.65.123.241) smtp.mailfrom=narwani.org; mit.edu; dkim=pass (signature was verified) header.d=narwani.org;mit.edu; dmarc=bestguesspass action=none header.from=narwani.org; user-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.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 - narwani.org x-source: x-authenticated-sender: premium47.web-hosting.com: ca4@narwani.org x-topics: [PIC] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Yes, I know... I was just asking about finding a crystal that calculates=20 to exactly 115200. I understand that there are tolerances, etc. On 10/20/2020 2:04 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% 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 clos= e >>>>> 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 .