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 08:27:22 -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 09KFInUm011116; Tue, 20 Oct 2020 11:18:59 -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 09KFImmh011113 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 20 Oct 2020 11:18:48 -0400 Received: from oc11exedge1.exchange.mit.edu (OC11EXEDGE1.EXCHANGE.MIT.EDU [18.9.3.17]) by outgoing-exchange-7.mit.edu (8.14.7/8.12.4) with ESMTP id 09KFIhZ0009600 for ; Tue, 20 Oct 2020 11:18:48 -0400 Received: from oc11expo13.exchange.mit.edu (18.9.4.18) by oc11exedge1.exchange.mit.edu (18.9.3.17) with Microsoft SMTP Server (TLS) id 15.0.1293.2; Tue, 20 Oct 2020 11:18:31 -0400 Received: from oc11exhyb6.exchange.mit.edu (18.9.1.111) by oc11expo13.exchange.mit.edu (18.9.4.18) with Microsoft SMTP Server (TLS) id 15.0.1365.1; Tue, 20 Oct 2020 11:18:40 -0400 Received: from NAM04-CO1-obe.outbound.protection.outlook.com (104.47.45.54) by oc11exhyb6.exchange.mit.edu (18.9.1.111) with Microsoft SMTP Server (TLS) id 15.0.1395.4 via Frontend Transport; Tue, 20 Oct 2020 11:18:40 -0400 Received: from DM5PR12CA0058.namprd12.prod.outlook.com (2603:10b6:3:103::20) by SN6PR01MB4445.prod.exchangelabs.com (2603:10b6:805:e2::33) 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 15:18:39 +0000 Received: from DM3NAM03FT054.eop-NAM03.prod.protection.outlook.com (2603:10b6:3:103:cafe::3c) by DM5PR12CA0058.outlook.office365.com (2603:10b6:3:103::20) 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 15:18:39 +0000 Received: from mail-io1-f46.google.com (209.85.166.46) by DM3NAM03FT054.mail.protection.outlook.com (10.152.83.223) 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 15:18:38 +0000 Received: by mail-io1-f46.google.com with SMTP id u62so1805282iod.8 for ; Tue, 20 Oct 2020 08:18:38 -0700 (PDT) From: David VanHorn To: Microcontroller discussion list - Public. Sender: "piclist-bounces@mit.edu" Date: Tue, 20 Oct 2020 08:18:26 -0700 Subject: Re: [PIC] Crystal frequency selection Thread-Topic: [PIC] Crystal frequency selection Thread-Index: Adam9YGzPl1NYYfuQbae02F8w0VOcQ== Message-ID: 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: Pass (protection.outlook.com: domain of gmail.com designates 209.85.166.46 as permitted sender) receiver=protection.outlook.com; client-ip=209.85.166.46; helo=mail-io1-f46.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=lURmWlyNGdN7pwqZavf+TKLoky4/VquyJ/fiKilJ0KI=; b=om6tto2YxrgRpPrZCVwDJMGo/T2OH251P9Z8OjrNteXVm+TCnlb2EYgRoOZqW/IOD0 a5jTCRI6/Koo9sqtSTXdH5zlNCaS2Q+pQmPeduQofK07aQw3DatERo0OMBC3vzGQCaGu xnMtvvlXgvyTOqtEKY/XLuYPpkUL0Z+doWLRwTu6P/nVrZ5B1fMUzJHhvnoFEWzTK7iM 2Uxke1J6DofDpqmvegVZfPY2k4+agrPvk+8B+0tKD+Q+oAfDmccay0uWOl5tMZQbhfDi ZRU7D82pS0bwEoCBi4FoTQJxhN3Z4RpZOWBJnbHdiqG/kueFTYLjbZDcYQO6pqAx2DbG JZ1A== authentication-results: spf=pass (sender IP is 209.85.166.46) 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:a02:6d61:: with SMTP id e33mr2422745jaf.14.1603207117265; Tue, 20 Oct 2020 08:18:37 -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 What divisor? I get 555.55... On Tue, Oct 20, 2020, 9:11 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 sta= rt > > 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 > >> > > -- > 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 .