From d3e00ce1eca6a7736f30b2e93992d0d5a6161de6 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Tue, 13 Jul 2010 04:16:23 +0000 Subject: Rename the AVRISP main source files to AVRISP-MKII so that it matches the project name. Add AVRStudio project file for the AVRISP-MKII project. --- Projects/AVRISP-MKII/AVRISP-MKII.aps | 1 + Projects/AVRISP-MKII/AVRISP-MKII.c | 130 ++++++++++++++++ Projects/AVRISP-MKII/AVRISP-MKII.h | 81 ++++++++++ Projects/AVRISP-MKII/AVRISP-MKII.txt | 285 +++++++++++++++++++++++++++++++++++ Projects/AVRISP-MKII/AVRISP.c | 130 ---------------- Projects/AVRISP-MKII/AVRISP.h | 81 ---------- Projects/AVRISP-MKII/AVRISP.txt | 285 ----------------------------------- Projects/AVRISP-MKII/makefile | 2 +- 8 files changed, 498 insertions(+), 497 deletions(-) create mode 100644 Projects/AVRISP-MKII/AVRISP-MKII.aps create mode 100644 Projects/AVRISP-MKII/AVRISP-MKII.c create mode 100644 Projects/AVRISP-MKII/AVRISP-MKII.h create mode 100644 Projects/AVRISP-MKII/AVRISP-MKII.txt delete mode 100644 Projects/AVRISP-MKII/AVRISP.c delete mode 100644 Projects/AVRISP-MKII/AVRISP.h delete mode 100644 Projects/AVRISP-MKII/AVRISP.txt (limited to 'Projects') diff --git a/Projects/AVRISP-MKII/AVRISP-MKII.aps b/Projects/AVRISP-MKII/AVRISP-MKII.aps new file mode 100644 index 000000000..f8a825f16 --- /dev/null +++ b/Projects/AVRISP-MKII/AVRISP-MKII.aps @@ -0,0 +1 @@ +AVRISP-MKII13-Jul-2010 14:10:1013-Jul-2010 14:14:47241013-Jul-2010 14:10:1044, 18, 0, 685AVR GCCAVRISP-MKII.elfC:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Projects\AVRISP-MKII\AVR ONE!AT90USB1287.xmlfalseR00R01R02R03R04R05R06R07R08R09R10R11R12R13R14R15R16R17R18R19R20R21R22R23R24R25R26R27R28R29R30R31Auto000Descriptors.cLib\V2Protocol.cLib\V2ProtocolParams.cLib\ISP\ISPProtocol.cLib\ISP\ISPTarget.cLib\XPROG\TINYNVM.cLib\XPROG\XMEGANVM.cLib\XPROG\XPROGProtocol.cLib\XPROG\XPROGTarget.cAVRISP-MKII.cDescriptors.hLib\V2Protocol.hLib\V2ProtocolConstants.hLib\V2ProtocolParams.hLib\ISP\ISPProtocol.hLib\ISP\ISPTarget.hLib\XPROG\TINYNVM.hLib\XPROG\XMEGANVM.hLib\XPROG\XPROGProtocol.hLib\XPROG\XPROGTarget.hAVRISP-MKII.hmakefiledefaultYESmakefileat90usb1287111AVRISP-MKII.elfdefault\1-Wall -gdwarf-2 -std=gnu99 -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enumsdefault1C:\WinAVR-20100110\bin\avr-gcc.exeC:\WinAVR-20100110\utils\bin\make.exeC:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Projects\AVRISP-MKII\AVRISP.hC:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Projects\AVRISP-MKII\Descriptors.hC:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Projects\AVRISP-MKII\Lib\V2Protocol.hC:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Projects\AVRISP-MKII\Lib\V2ProtocolConstants.hC:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Projects\AVRISP-MKII\Lib\V2ProtocolParams.hC:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Projects\AVRISP-MKII\Lib\ISP\ISPProtocol.hC:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Projects\AVRISP-MKII\Lib\ISP\ISPTarget.hC:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Projects\AVRISP-MKII\Lib\XPROG\TINYNVM.hC:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Projects\AVRISP-MKII\Lib\XPROG\XMEGANVM.hC:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Projects\AVRISP-MKII\Lib\XPROG\XPROGProtocol.hC:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Projects\AVRISP-MKII\Lib\XPROG\XPROGTarget.hC:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Projects\AVRISP-MKII\AVRISP.cC:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Projects\AVRISP-MKII\Descriptors.cC:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Projects\AVRISP-MKII\Lib\V2Protocol.cC:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Projects\AVRISP-MKII\Lib\V2ProtocolParams.cC:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Projects\AVRISP-MKII\Lib\ISP\ISPProtocol.cC:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Projects\AVRISP-MKII\Lib\ISP\ISPTarget.cC:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Projects\AVRISP-MKII\Lib\XPROG\TINYNVM.cC:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Projects\AVRISP-MKII\Lib\XPROG\XMEGANVM.cC:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Projects\AVRISP-MKII\Lib\XPROG\XPROGProtocol.cC:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Projects\AVRISP-MKII\Lib\XPROG\XPROGTarget.c00000AVRISP.c1 diff --git a/Projects/AVRISP-MKII/AVRISP-MKII.c b/Projects/AVRISP-MKII/AVRISP-MKII.c new file mode 100644 index 000000000..7293906bb --- /dev/null +++ b/Projects/AVRISP-MKII/AVRISP-MKII.c @@ -0,0 +1,130 @@ +/* + LUFA Library + Copyright (C) Dean Camera, 2010. + + dean [at] fourwalledcubicle [dot] com + www.fourwalledcubicle.com +*/ + +/* + Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com) + + Permission to use, copy, modify, distribute, and sell this + software and its documentation for any purpose is hereby granted + without fee, provided that the above copyright notice appear in + all copies and that both that the copyright notice and this + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the + software without specific, written prior permission. + + The author disclaim all warranties with regard to this + software, including all implied warranties of merchantability + and fitness. In no event shall the author be liable for any + special, indirect or consequential damages or any damages + whatsoever resulting from loss of use, data or profits, whether + in an action of contract, negligence or other tortious action, + arising out of or in connection with the use or performance of + this software. +*/ + +/** \file + * + * Main source file for the AVRISP project. This file contains the main tasks of + * the project and is responsible for the initial application hardware configuration. + */ + +#include "AVRISP-MKII.h" + +/** Main program entry point. This routine contains the overall program flow, including initial + * setup of all components and the main program loop. + */ +int main(void) +{ + SetupHardware(); + V2Protocol_Init(); + + LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); + sei(); + + for (;;) + { + AVRISP_Task(); + USB_USBTask(); + } +} + +/** Configures the board hardware and chip peripherals for the demo's functionality. */ +void SetupHardware(void) +{ + /* Disable watchdog if enabled by bootloader/fuses */ + MCUSR &= ~(1 << WDRF); + wdt_disable(); + + /* Disable clock division */ + clock_prescale_set(clock_div_1); + + /* Hardware Initialization */ + LEDs_Init(); + USB_Init(); +} + +/** Event handler for the library USB Connection event. */ +void EVENT_USB_Device_Connect(void) +{ + LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING); +} + +/** Event handler for the library USB Disconnection event. */ +void EVENT_USB_Device_Disconnect(void) +{ + LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); +} + +/** Event handler for the library USB Configuration Changed event. */ +void EVENT_USB_Device_ConfigurationChanged(void) +{ + /* Indicate USB connected and ready */ + LEDs_SetAllLEDs(LEDMASK_USB_READY); + + /* Setup AVRISP data Endpoints */ + if (!(Endpoint_ConfigureEndpoint(AVRISP_DATA_OUT_EPNUM, EP_TYPE_BULK, + ENDPOINT_DIR_OUT, AVRISP_DATA_EPSIZE, + ENDPOINT_BANK_SINGLE))) + { + LEDs_SetAllLEDs(LEDMASK_USB_ERROR); + } + + #if defined(LIBUSB_DRIVER_COMPAT) + if (!(Endpoint_ConfigureEndpoint(AVRISP_DATA_IN_EPNUM, EP_TYPE_BULK, + ENDPOINT_DIR_IN, AVRISP_DATA_EPSIZE, + ENDPOINT_BANK_SINGLE))) + { + LEDs_SetAllLEDs(LEDMASK_USB_ERROR); + } + #endif +} + +/** Processes incoming V2 Protocol commands from the host, returning a response when required. */ +void AVRISP_Task(void) +{ + /* Device must be connected and configured for the task to run */ + if (USB_DeviceState != DEVICE_STATE_Configured) + return; + + V2Params_UpdateParamValues(); + + Endpoint_SelectEndpoint(AVRISP_DATA_OUT_EPNUM); + + /* Check to see if a V2 Protocol command has been received */ + if (Endpoint_IsOUTReceived()) + { + LEDs_SetAllLEDs(LEDMASK_BUSY); + + /* Pass off processing of the V2 Protocol command to the V2 Protocol handler */ + V2Protocol_ProcessCommand(); + + LEDs_SetAllLEDs(LEDMASK_USB_READY); + } +} + diff --git a/Projects/AVRISP-MKII/AVRISP-MKII.h b/Projects/AVRISP-MKII/AVRISP-MKII.h new file mode 100644 index 000000000..1018ebc3d --- /dev/null +++ b/Projects/AVRISP-MKII/AVRISP-MKII.h @@ -0,0 +1,81 @@ +/* + LUFA Library + Copyright (C) Dean Camera, 2010. + + dean [at] fourwalledcubicle [dot] com + www.fourwalledcubicle.com +*/ + +/* + Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com) + + Permission to use, copy, modify, distribute, and sell this + software and its documentation for any purpose is hereby granted + without fee, provided that the above copyright notice appear in + all copies and that both that the copyright notice and this + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the + software without specific, written prior permission. + + The author disclaim all warranties with regard to this + software, including all implied warranties of merchantability + and fitness. In no event shall the author be liable for any + special, indirect or consequential damages or any damages + whatsoever resulting from loss of use, data or profits, whether + in an action of contract, negligence or other tortious action, + arising out of or in connection with the use or performance of + this software. +*/ + +/** \file + * + * Header file for AVRISP.c. + */ + +#ifndef _AVRISP_H_ +#define _AVRISP_H_ + + /* Includes: */ + #include + #include + #include + #include + + #include "Descriptors.h" + + #include + #include + #include + + #if defined(ADC) + #include + #endif + + #include "Lib/V2Protocol.h" + + /* Macros: */ + /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ + #define LEDMASK_USB_NOTREADY LEDS_LED1 + + /** LED mask for the library LED driver, to indicate that the USB interface is enumerating. */ + #define LEDMASK_USB_ENUMERATING (LEDS_LED2 | LEDS_LED3) + + /** LED mask for the library LED driver, to indicate that the USB interface is ready. */ + #define LEDMASK_USB_READY (LEDS_LED2 | LEDS_LED4) + + /** LED mask for the library LED driver, to indicate that an error has occurred in the USB interface. */ + #define LEDMASK_USB_ERROR (LEDS_LED1 | LEDS_LED3) + + /** LED mask for the library LED driver, to indicate that the USB interface is busy. */ + #define LEDMASK_BUSY (LEDS_LED1 | LEDS_LED2) + + /* Function Prototypes: */ + void SetupHardware(void); + void AVRISP_Task(void); + + void EVENT_USB_Device_Connect(void); + void EVENT_USB_Device_Disconnect(void); + void EVENT_USB_Device_ConfigurationChanged(void); + +#endif diff --git a/Projects/AVRISP-MKII/AVRISP-MKII.txt b/Projects/AVRISP-MKII/AVRISP-MKII.txt new file mode 100644 index 000000000..c4ba43ccc --- /dev/null +++ b/Projects/AVRISP-MKII/AVRISP-MKII.txt @@ -0,0 +1,285 @@ +/** \file + * + * This file contains special DoxyGen information for the generation of the main page and other special + * documentation pages. It is not a project source file. + */ + +/** \mainpage AVRISP MKII Programmer Project + * + * \section SSec_Compat Project Compatibility: + * + * The following list indicates what microcontrollers are compatible with this project. + * + * - Series 7 USB AVRs + * - Series 6 USB AVRs + * - Series 4 USB AVRs + * - Series 2 USB AVRs (8KB versions with reduced features only) + * + * \section SSec_Info USB Information: + * + * The following table gives a rundown of the USB utilization of this project. + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
USB Mode:Device
USB Class:Vendor Specific Class
USB Subclass:N/A
Relevant Standards:Atmel AVRISP MKII Protocol Specification
Usable Speeds:Full Speed Mode
+ * + * \section SSec_Description Project Description: + * + * Firmware for an AVRStudio compatible AVRISP-MKII clone programmer. This project will enable the USB AVR series of + * microcontrollers to act as a clone of the official Atmel AVRISP-MKII programmer, usable within AVRStudio. In its + * most basic form, it allows for the programming of 5V AVRs from within AVRStudio with no special hardware other than + * the USB AVR and the parts needed for the USB interface. If the user desires, more advanced circuits incorporating + * level conversion can be made to allow for the programming of 3.3V AVR designs. + * + * This device spoofs Atmel's official AVRISP-MKII device PID so that it remains compatible with Atmel's AVRISP-MKII + * drivers. When prompted, direct your OS to install Atmel's AVRISP-MKII drivers provided with AVRStudio. + * + * Note that this design currently has the following limitations: + * - Minimum ISP target clock speed of 500KHz due to hardware SPI module prescaler limitations + * - No reversed/shorted target connector detection and notification + * - A seperate header is required for each of the ISP, PDI and TPI programming protocols that the user wishes to use + * + * On AVR models with an ADC converter, AVCC should be tied to 5V (e.g. VBUS) and the VTARGET_ADC_CHANNEL token should be + * set to an appropriate ADC channel number in the project makefile for VTARGET detection to operate correctly. On models + * without an ADC converter, VTARGET will report a fixed 5V level at all times. + * + * While this application can be compiled for USB AVRs with as little as 8KB of FLASH, for full functionality 16KB or more + * of FLASH is required. On 8KB devices, ISP or PDI/TPI programming support can be disabled to reduce program size. + * + * \section Sec_ISP ISP Connections + * Connections to the device for SPI programming (when enabled): + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Programmer Pin:Target Device Pin:ISP 6 Pin Layout:
MISOPDO1
ADCx 1VTARGET2
SCLKSCLK3
MOSIPDI4
PORTx.y 2/RESET5
GNDGND6
+ * + * In addition, the AVR's XCK pin will generate a .5MHz clock when SPI programming is used, to act as an external + * device clock if the fuses have been mis-set. To use the recovery clock, connect XCK to the target AVR's XTAL1 + * pin, and set the ISP programming speed to 125KHz or below. + * + * 1 Optional, see \ref SSec_Options section - for USB AVRs with ADC modules only \n + * 2 See AUX line related tokens in the \ref SSec_Options section + * + * \section Sec_PDI PDI Connections + * Connections to the device for PDI programming (when enabled): + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Programmer Pin:Target Device Pin:PDI 6 Pin Layout:
Tx/Rx 2DATA1
ADCx 1VTARGET2
N/AN/A3
N/AN/A4
XCKCLOCK5
GNDGND6
+ * + * 1 Optional, see \ref SSec_Options section - for USB AVRs with ADC modules only \n + * 2 The AVR's Tx and Rx become the DATA line when connected together via a pair of 220 ohm resistors \n + * + * \section Sec_TPI TPI Connections + * Connections to the device for TPI programming (when enabled): + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Programmer Pin:Target Device Pin:TPI 6 Pin Layout:
Tx/Rx 2DATA1
ADCx 1VTARGET2
XCK 2CLOCK3
N/AN/A4
PORTx.y 3/RESET5
GNDGND6
+ * + * 1 Optional, see \ref SSec_Options section - for USB AVRs with ADC modules only \n + * 2 The AVR's Tx and Rx become the DATA line when connected together via a pair of 220 ohm resistors \n + * 3 See AUX line related tokens in the \ref SSec_Options section + * + * \section SSec_Options Project Options + * + * The following defines can be found in this project, which can control the project behaviour when defined, or changed in value. + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Define Name:Location:Description:
AUX_LINE_PORTMakefile CDEFSPORT register for the programmer's AUX target line. The use of this line varies between the programming protocols, + * but is generally used for the target's /RESET line. Ignored when compiled for the XPLAIN board.
AUX_LINE_PINMakefile CDEFSPIN register for the programmer's AUX target line. The use of this line varies between the programming protocols, + * but is generally used for the target's /RESET line. Ignored when compiled for the XPLAIN board.
AUX_LINE_DDRMakefile CDEFSDDR register for the programmer's AUX target line. The use of this line varies between the programming protocols, + * but is generally used for the target's /RESET line. Ignored when compiled for the XPLAIN board.
AUX_LINE_MASKMakefile CDEFSMask for the programmer's AUX target line. The use of this line varies between the programming protocols, + * but is generally used for the target's /RESET line. Must not be the AVR's /SS pin. Ignored when + * compiled for the XPLAIN board.
VTARGET_ADC_CHANNELMakefile CDEFSADC channel number (on supported AVRs) to use for VTARGET level detection, if NO_VTARGET_DETECT is not defined. + * Ignored when compiled for targets lacking an ADC.
ENABLE_ISP_PROTOCOLMakefile CDEFSDefine to enable SPI programming protocol support. Ignored when compiled for the XPLAIN board.
ENABLE_XPROG_PROTOCOLMakefile CDEFSDefine to enable PDI and TPI programming protocol support. Ignored when compiled for the XPLAIN board.
NO_VTARGET_DETECTMakefile CDEFSDefine to disable VTARGET sampling and reporting on AVR models with an ADC converter. This will cause the programmer + * to report a fixed 5V target voltage to the host regardless of the real target voltage. Ignored when compiled for + * targets lacking an ADC.
VTARGET_REF_VOLTSMakefile CDEFSIndicates the programmer AVR's AVCC reference voltage when measuring the target's supply voltage. Note that the supply + * voltage should never exceed the reference voltage on the programmer AVR without some form of protection to prevent damage + * to the ADC. Ignored when compiled for targets lacking an ADC, or when NO_VTARGET_DETECT is defined.
VTARGET_SCALE_FACTORMakefile CDEFSIndicates the target's supply voltage scale factor when applied to the ADC. A simple resistive divider can be used on the + * ADC pin for measuring the target's supply voltage, so that voltages above the programmer AVR's AVCC reference voltage can be + * measured. This should be the reciprocal of the division performed - e.g. if the VTARGET voltage is halved, this should be set + * to 2. Ignored when compiled for targets lacking an ADC, or when NO_VTARGET_DETECT is defined.
LIBUSB_DRIVER_COMPATMakefile CDEFSDefine 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. + *
+ */ diff --git a/Projects/AVRISP-MKII/AVRISP.c b/Projects/AVRISP-MKII/AVRISP.c deleted file mode 100644 index 33ea07b52..000000000 --- a/Projects/AVRISP-MKII/AVRISP.c +++ /dev/null @@ -1,130 +0,0 @@ -/* - LUFA Library - Copyright (C) Dean Camera, 2010. - - dean [at] fourwalledcubicle [dot] com - www.fourwalledcubicle.com -*/ - -/* - Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com) - - Permission to use, copy, modify, distribute, and sell this - software and its documentation for any purpose is hereby granted - without fee, provided that the above copyright notice appear in - all copies and that both that the copyright notice and this - permission notice and warranty disclaimer appear in supporting - documentation, and that the name of the author not be used in - advertising or publicity pertaining to distribution of the - software without specific, written prior permission. - - The author disclaim all warranties with regard to this - software, including all implied warranties of merchantability - and fitness. In no event shall the author be liable for any - special, indirect or consequential damages or any damages - whatsoever resulting from loss of use, data or profits, whether - in an action of contract, negligence or other tortious action, - arising out of or in connection with the use or performance of - this software. -*/ - -/** \file - * - * Main source file for the AVRISP project. This file contains the main tasks of - * the project and is responsible for the initial application hardware configuration. - */ - -#include "AVRISP.h" - -/** Main program entry point. This routine contains the overall program flow, including initial - * setup of all components and the main program loop. - */ -int main(void) -{ - SetupHardware(); - V2Protocol_Init(); - - LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); - sei(); - - for (;;) - { - AVRISP_Task(); - USB_USBTask(); - } -} - -/** Configures the board hardware and chip peripherals for the demo's functionality. */ -void SetupHardware(void) -{ - /* Disable watchdog if enabled by bootloader/fuses */ - MCUSR &= ~(1 << WDRF); - wdt_disable(); - - /* Disable clock division */ - clock_prescale_set(clock_div_1); - - /* Hardware Initialization */ - LEDs_Init(); - USB_Init(); -} - -/** Event handler for the library USB Connection event. */ -void EVENT_USB_Device_Connect(void) -{ - LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING); -} - -/** Event handler for the library USB Disconnection event. */ -void EVENT_USB_Device_Disconnect(void) -{ - LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); -} - -/** Event handler for the library USB Configuration Changed event. */ -void EVENT_USB_Device_ConfigurationChanged(void) -{ - /* Indicate USB connected and ready */ - LEDs_SetAllLEDs(LEDMASK_USB_READY); - - /* Setup AVRISP data Endpoints */ - if (!(Endpoint_ConfigureEndpoint(AVRISP_DATA_OUT_EPNUM, EP_TYPE_BULK, - ENDPOINT_DIR_OUT, AVRISP_DATA_EPSIZE, - ENDPOINT_BANK_SINGLE))) - { - LEDs_SetAllLEDs(LEDMASK_USB_ERROR); - } - - #if defined(LIBUSB_DRIVER_COMPAT) - if (!(Endpoint_ConfigureEndpoint(AVRISP_DATA_IN_EPNUM, EP_TYPE_BULK, - ENDPOINT_DIR_IN, AVRISP_DATA_EPSIZE, - ENDPOINT_BANK_SINGLE))) - { - LEDs_SetAllLEDs(LEDMASK_USB_ERROR); - } - #endif -} - -/** Processes incoming V2 Protocol commands from the host, returning a response when required. */ -void AVRISP_Task(void) -{ - /* Device must be connected and configured for the task to run */ - if (USB_DeviceState != DEVICE_STATE_Configured) - return; - - V2Params_UpdateParamValues(); - - Endpoint_SelectEndpoint(AVRISP_DATA_OUT_EPNUM); - - /* Check to see if a V2 Protocol command has been received */ - if (Endpoint_IsOUTReceived()) - { - LEDs_SetAllLEDs(LEDMASK_BUSY); - - /* Pass off processing of the V2 Protocol command to the V2 Protocol handler */ - V2Protocol_ProcessCommand(); - - LEDs_SetAllLEDs(LEDMASK_USB_READY); - } -} - diff --git a/Projects/AVRISP-MKII/AVRISP.h b/Projects/AVRISP-MKII/AVRISP.h deleted file mode 100644 index 1018ebc3d..000000000 --- a/Projects/AVRISP-MKII/AVRISP.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - LUFA Library - Copyright (C) Dean Camera, 2010. - - dean [at] fourwalledcubicle [dot] com - www.fourwalledcubicle.com -*/ - -/* - Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com) - - Permission to use, copy, modify, distribute, and sell this - software and its documentation for any purpose is hereby granted - without fee, provided that the above copyright notice appear in - all copies and that both that the copyright notice and this - permission notice and warranty disclaimer appear in supporting - documentation, and that the name of the author not be used in - advertising or publicity pertaining to distribution of the - software without specific, written prior permission. - - The author disclaim all warranties with regard to this - software, including all implied warranties of merchantability - and fitness. In no event shall the author be liable for any - special, indirect or consequential damages or any damages - whatsoever resulting from loss of use, data or profits, whether - in an action of contract, negligence or other tortious action, - arising out of or in connection with the use or performance of - this software. -*/ - -/** \file - * - * Header file for AVRISP.c. - */ - -#ifndef _AVRISP_H_ -#define _AVRISP_H_ - - /* Includes: */ - #include - #include - #include - #include - - #include "Descriptors.h" - - #include - #include - #include - - #if defined(ADC) - #include - #endif - - #include "Lib/V2Protocol.h" - - /* Macros: */ - /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ - #define LEDMASK_USB_NOTREADY LEDS_LED1 - - /** LED mask for the library LED driver, to indicate that the USB interface is enumerating. */ - #define LEDMASK_USB_ENUMERATING (LEDS_LED2 | LEDS_LED3) - - /** LED mask for the library LED driver, to indicate that the USB interface is ready. */ - #define LEDMASK_USB_READY (LEDS_LED2 | LEDS_LED4) - - /** LED mask for the library LED driver, to indicate that an error has occurred in the USB interface. */ - #define LEDMASK_USB_ERROR (LEDS_LED1 | LEDS_LED3) - - /** LED mask for the library LED driver, to indicate that the USB interface is busy. */ - #define LEDMASK_BUSY (LEDS_LED1 | LEDS_LED2) - - /* Function Prototypes: */ - void SetupHardware(void); - void AVRISP_Task(void); - - void EVENT_USB_Device_Connect(void); - void EVENT_USB_Device_Disconnect(void); - void EVENT_USB_Device_ConfigurationChanged(void); - -#endif diff --git a/Projects/AVRISP-MKII/AVRISP.txt b/Projects/AVRISP-MKII/AVRISP.txt deleted file mode 100644 index c4ba43ccc..000000000 --- a/Projects/AVRISP-MKII/AVRISP.txt +++ /dev/null @@ -1,285 +0,0 @@ -/** \file - * - * This file contains special DoxyGen information for the generation of the main page and other special - * documentation pages. It is not a project source file. - */ - -/** \mainpage AVRISP MKII Programmer Project - * - * \section SSec_Compat Project Compatibility: - * - * The following list indicates what microcontrollers are compatible with this project. - * - * - Series 7 USB AVRs - * - Series 6 USB AVRs - * - Series 4 USB AVRs - * - Series 2 USB AVRs (8KB versions with reduced features only) - * - * \section SSec_Info USB Information: - * - * The following table gives a rundown of the USB utilization of this project. - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
USB Mode:Device
USB Class:Vendor Specific Class
USB Subclass:N/A
Relevant Standards:Atmel AVRISP MKII Protocol Specification
Usable Speeds:Full Speed Mode
- * - * \section SSec_Description Project Description: - * - * Firmware for an AVRStudio compatible AVRISP-MKII clone programmer. This project will enable the USB AVR series of - * microcontrollers to act as a clone of the official Atmel AVRISP-MKII programmer, usable within AVRStudio. In its - * most basic form, it allows for the programming of 5V AVRs from within AVRStudio with no special hardware other than - * the USB AVR and the parts needed for the USB interface. If the user desires, more advanced circuits incorporating - * level conversion can be made to allow for the programming of 3.3V AVR designs. - * - * This device spoofs Atmel's official AVRISP-MKII device PID so that it remains compatible with Atmel's AVRISP-MKII - * drivers. When prompted, direct your OS to install Atmel's AVRISP-MKII drivers provided with AVRStudio. - * - * Note that this design currently has the following limitations: - * - Minimum ISP target clock speed of 500KHz due to hardware SPI module prescaler limitations - * - No reversed/shorted target connector detection and notification - * - A seperate header is required for each of the ISP, PDI and TPI programming protocols that the user wishes to use - * - * On AVR models with an ADC converter, AVCC should be tied to 5V (e.g. VBUS) and the VTARGET_ADC_CHANNEL token should be - * set to an appropriate ADC channel number in the project makefile for VTARGET detection to operate correctly. On models - * without an ADC converter, VTARGET will report a fixed 5V level at all times. - * - * While this application can be compiled for USB AVRs with as little as 8KB of FLASH, for full functionality 16KB or more - * of FLASH is required. On 8KB devices, ISP or PDI/TPI programming support can be disabled to reduce program size. - * - * \section Sec_ISP ISP Connections - * Connections to the device for SPI programming (when enabled): - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Programmer Pin:Target Device Pin:ISP 6 Pin Layout:
MISOPDO1
ADCx 1VTARGET2
SCLKSCLK3
MOSIPDI4
PORTx.y 2/RESET5
GNDGND6
- * - * In addition, the AVR's XCK pin will generate a .5MHz clock when SPI programming is used, to act as an external - * device clock if the fuses have been mis-set. To use the recovery clock, connect XCK to the target AVR's XTAL1 - * pin, and set the ISP programming speed to 125KHz or below. - * - * 1 Optional, see \ref SSec_Options section - for USB AVRs with ADC modules only \n - * 2 See AUX line related tokens in the \ref SSec_Options section - * - * \section Sec_PDI PDI Connections - * Connections to the device for PDI programming (when enabled): - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Programmer Pin:Target Device Pin:PDI 6 Pin Layout:
Tx/Rx 2DATA1
ADCx 1VTARGET2
N/AN/A3
N/AN/A4
XCKCLOCK5
GNDGND6
- * - * 1 Optional, see \ref SSec_Options section - for USB AVRs with ADC modules only \n - * 2 The AVR's Tx and Rx become the DATA line when connected together via a pair of 220 ohm resistors \n - * - * \section Sec_TPI TPI Connections - * Connections to the device for TPI programming (when enabled): - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Programmer Pin:Target Device Pin:TPI 6 Pin Layout:
Tx/Rx 2DATA1
ADCx 1VTARGET2
XCK 2CLOCK3
N/AN/A4
PORTx.y 3/RESET5
GNDGND6
- * - * 1 Optional, see \ref SSec_Options section - for USB AVRs with ADC modules only \n - * 2 The AVR's Tx and Rx become the DATA line when connected together via a pair of 220 ohm resistors \n - * 3 See AUX line related tokens in the \ref SSec_Options section - * - * \section SSec_Options Project Options - * - * The following defines can be found in this project, which can control the project behaviour when defined, or changed in value. - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Define Name:Location:Description:
AUX_LINE_PORTMakefile CDEFSPORT register for the programmer's AUX target line. The use of this line varies between the programming protocols, - * but is generally used for the target's /RESET line. Ignored when compiled for the XPLAIN board.
AUX_LINE_PINMakefile CDEFSPIN register for the programmer's AUX target line. The use of this line varies between the programming protocols, - * but is generally used for the target's /RESET line. Ignored when compiled for the XPLAIN board.
AUX_LINE_DDRMakefile CDEFSDDR register for the programmer's AUX target line. The use of this line varies between the programming protocols, - * but is generally used for the target's /RESET line. Ignored when compiled for the XPLAIN board.
AUX_LINE_MASKMakefile CDEFSMask for the programmer's AUX target line. The use of this line varies between the programming protocols, - * but is generally used for the target's /RESET line. Must not be the AVR's /SS pin. Ignored when - * compiled for the XPLAIN board.
VTARGET_ADC_CHANNELMakefile CDEFSADC channel number (on supported AVRs) to use for VTARGET level detection, if NO_VTARGET_DETECT is not defined. - * Ignored when compiled for targets lacking an ADC.
ENABLE_ISP_PROTOCOLMakefile CDEFSDefine to enable SPI programming protocol support. Ignored when compiled for the XPLAIN board.
ENABLE_XPROG_PROTOCOLMakefile CDEFSDefine to enable PDI and TPI programming protocol support. Ignored when compiled for the XPLAIN board.
NO_VTARGET_DETECTMakefile CDEFSDefine to disable VTARGET sampling and reporting on AVR models with an ADC converter. This will cause the programmer - * to report a fixed 5V target voltage to the host regardless of the real target voltage. Ignored when compiled for - * targets lacking an ADC.
VTARGET_REF_VOLTSMakefile CDEFSIndicates the programmer AVR's AVCC reference voltage when measuring the target's supply voltage. Note that the supply - * voltage should never exceed the reference voltage on the programmer AVR without some form of protection to prevent damage - * to the ADC. Ignored when compiled for targets lacking an ADC, or when NO_VTARGET_DETECT is defined.
VTARGET_SCALE_FACTORMakefile CDEFSIndicates the target's supply voltage scale factor when applied to the ADC. A simple resistive divider can be used on the - * ADC pin for measuring the target's supply voltage, so that voltages above the programmer AVR's AVCC reference voltage can be - * measured. This should be the reciprocal of the division performed - e.g. if the VTARGET voltage is halved, this should be set - * to 2. Ignored when compiled for targets lacking an ADC, or when NO_VTARGET_DETECT is defined.
LIBUSB_DRIVER_COMPATMakefile CDEFSDefine 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. - *
- */ diff --git a/Projects/AVRISP-MKII/makefile b/Projects/AVRISP-MKII/makefile index 1e2a86549..343448998 100644 --- a/Projects/AVRISP-MKII/makefile +++ b/Projects/AVRISP-MKII/makefile @@ -102,7 +102,7 @@ FORMAT = ihex # Target file name (without extension). -TARGET = AVRISP +TARGET = AVRISP-MKII # Object files directory -- cgit v1.2.3