diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2010-01-27 02:59:54 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2010-01-27 02:59:54 +0000 |
commit | 2059fd8b1a4c79f37811bb27fa568a97c56936a4 (patch) | |
tree | 87549877a9afec75d2d771cb26b687fa826a340f /Projects/AVRISP-MKII | |
parent | eb99b1ec905266ea4c076542168fb0e3b81b77a3 (diff) | |
download | lufa-2059fd8b1a4c79f37811bb27fa568a97c56936a4.tar.gz lufa-2059fd8b1a4c79f37811bb27fa568a97c56936a4.tar.bz2 lufa-2059fd8b1a4c79f37811bb27fa568a97c56936a4.zip |
Manually pull PDI clock pin high for 1ms before disabling PDI mode in the AVRISP-MKII project, to ensure that the PDI bus is disabled in the target and /RESET functionality restored.
Diffstat (limited to 'Projects/AVRISP-MKII')
-rw-r--r-- | Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.c b/Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.c index 01c861fb6..05d5ec9a4 100644 --- a/Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.c +++ b/Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.c @@ -230,6 +230,10 @@ void XPROGTarget_DisableTargetPDI(void) XPROGTarget_SetRxMode();
#if defined(XPROG_VIA_HARDWARE_USART)
+ /* Set /RESET high for a one millisecond to ensure target device is restarted */
+ PORTD |= (1 << 5);
+ _delay_ms(1);
+
/* Turn off receiver and transmitter of the USART, clear settings */
UCSR1A |= (1 << TXC1) | (1 << RXC1);
UCSR1B = 0;
@@ -239,6 +243,10 @@ void XPROGTarget_DisableTargetPDI(void) DDRD &= ~((1 << 5) | (1 << 3));
PORTD &= ~((1 << 5) | (1 << 3) | (1 << 2));
#else
+ /* Set /RESET high for a one millisecond to ensure target device is restarted */
+ BITBANG_PDICLOCK_PORT |= BITBANG_PDICLOCK_MASK;
+ _delay_ms(1);
+
/* Set DATA and CLOCK lines to inputs */
BITBANG_PDIDATA_DDR &= ~BITBANG_PDIDATA_MASK;
BITBANG_PDICLOCK_DDR &= ~BITBANG_PDICLOCK_MASK;
|