Added new VTARGET_USE_INTERNAL_REF configuration option to the AVRISP-MKII clone project (thanks to Volker Bosch).

pull/1469/head
Dean Camera 14 years ago
parent d5e874d348
commit 025742fca8

@ -39,6 +39,7 @@
* - Added new AudioInputHost Host LowLevel demo * - Added new AudioInputHost Host LowLevel demo
* - Added new AudioOutputHost Host LowLevel demo * - Added new AudioOutputHost Host LowLevel demo
* - Added new "checksource" target to all library project makefiles * - Added new "checksource" target to all library project makefiles
* - Added new VTARGET_USE_INTERNAL_REF configuration option to the AVRISP-MKII clone project (thanks to Volker Bosch)
* *
* <b>Changed:</b> * <b>Changed:</b>
* - Core: * - Core:

@ -117,7 +117,7 @@
* can be accurately set and the \ref EVENT_USB_Device_Connect() and \ref EVENT_USB_Device_Disconnect() events manually raised by the RAISE_EVENT macro. * can be accurately set and the \ref EVENT_USB_Device_Connect() and \ref EVENT_USB_Device_Disconnect() events manually raised by the RAISE_EVENT macro.
* When defined, this token disables the library's auto-detection of the connection state by the aforementioned suspension and wake up events. * When defined, this token disables the library's auto-detection of the connection state by the aforementioned suspension and wake up events.
* *
* <b>NO_SOF_EVENTS</b> - (\ref Group_Events) - <i>AVR8, UC3</i> \n * <b>NO_SOF_EVENTS</b> - (\ref Group_Events) - <i>All Architectures</i> \n
* By default, there exists a LUFA application event for the start of each USB frame while the USB bus is not suspended in either host or device mode. * By default, there exists a LUFA application event for the start of each USB frame while the USB bus is not suspended in either host or device mode.
* This event can be selectively enabled or disabled by calling the appropriate device or host mode function. When this compile time token is defined, * This event can be selectively enabled or disabled by calling the appropriate device or host mode function. When this compile time token is defined,
* the ability to receive USB Start of Frame events via the \ref EVENT_USB_Device_StartOfFrame() or \ref EVENT_USB_Host_StartOfFrame() events is removed, * the ability to receive USB Start of Frame events via the \ref EVENT_USB_Device_StartOfFrame() or \ref EVENT_USB_Host_StartOfFrame() events is removed,
@ -167,7 +167,7 @@
* is through control endpoint requests. Defining this token will remove several features related to the selection and control of device * is through control endpoint requests. Defining this token will remove several features related to the selection and control of device
* endpoints internally, saving space. Generally, this is usually only useful in (some) bootloaders and is best avoided. * endpoints internally, saving space. Generally, this is usually only useful in (some) bootloaders and is best avoided.
* *
* <b>INTERRUPT_CONTROL_ENDPOINT</b> - (\ref Group_USBManagement) - <i>AVR8 Only</i> \n * <b>INTERRUPT_CONTROL_ENDPOINT</b> - (\ref Group_USBManagement) - <i>All Architectures</i> \n
* Some applications prefer to not call the USB_USBTask() management task regularly while in device mode, as it can complicate code significantly. * Some applications prefer to not call the USB_USBTask() management task regularly while in device mode, as it can complicate code significantly.
* Instead, when device mode is used this token can be passed to the library via the -D switch to allow the library to manage the USB control * Instead, when device mode is used this token can be passed to the library via the -D switch to allow the library to manage the USB control
* endpoint entirely via USB controller interrupts asynchronously to the user application. When defined, USB_USBTask() does not need to be called * endpoint entirely via USB controller interrupts asynchronously to the user application. When defined, USB_USBTask() does not need to be called

