projects
/
pub
/
USBasp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b27f355
)
Added new XCK_RESCUE_CLOCK_ENABLE compile time option to the AVRISP-MKII clone progra...
author
Dean Camera
<dean@fourwalledcubicle.com>
Tue, 16 Nov 2010 01:37:43 +0000
(
01:37
+0000)
committer
Dean Camera
<dean@fourwalledcubicle.com>
Tue, 16 Nov 2010 01:37:43 +0000
(
01:37
+0000)
LUFA/ManPages/ChangeLog.txt
patch
|
blob
|
blame
|
history
Projects/AVRISP-MKII/AVRISP-MKII.txt
patch
|
blob
|
blame
|
history
Projects/AVRISP-MKII/Lib/ISP/ISPTarget.c
patch
|
blob
|
blame
|
history
Projects/AVRISP-MKII/Lib/XPROG/XPROGProtocol.c
patch
|
blob
|
blame
|
history
Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.c
patch
|
blob
|
blame
|
history
Projects/AVRISP-MKII/makefile
patch
|
blob
|
blame
|
history
diff --git
a/LUFA/ManPages/ChangeLog.txt
b/LUFA/ManPages/ChangeLog.txt
index
1eda701
..
0afdd4a
100644
(file)
--- a/
LUFA/ManPages/ChangeLog.txt
+++ b/
LUFA/ManPages/ChangeLog.txt
@@
-35,6
+35,7
@@
* - Added new Pipe_GetBusyBanks(), Endpoint_GetBusyBanks() and Endpoint_AbortPendingIN() functions
* - Added new NO_BLOCK_SUPPORT, NO_EEPROM_BYTE_SUPPORT, NO_FLASH_BYTE_SUPPORT and NO_LOCK_BYTE_WRITE_SUPPORT compile time options to the
* CDC class bootloader
* - Added new Pipe_GetBusyBanks(), Endpoint_GetBusyBanks() and Endpoint_AbortPendingIN() functions
* - Added new NO_BLOCK_SUPPORT, NO_EEPROM_BYTE_SUPPORT, NO_FLASH_BYTE_SUPPORT and NO_LOCK_BYTE_WRITE_SUPPORT compile time options to the
* CDC class bootloader
+ * - Added new XCK_RESCUE_CLOCK_ENABLE compile time option to the AVRISP-MKII clone programmer project (thanks to Tom Light)
*
* <b>Changed:</b>
* - Removed complicated logic for the Endpoint_ConfigureEndpoint() function to use inlined or function called versions
*
* <b>Changed:</b>
* - Removed complicated logic for the Endpoint_ConfigureEndpoint() function to use inlined or function called versions
diff --git
a/Projects/AVRISP-MKII/AVRISP-MKII.txt
b/Projects/AVRISP-MKII/AVRISP-MKII.txt
index
d569e7e
..
7489cf6
100644
(file)
--- a/
Projects/AVRISP-MKII/AVRISP-MKII.txt
+++ b/
Projects/AVRISP-MKII/AVRISP-MKII.txt
@@
-280,6
+280,12
@@
* <td>Define to switch to a non-standard endpoint scheme, breaking compatibility with AVRStudio under Windows but making
* the code compatible with software such as avrdude (all platforms) that use the libUSB driver.
* </tr>
* <td>Define to switch to a non-standard endpoint scheme, breaking compatibility with AVRStudio under Windows but making
* the code compatible with software such as avrdude (all platforms) that use the libUSB driver.
* </tr>
+ * <tr>
+ * <td>XCK_RESCUE_CLOCK_ENABLE</td>
+ * <td>Makefile LUFA_OPTS</td>
+ * <td>Define to move the ISP rescue clock to the AVR's XCK pin instead of the OCR1A output pin. This is useful for existing programming
+ * hardware that does not expose the OCR1A pin of the AVR, but *may* cause some issues with PDI programming mode.
+ * </tr>
* </table>
*/
* </table>
*/
diff --git
a/Projects/AVRISP-MKII/Lib/ISP/ISPTarget.c
b/Projects/AVRISP-MKII/Lib/ISP/ISPTarget.c
index
66a1c25
..
657c2c9
100644
(file)
--- a/
Projects/AVRISP-MKII/Lib/ISP/ISPTarget.c
+++ b/
Projects/AVRISP-MKII/Lib/ISP/ISPTarget.c
@@
-189,19
+189,29
@@
void ISPTarget_DisableTargetISP(void)
*/
void ISPTarget_ConfigureRescueClock(void)
{
*/
void ISPTarget_ConfigureRescueClock(void)
{
- /* Configure OCR1A as an output for the specified AVR model */
- #if defined(USB_SERIES_2_AVR)
- DDRC |= (1 << 6);
+ #if defined(XCK_RESCUE_CLOCK_ENABLE)
+ /* Configure XCK as an output for the specified AVR model */
+ DDRD |= (1 << 5);
+
+ /* Start USART to generate a 4MHz clock on the XCK pin */
+ UBRR1 = ((F_CPU / 2 / ISP_RESCUE_CLOCK_SPEED) - 1);
+ UCSR1B = (1 << TXEN1);
+ UCSR1C = (1 << UMSEL10) | (1 << UPM11) | (1 << USBS1) | (1 << UCSZ11) | (1 << UCSZ10) | (1 << UCPOL1);
#else
#else
- DDRB |= (1 << 5);
+ /* Configure OCR1A as an output for the specified AVR model */
+ #if defined(USB_SERIES_2_AVR)
+ DDRC |= (1 << 6);
+ #else
+ DDRB |= (1 << 5);
+ #endif
+
+ /* Start Timer 1 to generate a 4MHz clock on the OCR1A pin */
+ TIMSK1 = 0;
+ TCNT1 = 0;
+ OCR1A = ((F_CPU / 2 / ISP_RESCUE_CLOCK_SPEED) - 1);
+ TCCR1A = (1 << COM1A0);
+ TCCR1B = ((1 << WGM12) | (1 << CS10));
#endif
#endif
-
- /* Start Timer 1 to generate a 4MHz clock on the OCR1A pin */
- TIMSK1 = 0;
- TCNT1 = 0;
- OCR1A = ((F_CPU / 2 / ISP_RESCUE_CLOCK_SPEED) - 1);
- TCCR1A = (1 << COM1A0);
- TCCR1B = ((1 << WGM12) | (1 << CS10));
}
/** Configures the AVR's timer ready to produce software ISP for the slower ISP speeds that
}
/** Configures the AVR's timer ready to produce software ISP for the slower ISP speeds that
diff --git
a/Projects/AVRISP-MKII/Lib/XPROG/XPROGProtocol.c
b/Projects/AVRISP-MKII/Lib/XPROG/XPROGProtocol.c
index
02fbbf4
..
276f63e
100644
(file)
--- a/
Projects/AVRISP-MKII/Lib/XPROG/XPROGProtocol.c
+++ b/
Projects/AVRISP-MKII/Lib/XPROG/XPROGProtocol.c
@@
-196,6
+196,10
@@
static void XPROGProtocol_LeaveXPROGMode(void)
XPROGTarget_DisableTargetTPI();
}
XPROGTarget_DisableTargetTPI();
}
+ #if defined(XCK_RESCUE_CLOCK_ENABLE) && defined(ENABLE_ISP_PROTOCOL)
+ ISPTarget_ConfigureRescueClock();
+ #endif
+
Endpoint_Write_Byte(CMD_XPROG);
Endpoint_Write_Byte(XPRG_CMD_LEAVE_PROGMODE);
Endpoint_Write_Byte(XPRG_ERR_OK);
Endpoint_Write_Byte(CMD_XPROG);
Endpoint_Write_Byte(XPRG_CMD_LEAVE_PROGMODE);
Endpoint_Write_Byte(XPRG_ERR_OK);
diff --git
a/Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.c
b/Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.c
index
8760e62
..
f6fff1c
100644
(file)
--- a/
Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.c
+++ b/
Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.c
@@
-118,7
+118,7
@@
void XPROGTarget_DisableTargetTPI(void)
/* Set all USART lines as input, tristate */
DDRD &= ~((1 << 5) | (1 << 3));
PORTD &= ~((1 << 5) | (1 << 3) | (1 << 2));
/* Set all USART lines as input, tristate */
DDRD &= ~((1 << 5) | (1 << 3));
PORTD &= ~((1 << 5) | (1 << 3) | (1 << 2));
-
+
/* Tristate target /RESET line */
AUX_LINE_DDR &= ~AUX_LINE_MASK;
AUX_LINE_PORT &= ~AUX_LINE_MASK;
/* Tristate target /RESET line */
AUX_LINE_DDR &= ~AUX_LINE_MASK;
AUX_LINE_PORT &= ~AUX_LINE_MASK;
diff --git
a/Projects/AVRISP-MKII/makefile
b/Projects/AVRISP-MKII/makefile
index
6c6e117
..
5135722
100644
(file)
--- a/
Projects/AVRISP-MKII/makefile
+++ b/
Projects/AVRISP-MKII/makefile
@@
-137,6
+137,7
@@
LUFA_OPTS += -D VTARGET_REF_VOLTS=5
LUFA_OPTS += -D VTARGET_SCALE_FACTOR=1
#LUFA_OPTS += -D NO_VTARGET_DETECT
#LUFA_OPTS += -D LIBUSB_DRIVER_COMPAT
LUFA_OPTS += -D VTARGET_SCALE_FACTOR=1
#LUFA_OPTS += -D NO_VTARGET_DETECT
#LUFA_OPTS += -D LIBUSB_DRIVER_COMPAT
+#LUFA_OPTS += -D XCK_RESCUE_CLOCK_ENABLE
# Create the LUFA source path variables by including the LUFA root makefile
# Create the LUFA source path variables by including the LUFA root makefile