I have a product with an external connector with the intentions of using this for applying updates to an ATMEGA328P later on down the road. There are limited pins available, so I can't use SPI for downloading new programs. debugWIRE would work perfectly, as only 3 pins are necessary (5V, RESET, GND). Are there any potential issues leaving the micro in debugWIRE mode indefinitely? I'm using an ATMEL-ICE for programming.
2 Answers
You still need the SPI interface to initially enable debugWIRE.
debugWIRE Special Considerations
The debugWIRE interface itself cannot be used to set this fuse. To set the DWEN fuse, the SPI mode must be used.
Apart from that, you usually always want to lock the MCU when releasing a product. For example, the ELM327 v1.0 was released without being locked. The firmware was leaked and now the market is flooded with counterfeit and low quality ELM327 products.
If leaving the device unlocked is not a concern (e.g. for a hobby project), I see no harm in leaving the device unlocked for later programming via debugWIRE.
Leaving debugWire enabled significantly increases power usage during sleep.