When PDI CLK is connected on the XMEGA (also the RESET*) pin, can this pin still be used to trigger a reset on the chip? If so, how does the chip tell the difference between PDI being used as a clock and a genuine reset signal? Every document I have found on this matter is somewhat vague about what happens to the rest functionality of the pin when PDI is used.

If my wording is vague, what I am basically asking is if the reset pin can be used to reset the chip, if the firmware on the XMEGA was loaded via the PDI interface. I have a project that needs to be able to be reset in the field, but I also want to use the PDI interface to load the firmware on it from the factory.


You can still use it as /RESET. See this application note from Equinox for some details, or Atmel's own application note describing the PDI interface, if you'd prefer to get it straight from the source.

See part 3.2 in the Atmel doc for more specifics on how it works. In order to enter PDI mode, the programmer does a little dance: first it holds the PDI_DATA line high for a little while, which disables the normal reset functionality. Then, 16 edges are sent on PDI_CLK (RESET). If there aren't 16 edges, or if the timing isn't right, then it's treated as a normal reset. This is how the microcontroller differentiates between trying to enter programming mode and a normal reset.

It's common to put some filter circuitry on /RESET, or even to have a watchdog chip controlling it instead. That would cause problems with PDI -- as they describe, you need to have /RESET be more or less disconnected from anything else while programming for the programming to work. If you just have a button and maybe some small capacitance on /RESET, you shouldn't have to worry about it. But if you need more circuitry connected there, you may want a jumper or switch that you can use to temporarily disconnect things for programming.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.