MPLAB® PICkit™ 4 - High Voltage Activation of UPDI
Microchip's AVR microcontrollers with Unified Program and Debug Interface (UPDI) support can be configured to use the UPDI pin as either a GPIO or a RESET pin. This is done by setting the RSTPINCFG configuration bits in the device's fuse settings. If the UPDI pin is configured as a GPIO, it can be used for general-purpose input or output operations. However, if it is configured as a RESET pin, it will be used to reset the device when a reset pulse is applied. To reprogram a device with its UPDI pin configured as a RESET pin, the MPLAB® PICkit 4 programmer must use a high-voltage pulse to reactivate the UPDI interface. This is because the UPDI interface is disabled when the pin is configured as a RESET pin. It's important to note that when using the high voltage pulse to reactivate the UPDI interface, all circuits connected to the UPDI wire must be able to tolerate a pulse of at least 12 V. Failure to do so could result in damage to the device or other connected circuits.
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 |