Support for using the high-voltage pulse to activate the AVR® Unified Program and Debug Interface (UPDI) is available in the v5.25 firmware release for MPLAB® PICkit™ 4.
On low pin count AVR devices with UPDI, the UPDI pin can be configured as General Purpose Input/Output (GPIO) or RESET by configuring the RSTPINCFG configuration bits. To do further programming, the MPLAB PICkit 4 will have to use a high voltage pulse to reactivate the UPDI interface. When using the high voltage pulse, you must make sure that all circuits connected to the UPDI wire can tolerate a pulse of at least 12 V.
MPLAB PICkit 4 Options
To select high voltage options in Project Properties, go to the drop-down menu: PICkit 4 > Communications > High Voltage Activation Mode.Table 1: PICkit 4 High Voltage Options
Drop-down menu item | Description |
---|---|
No High Voltage | No high voltage pulse will be generated. |
Simple High Voltage Pulse | The tool will try to activate the interface by issuing a high voltage pulse. This procedure is safe if the pin is configured as an input. |
User Power Toggle | In this mode, the user will be prompted to toggle power on the target device. Once the tool detects that the power returns, it will issue a high voltage pulse before the target device pin is configured, making the activation procedure as gentle as possible. |
GPIO vs. UPDI Operation
When using a high voltage pulse to reactivate the UPDI interface, the reactivation is only temporary, but it will retain the UPDI functionality until the next reset. After the next reset, the pin will go back to the configuration as specified by the RSTPINCFG configuration bits. To have the pin configured as UPDI after a reset, you will have to change the RTSPINCFG configuration bits back to UPDI.
It is possible to do a debug session when the RSTPINCFG is configured to GPIO. However, to perform a debug session, the pin will be temporarily configured as UPDI and it will not operate as a GPIO pin.Table 2: SYSCFG0 RSTPINCFG[1:0] Configuration Bits
Values | Function |
---|---|
0x0 | GPIO |
0x1 | UPDI |
0x2 | RESET |
0x3 | Reserved |