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; Mon, 20 Jul 2020 02:48:35 -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 06K9dGGl031256; Mon, 20 Jul 2020 05:39:57 -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 06K9dFuk031253 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 20 Jul 2020 05:39:16 -0400 Received: from w92exedge4.exchange.mit.edu (W92EXEDGE4.EXCHANGE.MIT.EDU [18.7.73.16]) by outgoing-exchange-7.mit.edu (8.14.7/8.12.4) with ESMTP id 06K9bbmU024952 for ; Mon, 20 Jul 2020 05:37:37 -0400 Received: from oc11expo12.exchange.mit.edu (18.9.4.17) by w92exedge4.exchange.mit.edu (18.7.73.16) with Microsoft SMTP Server (TLS) id 15.0.1293.2; Mon, 20 Jul 2020 05:39:05 -0400 Received: from oc11exhyb5.exchange.mit.edu (18.9.1.110) by oc11expo12.exchange.mit.edu (18.9.4.17) with Microsoft SMTP Server (TLS) id 15.0.1365.1; Mon, 20 Jul 2020 05:39:15 -0400 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.177) by oc11exhyb5.exchange.mit.edu (18.9.1.110) with Microsoft SMTP Server (TLS) id 15.0.1395.4 via Frontend Transport; Mon, 20 Jul 2020 05:39:14 -0400 Received: from DM5PR07CA0038.namprd07.prod.outlook.com (2603:10b6:3:16::24) by MN2PR01MB5744.prod.exchangelabs.com (2603:10b6:208:196::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3195.23; Mon, 20 Jul 2020 09:39:14 +0000 Received: from DM3NAM03FT009.eop-NAM03.prod.protection.outlook.com (2603:10b6:3:16:cafe::75) by DM5PR07CA0038.outlook.office365.com (2603:10b6:3:16::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3195.17 via Frontend Transport; Mon, 20 Jul 2020 09:39:14 +0000 Received: from mail-lj1-f174.google.com (209.85.208.174) by DM3NAM03FT009.mail.protection.outlook.com (10.152.82.114) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3195.18 via Frontend Transport; Mon, 20 Jul 2020 09:39:13 +0000 Received: by mail-lj1-f174.google.com with SMTP id h19so19459711ljg.13 for ; Mon, 20 Jul 2020 02:39:13 -0700 (PDT) From: "Forrest Christian (List Account)" To: Microcontroller discussion list - Public. Sender: "piclist-bounces@mit.edu" Date: Mon, 20 Jul 2020 02:39:02 -0700 Subject: Re: [PIC] MPLAB-X won't set PWM frequency above 25Hz Thread-Topic: [PIC] MPLAB-X won't set PWM frequency above 25Hz Thread-Index: AdZeevALyH8BJwwpQ+Gj519vO45llQ== Message-ID: References: List-Help: List-Subscribe: , List-Unsubscribe: , In-Reply-To: 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 packetflux.com designates 209.85.208.174 as permitted sender) receiver=protection.outlook.com; client-ip=209.85.208.174; helo=mail-lj1-f174.google.com; dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=packetflux-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=Fmj9IzGF7zxUK3nQvSmcPzn6WMjXsp4H8LrtsMvcfgM=; b=S42lAg4gsws7v3GFDaHytbhhU870E+zzvMTnwXtzqLfqFX5b/xTO2xkuVPtZl5YwO1 ZvT6XzMiw25Um5OSoe9UHleTCjYqLN9gMAXTppSoOg5/hSfCMw1yTjl9GizS1NMxFy1q 62ZQ8bJ06FS5kDkFO6e0MkQXTAAZdfAl1e1R2sJ/TUBVlqTj2r5PqT3EQn6+clwKcDYL leH9SzkqyyCzc29ayZwRZ8gtiRwvgCTwJz0EQgaSboAMMdx7pQ1xyShCWQroiPmfcDnb 8XOi87Hm1n/Y/idJbnLiw3E5Tt25dIfNmbKk/Sdcy5fpw+wWLfBxOMdp4nTNnQW0LKyg rJyg== authentication-results: spf=pass (sender IP is 209.85.208.174) smtp.mailfrom=packetflux.com; mit.edu; dkim=pass (signature was verified) header.d=packetflux-com.20150623.gappssmtp.com; mit.edu; dmarc=bestguesspass action=none header.from=packetflux.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:a2e:99c6:: with SMTP id l6mr10999296ljj.220.1595237952447; Mon, 20 Jul 2020 02:39:12 -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 I'm curious where you're seeing these values, Is this in MCC or something like that? So, here are random thoughts: Is the processor really running at 16Mhz? Blinking a led with a delay loop is a good way to verify this. If you're running at 16Mhz, it seems like if you set the timer prescale to 1, and then set a PR2 value of 0xff you'd get where you want to be. That is 16Mhz/4 =3D 4Mhz(Fosc/4) / 1 =3D 4Mhz / 256=3D 15.625kHz On Sun, Jul 19, 2020 at 10:06 PM James Burkart wrote: > I'm using MPLAB-X v5.35, and XC-8 v2.20. > > Using PIC16F1503. Brand new stand alone project. Set internal frequency t= o > 16MHz. TMR2 period set to 250ns. PWM frequency shows 25Hz. Nothing I do i= s > setting the PWM frequency correctly. What am I missing here? I'll have to > dig out my stuff to breadboard it and see what the actual PWM frequency i= s, > but this is frustrating. > > I'd like to set the timer period to 64 us and get a PWM frequency of 15.6= 25 > kHz. > -- > 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 - Forrest --=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 .