@ -267,6 +267,12 @@
* to the ADC. <i>Ignored when compiled for targets lacking an ADC, or when NO_VTARGET_DETECT is defined.</i></td> * to the ADC. <i>Ignored when compiled for targets lacking an ADC, or when NO_VTARGET_DETECT is defined.</i></td>
* </tr> * </tr>
* <tr> * <tr>
* <td>VTARGET_USE_INTERNAL_REF</td>
* <td>Makefile LUFA_OPTS</td>
* <td>Selects the internal 2.56V ADC reference voltage, instead of using the AVR's VREF pin. When enabled, this option will
* override the VTARGET_REF_VOLTS configuration option.</i></td>
* </tr>
* <tr>
* <td>VTARGET_SCALE_FACTOR</td> * <td>VTARGET_SCALE_FACTOR</td>
* <td>Makefile LUFA_OPTS</td> * <td>Makefile LUFA_OPTS</td>
* <td>Indicates the target's supply voltage scale factor when applied to the ADC. A simple resistive divider can be used on the * <td>Indicates the target's supply voltage scale factor when applied to the ADC. A simple resistive divider can be used on the

@ -57,7 +57,7 @@ void V2Protocol_Init(void)
/* Initialize the ADC converter for VTARGET level detection on supported AVR models */ /* Initialize the ADC converter for VTARGET level detection on supported AVR models */
ADC_Init(ADC_FREE_RUNNING | ADC_PRESCALE_128); ADC_Init(ADC_FREE_RUNNING | ADC_PRESCALE_128);
ADC_SetupChannel(VTARGET_ADC_CHANNEL); ADC_SetupChannel(VTARGET_ADC_CHANNEL);
ADC_StartReading(ADC_REFERENCE_AVCC | ADC_RIGHT_ADJUSTED | VTARGET_ADC_CHANNEL_MASK); ADC_StartReading(VTARGET_REF_MASK | ADC_RIGHT_ADJUSTED | VTARGET_ADC_CHANNEL_MASK);
#endif #endif
V2Params_LoadNonVolatileParamValues(); V2Params_LoadNonVolatileParamValues();

@ -62,6 +62,15 @@
#error The U4 AVR chips do not contain ADC channels 2 or 3. Please change VTARGET_ADC_CHANNEL or define NO_VTARGET_DETECT in the makefile. #error The U4 AVR chips do not contain ADC channels 2 or 3. Please change VTARGET_ADC_CHANNEL or define NO_VTARGET_DETECT in the makefile.
#endif #endif
#if defined(VTARGET_USE_INTERNAL_REF)
#undef VTARGET_REF_VOLTS
#define VTARGET_REF_VOLTS 2.56
#define VTARGET_REF_MASK ADC_REFERENCE_INT2560MV
#else
#define VTARGET_REF_MASK ADC_REFERENCE_AVCC
#endif
/* Macros: */ /* Macros: */
/** Programmer ID string, returned to the host during the CMD_SIGN_ON command processing. */ /** Programmer ID string, returned to the host during the CMD_SIGN_ON command processing. */
#define PROGRAMMER_ID "AVRISP_MK2" #define PROGRAMMER_ID "AVRISP_MK2"

@ -140,6 +140,7 @@ LUFA_OPTS += -D ENABLE_XPROG_PROTOCOL
LUFA_OPTS += -D VTARGET_ADC_CHANNEL=2 LUFA_OPTS += -D VTARGET_ADC_CHANNEL=2
LUFA_OPTS += -D VTARGET_REF_VOLTS=5 LUFA_OPTS += -D VTARGET_REF_VOLTS=5
LUFA_OPTS += -D VTARGET_SCALE_FACTOR=1 LUFA_OPTS += -D VTARGET_SCALE_FACTOR=1
#LUFA_OPTS += -D VTARGET_USE_INTERNAL_REF
#LUFA_OPTS += -D NO_VTARGET_DETECT #LUFA_OPTS += -D NO_VTARGET_DETECT
#LUFA_OPTS += -D LIBUSB_DRIVER_COMPAT #LUFA_OPTS += -D LIBUSB_DRIVER_COMPAT
#LUFA_OPTS += -D XCK_RESCUE_CLOCK_ENABLE #LUFA_OPTS += -D XCK_RESCUE_CLOCK_ENABLE

Loading…
Cancel
Save