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; Sun, 15 Nov 2020 17:11:58 -0800 Received: from PCH.MIT.EDU (localhost.localdomain [127.0.0.1]) by PCH.mit.edu (8.14.7/8.12.8) with ESMTP id 0AG14BuH025505; Sun, 15 Nov 2020 20:04:27 -0500 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 0AG14ApT025502 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Sun, 15 Nov 2020 20:04:10 -0500 Received: from w92exedge4.exchange.mit.edu (W92EXEDGE4.EXCHANGE.MIT.EDU [18.7.73.16]) by outgoing-exchange-1.mit.edu (8.14.7/8.12.4) with ESMTP id 0AG144SG016827 for ; Sun, 15 Nov 2020 20:04:10 -0500 Received: from oc11expo11.exchange.mit.edu (18.9.4.16) by w92exedge4.exchange.mit.edu (18.7.73.16) with Microsoft SMTP Server (TLS) id 15.0.1293.2; Sun, 15 Nov 2020 20:03:30 -0500 Received: from oc11exhyb1.exchange.mit.edu (18.9.1.60) by oc11expo11.exchange.mit.edu (18.9.4.16) with Microsoft SMTP Server (TLS) id 15.0.1365.1; Sun, 15 Nov 2020 20:03:39 -0500 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.41) by oc11exhyb1.exchange.mit.edu (18.9.1.60) with Microsoft SMTP Server (TLS) id 15.0.1395.4 via Frontend Transport; Sun, 15 Nov 2020 20:03:39 -0500 Received: from MW2PR16CA0055.namprd16.prod.outlook.com (2603:10b6:907:1::32) by DM6PR01MB3897.prod.exchangelabs.com (2603:10b6:5:84::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3564.28; Mon, 16 Nov 2020 01:03:37 +0000 Received: from CO1NAM11FT040.eop-nam11.prod.protection.outlook.com (2603:10b6:907:1:cafe::6b) by MW2PR16CA0055.outlook.office365.com (2603:10b6:907:1::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3564.25 via Frontend Transport; Mon, 16 Nov 2020 01:03:37 +0000 Received: from mail-pg1-f179.google.com (209.85.215.179) by CO1NAM11FT040.mail.protection.outlook.com (10.13.174.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3564.28 via Frontend Transport; Mon, 16 Nov 2020 01:03:37 +0000 Received: by mail-pg1-f179.google.com with SMTP id q28so1011066pgk.1 for ; Sun, 15 Nov 2020 17:03:37 -0800 (PST) Received: from [192.168.1.5] (118-93-170-172.dsl.dyn.ihug.co.nz. [118.93.170.172]) by smtp.gmail.com with ESMTPSA id k17sm17885916pji.50.2020.11.15.17.03.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 15 Nov 2020 17:03:35 -0800 (PST) From: Brent Brown To: Microcontroller discussion list - Public. Sender: "piclist-bounces@mit.edu" Date: Sun, 15 Nov 2020 17:03:32 -0800 Subject: Re: [PIC] An In-Circuit Serial Programmer application Thread-Topic: [PIC] An In-Circuit Serial Programmer application Thread-Index: Ada7tXurDrKrq6sbS4ih7ONHGyuIOQ== Message-ID: <5FB1CFE4.26802.175E8E5C@brent.eds.co.nz> References: , <6c4cb75c-c4d5-43a4-8bb3-5c0613364c98@BN8NAM11FT064.eop-nam11.prod.protection.outlook.com> List-Help: List-Subscribe: , List-Unsubscribe: , In-Reply-To: <6c4cb75c-c4d5-43a4-8bb3-5c0613364c98@BN8NAM11FT064.eop-nam11.prod.protection.outlook.com> 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: eds.co.nz does not designate permitted sender hosts) dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eds-co-nz.20150623.gappssmtp.com; s=20150623; h=from:organization:to:date:mime-version:subject:message-id:priority :in-reply-to:references:content-transfer-encoding :content-description; bh=PvRE5vwPxmwQmCqt3qreHqsH/+nxMWmvz1LWUCMKp8A=; b=ykFadcbLhirDtICFLZC1hMvfJFMhnlzPLfIDH5Nr9Z6dIyBHQUgESiMlI2pNsXFyvp 0QQ8nLDf1B1ff+gqc250Z5rLMhI+1WBfkUP0JhwV2BF1DN5HZ8jO0U+DoVlByuqngKi6 KbG9NicSa/byyCQJ8YzyzmjeBTNwAmbnkFffi3STJ2HWe1zfVRanqczmueH2MQ4rWjit K4pGgzM3h2WbXkZedldhAFCzjbFTvQEPQDCrTNTtpQs6xP5c3N66d55v3nhO9k4xoOdr RjpCwFMAYOyLbAQiEK4tQJwQdDrgUlG4ezNLoIdV6eMMNE28m7jlRahFhrtPKaRHis7k t45g== authentication-results: spf=none (sender IP is 209.85.215.179) smtp.mailfrom=eds.co.nz; mit.edu; dkim=pass (signature was verified) header.d=eds-co-nz.20150623.gappssmtp.com; mit.edu; dmarc=none action=none header.from=eds.co.nz; 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:a17:90a:460a:: with SMTP id w10mr13018166pjg.232.1605488616040; Sun, 15 Nov 2020 17:03:36 -0800 (PST) x-topics: [PIC] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 On 16 Nov 2020 at 0:17, Don Kuenz wrote: > =20 > >> Don wrote: > >>> This project shows how to implement an In-Circuit Serial > >>> Programmer application. It utilizes the ICSP's 5 VDC > >>> (Vdd) pin to toggle the PIC microcontroller between > >>> application mode and programming mode. > >>> > >>> https://crcomp.net/icsp/index.php >=20 > > Chris wrote: > >> Nice, but why not just use two Jumpers or a DPDT switch rather than ad= d > >> additional silicon? > >> My preference with the more recent PIC's is to use PPS to assign the U= SART > >> to those pins. > >> I then use the PICKit as a terminal for debugging as well as a Program= mer. > >> The serial interface may even have a use in the target application. > >> Have the serial interface use the same pin assignments as the ICSP and= you > >> have a nice 'Plug and Play' programming/debugging/communications port. >=20 > Chris wrote: > > P.S. - It also works well with a Bootloader. > > use the ICSP interface to install the TinyBootloader or an equivalent w= ith > > the ICSP Dat and Clk lines set at the Rx and Tx lines and you have a ni= ce > > development device with Programming, Debugging and Communications all > > achieved via a USB/Serial adapter - Great to hand out to students or us= e > > for casual experimenting as well as in target applications. >=20 > There's four good reasons (or at least three and a half) for me to use=20 > additional silicon. Let's start with the half reason. If you look=20 > closely at Figure 4 you see a blue DIP switch near the top, middle. It's > a drag to flip those switches each time. A mouse click is so much=20 > easier. > There's also a dearth of ICSP applications available on the Inet, > probably for a very good reason. The wide, inviting, easy route with old > MCUs is to simply dedicate RB6 and RB7 to ICSP. The third reason is my > application allows all 8 bits of RB to be used. > The final reason is actually the best. It motivated you to talk > about another way. It's time for me to step up to an MCU with a UART. IMHO the ICSP circuit can be simpler yet remain effective i many cases... j= ust a=20 single pull up resistor to VDD. Value of 10k works well for me, using ICD3 = and=20 ICD4. The resistor must present not too great a load to the programmer duri= ng HV=20 programming mode, nor push up VDD appreciably. Conversely it must be low=20 enough value to prevent unwanted MCLR pul downs by noise. A couple of basic= =20 tips: keep traces short around ICSP, and don't expose VDD to the outside wo= rld=20 where it can pick up noise. In most cases the RC reset circuit is no great = loss with=20 most PIC's having fairly decent internal power up & brownout reset generato= rs that=20 can be enabled. Yes ~ a bootloader is indispensable once you have settled on a good one. Al= l going=20 well you then only need to use ICSP once... so isolation becomes less impor= tant. I=20 prefer a bootloader that doesn't require a button press, DIP switch, or jum= per, to=20 initiate it... these are time consuming and annoying steps during developme= nt=20 code/program/debug cycles (frequent for me), and a complication when doing = field=20 updates. Ideal: bootloader runs for a brief time at reset and invokes loadi= ng if=20 detected else runs application, optionally add hardware reset capability by= using=20 e.g. the RTS line, and/or have the application code invoke the bootloader a= fter=20 receiving a serial escape sequence (unless this presents an unacceptable se= curity=20 risk). Nice work on the web page though, good circuit design/description. I skip r= ead it=20 and only noticed a missing "be" in 4th pragraph "can not left unused". --=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 .