bootloader/bootloaderconfig.h File Reference

This file (together with some settings in Makefile) configures the boot loader according to the hardware. More...

Go to the source code of this file.

Defines

#define USB_CFG_IOPORTNAME   D
 This is the port where the USB bus is connected.
#define USB_CFG_DMINUS_BIT   0
 This is the bit number in USB_CFG_IOPORT where the USB D- line is connected.
#define USB_CFG_DPLUS_BIT   2
 This is the bit number in USB_CFG_IOPORT where the USB D+ line is connected.
#define USB_CFG_CLOCK_KHZ   (F_CPU/1000)
 Clock rate of the AVR in MHz.
#define HAVE_EEPROM_PAGED_ACCESS   1
 If HAVE_EEPROM_PAGED_ACCESS is defined to 1, page mode access to EEPROM is compiled in.
#define HAVE_EEPROM_BYTE_ACCESS   1
 If HAVE_EEPROM_BYTE_ACCESS is defined to 1, byte mode access to EEPROM is compiled in.
#define BOOTLOADER_CAN_EXIT   1
 If this macro is defined to 1, the boot loader will exit shortly after the programmer closes the connection to the device.
#define SIGNATURE_BYTES   0x1e, 0x95, 0x02, 0
 This macro defines the signature bytes returned by the emulated USBasp to the programmer software.

Variables

uint8_t ledcounter = 0
 counter used to set the speed of the running light
uint8_t ledstate = 0
 state of the running light


Detailed Description

This file (together with some settings in Makefile) configures the boot loader according to the hardware.

This file contains (besides the hardware configuration normally found in usbconfig.h) two functions or macros: bootLoaderInit() and bootLoaderCondition(). Whether you implement them as macros or as static inline functions is up to you, decide based on code size and convenience.

bootLoaderInit() is called as one of the first actions after reset. It should be a minimum initialization of the hardware so that the boot loader condition can be read. This will usually consist of activating a pull-up resistor for an external jumper which selects boot loader mode.

bootLoaderCondition() is called immediately after initialization and in each main loop iteration. If it returns TRUE, the boot loader will be active. If it returns FALSE, the boot loader jumps to address 0 (the loaded application) immediately.

For compatibility with Thomas Fischl's avrusbboot, we also support the macro names BOOTLOADER_INIT and BOOTLOADER_CONDITION for this functionality. If these macros are defined, the boot loader usees them.

Author:
Ronald Schaten <ronald@schatenseite.de>
Version:
Id
bootloaderconfig.h,v 1.1 2008-07-09 20:47:11 rschaten Exp

License: GNU GPL v2 (see License.txt)

Definition in file bootloaderconfig.h.


Define Documentation

#define BOOTLOADER_CAN_EXIT   1

If this macro is defined to 1, the boot loader will exit shortly after the programmer closes the connection to the device.

Costs ~36 bytes.

Definition at line 91 of file bootloaderconfig.h.

#define HAVE_EEPROM_BYTE_ACCESS   1

If HAVE_EEPROM_BYTE_ACCESS is defined to 1, byte mode access to EEPROM is compiled in.

Byte mode is only used if the device (as identified by its signature) does not support page mode for EEPROM. It is required for accessing the EEPROM on the ATMega8. Costs ~54 bytes.

Definition at line 87 of file bootloaderconfig.h.

#define HAVE_EEPROM_PAGED_ACCESS   1

If HAVE_EEPROM_PAGED_ACCESS is defined to 1, page mode access to EEPROM is compiled in.

Whether page mode or byte mode access is used by AVRDUDE depends on the target device. Page mode is only used if the device supports it, e.g. for the ATMega88, 168 etc. You can save quite a bit of memory by disabling page mode EEPROM access. Costs ~ 138 bytes.

Definition at line 81 of file bootloaderconfig.h.

#define SIGNATURE_BYTES   0x1e, 0x95, 0x02, 0

This macro defines the signature bytes returned by the emulated USBasp to the programmer software.

They should match the actual device at least in memory size and features. If you don't define this, values for ATMega8, ATMega88, ATMega168 and ATMega328 are guessed correctly.

Definition at line 97 of file bootloaderconfig.h.

#define USB_CFG_CLOCK_KHZ   (F_CPU/1000)

Clock rate of the AVR in MHz.

Legal values are 12000, 16000 or 16500. The 16.5 MHz version of the code requires no crystal, it tolerates +/- 1% deviation from the nominal frequency. All other rates require a precision of 2000 ppm and thus a crystal! Default if not specified: 12 MHz

Definition at line 55 of file bootloaderconfig.h.

#define USB_CFG_DMINUS_BIT   0

This is the bit number in USB_CFG_IOPORT where the USB D- line is connected.

This may be any bit in the port.

Definition at line 43 of file bootloaderconfig.h.

#define USB_CFG_DPLUS_BIT   2

This is the bit number in USB_CFG_IOPORT where the USB D+ line is connected.

This may be any bit in the port. Please note that D+ must also be connected to interrupt pin INT0!

Definition at line 48 of file bootloaderconfig.h.

#define USB_CFG_IOPORTNAME   D

This is the port where the USB bus is connected.

When you configure it to "B", the registers PORTB, PINB and DDRB will be used.

Definition at line 39 of file bootloaderconfig.h.


Variable Documentation

uint8_t ledcounter = 0

counter used to set the speed of the running light

Definition at line 118 of file bootloaderconfig.h.

uint8_t ledstate = 0

state of the running light

Definition at line 119 of file bootloaderconfig.h.


Generated on Sat Jul 12 22:27:15 2008 for Dulcimer by  doxygen 1.5.4