Don't enable the pullup on the target /RESET line in the AVRISP project for PDI mode - clearing the XMEGA's reset control register twice is enough to release it from reset. Possible silicon bug, since the official Atmel programmers have the same issue.

Dean Camera 15 years ago
parent 39d56aeffe
commit 2b74b517ea

@ -27,7 +27,7 @@
* - Fixed ADC routines failing to read the extended channels (Channels 8 to 13, Internal Temperature Sensor) on the * - Fixed ADC routines failing to read the extended channels (Channels 8 to 13, Internal Temperature Sensor) on the
* U4 series USB AVR parts * U4 series USB AVR parts
* - Fixed PDI programming mode in the AVRISP programmer project not exiting programming mode correctly (clear target * - Fixed PDI programming mode in the AVRISP programmer project not exiting programming mode correctly (clear target
* Reset key twice, set /RESET pin to pullup) * Reset key twice, possible silicon bug?)
* *
* \section Sec_ChangeLog100219 Version 100219 * \section Sec_ChangeLog100219 Version 100219
* *

@ -237,19 +237,18 @@ void XPROGTarget_DisableTargetPDI(void)
UCSR1B = 0; UCSR1B = 0;
UCSR1C = 0; UCSR1C = 0;
/* Make Reset input with pullup to take target out of /RESET, tristate all other pins */ /* Tristate all pins */
DDRD &= ~((1 << 5) | (1 << 3)); DDRD &= ~((1 << 5) | (1 << 3));
PORTD &= ~((1 << 3) | (1 << 2)); PORTD &= ~((1 << 3) | (1 << 2));
PORTD |= (1 << 5);
#else #else
/* Turn off software USART management timer */ /* Turn off software USART management timer */
TCCR1B = 0; TCCR1B = 0;
/* Make Reset input with pullup to take target out of /RESET, tristate all other pins */ /* Tristate all pins */
BITBANG_PDIDATA_DDR &= ~BITBANG_PDIDATA_MASK; BITBANG_PDIDATA_DDR &= ~BITBANG_PDIDATA_MASK;
BITBANG_PDICLOCK_DDR &= ~BITBANG_PDICLOCK_MASK; BITBANG_PDICLOCK_DDR &= ~BITBANG_PDICLOCK_MASK;
BITBANG_PDICLOCK_PORT &= ~BITBANG_PDICLOCK_MASK; BITBANG_PDICLOCK_PORT &= ~BITBANG_PDICLOCK_MASK;
BITBANG_PDIDATA_PORT |= BITBANG_PDIDATA_MASK; BITBANG_PDIDATA_PORT &= ~BITBANG_PDIDATA_MASK;
#endif #endif
} }

Loading…
Cancel
Save