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 09:10:06 -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 09KG39l7019423; Tue, 20 Oct 2020 12:03:10 -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 09KG38i2019419 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 20 Oct 2020 12:03:08 -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 09KG2jPf016232 for ; Tue, 20 Oct 2020 12:03:08 -0400 Received: from OC11EXPO27.exchange.mit.edu (18.9.4.98) by oc11exedge1.exchange.mit.edu (18.9.3.17) with Microsoft SMTP Server (TLS) id 15.0.1293.2; Tue, 20 Oct 2020 12:02:24 -0400 Received: from oc11exhyb3.exchange.mit.edu (18.9.1.99) by OC11EXPO27.exchange.mit.edu (18.9.4.98) with Microsoft SMTP Server (TLS) id 15.0.1365.1; Tue, 20 Oct 2020 12:02:34 -0400 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.168) 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 12:02:34 -0400 Received: from MWHPR19CA0005.namprd19.prod.outlook.com (2603:10b6:300:d4::15) by BN6PR0101MB3091.prod.exchangelabs.com (2603:10b6:405:2f::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18; Tue, 20 Oct 2020 16:02:33 +0000 Received: from CO1NAM03FT032.eop-NAM03.prod.protection.outlook.com (2603:10b6:300:d4:cafe::d7) by MWHPR19CA0005.outlook.office365.com (2603:10b6:300:d4::15) 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 16:02:33 +0000 Received: from premium47-1.web-hosting.com (68.65.123.241) by CO1NAM03FT032.mail.protection.outlook.com (10.152.80.173) 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 16:02:33 +0000 Received: from 107-145-246-199.res.spectrum.com ([107.145.246.199]:56172 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 1kUu5j-001CnC-00; Tue, 20 Oct 2020 12:02:31 -0400 From: Neil To: Microcontroller discussion list - Public. Sender: "piclist-bounces@mit.edu" Date: Tue, 20 Oct 2020 09:02:26 -0700 Subject: Re: [PIC] Crystal frequency selection Thread-Topic: [PIC] Crystal frequency selection Thread-Index: Adam+3pJfzJ0oJp1QoCgkKjV2Dr3RA== Message-ID: <5F8F0A12.1010901@narwani.org> References: <5F8EF750.1010301@narwani.org> <48194d83-b7bd-e7ce-bea1-7da72b0d6dbb@jle.co.uk> List-Help: List-Subscribe: , List-Unsubscribe: , In-Reply-To: <48194d83-b7bd-e7ce-bea1-7da72b0d6dbb@jle.co.uk> 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:Reply-To:From: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=pVGl6XULxpALbyEcGAa4gRmmtQHw+oa820o0V1UZG78=; b=pwcOISJ6TPcojpbz0APTK1twKg 7urnmXLqclX7LrvnshD7S0/QV+fQTajutX/PNRnH4B93RFGuiMDTLvi9/dzngitLG+dvXUPkC9vMb 0PRfRqHDoG/B+jfVWkydznI3BDP2Nw8lNMH3tMWEq3aqSK1olrub7bQmgcrz44nKSrmmnfAfRgqkB DImLE9VljPjj51Y7h+JcMB/wPFYAG+6mAooCFgKIiDdqUTSL8/d5mokEuXgaJiDGUJURZ+JWuMh6I TEtXf6PkhxzTQLIH/xLdRw2dORw00WBGTkA/EwpJmC+341emCY/pqV/sEP/4vFfdZhPEyCURValXv x3XYEqcw==; 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 18F45Q10. But I would expect that the EUSART is the same on both. I'll=20 check the datasheet. But my point though is that isn't there a crystal that would for which=20 there is a SPBRG value that results in 0% error? On 10/20/2020 11:10 AM, John Lawton wrote: > Which device? > > For the 18F25K22, -0.08% error at 64MHz clock according to the datasheet. > > John > > On 20/10/2020 15:50, David VanHorn wrote: >> 115200 might be tough since the divisor is getting small. >> 7.372800 would work, 14.745600, and so on. >> >> >> One thing a lot of people miss, which causes baud rates to be off, is >> selecting the right crystal caps. >> A crystal with CL of 22pF wants (2*CL-Cp) =3D 44pF - Cp where Cp is an >> estimate of the parasitics (5 to 6 pf is a good first guess) >> Running 22pF caps puts you a bit high, and the oscillator might not star= t >> in all conditions. >> >> >> >> On Tue, Oct 20, 2020 at 8:44 AM 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. >>> >>> -- >>> 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 .