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; Fri, 11 Sep 2020 17:57: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 08C0iK89018397; Fri, 11 Sep 2020 20:45:03 -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 08C0iJ2e018389 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for <piclist@PCH.MIT.EDU>; Fri, 11 Sep 2020 20:44:19 -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 08C0iCXj025456 for <piclist@PCH.MIT.EDU>; Fri, 11 Sep 2020 20:44:19 -0400 Received: from oc11expo25.exchange.mit.edu (18.9.4.96) by oc11exedge1.exchange.mit.edu (18.9.3.17) with Microsoft SMTP Server (TLS) id 15.0.1293.2; Fri, 11 Sep 2020 20:44:00 -0400 Received: from oc11exhyb6.exchange.mit.edu (18.9.1.111) by oc11expo25.exchange.mit.edu (18.9.4.96) with Microsoft SMTP Server (TLS) id 15.0.1365.1; Fri, 11 Sep 2020 20:44:05 -0400 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.103) by oc11exhyb6.exchange.mit.edu (18.9.1.111) with Microsoft SMTP Server (TLS) id 15.0.1395.4 via Frontend Transport; Fri, 11 Sep 2020 20:44:05 -0400 Received: from DM5PR21CA0066.namprd21.prod.outlook.com (2603:10b6:3:129::28) by BY5PR01MB6084.prod.exchangelabs.com (2603:10b6:a03:1c1::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3370.16; Sat, 12 Sep 2020 00:44:02 +0000 Received: from DM3NAM03FT011.eop-NAM03.prod.protection.outlook.com (2603:10b6:3:129:cafe::d5) by DM5PR21CA0066.outlook.office365.com (2603:10b6:3:129::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3391.3 via Frontend Transport; Sat, 12 Sep 2020 00:44:02 +0000 Received: from mail-40138.protonmail.ch (185.70.40.138) by DM3NAM03FT011.mail.protection.outlook.com (10.152.82.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3370.16 via Frontend Transport; Sat, 12 Sep 2020 00:44:02 +0000 From: madscientistatlarge <madscientistatlarge@protonmail.com> To: "piclist@mit.edu" <piclist@mit.edu> Sender: "piclist-bounces@mit.edu" <piclist-bounces@mit.edu> Date: Fri, 11 Sep 2020 17:43:56 -0700 Subject: [AVR] Square on AVR? Thread-Topic: [AVR] Square on AVR? Thread-Index: AdaIn7HV9O8vBYeYS0mGrfOzki2emg== Message-ID: <YPA3xRbyMfz11pqZiu-k_eE7eSY8CFS4rsyrGAn95yKMsvnXwzl8uaKM174fgFc-xVJQhda_nVhYJkXC2LiT0J_T-fvoSeGJ2UHLYNYi35k=@protonmail.com> List-Help: <mailto:piclist-request@mit.edu?subject=help> List-Subscribe: <http://mailman.mit.edu/mailman/listinfo/piclist>, <mailto:piclist-request@mit.edu?subject=subscribe> List-Unsubscribe: <http://mailman.mit.edu/mailman/listinfo/piclist>, <mailto:piclist-request@mit.edu?subject=unsubscribe> Reply-To: Microcontroller discussion list - Public. <piclist@mit.edu> 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 protonmail.com designates 185.70.40.138 as permitted sender) receiver=protection.outlook.com; client-ip=185.70.40.138; helo=mail-40138.protonmail.ch; dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1599871440; bh=71su7k/55K6RYbR18l1yOgfngJbgjwlJpejhX7IoM/8=; h=Date:To:From:Reply-To:Subject:From; b=owTvaFXzCiUY+1bU3eOWNMsPtevYJj8D4M0/ZlIqShwFx/qZnQf4hgVOF8NJXDVvn Dy0hSBMSRnkhtQzS33MKWmRi3YFapDST6LG88jwzozdm4AfxVgHP9WLEFcVjsrQ9L6 CRNFm7gES7aaDIvZtq/mVJ1aJZbc9PnghthsGCK0= authentication-results: spf=pass (sender IP is 185.70.40.138) smtp.mailfrom=protonmail.com; mit.edu; dkim=pass (signature was verified) header.d=protonmail.com;mit.edu; dmarc=pass action=none header.from=protonmail.com; errors-to: piclist-bounces@mit.edu list-id: "Microcontroller discussion list - Public." <piclist.mit.edu> list-post: <mailto:piclist@mit.edu> x-beenthere: piclist@mit.edu x-mailman-version: 2.1.6 x-spam-checker-version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch x-spam-status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM shortcircuit=no autolearn=disabled version=3.4.4 x-topics: [AVR] x-mime-autoconverted: from quoted-printable to 8bit by PCH.mit.edu id 08C0iJ2e018389 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Is it reasonable to calculate the square root of a 16 bit or preferably 20 = bit integer? I'll need to do this 400 times a second. I do have an altern= ate hardware plan that would work, but I'd prefer using the Square root. I= t's a PID controller and I'd rather use a "constant" (between calculations = at least) Voltage output, or I can use a fet to do PWM without the math (wi= th square root I'd calculate the power required, take the square root and s= et the voltage output to that value). This would reduce the noise from the= high power (240W) switching converter. Alternately I could set a fixed ma= x voltage and drive a fet with a pwm signal. Just wondering how expensive = that calculation would be in terms of processor cycles. Sent with ProtonMail Secure Email. --=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 .