high voltage programming mode with PICkit 4 for TPI? - Page 1
Forum section: electronics / general

author: FrankBuss
author_rank: Unknown
timestamp: November 12, 2020, 03:49:38 pm
content: When I program an ATTiny10, I can select the reset disable fuse bit, which configures the reset pin as normal GPIO. After this, I could only program it again with the high voltage programming mode, which means applying 12 V to the reset pin. I asked the Microchip support as well for this silly limitation and they say the PICkit 4 TPI programming mode can't use high voltage programming, only the UPDI programming mode can do this. They recommended that I should buy a STK600.So first question is, can I somehow convince or hack MPLAB-X or the programmer firmware to use high voltage programming mode for TPI, or is it a real hardware limitation?And if it is not possible, is it safe when I apply 12 V from an external power supply to the reset pin, and then program it with the PICkit 4?

author: westfw
author_rank: Super Contributor
timestamp: November 13, 2020, 08:45:57 am
content: Well, you could use one of the tiny10 programmers written to run on an Arduino.http://junkplusarduino.blogspot.com/p/attiny10-resources.htmlThatwould at least give you something that is more easily hackable.Since HV TPI seems to consist of holding reset at 12V for the entire programming session, instead of pulling it low, adding HV support should be relatively easy.Whether it's "safe" or not depends on what you have connected to the reset pin, and whether you're careful enough with that 12V signal - having a probe slip and send it into some other pin would probably be bad.I had some ATtiny28s to program recently, and in the end it turned out to be easier to build a whole custom HV (parallel) programmer and write custom programming SW, than to figure out how to get any of my other gear and SW to write to it.

author: FrankBuss
author_rank: Unknown
timestamp: November 17, 2020, 10:27:14 pm
content: Would be nice to have something professional. So I bought the STK600, thought this would be the best you can get for programming Atmel microcontroller. But I can't program the ATtiny10 with it at all. And looks like the programmer is not even supported in MPLAB-X, at least not for the ATtiny10.Thanks for the link, maybe I should look at the Arduino programmer, then I can at least write the software myself and add all features I need. But I contacted the Microchip support again, maybe I do just something wrong.Documentation is not that great either. For example it looks like the PROGCTRL and PROGDATA pin headers are needed for high voltage programming mode (I measured the ISP/PDI RESET pin with my scope, and no high voltage there when selecting HVSP and trying to read the chip ID). But the STK600 users guide doesn't show the pinout of these two headers.I think I will only use chips with JTAG or SWD interface for my projects. I never had any problems with it and with my J-Link. Even other Atmel chips like the SAMD21 works with it flawlessly.

author: westfw
author_rank: Super Contributor
timestamp: November 18, 2020, 12:22:20 am
content: QuoteSTK600 is pretty old. I think the most recent programmer that supports HV serial programming is the power debugger:https://www.microchip.com/Developmenttools/ProductDetails/ATPOWERDEBUGGERI think you're right that the PICKit 4 OUGHT to be able to do it. But even the HV support for NEW UPDI AVRs (tiny-0, tiny-1) has been pretty slow to release (although, those are somewhat more difficult than HV TPI.)Apparentlynoneof the Microchip programmers are considered "production" programmers.http://ww1.microchip.com/downloads/en/Appnotes/Production-Programming-of-Microchip-AVR-SAM-MCU-00002468D.pdf

author: fchk
author_rank: Frequent Contributor
timestamp: November 18, 2020, 09:56:09 am
content: You should be able to use the PIC10F322 - this may even be pin compatible.https://www.microchip.com/wwwproducts/en/pic10f322This uses standard ICSP like all 8 bit PICs, so you should not have any problems programming it.fchk

author: FrankBuss
author_rank: Unknown
timestamp: November 18, 2020, 03:15:28 pm
content: Yes, the PIC works fine, I have used a PIC10F200 in another project, no problem with PICkit4. But the power down current of the ATtinys is lower, and I can enable the internal pullup resistors individually for each pin, which both is important for a project for which I use it.But meanwhile I could successfully reset the fuses of an ATtiny25 with this project:https://www.rickety.us/2010/03/arduino-avr-high-voltage-serial-programmer/I didn't check it so far, but is it required to connect the CLOCK input of the target microcontroller, or is this just in case a wrong oscillator setting was configured for the fuse bits?Maybe I should create a simple circuit with the PICkit4 on one side, a dedicated microcontroller for the reset fuse procedure with a button, some multiplexers etc., and the programming headers for the target microcontroller on the other side. Then I can just push the button to reset the fuses, and program it from the PICkit4 again without any cable switching. I know, it is overkill, because I probably don't need to program it that often, but would be a fun little project, and might be useful for others as well.But I'm sure the PICkit could do it on its own. Even if it is not possible from the hardware to route 12V to the reset output, the programming procedure could just use the VPP pin instead, which can do 12V. Is it possible to control the pins of the PICkit4 from Windows? Then the best solution would be to write a little program, which runs on Windows and executes the same Arduino script to reset the fuses, with VPP connected to reset. No extra hardware needed, just one pin needs to be swapped when resetting the fuses.