We keep the finger crossed that the PICKIT4 will repeat the path the PICKIT3 had, but in the meantime we are on our own. Thanks to the great work of "El Tangas" we now can use JTAG2UPDI to build a UPDI Programmer out of an Arduino. You can grab the GitHub repository or you use the prebuild .HEX file for a 16 MHz ATmega328P.
After you have prepared your programmer, you need to modify avrdude, or here make a copy of the avrdude shipped with the Arduino IDE. Copy the executable to a new location and place the avrdude.conf from the repository also there. Now you are almost ready to flash software to the new devices. Open a new terminal, for Windows e.g run cmd, and navigate to the folder you copied the avrdude and the avrdude.conf to.
You only need three wires: GND, VCC and RESET. The programming is done with the RESET-pin so you can save pins for the programming interface. Also note that the 328p used as programmer must run at the same voltagte as the target MCU you are programming. A simple setup wil look like this:
Within the RESET connection there is a 4,7k resistor. You can see the circuitry becomes pretty simple.
We will give a short example for the ATtiny816 and assume you have built a Blinky.hex file with the tools of your choice. Copy the HEX file also to the folder where you have copied avrdude to. Also get the COM-port of your Arduino board, we assume COM15 here, depending on your OS this can be something else. To programm the file use:
avrdude -c jtag2updi -P COM15 -p t816 -U flash:w:816_Blinky.hex
For the ATMega48090 to give an example, we assume a 4809_Blinky.hex and also COM15 as the programmers port. In this case the command would be:
avrdude -c jtag2updi -P COM15 -p m4809 -U flash:w:4809_Blinky.hex
This is not as plug and play as with other tools, but we can start using the new chips with stuff we may have already lying arround. This short description may help you to get started with these new ICs.