├── README ├── README_zh-cn.txt ├── bin └── win32 │ ├── 7z.dll │ ├── 7z.exe │ ├── avrdude-arduino.exe │ ├── avrdude.conf │ ├── bootloadHID.exe │ ├── cp.exe │ ├── echo.exe │ ├── msys-1.0.dll │ ├── mv.exe │ ├── posix.7z │ ├── setenv.sh │ ├── sh.exe │ └── winavr-20090313.7z ├── buildenv.cmd ├── buildenv.sh ├── doc └── arduino_lite_pins.txt ├── hardware ├── README ├── atmega │ ├── atmega_basic.pdf │ └── atmega_basic.sch └── attiny26 │ ├── attiny26_basic.pdf │ └── attiny26_basic.sch ├── launchsh.cmd ├── scripts ├── mak_avr_common.inc ├── mak_avr_def.inc └── mak_lib.inc ├── shenv.sh ├── sketch ├── ledfading │ ├── Makefile │ ├── README.txt │ ├── build.cmd │ ├── launchsh.cmd │ └── src │ │ ├── fading.cpp │ │ └── you_can_put_files_in_any_path │ │ └── example.cpp └── template.zip └── src ├── bootloaders ├── README ├── atmega8 │ ├── ATmegaBOOT.c │ ├── ATmegaBOOT@16.hex │ ├── ATmegaBOOT@8.hex │ └── Makefile ├── atmegax8 │ ├── ATmegaBOOT_168.c │ ├── ATmegaBOOT_168_atmega1280.hex │ ├── ATmegaBOOT_168_atmega328.hex │ ├── ATmegaBOOT_168_atmega328_pro_8MHz.hex │ ├── ATmegaBOOT_168_diecimila.hex │ ├── ATmegaBOOT_168_ng.hex │ ├── ATmegaBOOT_168_pro_8MHz.hex │ ├── ATmegaBOOT_168_std_16Mhz.hex │ ├── ATmegaBOOT_88_pro_12MHz.hex │ ├── ATmegaBOOT_88_pro_8MHz.hex │ ├── Makefile │ └── Makefile_mega88 └── hidbootloader │ ├── Makefile_mega168_12M │ ├── Makefile_mega88_12M │ ├── Makefile_mega8_12M │ ├── bootloaderconfig.h │ ├── fuse.txt │ ├── hardware_requirement.txt │ ├── main.c │ ├── pre-compiled │ ├── mega168_12M.hex │ ├── mega88_12M.hex │ └── mega8_12M.hex │ ├── usbconfig.h │ └── usbdrv │ ├── Changelog.txt │ ├── CommercialLicense.txt │ ├── License.txt │ ├── Readme.txt │ ├── USBID-License.txt │ ├── asmcommon.inc │ ├── oddebug.c │ ├── oddebug.h │ ├── usbconfig-prototype.h │ ├── usbdrv.c │ ├── usbdrv.h │ ├── usbdrvasm.S │ ├── usbdrvasm.asm │ ├── usbdrvasm12.inc │ ├── usbdrvasm128.inc │ ├── usbdrvasm15.inc │ ├── usbdrvasm16.inc │ ├── usbdrvasm165.inc │ ├── usbdrvasm20.inc │ └── usbportability.h └── core ├── WConstants.h ├── WInterrupts.c ├── WMath.c ├── WProgram.h ├── abs_io.h ├── arduino_lit.h ├── binary.h ├── net_serial.cpp ├── net_serial.h ├── pins_arduino.c ├── pins_arduino.h ├── pins_arduino_lit.h ├── simp_print.cpp ├── simp_print.h ├── wiring.c ├── wiring.h ├── wiring_analog.c ├── wiring_digital.c ├── wiring_lit.h ├── wiring_private.h ├── wiring_pulse.c └── wiring_shift.c /README: -------------------------------------------------------------------------------- 1 | Welcome to use Arduino-Lite, the light-weight and efficient arduino-variant runtime library for AVR based devices. 2 | 3 | Arduino-Lite is based on the work of Arduino Project: www.arduino.cc 4 | 5 | This library is orignally used by RoboPeak team (www.robopeak.com) and we are proud of releasing it to the public. 6 | 7 | Project website: http://code.google.com/p/arduino-lite 8 | RoboPeak Prject: http://www.robopeak.com 9 | 10 | --------------------------- 11 | First Use: 12 | --------------------------- 13 | If it is the first time for this lib to run on the machine (checked-out from the SVN, extracted from the downloaded package file), please follow these steps: 14 | 15 | a. make sure the current platform is supported (see Support Platforms) 16 | c. execute the batch file: buildenv.cmd under the source root 17 | This script will extract the WinAVR automatically and configure the working envirnoment. 18 | b. you are ready to use Arduino-Lite after the script exit 19 | 20 | Arduino-Lite is self-contained, which means you don't need to install/download any extra software/lib before (Yes, Arduino-lite also includes WINAVR for you). 21 | 22 | --------------------------- 23 | Supported Platforms: 24 | --------------------------- 25 | The source code shoud work on all platforms (Linux, MacOS, Win32) but the build system only supports Win32 currently. 26 | 27 | We had verified the following Windows versions: 28 | <> Windows XP 32bit 29 | <> Windows Vista 32bit and 64bit 30 | <> Windows 7 32bit and 64bit 31 | 32 | --------------------------- 33 | Create New Project 34 | --------------------------- 35 | Arduino-Lite Project can be created via the template file under /sketch/template.zip 36 | 37 | To create your own project: 38 | 1) extract the template.zip under the folder /sketch 39 | 2) make sure the extracted folder is like the following: 40 | /sketch/template/build.cmd 41 | 3) rename the dir template to any name you like, e.g. helloAVR 42 | 4) You have done. 43 | 44 | --------------------------- 45 | Compile a Project 46 | --------------------------- 47 | 1) enter the project folder (e.g. helloAVR), execute the batch file launchsh.cmd 48 | 2) type make 49 | 3) If there is no error during the building phase, you will get the hex/elf file under /build/ 50 | 51 | --------------------------- 52 | Documents? 53 | --------------------------- 54 | You may refer to the following links: 55 | Introduction to Arduino-Lite: 56 | http://www.robopeak.net/blog/?p=131 57 | 58 | How to install and use Arduino-Lite: 59 | http://www.robopeak.net/blog/?p=151 60 | 61 | Arduino-Lite Interface & Development Mannual 62 | http://www.robopeak.net/blog/?p=107 63 | 64 | Arduino-Lite Project homepage: 65 | http://code.google.com/p/arduino-lite 66 | 67 | Besides, you may check RoboPeak website(http://www.robopeak.com) for additional tips. (some articles may written in Chinese only) 68 | 69 | As Arduino-Lite are similar to the offical Arduino library, you will find most function calls are alike. So the offical Arduino referece document is helpful. 70 | 71 | 72 | --------------------------- 73 | Avaliable Make Commands 74 | --------------------------- 75 | Compiling Related: 76 | <> make/make all 77 | build the current project 78 | <> make clean 79 | clean the previous build result 80 | 81 | Chip programming and setting: 82 | <> make upload 83 | upload the hex to the AVR chip (via STK500v2 bootloader, serial-cable) 84 | <> make usbupload 85 | upload the the to the AVR chip via USB cable (require BootloaderHID) 86 | <> make burn 87 | burning the hex to the AVR chip via RoboPeak USB Connector programmer (or any AVR-Doper compatible devices) 88 | <> make erase 89 | erase the AVR chip via RoboPeak USB Connector programmer (or any AVR-Doper compatible devices) 90 | <> make fuse 91 | configure the AVR chip's fuse setting via RoboPeak USB Connector programmer (or any AVR-Doper compatible devices) 92 | <> make lock 93 | configure the AVR chip's lock-bit setting via RoboPeak USB Connector programmer (or any AVR-Doper compatible devices) 94 | 95 | Code analysis & debugging 96 | <> make dump 97 | disassembly the generated binary (*.elf) to AVR assembly code 98 | <> make dumpobj 99 | disassembly each generated object file (*.o) to AVR assembly code 100 | 101 | --------------------------- 102 | Contact the Author 103 | --------------------------- 104 | The inital developer of Arduino-Lite is Shikai Chen (www.csksoft.net). For any question, please contact via E-mail: 105 | CSK@live.com 106 | -------------------------------------------------------------------------------- /README_zh-cn.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robopeak/arduino-lite/11e477c7b8ddd7efbcedd7e0a45b23205a86290a/README_zh-cn.txt -------------------------------------------------------------------------------- /bin/win32/7z.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robopeak/arduino-lite/11e477c7b8ddd7efbcedd7e0a45b23205a86290a/bin/win32/7z.dll -------------------------------------------------------------------------------- /bin/win32/7z.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robopeak/arduino-lite/11e477c7b8ddd7efbcedd7e0a45b23205a86290a/bin/win32/7z.exe -------------------------------------------------------------------------------- /bin/win32/avrdude-arduino.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robopeak/arduino-lite/11e477c7b8ddd7efbcedd7e0a45b23205a86290a/bin/win32/avrdude-arduino.exe -------------------------------------------------------------------------------- /bin/win32/bootloadHID.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robopeak/arduino-lite/11e477c7b8ddd7efbcedd7e0a45b23205a86290a/bin/win32/bootloadHID.exe -------------------------------------------------------------------------------- /bin/win32/cp.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robopeak/arduino-lite/11e477c7b8ddd7efbcedd7e0a45b23205a86290a/bin/win32/cp.exe -------------------------------------------------------------------------------- /bin/win32/echo.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robopeak/arduino-lite/11e477c7b8ddd7efbcedd7e0a45b23205a86290a/bin/win32/echo.exe -------------------------------------------------------------------------------- /bin/win32/msys-1.0.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robopeak/arduino-lite/11e477c7b8ddd7efbcedd7e0a45b23205a86290a/bin/win32/msys-1.0.dll -------------------------------------------------------------------------------- /bin/win32/mv.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robopeak/arduino-lite/11e477c7b8ddd7efbcedd7e0a45b23205a86290a/bin/win32/mv.exe -------------------------------------------------------------------------------- /bin/win32/posix.7z: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robopeak/arduino-lite/11e477c7b8ddd7efbcedd7e0a45b23205a86290a/bin/win32/posix.7z -------------------------------------------------------------------------------- /bin/win32/setenv.sh: -------------------------------------------------------------------------------- 1 | # RoboPeak Project 2 | # http://www.robopeak.com 3 | # 4 | # 5 | #!/bin/sh 6 | #This is actually a bashrc... 7 | #SET current PATH as bin 8 | export PATH=`pwd`:"`pwd`/posix":"`pwd`/WinAVR-20090313/utils/libusb/bin":$PATH 9 | 10 | #useful alias 11 | alias ls='ls --color=auto' 12 | alias ll='ls -l' 13 | 14 | -------------------------------------------------------------------------------- /bin/win32/sh.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robopeak/arduino-lite/11e477c7b8ddd7efbcedd7e0a45b23205a86290a/bin/win32/sh.exe -------------------------------------------------------------------------------- /bin/win32/winavr-20090313.7z: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robopeak/arduino-lite/11e477c7b8ddd7efbcedd7e0a45b23205a86290a/bin/win32/winavr-20090313.7z -------------------------------------------------------------------------------- /buildenv.cmd: -------------------------------------------------------------------------------- 1 | @REM RoboPeak Project 2 | @REM www.RoboPeak.com 3 | @REM 4 | @REM The buildenv.sh bashshell loader for WIN32 5 | @ECHO OFF 6 | 7 | bin\win32\sh -c ./buildenv.sh 8 | -------------------------------------------------------------------------------- /buildenv.sh: -------------------------------------------------------------------------------- 1 | # RoboPeak Project 2 | # www.RoboPeak.com 3 | # 4 | #!/bin/sh 5 | 6 | #Assumes win32 is the only target platform 7 | 8 | cd bin/win32 9 | . ./setenv.sh 10 | 11 | echo "Phase1. extracting the full POSIX env." 12 | 7z x posix.7z 13 | 14 | echo "Phase2. extracting the GCC-AVR( WinAVR for win32 )." 15 | 7z x winavr-20090313.7z 16 | 17 | -------------------------------------------------------------------------------- /doc/arduino_lite_pins.txt: -------------------------------------------------------------------------------- 1 | PIN for standard arduino: 2 | 3 | // ATMEL ATMEGA8 & 168 4 | // 5 | // +-\/-+ 6 | // PC6 1| |28 PC5 (AI 5/*D19) 7 | // (D 0) PD0 2| |27 PC4 (AI 4/*D18) 8 | // (D 1) PD1 3| |26 PC3 (AI 3/*D17) 9 | // (D 2) PD2 4| |25 PC2 (AI 2/*D16) 10 | // PWM+ (D 3) PD3 5| |24 PC1 (AI 1/*D15) 11 | // (D 4) PD4 6| |23 PC0 (AI 0/*D14) 12 | // VCC 7| |22 GND 13 | // GND 8| |21 AREF 14 | // *(D20) PB6 9| |20 AVCC 15 | // *(D21) PB7 10| |19 PB5 (D 13) 16 | // PWM+ (D 5) PD5 11| |18 PB4 (D 12) 17 | // PWM+ (D 6) PD6 12| |17 PB3 (D 11) PWM 18 | // (D 7) PD7 13| |16 PB2 (D 10) PWM 19 | // (D 8) PB0 14| |15 PB1 (D 9) PWM 20 | // +----+ 21 | // 22 | // (PWM+ indicates the additional PWM pins on the ATmega168.) 23 | // Pins with the star(*): arduinoLite extention 24 | 25 | PIN for Attiny2313 (only in Arduino Lite) 26 | //Fuse setting for 2313: eFuse: 0xFF lFuse: 0xDF hFuse:0xDD 27 | 28 | // +-\/-+ 29 | // RESET 1| |20 VCC 30 | // D0 (RXD) PD0 2| |19 PB7 (UCSK/SCL/PCINT7) D14 31 | // D1 (TXD) PD1 3| |18 PB6 (MISO/DO/PCINT6) D13 32 | // (XTAL2) PA1 4| |17 PB5 (MOSI/DI/SDA/PCINT5) D12 33 | // (XTAL1) PA0 5| |16 PB4 (OC1B/PCINT4) D11 PWM 34 | // D2 (CKOUT/XCK/INT0) PD2 6| |15 PB3 (OC1A/PCINT3) D10 PWM 35 | // D3 (INT1) PD3 7| |14 PB2 (OC0A/PCINT2) D9 PWM 36 | // D4 (T0) PD4 8| |13 PB1 (AIN1/PCINT1) D8 37 | // PWM D5 (OC0B/T1) PD5 9| |12 PB0 (AIN0/PCINT0) D7 38 | // GND 10| |11 PD6 (ICP) D6 39 | // +----+ 40 | 41 | PIN for Attiny26 (only in Arduino Lite) 42 | 43 | 44 | // +-\/-+ 45 | // ~PWM D0 MOSI/DI/SDA/!OC1A) PB0 1| |20 PA0 (ADC0) A0/D7 46 | // PWM D1 (MISO/DO/OC1A) PB1 2| |19 PA1 (ADC1) A1/D8 47 | // ~PWM D2 (SCK/SCL/!OC1B) PB2 3| |18 PA2 (ADC2) A2/D9 48 | // PWM D3 (OC1B) PB3 4| |17 PA3 (AREF) 49 | // VCC 5| |16 GND 50 | // GND 6| |15 AVCC 51 | // D4/A7 (ADC7/XTAL1) PB4 7| |14 PA4 (ADC3) A3/D10 52 | // D5/A8 (ADC8/XTAL2) PB5 8| |13 PA5 (ADC4) A4/D11 53 | // D6/A9 (ADC9/INT0/T0) PB6 9| |12 PA6 (ADC5/AIN0) A5/D12 54 | // (ADC10/RESET) PB7 10| |11 PA7 (ADC6/AIN1) A6/D13 55 | // +----+ -------------------------------------------------------------------------------- /hardware/README: -------------------------------------------------------------------------------- 1 | Please use EAGLE to open these documents. 2 | -------------------------------------------------------------------------------- /hardware/atmega/atmega_basic.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robopeak/arduino-lite/11e477c7b8ddd7efbcedd7e0a45b23205a86290a/hardware/atmega/atmega_basic.pdf -------------------------------------------------------------------------------- /hardware/atmega/atmega_basic.sch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robopeak/arduino-lite/11e477c7b8ddd7efbcedd7e0a45b23205a86290a/hardware/atmega/atmega_basic.sch -------------------------------------------------------------------------------- /hardware/attiny26/attiny26_basic.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robopeak/arduino-lite/11e477c7b8ddd7efbcedd7e0a45b23205a86290a/hardware/attiny26/attiny26_basic.pdf -------------------------------------------------------------------------------- /hardware/attiny26/attiny26_basic.sch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robopeak/arduino-lite/11e477c7b8ddd7efbcedd7e0a45b23205a86290a/hardware/attiny26/attiny26_basic.sch -------------------------------------------------------------------------------- /launchsh.cmd: -------------------------------------------------------------------------------- 1 | @REM RoboPeak Project 2 | @REM www.RoboPeak.com 3 | @REM Launch the bash shell under win32 4 | @ECHO OFF 5 | 6 | 7 | 8 | bin\win32\sh -c "./shenv.sh" 9 | -------------------------------------------------------------------------------- /scripts/mak_avr_common.inc: -------------------------------------------------------------------------------- 1 | # 2 | # ArduinoLite Building System 3 | # By Shikai Chen (csk@live.com) 4 | # 5 | # 6 | 7 | .SUFFIXES: 8 | .SUFFIXES: .o .cpp .s 9 | 10 | .PHONY: all make_lib clean addition additionclean make_subs 11 | 12 | make_subs: 13 | @for subdir in $(MAKE_TARGETS) ; do \ 14 | $(MAKE) -C $$subdir $(MAKECMDGOALS) ; \ 15 | done 16 | 17 | # Detect any Eclipse set configs 18 | ifdef AVRARGETCPU 19 | MCU = $(AVRARGETCPU) 20 | endif 21 | 22 | ifdef AVRARGETFCPU 23 | F_CPU = $(AVRARGETFCPU) 24 | endif 25 | 26 | 27 | 28 | # Define all object files. 29 | 30 | _CSRC = $(filter-out %*.c,$(CSRC)) 31 | _CXXSRC = $(filter-out %*.cpp,$(CXXSRC)) 32 | _ASRC = $(filter-out %*.S,$(ASRC)) 33 | 34 | 35 | OBJ += $(patsubst %.c, $(TARGET_OBJ_ROOT)/%.o, $(_CSRC)) 36 | OBJ += $(patsubst %.cpp, $(TARGET_OBJ_ROOT)/%.o, $(_CXXSRC)) 37 | OBJ += $(patsubst %.S, $(TARGET_OBJ_ROOT)/%.o, $(_ASRC)) 38 | 39 | OBJ_DUMP = $(patsubst %.c, $(TARGET_OBJ_ROOT)/%.txt, $(_CSRC)) 40 | OBJ_DUMP += $(patsubst %.cpp, $(TARGET_OBJ_ROOT)/%.txt, $(_CXXSRC)) 41 | OBJ_DUMP += $(patsubst %.S, $(TARGET_OBJ_ROOT)/%.txt, $(_ASRC)) 42 | 43 | BIN_DUMP = $(TARGET).txt 44 | 45 | # Define all listing files. 46 | 47 | LST += $(patsubst %.c, $(TARGET_OBJ_ROOT)/%.lst, $(_CSRC)) 48 | LST += $(patsubst %.cpp, $(TARGET_OBJ_ROOT)/%.lst, $(_CXXSRC)) 49 | LST += $(patsubst %.S, $(TARGET_OBJ_ROOT)/%.lst, $(_ASRC)) 50 | 51 | DEP_FILE += $(patsubst %.c, $(TARGET_OBJ_ROOT)/%.d, $(_CSRC)) 52 | DEP_FILE += $(patsubst %.cpp, $(TARGET_OBJ_ROOT)/%.d, $(_CXXSRC)) 53 | 54 | build: elf hex 55 | 56 | clean: additionalclean 57 | $(REMOVE) -r $(AVR_OUTPUT_ROOT)/* 58 | 59 | elf: $(TARGET).elf 60 | hex: $(TARGET).hex 61 | eep: $(TARGET).eep 62 | lss: $(TARGET).lss 63 | sym: $(TARGET).sym 64 | 65 | # Program the device. 66 | 67 | # Burning command 68 | 69 | # BUILD FUSE updating commanding based on the actual configuration 70 | ifdef EFUSE 71 | BURNING_WRITE_FUSE += -U efuse:w:0x$(EFUSE):m 72 | endif 73 | 74 | ifdef HFUSE 75 | BURNING_WRITE_FUSE += -U hfuse:w:0x$(HFUSE):m 76 | endif 77 | 78 | ifdef LFUSE 79 | BURNING_WRITE_FUSE += -U lfuse:w:0x$(LFUSE):m 80 | endif 81 | 82 | ifdef LOCKFUSE 83 | BURNING_WRITE_LOCKFUSE = -U lock:w:0x$(LOCKFUSE):m 84 | endif 85 | 86 | 87 | # erase the chip and burning the hex file only 88 | burn: $(TARGET).hex 89 | $(AVRDUDE) $(BURNING_FLAGS) $(BURNING_WRITE_FLASH) 90 | 91 | fuse: 92 | $(AVRDUDE) $(BURNING_FLAGS) $(BURNING_WRITE_FUSE) 93 | 94 | lock: 95 | $(AVRDUDE) $(BURNING_FLAGS) $(BURNING_WRITE_LOCKFUSE) 96 | 97 | erase: 98 | $(AVRDUDE) $(BURNING_FLAGS) $(BURNING_EARSE_CHIP) 99 | 100 | # Bootloader command 101 | upload: $(TARGET).hex 102 | $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) 103 | 104 | usbupload: $(TARGET).hex 105 | $(HIDDOWNLOADER) $(TARGET).hex 106 | 107 | # DEBUGING SUPPORT 108 | 109 | # disassembly all the output file (*.o) 110 | dumpobj: $(OBJ_DUMP) 111 | 112 | # disassembly the elf file 113 | dump: $(BIN_DUMP) 114 | 115 | sizebefore: 116 | @if [ -f $(TARGET).elf ]; then echo; $(ELFSIZE); echo; fi 117 | 118 | sizeafter: 119 | @if [ -f $(TARGET).elf ]; then echo; $(HEXSIZE); echo; fi 120 | 121 | coff: $(TARGET).elf 122 | $(COFFCONVERT) -O coff-avr $(TARGET).elf $(TARGET).cof 123 | 124 | 125 | extcoff: $(TARGET).elf 126 | $(COFFCONVERT) -O coff-ext-avr $(TARGET).elf $(TARGET).cof 127 | 128 | 129 | .SUFFIXES: .elf .hex .eep .lss .sym 130 | 131 | ifneq ($(MAKECMDGOALS), clean) 132 | sinclude $(DEP_FILE) 133 | endif 134 | 135 | .elf.hex: 136 | $(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@ 137 | 138 | .elf.eep: 139 | -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \ 140 | --no-change-warnings --change-section-lma .eeprom=0 -O $(FORMAT) $< $@ 141 | 142 | # Create extended listing file from ELF output file. 143 | .elf.lss: 144 | $(OBJDUMP) -h -S $< > $@ 145 | 146 | # Create a symbol table from ELF output file. 147 | .elf.sym: 148 | $(NM) -n $< > $@ 149 | 150 | $(TARGET).elf: $(OBJ) $(EXTRA_OBJ) 151 | $(MKDIR) `$(DIRNAME) $@` 152 | $(CC) $(ALL_CFLAGS) --cref -o $@ -L. $^ $(LDFLAGS) 153 | 154 | # Compile: create object files from C++ source files. 155 | $(TARGET_OBJ_ROOT)/%.o: %.cpp 156 | $(MKDIR) `$(DIRNAME) $@` 157 | $(CXX) -c $(ALL_CXXFLAGS) $< -o $@ 158 | 159 | # Compile: create object files from C source files. 160 | $(TARGET_OBJ_ROOT)/%.o: %.c 161 | $(MKDIR) `$(DIRNAME) $@` 162 | $(CC) -c $(ALL_CFLAGS) $< -o $@ 163 | 164 | 165 | # Compile: create assembler files from C source files. 166 | $(TARGET_OBJ_ROOT)/%.s: %.c 167 | $(MKDIR) `$(DIRNAME) $@` 168 | $(CC) -S $(ALL_CFLAGS) $< -o $@ 169 | 170 | 171 | # Assemble: create object files from assembler source files. 172 | $(TARGET_OBJ_ROOT)/%.o: %.S 173 | $(MKDIR) `$(DIRNAME) $@` 174 | $(CC) -c $(ALL_ASFLAGS) $< -o $@ 175 | 176 | 177 | # Automatic dependencies 178 | $(TARGET_OBJ_ROOT)/%.d: %.c 179 | $(MKDIR) `$(DIRNAME) $@` 180 | ($(CC) -M $(ALL_CFLAGS) $< | $(SED) "s;$(notdir $*).o:;$(TARGET_OBJ_ROOT)/$*.o $(TARGET_OBJ_ROOT)/$*.d:;" ) > $@ 181 | 182 | $(TARGET_OBJ_ROOT)/%.d: %.cpp 183 | $(MKDIR) `$(DIRNAME) $@` 184 | ($(CXX) -M $(ALL_CXXFLAGS) $< | $(SED) "s;$(notdir $*).o:;$(TARGET_OBJ_ROOT)/$*.o $(TARGET_OBJ_ROOT)/$*.d:;" ) > $@ 185 | 186 | # Debugibility Support 187 | $(TARGET_OBJ_ROOT)/%.txt: $(TARGET_OBJ_ROOT)/%.o 188 | $(OBJDUMP) -d $< > $@ 189 | 190 | $(TARGET).txt: $(TARGET).elf lss 191 | $(OBJDUMP) -d $< > $@ 192 | 193 | .PHONY: all build elf hex eep lss sym program coff extcoff clean applet_files sizebefore sizeafter dump dumpobj 194 | 195 | 196 | 197 | -------------------------------------------------------------------------------- /scripts/mak_avr_def.inc: -------------------------------------------------------------------------------- 1 | 2 | ##################################### 3 | # ArduinoLite Building System 4 | # By Shikai Chen (csk@live.com) 5 | # Modified from Arduino's Makefile 6 | # 7 | # Dependency: 8 | # HOME_TREE , PRJ_NAME, BINARY_NAME, WINAVR_HOME 9 | BUILD_ROOT := build 10 | SOURCE_ROOT := $(HOME_TREE)/src 11 | TOOL_ROOT := $(HOME_TREE)/bin 12 | OUTPUT_ROOT := $(BUILD_ROOT) 13 | OBJ_ROOT := $(BUILD_ROOT)/obj 14 | LIB_ROOT := $(OBJ_ROOT)/lib 15 | 16 | ifndef WINAVR_HOME 17 | WINAVR_HOME := $(TOOL_ROOT)/win32/WinAVR-20090313 18 | endif 19 | 20 | REMOVE := $(TOOL_ROOT)/win32/posix/rm -f 21 | MV := $(TOOL_ROOT)/win32/posix/mv -f 22 | MKDIR := $(TOOL_ROOT)/win32/posix/mkdir -p 23 | SED := $(TOOL_ROOT)/win32/posix/sed 24 | FIND := $(TOOL_ROOT)/win32/posix/find 25 | DIRNAME := $(TOOL_ROOT)/win32/posix/dirname 26 | #we use the modified avrdude version provided by Arduino 27 | AVRDUDE := $(TOOL_ROOT)/win32/avrdude-arduino.exe 28 | 29 | #HID based usb bootloader download app for win32 30 | HIDDOWNLOADER := $(TOOL_ROOT)/win32/bootloadHID.exe 31 | 32 | AVR_RUNTIME_LIB := core.a 33 | AVR_RUNTIME_PATH := $(SOURCE_ROOT)/core 34 | AVR_OBJ_ROOT := $(OBJ_ROOT) 35 | AVR_OUTPUT_ROOT := $(OUTPUT_ROOT) 36 | TARGET := $(AVR_OUTPUT_ROOT)/$(BINARY_NAME) 37 | TARGET_OBJ_ROOT := $(AVR_OBJ_ROOT) 38 | 39 | ################################################################# 40 | #The follow are default config, please overide them if necessary. 41 | UPLOAD_PORT := COM3 42 | PORT_RATE := 19200 43 | 44 | MCU := atmega168 45 | F_CPU := 16000000L 46 | 47 | AVRDUDE_PROGRAMMER := stk500v1 48 | BURNING_PROGRAMMER := stk500v2 49 | ###################################### 50 | AVR_TOOLS_PATH = $(WINAVR_HOME)/bin 51 | 52 | FORMAT := ihex 53 | 54 | # Debugging format. 55 | # Native formats for AVR-GCC's -g are stabs [default], or dwarf-2. 56 | # AVR (extended) COFF requires stabs, plus an avr-objcopy run. 57 | DEBUG = stabs 58 | 59 | OPT = s 60 | 61 | # Place -D or -U options here 62 | CDEFS = -DF_CPU=$(F_CPU) -D_AVR_ $(EXTRA_DEFS) 63 | CXXDEFS = -DF_CPU=$(F_CPU) -D_AVR_ $(EXTRA_DEFS) 64 | 65 | 66 | # Compiler flag to set the C Standard level. 67 | # c89 - "ANSI" C 68 | # gnu89 - c89 plus GCC extensions 69 | # c99 - ISO C99 standard (not yet fully implemented) 70 | # gnu99 - c99 plus GCC extensions 71 | CSTANDARD = -std=gnu99 72 | CDEBUG = -g$(DEBUG) 73 | CWARN = -Wall -Wstrict-prototypes 74 | CTUNING = -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums 75 | #CEXTRA = -Wa,-adhlns=$(<:.c=.lst) 76 | 77 | 78 | CFLAGS = $(CDEBUG) $(CDEFS) $(CINCS) -O$(OPT) $(CWARN) $(CSTANDARD) $(CEXTRA) 79 | CXXFLAGS = $(CDEFS) $(CINCS) -O$(OPT) 80 | ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs $(CDEFS) $(CINCS) 81 | LDFLAGS = -lm -Wl,--gc-sections -Os 82 | 83 | # Programming support using avrdude. Settings and variables. 84 | AVRDUDE_PORT = $(PORT) 85 | AVRDUDE_WRITE_FLASH = -D -U flash:w:$(TARGET).hex 86 | AVRDUDE_FLAGS = -V \ 87 | -p $(MCU) -P $(UPLOAD_PORT) -c $(AVRDUDE_PROGRAMMER) \ 88 | -b $(PORT_RATE) 89 | 90 | BURNING_EARSE_CHIP = -e 91 | BURNING_WRITE_FUSE = 92 | BURNING_WRITE_LOCKFUSE = 93 | BURNING_WRITE_FLASH = -U flash:w:$(TARGET).hex 94 | BURNING_FLAGS = -F -p $(MCU) -P $(BURNING_PORT) -c $(BURNING_PROGRAMMER) 95 | BURNING_PORT = avrdoper 96 | 97 | BOOTLOADER_SERIAL_M8_8M = $(SOURCE_ROOT)/bootloaders/atmega8/ATmegaBOOT@8.hex 98 | BOOTLOADER_SERIAL_M8_16M = $(SOURCE_ROOT)/bootloaders/atmega8/ATmegaBOOT@16.hex 99 | BOOTLOADER_SERIAL_M88_8M = $(SOURCE_ROOT)/bootloaders/atmegax8/ATmegaBOOT_88_pro_8MHz.hex 100 | BOOTLOADER_SERIAL_M88_12M = $(SOURCE_ROOT)/bootloaders/atmegax8/ATmegaBOOT_88_pro_12MHz.hex 101 | BOOTLOADER_SERIAL_M168_8M = $(SOURCE_ROOT)/bootloaders/atmegax8/ATmegaBOOT_168_pro_8MHz.hex 102 | BOOTLOADER_SERIAL_M168_16M = $(SOURCE_ROOT)/bootloaders/atmegax8/ATmegaBOOT_168_diecimila.hex 103 | 104 | BOOTLOADER_USB_M8_12M = $(SOURCE_ROOT)/bootloaders/hidbootloader/pre-compiled/mega8_12M.hex 105 | BOOTLOADER_USB_M88_12M = $(SOURCE_ROOT)/bootloaders/hidbootloader/pre-compiled/mega88_12M.hex 106 | BOOTLOADER_USB_M168_12M = $(SOURCE_ROOT)/bootloaders/hidbootloader/pre-compiled/mega168_12M.hex 107 | ######################################## 108 | #Override the default compiler setting 109 | 110 | CC = $(AVR_TOOLS_PATH)/avr-gcc 111 | CXX = $(AVR_TOOLS_PATH)/avr-g++ 112 | OBJCOPY = $(AVR_TOOLS_PATH)/avr-objcopy 113 | OBJDUMP = $(AVR_TOOLS_PATH)/avr-objdump 114 | AR = $(AVR_TOOLS_PATH)/avr-ar 115 | SIZE = $(AVR_TOOLS_PATH)/avr-size 116 | NM = $(AVR_TOOLS_PATH)/avr-nm 117 | 118 | # Combine all necessary flags and optional flags. 119 | # Add target processor to flags. 120 | 121 | INCLUDE_PATH += -I. 122 | 123 | ALL_CFLAGS = -ffunction-sections -fdata-sections -mmcu=$(MCU) $(INCLUDE_PATH) $(CFLAGS) 124 | ALL_CXXFLAGS = -fno-exceptions -ffunction-sections -fdata-sections -mmcu=$(MCU) $(INCLUDE_PATH) $(CXXFLAGS) 125 | ALL_ASFLAGS = -mmcu=$(MCU) $(INCLUDE_PATH) -x assembler-with-cpp $(ASFLAGS) 126 | 127 | # Display size of file. 128 | HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex 129 | ELFSIZE = $(SIZE) $(TARGET).elf 130 | 131 | # Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB. 132 | COFFCONVERT=$(OBJCOPY) --debugging \ 133 | --change-section-address .data-0x800000 \ 134 | --change-section-address .bss-0x800000 \ 135 | --change-section-address .noinit-0x800000 \ 136 | --change-section-address .eeprom-0x810000 137 | -------------------------------------------------------------------------------- /scripts/mak_lib.inc: -------------------------------------------------------------------------------- 1 | LIB_CSRC := $(shell find $(AVR_RUNTIME_PATH)/ -name "*.c") 2 | LIB_CXXSRC := $(shell find $(AVR_RUNTIME_PATH)/ -name "*.cpp") 3 | 4 | 5 | LIB_AVR_OBJ_PATH := $(TARGET_OBJ_ROOT)/arduinolite 6 | 7 | INCLUDE_PATH += -I$(AVR_RUNTIME_PATH) 8 | 9 | LIB_OBJ += $(patsubst $(AVR_RUNTIME_PATH)/%.c, $(LIB_AVR_OBJ_PATH)/%.o, $(LIB_CSRC)) 10 | LIB_OBJ += $(patsubst $(AVR_RUNTIME_PATH)/%.cpp, $(LIB_AVR_OBJ_PATH)/%.o, $(LIB_CXXSRC)) 11 | LIB_OBJ += $(patsubst $(AVR_RUNTIME_PATH)/%.S, $(LIB_AVR_OBJ_PATH)/%.o, $(LIB_ASRC)) 12 | 13 | EXTRA_OBJ += $(LIB_AVR_OBJ_PATH)/$(AVR_RUNTIME_LIB) 14 | 15 | DEP_FILE+= $(patsubst $(AVR_RUNTIME_PATH)/%.c, $(LIB_AVR_OBJ_PATH)/%.d, $(LIB_CSRC)) 16 | DEP_FILE+= $(patsubst $(AVR_RUNTIME_PATH)/%.cpp, $(LIB_AVR_OBJ_PATH)/%.d, $(LIB_CXXSRC)) 17 | 18 | 19 | build_avr_lib: $(LIB_AVR_OBJ_PATH)/$(AVR_RUNTIME_LIB) 20 | 21 | $(LIB_AVR_OBJ_PATH)/$(AVR_RUNTIME_LIB) : $(LIB_OBJ) 22 | @for i in $(LIB_OBJ); do echo "$(AR) rcs $(LIB_AVR_OBJ_PATH)/$(AVR_RUNTIME_LIB) $$i"; $(AR) rcs $(LIB_AVR_OBJ_PATH)/$(AVR_RUNTIME_LIB) $$i; done 23 | 24 | 25 | clean_avr_lib: 26 | $(REMOVE) -r $(LIB_AVR_OBJ_PATH) 27 | 28 | $(LIB_AVR_OBJ_PATH)/%.o: $(AVR_RUNTIME_PATH)/%.c 29 | $(MKDIR) `$(DIRNAME) $@` 30 | $(CC) -c $(ALL_CFLAGS) $< -o $@ 31 | 32 | $(LIB_AVR_OBJ_PATH)/%.o: $(AVR_RUNTIME_PATH)/%.cpp 33 | $(MKDIR) `$(DIRNAME) $@` 34 | $(CXX) -c $(ALL_CXXFLAGS) $< -o $@ 35 | 36 | $(LIB_AVR_OBJ_PATH)/%.o: $(AVR_RUNTIME_PATH)/%.S 37 | $(MKDIR) `$(DIRNAME) $@` 38 | $(CC) -c $(ALL_ASFLAGS) $< -o $@ 39 | 40 | # Automatic dependencies 41 | $(LIB_AVR_OBJ_PATH)/%.d: $(AVR_RUNTIME_PATH)/%.cpp 42 | $(MKDIR) `$(DIRNAME) $@` 43 | ($(CXX) -M $(ALL_CXXFLAGS) $< | $(SED) "s;$(notdir $*).o:;$(LIB_AVR_OBJ_PATH)/$*.o $(LIB_AVR_OBJ_PATH)/$*.d:;") > $@ 44 | 45 | $(LIB_AVR_OBJ_PATH)/%.d: $(AVR_RUNTIME_PATH)/%.c 46 | $(MKDIR) `$(DIRNAME) $@` 47 | ($(CC) -M $(ALL_CFLAGS) $< | $(SED) "s;$(notdir $*).o:;$(LIB_AVR_OBJ_PATH)/$*.o $(LIB_AVR_OBJ_PATH)/$*.d:;") > $@ 48 | 49 | 50 | .PHONY: build_avr_lib build_lib_obj make_lib_path clean_avr_lib 51 | 52 | -------------------------------------------------------------------------------- /shenv.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | #For using under win32 only! 3 | 4 | export HOME_ROOT=`pwd` 5 | export PATH=$HOME_ROOT/scripts:$PATH 6 | 7 | cd bin/win32 8 | . ./setenv.sh 9 | 10 | if [ "$REDIRECT_PATH" == "" ];then 11 | cd ../.. 12 | else 13 | cd $REDIRECT_PATH 14 | fi 15 | 16 | echo "Arduino-Lite Console" 17 | echo "Powered by RoboPeak Project (robopeak.com)" 18 | echo "------------------------------------------" 19 | echo "" 20 | echo "Entering bash..." 21 | echo "Current Dir is: " 22 | echo " "`pwd` 23 | 24 | if [ "$SH_CMD" == "" ];then 25 | sh 26 | else 27 | $SH_CMD 28 | fi 29 | -------------------------------------------------------------------------------- /sketch/ledfading/Makefile: -------------------------------------------------------------------------------- 1 | HOME_TREE := ../.. 2 | 3 | # TODO: Set the WINAVR_HOME if you do not want to use the build-in winavr 4 | # WINAVR_HOME := /d/WinAVR-20090313 5 | 6 | # TODO: set the prj_name here 7 | # default name is your folder's title 8 | PRJ_NAME := $(notdir $(CURDIR)) 9 | 10 | # TODO: set the output binary name here 11 | # default name is your folder's tilte 12 | BINARY_NAME := $(notdir $(CURDIR)) 13 | 14 | # enable the following marco in case you want these features 15 | #EXTRA_DEFS = -D_ENABLE_SERIAL_CALLBACK 16 | #EXTRA_DEFS += -D_SERIAL_CUSTOM_RX_ROUTINE_ 17 | 18 | #includes the common definitions... 19 | #do not remove them unless you know what you are doing 20 | include $(HOME_TREE)/scripts/mak_avr_def.inc 21 | ############################################# 22 | # the following are default settings, 23 | # modify them if necessary... 24 | UPLOAD_PORT := COM3 25 | #PORT_RATE := 19200 26 | #MCU := atmega168 27 | #F_CPU := 16000000 28 | ############################################# 29 | 30 | 31 | 32 | # TODO: list the C-Source files here 33 | # All of the .c files within this folder will be included by default 34 | CSRC := $(shell find src/ -name "*.c") 35 | 36 | # TODO: list the CPP-Source files here 37 | # All of the .cpp files within this folder will be included by default 38 | CXXSRC := $(shell find src/ -name "*.cpp") 39 | 40 | # TODO: list the Assmebly-Source files here 41 | # All of the .S files within this folder will be included by default 42 | ASRC := $(shell find src/ -name "*.S") 43 | 44 | # TODO: Put the header's path that you want to include 45 | INCLUDE_PATH += -I$(SOURCE_ROOT)/core 46 | 47 | 48 | all: build_avr_lib build sizebefore sizeafter 49 | 50 | #include Arduino-Lite building rules. 51 | include $(HOME_TREE)/scripts/mak_lib.inc 52 | 53 | #include standard build logic 54 | include $(HOME_TREE)/scripts/mak_avr_common.inc 55 | 56 | 57 | additionalclean: clean_avr_lib 58 | -------------------------------------------------------------------------------- /sketch/ledfading/README.txt: -------------------------------------------------------------------------------- 1 | This is a template sketch that you may want to make a copy from it. 2 | 3 | How to create your own sketch? 4 | -------------------------------- 5 | Very Simple! 6 | 1) Just copy the template folder and paste it in the same folder with the name you would like it to be. 7 | E.g. copy sketch/template to sketch/mySketch 8 | 9 | 2) Put any sourcecode inside your sketch's src folder. We support following source code format: 10 | * .c //c 11 | * .cpp //c plus plus 12 | * .S //assembly code 13 | 14 | 3) Click build.cmd to compile! 15 | You will find the compiled result (*.hex) in the /build/output/avr folder 16 | 17 | How to upload the hex to AVR? 18 | -------------------------------- 19 | just click launchsh.cmd and type : make upload 20 | NOTICE: you should modify the Makefile to set correct AVR type, CPU Frequency, Serial Port, etc in advance. 21 | 22 | -------------------------------------------------------------------------------- /sketch/ledfading/build.cmd: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | set REDIRECT_PATH=%cd% 3 | set SH_CMD=make 4 | cd ..\.. 5 | launchsh.cmd 6 | 7 | cd %REDIRECT_PATH% 8 | -------------------------------------------------------------------------------- /sketch/ledfading/launchsh.cmd: -------------------------------------------------------------------------------- 1 | @REM Launch the bash shell under win32 2 | @ECHO OFF 3 | set REDIRECT_PATH=%cd% 4 | cd ..\.. 5 | launchsh.cmd 6 | -------------------------------------------------------------------------------- /sketch/ledfading/src/fading.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Demo sketch modified from Arduino 3 | * 4 | * 5 | */ 6 | 7 | #include "arduino_lit.h" 8 | 9 | #define ledPin 11 // LED connected to digital pin 11 10 | 11 | void setup() { 12 | // initalize the serail port at the default baud rate 19200 13 | // you can still use the orignal serial_begin(19200); as well 14 | SERIAL_BEGIN(); 15 | 16 | PIN_MODE(ledPin,OUTPUT); 17 | 18 | // Enable PWM output for ledPin 19 | PWM_ENABLE(ledPin); 20 | 21 | // Previous Print class has been changed to C functions 22 | println("Hello from Arduino_lite!", serial_puts); 23 | 24 | // use the PRINT marco to make serail output simple 25 | PRINT("ledPin is:"); 26 | PRINT(ledPin); 27 | PRINT("\n"); 28 | 29 | 30 | // for debugging output, you can use the DBG_PRINT marco 31 | // to make this marco work, you need to define _DEBUG marco 32 | // #define _DEBUG 33 | DBG_PRINT("Start working...\n"); 34 | } 35 | 36 | void loop() { 37 | // fade in from min to max in increments of 5 points: 38 | for(int fadeValue = 0 ; fadeValue <= 255; fadeValue +=5) { 39 | // sets the value (range from 0 to 255): 40 | PWM_SET(ledPin, fadeValue); 41 | // wait for 30 milliseconds to see the dimming effect 42 | // sleep is the power saving version of the orignal delay func 43 | sleep(30); 44 | 45 | PRINT(millis()); 46 | } 47 | 48 | // fade out from max to min in increments of 5 points: 49 | for(int fadeValue = 255 ; fadeValue >= 0; fadeValue -=5) { 50 | // sets the value (range from 0 to 255): 51 | PWM_SET(ledPin, fadeValue); 52 | // wait for 30 milliseconds to see the dimming effect 53 | sleep(30); 54 | } 55 | } 56 | 57 | int main() 58 | { 59 | init(); 60 | setup(); 61 | while(1) 62 | loop(); 63 | } 64 | -------------------------------------------------------------------------------- /sketch/ledfading/src/you_can_put_files_in_any_path/example.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robopeak/arduino-lite/11e477c7b8ddd7efbcedd7e0a45b23205a86290a/sketch/ledfading/src/you_can_put_files_in_any_path/example.cpp -------------------------------------------------------------------------------- /sketch/template.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robopeak/arduino-lite/11e477c7b8ddd7efbcedd7e0a45b23205a86290a/sketch/template.zip -------------------------------------------------------------------------------- /src/bootloaders/README: -------------------------------------------------------------------------------- 1 | Bootloader code comes from the following source: 2 | 1. Arduino Firmware ( Arduino.cc) 3 | 2. BootloadHID Project (http://www.obdev.at/products/vusb/bootloadhid.html) 4 | -------------------------------------------------------------------------------- /src/bootloaders/atmega8/ATmegaBOOT@16.hex: -------------------------------------------------------------------------------- 1 | :101C000012C02BC02AC029C028C027C026C025C0AA 2 | :101C100024C023C022C021C020C01FC01EC01DC0C0 3 | :101C20001CC01BC01AC011241FBECFE5D4E0DEBF0C 4 | :101C3000CDBF10E0A0E6B0E0E8EEFFE102C0059005 5 | :101C40000D92A236B107D9F711E0A2E6B0E001C0CB 6 | :101C50001D92AA36B107E1F74FC0D2CFEF92FF92A3 7 | :101C60000F931F93EE24FF24870113C00894E11CF7 8 | :101C7000F11C011D111D81E0E81682E1F8068AE7DA 9 | :101C8000080780E0180728F0E0916200F0916300F7 10 | :101C900009955F9BEBCF8CB1992787FD90951F919C 11 | :101CA0000F91FF90EF9008955D9BFECF8CB9089542 12 | :101CB000D5DF803221F484E1F7DF80E1F5DF08959C 13 | :101CC0001F93182FCBDF803231F484E1EDDF812FB9 14 | :101CD000EBDF80E1E9DF1F9108951F93CF93DF933E 15 | :101CE000182FC0E0D0E002C0B9DF2196C117E0F3A1 16 | :101CF000DF91CF911F910895CFE5D4E0DEBFCDBF36 17 | :101D0000000010BC83E389B988E18AB986E880BD08 18 | :101D1000BD9A1092680130E2E0E0F0E02FE088B375 19 | :101D2000832788BBCF010197F1F7215027FFF7CF19 20 | :101D300020E12093680192DF803381F1813399F4AF 21 | :101D40008DDF8032C1F784E1AFDF81E4ADDF86E56E 22 | :101D5000ABDF82E5A9DF80E2A7DF89E4A5DF83E5C9 23 | :101D6000A3DF80E5C7C0803429F478DF8638B0F07F 24 | :101D700075DF14C0813471F471DF803811F482E0B2 25 | :101D80001DC1813811F481E019C1823809F015C1F3 26 | :101D900082E114C1823421F484E19FDF89DFCBCF5B 27 | :101DA000853411F485E0F9CF8035C1F38135B1F385 28 | :101DB0008235A1F3853539F451DF809364004EDF1D 29 | :101DC00080936500EBCF863519F484E086DFF5C09B 30 | :101DD000843609F093C042DF809367013FDF809330 31 | :101DE0006601809169018E7F8093690137DF8534B8 32 | :101DF00029F480916901816080936901C0E0D0E09D 33 | :101E000006E610E005C02ADFF80181938F012196D4 34 | :101E10008091660190916701C817D907A0F31EDF72 35 | :101E2000803209F088CF8091690180FF1FC020E0D7 36 | :101E300030E0E6E6F0E012C0A0916400B0916500E9 37 | :101E40008191082EC5D08091640090916500019623 38 | :101E500090936500809364002F5F3F4F80916601EF 39 | :101E6000909167012817390738F343C0F894E19936 40 | :101E7000FECF1127E0916400F0916500EE0FFF1F87 41 | :101E8000C6E6D0E0809166019091670180FF01C0B5 42 | :101E90000196103051F422D003E000935700E895EA 43 | :101EA0001DD001E100935700E8950990199016D0D4 44 | :101EB00001E000935700E8951395103258F0112770 45 | :101EC0000DD005E000935700E89508D001E100939C 46 | :101ED0005700E8953296029739F0DBCF0091570012 47 | :101EE00001700130D9F30895103011F00296E7CF58 48 | :101EF000112484E1D9DE80E1D7DE1DCF843709F0DB 49 | :101F00004BC0ACDE80936701A9DE80936601A6DE3C 50 | :101F100090916901853421F49160909369010DC01D 51 | :101F20009E7F909369018091640090916500880F75 52 | :101F3000991F909365008093640090DE803209F0D1 53 | :101F4000FACE84E1B1DEC0E0D0E01EC0809169012C 54 | :101F500080FF07C0A0916400B091650031D0802D52 55 | :101F600008C081FD07C0E0916400F0916500E49134 56 | :101F70008E2F9ADE80916400909165000196909377 57 | :101F800065008093640021968091660190916701BD 58 | :101F9000C817D907D8F2AFCF853761F45FDE80323A 59 | :101FA00009F0C9CE84E180DE8EE17EDE83E97CDE4D 60 | :101FB00087E0A0CF863709F0BECE80E081DEBBCEC1 61 | :101FC000E199FECFBFBBAEBBE09A11960DB208956A 62 | :101FD000E199FECFBFBBAEBB0DBA11960FB6F89418 63 | :081FE000E29AE19A0FBE089598 64 | :021FE800800077 65 | :0400000300001C00DD 66 | :00000001FF 67 | -------------------------------------------------------------------------------- /src/bootloaders/atmega8/ATmegaBOOT@8.hex: -------------------------------------------------------------------------------- 1 | :101C000012C02BC02AC029C028C027C026C025C0AA 2 | :101C100024C023C022C021C020C01FC01EC01DC0C0 3 | :101C20001CC01BC01AC011241FBECFE5D4E0DEBF0C 4 | :101C3000CDBF10E0A0E6B0E0ECEDFFE102C0059002 5 | :101C40000D92A236B107D9F711E0A2E6B0E001C0CB 6 | :101C50001D92AA36B107E1F74BC0D2CFEF92FF92A7 7 | :101C60000F931F93EE24FF2487015F9915C00894FA 8 | :101C7000E11CF11C011D111D81E2E81681EAF80644 9 | :101C800087E0080780E0180728F0E0916200F091F3 10 | :101C9000630009955F9BEBCF8CB1992787FD9095E9 11 | :101CA0001F910F91FF90EF9008955D9BFECF8CB92F 12 | :101CB0000895D4DF803221F484E1F7DF80E1F5DF9D 13 | :101CC00008950895CF93C82FC9DF803231F484E19D 14 | :101CD000ECDF8C2FEADF80E1E8DFCF910895CF932E 15 | :101CE000882321F0C82FBADFC150E9F7CF910895BA 16 | :101CF000CFE5D4E0DEBFCDBF000010BC89E189B9DB 17 | :101D000088E18AB986E880BDA9DF803309F444C040 18 | :101D10008133A1F4A3DFC82F8032B1F784E1C5DF9E 19 | :101D200081E4C3DF86E5C1DF82E5BFDF8C2FBDDF45 20 | :101D300089E4BBDF83E5B9DF80E52EC1803429F477 21 | :101D40008DDF863848F18ADF27C0813471F486DF61 22 | :101D5000803811F482E027C1813811F481E023C179 23 | :101D6000823809F01FC182E11EC1823411F484E17E 24 | :101D700003C0853419F485E0B2DF0EC0803561F010 25 | :101D8000813551F0823541F0853541F467DF80932C 26 | :101D9000640064DF809365008CDFB6CF863519F46C 27 | :101DA00084E09DDFFFC0843609F09DC057DF80933B 28 | :101DB000670154DF80936601809169018E7F809373 29 | :101DC00069014CDF853429F4809169018160809339 30 | :101DD0006901C0E0D0E08091660190916701C81769 31 | :101DE000D90770F406E610E039DFF80181938F011E 32 | :101DF00021968091660190916701C817D907A0F3D9 33 | :101E00002DDF803209F080CF8091690180FF26C0EC 34 | :101E1000C0E0D0E08091660190916701C817D907B2 35 | :101E200008F05FC006E610E0F80161918F01809133 36 | :101E3000640090916500C7D0809164009091650026 37 | :101E400001969093650080936400219680916601CD 38 | :101E500090916701C817D90738F343C0F894E19906 39 | :101E6000FECF1127E0916400F0916500EE0FFF1F97 40 | :101E7000C6E6D0E0809166019091670180FF01C0C5 41 | :101E80000196103051F422D003E000935700E895FA 42 | :101E90001DD001E100935700E8950990199016D0E4 43 | :101EA00001E000935700E8951395103258F0112780 44 | :101EB0000DD005E000935700E89508D001E10093AC 45 | :101EC0005700E8953296029739F0DBCF0091570022 46 | :101ED00001700130D9F30895103011F00296E7CF68 47 | :101EE000112484E159C0843709F049C0B7DE8093DA 48 | :101EF0006701B4DE80936601B1DE9091690185349B 49 | :101F000021F49160909369010DC09E7F90936901C7 50 | :101F10008091640090916500880F991F90936500EF 51 | :101F2000809364009BDE803209F0EECE84E1BDDE5A 52 | :101F3000C0E0D0E08091660190916701C817D90791 53 | :101F400060F58091690180FF06C0809164009091E6 54 | :101F5000650031D008C0869580FD06C0E091640020 55 | :101F6000F09165008491A1DE8091640090916500FC 56 | :101F7000019690936500809364002196DBCF8537AE 57 | :101F800079F46CDE803209F0BFCE84E18EDE8EE122 58 | :101F90008CDE83E98ADE87E088DE80E186DEB4CEEF 59 | :101FA000863719F480E08EDEAFCEE0916200F091CA 60 | :101FB00063000995A9CEE199FECF9FBB8EBBE09A45 61 | :101FC00099278DB30895E199FECF9FBB8EBB6DBB62 62 | :0C1FD0000FB6F894E29AE19A0FBE089553 63 | :021FDC00800083 64 | :0400000300001C00DD 65 | :00000001FF 66 | -------------------------------------------------------------------------------- /src/bootloaders/atmega8/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for ATmegaBOOT 2 | # E.Lins, 2004-10-14 3 | 4 | # program name should not be changed... 5 | PROGRAM = ATmegaBOOT 6 | 7 | PRODUCT=atmega8 8 | 9 | # enter the parameters for the UISP isp tool 10 | ISPPARAMS = -dprog=stk500 -dserial=$(SERIAL) -dspeed=115200 11 | 12 | 13 | DIRAVR = ../../../../../../bin/win32/WinAVR-20050214 14 | DIRAVRBIN = $(DIRAVR)/bin 15 | DIRAVRUTILS = $(DIRAVR)/utils/bin 16 | DIRINC = $(DIRAVR)/include 17 | DIRLIB = $(DIRAVR)/avr/lib 18 | 19 | 20 | MCU_TARGET = atmega8 21 | LDSECTION = --section-start=.text=0x1c00 22 | FUSE_L = 0xdf 23 | FUSE_H = 0xca 24 | ISPFUSES = $(DIRAVRBIN)/uisp -dpart=ATmega8 $(ISPPARAMS) --wr_fuse_l=$(FUSE_L) --wr_fuse_h=$(FUSE_H) 25 | ISPFLASH = $(DIRAVRBIN)/uisp -dpart=ATmega8 $(ISPPARAMS) --erase --upload if=$(PROGRAM).hex -v 26 | 27 | 28 | OBJ = $(PROGRAM).o 29 | OPTIMIZE = -Os 30 | 31 | DEFS = -DF_CPU=16000000 -DBAUD_RATE=19200 32 | LIBS = 33 | 34 | CC = $(DIRAVRBIN)/avr-gcc 35 | 36 | 37 | # Override is only needed by avr-lib build system. 38 | 39 | override CFLAGS = -g -Wall $(OPTIMIZE) -mmcu=$(MCU_TARGET) -D$(PRODUCT) $(DEFS) -I$(DIRINC) 40 | override LDFLAGS = -Wl,-Map,$(PROGRAM).map,$(LDSECTION) 41 | 42 | OBJCOPY = $(DIRAVRBIN)/avr-objcopy 43 | OBJDUMP = $(DIRAVRBIN)/avr-objdump 44 | SIZE = $(DIRAVRBIN)/avr-size 45 | 46 | all: $(PROGRAM).elf lst text asm size 47 | 48 | isp: $(PROGRAM).hex 49 | $(ISPFUSES) 50 | $(ISPFLASH) 51 | 52 | $(PROGRAM).elf: $(OBJ) 53 | $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) 54 | 55 | clean: 56 | rm -rf *.s 57 | rm -rf *.o *.elf 58 | rm -rf *.lst *.map 59 | 60 | asm: $(PROGRAM).s 61 | 62 | %.s: %.c 63 | $(CC) -S $(CFLAGS) -g1 $^ 64 | 65 | lst: $(PROGRAM).lst 66 | 67 | %.lst: %.elf 68 | $(OBJDUMP) -h -S $< > $@ 69 | 70 | size: $(PROGRAM).hex 71 | $(SIZE) $^ 72 | 73 | # Rules for building the .text rom images 74 | 75 | text: hex bin srec 76 | 77 | hex: $(PROGRAM).hex 78 | bin: $(PROGRAM).bin 79 | srec: $(PROGRAM).srec 80 | 81 | %.hex: %.elf 82 | $(OBJCOPY) -j .text -j .data -O ihex $< $@ 83 | 84 | %.srec: %.elf 85 | $(OBJCOPY) -j .text -j .data -O srec $< $@ 86 | 87 | %.bin: %.elf 88 | $(OBJCOPY) -j .text -j .data -O binary $< $@ 89 | -------------------------------------------------------------------------------- /src/bootloaders/atmegax8/ATmegaBOOT_168_atmega328.hex: -------------------------------------------------------------------------------- 1 | :107800000C94343C0C94513C0C94513C0C94513CE1 2 | :107810000C94513C0C94513C0C94513C0C94513CB4 3 | :107820000C94513C0C94513C0C94513C0C94513CA4 4 | :107830000C94513C0C94513C0C94513C0C94513C94 5 | :107840000C94513C0C94513C0C94513C0C94513C84 6 | :107850000C94513C0C94513C0C94513C0C94513C74 7 | :107860000C94513C0C94513C11241FBECFEFD8E036 8 | :10787000DEBFCDBF11E0A0E0B1E0ECE9FFE702C060 9 | :1078800005900D92A230B107D9F712E0A2E0B1E065 10 | :1078900001C01D92AD30B107E1F70E942D3D0C945F 11 | :1078A000CC3F0C94003C982F959595959595959582 12 | :1078B000905D8F708A307CF0282F295A8091C0000B 13 | :1078C00085FFFCCF9093C6008091C00085FFFCCF60 14 | :1078D0002093C6000895282F205DF0CF982F809127 15 | :1078E000C00085FFFCCF9093C6000895EF92FF92F1 16 | :1078F0000F931F93EE24FF2487018091C00087FD22 17 | :1079000017C00894E11CF11C011D111D81E4E8164B 18 | :1079100082E4F8068FE0080780E0180770F3E09132 19 | :107920000401F091050109958091C00087FFE9CF1E 20 | :107930008091C6001F910F91FF90EF9008950E94D3 21 | :10794000763C982F8091C00085FFFCCF9093C600B5 22 | :1079500091362CF490330CF09053892F089597555D 23 | :10796000892F08951F930E949F3C182F0E949F3CCF 24 | :107970001295107F810F1F9108951F93182F882350 25 | :1079800021F00E94763C1150E1F71F9108951F935A 26 | :10799000182F0E94763C803249F0809103018F5F5E 27 | :1079A000809303018530C1F01F9108958091C0003C 28 | :1079B00085FFFCCF84E18093C6008091C00085FFE5 29 | :1079C000FCCF1093C6008091C00085FFFCCF80E102 30 | :1079D0008093C6001F910895E0910401F091050184 31 | :1079E00009951F9108950E94763C803241F0809164 32 | :1079F00003018F5F80930301853081F008958091AA 33 | :107A0000C00085FFFCCF84E18093C6008091C00058 34 | :107A100085FFFCCF80E18093C6000895E0910401CA 35 | :107A2000F09105010995089540E951E08823A1F0FE 36 | :107A30002D9A28EE33E0FA013197F1F721503040CA 37 | :107A4000D1F72D9828EE33E0FA013197F1F7215064 38 | :107A50003040D1F7815061F708953F924F925F9285 39 | :107A60006F927F928F929F92AF92BF92CF92DF924E 40 | :107A7000EF92FF920F931F93CF93DF93000080E16B 41 | :107A80008093C4001092C50088E18093C10086E015 42 | :107A90008093C2005098589A259A81E00E94143D24 43 | :107AA00024E1F22E9EE1E92E85E9D82E0FE0C02ECA 44 | :107AB00010E1B12EAA24A394B1E49B2EA6E58A2E50 45 | :107AC000F2E57F2EE0E26E2E79E4572E63E5462E36 46 | :107AD00050E5352E0E94763C8033B1F18133B9F107 47 | :107AE000803409F46FC0813409F476C0823409F41B 48 | :107AF00085C0853409F488C0803531F1823521F1A3 49 | :107B0000813511F1853509F485C0863509F48DC0BC 50 | :107B1000843609F496C0843709F403C1853709F423 51 | :107B200072C1863709F466C0809103018F5F80932C 52 | :107B30000301853079F6E0910401F0910501099582 53 | :107B40000E94763C803351F60E94F33CC3CF0E94E2 54 | :107B5000763C803249F78091C00085FFFCCFF092DF 55 | :107B6000C6008091C00085FFFCCF9092C600809136 56 | :107B7000C00085FFFCCF8092C6008091C00085FFC9 57 | :107B8000FCCF7092C6008091C00085FFFCCF609250 58 | :107B9000C6008091C00085FFFCCF5092C600809146 59 | :107BA000C00085FFFCCF4092C6008091C00085FFD9 60 | :107BB000FCCF3092C6008091C00085FFFCCFB09210 61 | :107BC000C60088CF0E94763C863808F4BDCF0E945C 62 | :107BD000763C0E94F33C7ECF0E94763C803809F4CC 63 | :107BE0009CC0813809F40BC1823809F43CC1883942 64 | :107BF00009F48FC080E00E94C73C6CCF84E10E94F2 65 | :107C0000BD3C0E94F33C66CF85E00E94BD3C0E94D3 66 | :107C1000F33C60CF0E94763C809306010E94763C44 67 | :107C2000809307010E94F33C55CF0E94763C80333D 68 | :107C300009F41DC183E00E94BD3C80E00E94C73C66 69 | :107C400049CF0E94763C809309020E94763C809343 70 | :107C5000080280910C028E7F80930C020E94763C79 71 | :107C6000853409F415C18091080290910902892B8D 72 | :107C700089F000E010E00E94763CF801E85FFE4FDA 73 | :107C800080830F5F1F4F80910802909109020817AF 74 | :107C9000190788F30E94763C803209F045CF809125 75 | :107CA0000C0280FF01C16091060170910701660F0F 76 | :107CB000771F7093070160930601A0910802B091AD 77 | :107CC00009021097C9F0E8E0F1E09B01AD014E0F09 78 | :107CD0005F1FF999FECF32BD21BD819180BDFA9A17 79 | :107CE000F99A2F5F3F4FE417F50799F76A0F7B1F4B 80 | :107CF00070930701609306018091C00085FFFCCF5F 81 | :107D0000F092C6008091C00085FFFCCFB092C60003 82 | :107D1000E1CE83E00E94C73CDDCE82E00E94C73CFA 83 | :107D2000D9CE0E94763C809309020E94763C8093D3 84 | :107D300008028091060190910701880F991F909386 85 | :107D40000701809306010E94763C853409F4A6C0A1 86 | :107D500080910C028E7F80930C020E94763C8032D0 87 | :107D600009F0B8CE8091C00085FFFCCFF092C6002C 88 | :107D7000609108027091090261157105B9F140E046 89 | :107D800050E080910C02A82FA170B82FB27011C0E2 90 | :107D9000BB2309F45CC0E0910601F0910701319624 91 | :107DA000F0930701E09306014F5F5F4F46175707B7 92 | :107DB000E8F4AA2369F3F999FECF209106013091E6 93 | :107DC000070132BD21BDF89A90B58091C00085FFB2 94 | :107DD000FCCF9093C6002F5F3F4F30930701209355 95 | :107DE00006014F5F5F4F4617570718F38091C00099 96 | :107DF00085FDE5CE8091C00085FFF8CFE0CE81E023 97 | :107E00000E94C73C67CE0E94763C803209F08CCE3F 98 | :107E10008091C00085FFFCCFF092C6008091C00029 99 | :107E200085FFFCCFE092C6008091C00085FFFCCFAB 100 | :107E3000D092C6008091C00085FFFCCFC092C600E2 101 | :107E40008091C00085FFFCCFB092C60043CEE09188 102 | :107E50000601F091070194918091C00085FFFCCF4D 103 | :107E60009093C6009CCF80E10E94C73C33CE0E9415 104 | :107E7000763C0E94763C182F0E94763C112309F430 105 | :107E800083C0113009F484C08FE00E94C73C22CE29 106 | :107E900080910C02816080930C02E5CE80910C02EF 107 | :107EA000816080930C0259CF809107018823880F4D 108 | :107EB000880B8A2180930B02809106019091070123 109 | :107EC000880F991F90930701809306018091080203 110 | :107ED00080FF09C080910802909109020196909359 111 | :107EE000090280930802F894F999FECF1127E091D6 112 | :107EF0000601F0910701C8E0D1E08091080290915D 113 | :107F00000902103091F40091570001700130D9F34B 114 | :107F100003E000935700E89500915700017001308D 115 | :107F2000D9F301E100935700E89509901990009169 116 | :107F3000570001700130D9F301E000935700E89534 117 | :107F40001395103498F011270091570001700130FB 118 | :107F5000D9F305E000935700E895009157000170B0 119 | :107F60000130D9F301E100935700E895329602976A 120 | :107F700009F0C7CF103011F00296E5CF112480919F 121 | :107F8000C00085FFB9CEBCCE8EE10E94C73CA2CD19 122 | :0C7F900085E90E94C73C9ECDF894FFCF0D 123 | :027F9C00800063 124 | :040000030000780081 125 | :00000001FF 126 | -------------------------------------------------------------------------------- /src/bootloaders/atmegax8/ATmegaBOOT_168_atmega328_pro_8MHz.hex: -------------------------------------------------------------------------------- 1 | :107800000C94343C0C94513C0C94513C0C94513CE1 2 | :107810000C94513C0C94513C0C94513C0C94513CB4 3 | :107820000C94513C0C94513C0C94513C0C94513CA4 4 | :107830000C94513C0C94513C0C94513C0C94513C94 5 | :107840000C94513C0C94513C0C94513C0C94513C84 6 | :107850000C94513C0C94513C0C94513C0C94513C74 7 | :107860000C94513C0C94513C11241FBECFEFD8E036 8 | :10787000DEBFCDBF11E0A0E0B1E0EAE8FFE702C063 9 | :1078800005900D92A230B107D9F712E0A2E0B1E065 10 | :1078900001C01D92AD30B107E1F70E942D3D0C945F 11 | :1078A000C33F0C94003C982F95959595959595958B 12 | :1078B000905D8F708A307CF0282F295A8091C0000B 13 | :1078C00085FFFCCF9093C6008091C00085FFFCCF60 14 | :1078D0002093C6000895282F205DF0CF982F809127 15 | :1078E000C00085FFFCCF9093C6000895EF92FF92F1 16 | :1078F0000F931F93EE24FF2487018091C00087FD22 17 | :1079000017C00894E11CF11C011D111D81E2E8164D 18 | :1079100081EAF80687E0080780E0180770F3E09135 19 | :107920000401F091050109958091C00087FFE9CF1E 20 | :107930008091C6001F910F91FF90EF9008950E94D3 21 | :10794000763C982F8091C00085FFFCCF9093C600B5 22 | :1079500091362CF490330CF09053892F089597555D 23 | :10796000892F08951F930E949F3C182F0E949F3CCF 24 | :107970001295107F810F1F9108951F93182F882350 25 | :1079800021F00E94763C1150E1F71F9108951F935A 26 | :10799000182F0E94763C803249F0809103018F5F5E 27 | :1079A000809303018530C1F01F9108958091C0003C 28 | :1079B00085FFFCCF84E18093C6008091C00085FFE5 29 | :1079C000FCCF1093C6008091C00085FFFCCF80E102 30 | :1079D0008093C6001F910895E0910401F091050184 31 | :1079E00009951F9108950E94763C803241F0809164 32 | :1079F00003018F5F80930301853081F008958091AA 33 | :107A0000C00085FFFCCF84E18093C6008091C00058 34 | :107A100085FFFCCF80E18093C6000895E0910401CA 35 | :107A2000F09105010995089548EC50E08823A1F0F4 36 | :107A30002D9A28EE33E0FA013197F1F721503040CA 37 | :107A4000D1F72D9828EE33E0FA013197F1F7215064 38 | :107A50003040D1F7815061F708953F924F925F9285 39 | :107A60006F927F928F929F92AF92BF92CF92DF924E 40 | :107A7000EF92FF920F931F93CF93DF93000082E06A 41 | :107A80008093C00080E18093C4001092C50088E11B 42 | :107A90008093C10086E08093C2005098589A259A3E 43 | :107AA00081E00E94143D24E1F22E9EE1E92E85E959 44 | :107AB000D82E0FE0C02E10E1B12EAA24A394B1E479 45 | :107AC0009B2EA6E58A2EF2E57F2EE0E26E2E79E46B 46 | :107AD000572E63E5462E50E5352E0E94763C8033C6 47 | :107AE000B1F18133B9F1803409F46FC0813409F404 48 | :107AF00076C0823409F485C0853409F488C08035A5 49 | :107B000031F1823521F1813511F1853509F485C0D6 50 | :107B1000863509F48DC0843609F496C0843709F49B 51 | :107B200003C1853709F472C1863709F466C08091B4 52 | :107B300003018F5F80930301853079F6E0910401A2 53 | :107B4000F091050109950E94763C803351F60E9420 54 | :107B5000F33CC3CF0E94763C803249F78091C0004D 55 | :107B600085FFFCCFF092C6008091C00085FFFCCF5E 56 | :107B70009092C6008091C00085FFFCCF8092C60025 57 | :107B80008091C00085FFFCCF7092C6008091C0003C 58 | :107B900085FFFCCF6092C6008091C00085FFFCCFBE 59 | :107BA0005092C6008091C00085FFFCCF4092C60075 60 | :107BB0008091C00085FFFCCF3092C6008091C0004C 61 | :107BC00085FFFCCFB092C60088CF0E94763C8638F5 62 | :107BD00008F4BDCF0E94763C0E94F33C7ECF0E9409 63 | :107BE000763C803809F49CC0813809F40BC1823896 64 | :107BF00009F430C1883909F48FC080E00E94C73C85 65 | :107C00006CCF84E10E94BD3C0E94F33C66CF85E0CE 66 | :107C10000E94BD3C0E94F33C60CF0E94763C809362 67 | :107C200006010E94763C809307010E94F33C55CFE9 68 | :107C30000E94763C803309F411C183E00E94BD3C70 69 | :107C400080E00E94C73C49CF0E94763C80930902A5 70 | :107C50000E94763C8093080280910C028E7F809374 71 | :107C60000C020E94763C853409F409C18091080217 72 | :107C700090910902892B89F000E010E00E94763C87 73 | :107C8000F801E85FFE4F80830F5F1F4F809108026D 74 | :107C9000909109020817190788F30E94763C8032F8 75 | :107CA00009F045CF80910C0280FFF5C0609106017C 76 | :107CB00070910701660F771F7093070160930601AB 77 | :107CC000A0910802B09109021097C9F0E8E0F1E034 78 | :107CD0009B01AD014E0F5F1FF999FECF32BD21BD53 79 | :107CE000819180BDFA9AF99A2F5F3F4FE417F5070B 80 | :107CF00099F76A0F7B1F70930701609306018091CB 81 | :107D0000C00085FFFCCFF092C6008091C00085FFC7 82 | :107D1000FCCFB092C600E1CE83E00E94C73CDDCE2E 83 | :107D200082E00E94C73CD9CE0E94763C8093090233 84 | :107D30000E94763C80930802809106019091070191 85 | :107D4000880F991F90930701809306010E94763C4B 86 | :107D5000853409F49AC080910C028E7F80930C02C6 87 | :107D60000E94763C803209F0B8CE8091C00085FF39 88 | :107D7000FCCFF092C600A0910802B09109021097C2 89 | :107D8000C1F180910C02082F0170182F1695117007 90 | :107D9000E0910601F0910701AF014F5F5F4FBA011B 91 | :107DA00020E030E00023B1F4112339F49491809164 92 | :107DB000C00085FFFCCF9093C6002F5F3F4FCB01E3 93 | :107DC0000196FA012A173B0780F4BC014F5F5F4F11 94 | :107DD000002351F3F999FECFF2BDE1BDF89A90B5B9 95 | :107DE0008091C00085FFFCCFE6CF709307016093C0 96 | :107DF00006018091C00085FDE5CE8091C00085FF21 97 | :107E0000F8CFE0CE81E00E94C73C67CE0E94763C6E 98 | :107E1000803209F08CCE8091C00085FFFCCFF092BB 99 | :107E2000C6008091C00085FFFCCFE092C600809123 100 | :107E3000C00085FFFCCFD092C6008091C00085FFB6 101 | :107E4000FCCFC092C6008091C00085FFFCCFB092ED 102 | :107E5000C60043CE80E10E94C73C3FCE0E94763CE4 103 | :107E60000E94763C182F0E94763C112309F483C0AF 104 | :107E7000113009F484C08FE00E94C73C2ECE80915F 105 | :107E80000C02816080930C02F1CE80910C02816023 106 | :107E900080930C0265CF809107018823880F880B9F 107 | :107EA0008A2180930B028091060190910701880F2F 108 | :107EB000991F90930701809306018091080280FF2B 109 | :107EC00009C08091080290910902019690930902DD 110 | :107ED00080930802F894F999FECF1127E0910601EA 111 | :107EE000F0910701C8E0D1E0809108029091090269 112 | :107EF000103091F40091570001700130D9F303E084 113 | :107F000000935700E8950091570001700130D9F3B4 114 | :107F100001E100935700E8950990199000915700EE 115 | :107F200001700130D9F301E000935700E8951395F3 116 | :107F3000103498F011270091570001700130D9F3E7 117 | :107F400005E000935700E89500915700017001305B 118 | :107F5000D9F301E100935700E8953296029709F0B2 119 | :107F6000C7CF103011F00296E5CF11248091C000E8 120 | :107F700085FFC5CEC8CE8EE10E94C73CAECD85E957 121 | :0A7F80000E94C73CAACDF894FFCF81 122 | :027F8A00800075 123 | :040000030000780081 124 | :00000001FF 125 | -------------------------------------------------------------------------------- /src/bootloaders/atmegax8/ATmegaBOOT_168_diecimila.hex: -------------------------------------------------------------------------------- 1 | :103800000C94341C0C94511C0C94511C0C94511CA1 2 | :103810000C94511C0C94511C0C94511C0C94511C74 3 | :103820000C94511C0C94511C0C94511C0C94511C64 4 | :103830000C94511C0C94511C0C94511C0C94511C54 5 | :103840000C94511C0C94511C0C94511C0C94511C44 6 | :103850000C94511C0C94511C0C94511C0C94511C34 7 | :103860000C94511C0C94511C11241FBECFEFD4E0BA 8 | :10387000DEBFCDBF11E0A0E0B1E0E4EAFFE302C0AB 9 | :1038800005900D92A230B107D9F712E0A2E0B1E0A5 10 | :1038900001C01D92AD30B107E1F70E94361D0C94B6 11 | :1038A000D01F0C94001C982F9595959595959595FE 12 | :1038B000905D8F708A307CF0282F295A8091C0004B 13 | :1038C00085FFFCCF9093C6008091C00085FFFCCFA0 14 | :1038D0002093C6000895282F205DF0CF982F809167 15 | :1038E000C00085FFFCCF9093C6000895EF92FF9231 16 | :1038F0000F931F93EE24FF2487018091C00087FD62 17 | :1039000017C00894E11CF11C011D111D81E4E8168B 18 | :1039100082E4F8068FE0080780E0180770F3E09172 19 | :103920000401F091050109958091C00087FFE9CF5E 20 | :103930008091C6001F910F91FF90EF9008950E9413 21 | :10394000761C982F8091C00085FFFCCF9093C60015 22 | :1039500091362CF490330CF09053892F089597559D 23 | :10396000892F08951F930E949F1C182F0E949F1C4F 24 | :103970001295107F810F1F910895882351F0982F81 25 | :1039800091508091C00087FFFCCF8091C6009923A1 26 | :10399000B9F708951F93182F0E94761C803249F0C2 27 | :1039A000809103018F5F809303018530C1F01F91E7 28 | :1039B00008958091C00085FFFCCF84E18093C6000C 29 | :1039C0008091C00085FFFCCF1093C6008091C0009D 30 | :1039D00085FFFCCF80E18093C6001F910895E091A0 31 | :1039E0000401F091050109951F9108950E94761C2C 32 | :1039F000803241F0809103018F5F80930301853015 33 | :103A000081F008958091C00085FFFCCF84E1809310 34 | :103A1000C6008091C00085FFFCCF80E18093C60086 35 | :103A20000895E0910401F09105010995089510921F 36 | :103A30000A028823D1F090E040E951E02D9A28EE67 37 | :103A400033E0FA013197F1F721503040D1F72D984A 38 | :103A500028EE33E0FA013197F1F721503040D1F7E9 39 | :103A60009F5F981758F380930A0208953F924F92F0 40 | :103A70005F926F927F928F929F92AF92BF92CF92FE 41 | :103A8000DF92EF92FF920F931F93CF93DF9300008B 42 | :103A900083E38093C4001092C50088E18093C10045 43 | :103AA00086E08093C2005098589A259A81E00E943F 44 | :103AB000171D44E1F42E3EE1E32E24E9D22E96E0D8 45 | :103AC000C92E80E1B82EAA24A39401E4902E16E515 46 | :103AD000812EB2E57B2EA0E26A2EF9E45F2EE3E5AB 47 | :103AE0004E2E70E5372E0E94761C8033B1F1813363 48 | :103AF00009F441C0803409F479C0813409F48CC0E0 49 | :103B0000823471F1853409F47BC0803531F182351E 50 | :103B100021F1813511F1853509F48DC0863509F41F 51 | :103B20009DC0843609F4AEC0843709F41BC18537C3 52 | :103B300009F485C1863709F47AC0809103018F5F4B 53 | :103B400080930301853079F6E0910401F09105013D 54 | :103B500009950E94761C803351F60E94F61CC3CF53 55 | :103B600093E18091C00087FFFCCF8091C60099232C 56 | :103B7000A1F39150F6CF0E94761C8032F1F680912D 57 | :103B8000C00085FFFCCFF092C6008091C00085FF89 58 | :103B9000FCCF9092C6008091C00085FFFCCF809240 59 | :103BA000C6008091C00085FFFCCF7092C600809156 60 | :103BB000C00085FFFCCF6092C6008091C00085FFE9 61 | :103BC000FCCF5092C6008091C00085FFFCCF409290 62 | :103BD000C6008091C00085FFFCCF3092C600809166 63 | :103BE000C00085FFFCCFB092C6007DCF0E94761C3E 64 | :103BF000863808F4B2CF0E94761C0E94F61C73CF60 65 | :103C000094E08091C00087FFFCCF8091C60099238B 66 | :103C100009F4A3CF9150F5CF0E94761C8038D1F0E3 67 | :103C2000813861F1823809F499C0883979F080E0EF 68 | :103C30000E94CA1C58CF0E94761C809306010E94E5 69 | :103C4000761C809307010E94F61C4DCF83E00E94F2 70 | :103C5000CA1C49CF82E00E94CA1C45CF0E94761C34 71 | :103C6000803309F486C192E08091C00087FFFCCFC9 72 | :103C70008091C6009923D9F29150F6CF81E00E943D 73 | :103C8000CA1C31CF0E94761C809309020E94761CC8 74 | :103C90008093080280910C028E7F80930C020E9418 75 | :103CA000761C853429F480910C02816080930C028B 76 | :103CB0008091080290910902892B89F000E010E0C0 77 | :103CC0000E94761CF801E85FFE4F80830F5F1F4F54 78 | :103CD00080910802909109020817190788F30E9441 79 | :103CE000761C803209F029CF80910C0280FFD1C070 80 | :103CF0004091060150910701440F551F5093070151 81 | :103D000040930601A0910802B09109021097C9F0F2 82 | :103D1000E8E0F1E09A01BD016E0F7F1FF999FECF37 83 | :103D200032BD21BD819180BDFA9AF99A2F5F3F4F34 84 | :103D3000E617F70799F74A0F5B1F50930701409367 85 | :103D400006018091C00085FFFCCFF092C6008091F3 86 | :103D5000C00085FFFCCFB092C600C5CE80E10E94B6 87 | :103D6000CA1CC1CE0E94761C809309020E94761C58 88 | :103D7000809308028091060190910701880F991F96 89 | :103D800090930701809306010E94761C853409F404 90 | :103D90007AC080910C028E7F80930C020E94761C68 91 | :103DA000803209F0A0CE8091C00085FFFCCFF09258 92 | :103DB000C600A0910802B09109021097B9F1809154 93 | :103DC0000C02182F1170082F0270E0910601F0917B 94 | :103DD00007019F012F5F3F4FB90140E050E01123E1 95 | :103DE000B1F4002339F494918091C00085FFFCCF99 96 | :103DF0009093C6004F5F5F4FCB010196F9014A17C0 97 | :103E00005B0780F4BC012F5F3F4F112351F3F999F9 98 | :103E1000FECFF2BDE1BDF89A90B58091C00085FF5C 99 | :103E2000FCCFE6CF70930701609306018091C0003C 100 | :103E300085FDD9CE8091C00085FFF8CFD4CE0E94F9 101 | :103E4000761C803209F079CE8091C00085FFFCCFCE 102 | :103E5000F092C6008091C00085FFFCCFE092C600C2 103 | :103E60008091C00085FFFCCFD092C6008091C00039 104 | :103E700085FFFCCFC092C6008091C00085FFFCCFBB 105 | :103E8000B092C60030CE80910C02816080930C020B 106 | :103E900085CF809107018823880F880B8A21809322 107 | :103EA0000B028091060190910701880F991F909352 108 | :103EB0000701809306018091080280FF09C080916C 109 | :103EC00008029091090201969093090280930802DA 110 | :103ED000F894F999FECF1127E0910601F0910701BE 111 | :103EE000C8E0D1E08091080290910902103091F46D 112 | :103EF0000091570001700130D9F303E0009357009F 113 | :103F0000E8950091570001700130D9F301E1009369 114 | :103F10005700E89509901990009157000170013001 115 | :103F2000D9F301E000935700E8951395103498F009 116 | :103F300011270091570001700130D9F305E000937B 117 | :103F40005700E8950091570001700130D9F301E165 118 | :103F500000935700E8953296029709F0C7CF1030CA 119 | :103F600011F00296E5CF11248091C00085FFE9CEC3 120 | :103F7000ECCE0E94761C0E94761C182F0E94761CA4 121 | :103F8000112351F0113021F086E00E94CA1CABCD04 122 | :103F900084E90E94CA1CA7CD8EE10E94CA1CA3CD51 123 | :043FA000F894FFCFC3 124 | :023FA40080009B 125 | :0400000300003800C1 126 | :00000001FF 127 | -------------------------------------------------------------------------------- /src/bootloaders/atmegax8/ATmegaBOOT_168_ng.hex: -------------------------------------------------------------------------------- 1 | :103800000C94341C0C94511C0C94511C0C94511CA1 2 | :103810000C94511C0C94511C0C94511C0C94511C74 3 | :103820000C94511C0C94511C0C94511C0C94511C64 4 | :103830000C94511C0C94511C0C94511C0C94511C54 5 | :103840000C94511C0C94511C0C94511C0C94511C44 6 | :103850000C94511C0C94511C0C94511C0C94511C34 7 | :103860000C94511C0C94511C11241FBECFEFD4E0BA 8 | :10387000DEBFCDBF11E0A0E0B1E0E4EAFEE302C0AC 9 | :1038800005900D92A230B107D9F712E0A2E0B1E0A5 10 | :1038900001C01D92AD30B107E1F70E94ED1C0C9400 11 | :1038A000511F0C94001C482F10920A0280E08417CC 12 | :1038B000E0F4582F2D9A28EE33E080E991E001974B 13 | :1038C000F1F721503040C9F72D9828EE33E080E918 14 | :1038D00091E00197F1F721503040C9F7852F8F5FB4 15 | :1038E000582F841738F380930A020895EF92FF92BD 16 | :1038F0000F931F93EE24FF2487018091C00087FD62 17 | :1039000017C00894E11CF11C011D111D81E0E8168F 18 | :1039100082E1F8068AE7080780E0180770F3E09173 19 | :103920000201F091030109958091C00087FFE9CF62 20 | :103930008091C600992787FD90951F910F91FF9068 21 | :10394000EF900895982F8091C00085FFFCCF909351 22 | :10395000C60008950E94761C803271F080910401A7 23 | :103960008F5F80930401853009F00895E091020192 24 | :10397000F09103010995089584E10E94A21C80E161 25 | :103980000E94A21C0895CF93C82F0E94761C8032FB 26 | :1039900041F0809104018F5F80930401853081F4B0 27 | :1039A0000AC084E10E94A21C8C2F0E94A21C80E10C 28 | :1039B0000E94A21C05C0E0910201F091030109954B 29 | :1039C000CF910895CF93C82FC150CF3F21F00E94CF 30 | :1039D000761CC150E0F7CF910895CFEFD4E0DEBF61 31 | :1039E000CDBF000083E38093C4001092C50088E13E 32 | :1039F0008093C10086E08093C2005098589A259A1F 33 | :103A000083E00E94531C0E94761C8033B1F1813305 34 | :103A1000B9F1803409F455C0813409F45BC08234B3 35 | :103A200009F46DC0853409F470C0803531F18235F8 36 | :103A300021F1813511F1853509F46BC0863509F422 37 | :103A400073C0843609F47AC0843709F4CEC0853750 38 | :103A500009F429C1863709F44AC0809104018F5FB7 39 | :103A600080930401853079F6E0910201F091030121 40 | :103A700009950E94761C803351F60E94AA1CC3CF80 41 | :103A80000E94761CC82F803241F784E10E94A21C5C 42 | :103A900081E40E94A21C86E50E94A21C82E50E948D 43 | :103AA000A21C8C2F0E94A21C89E40E94A21C83E508 44 | :103AB0000E94A21C80E50E94A21C80E10E94A21C20 45 | :103AC000A2CF0E94761C8638C0F20E94761C0E940B 46 | :103AD000AA1C99CF0E94761C803809F486C18138CF 47 | :103AE00009F487C1823809F488C1883921F080E05F 48 | :103AF0000E94C31C88CF83E00E94C31C84CF84E152 49 | :103B00000E94E21C0E94AA1C7ECF85E00E94E21C5B 50 | :103B1000F9CF0E94761C809306010E94761C809348 51 | :103B200007010E94AA1C6FCF0E94761C803309F403 52 | :103B3000CAC083E00E94E21C80E0DACF0E94761CBB 53 | :103B4000809309020E94761C8093080280910C02E7 54 | :103B50008E7F80930C020E94761C853409F4C4C0C9 55 | :103B600000E010E0809108029091090218161906F1 56 | :103B700070F4C8E0D1E00E94761C89930F5F1F4F5C 57 | :103B8000809108029091090208171907A0F30E947A 58 | :103B9000761C803209F061CF80910C0280FFAEC0AC 59 | :103BA000E0910601F0910701EE0FFF1F00E010E029 60 | :103BB00020910802309109021216130680F4A8E041 61 | :103BC000B1E0F999FECFF2BDE1BD8D9180BDFA9AC9 62 | :103BD000F99A31960F5F1F4F0217130790F3F09376 63 | :103BE0000701E093060184E166CF0E94761C809372 64 | :103BF00009020E94761C8093080280910601909130 65 | :103C00000701880F991F90930701809306010E9476 66 | :103C1000761C853409F46EC080910C028E7F8093EF 67 | :103C20000C020E94761C803209F0EDCE84E10E94E5 68 | :103C3000A21C00E010E02091080230910902121647 69 | :103C4000130608F03ACFE0910601F0910701809148 70 | :103C50000C0280FF1FC0F999FECFF2BDE1BDF89ABA 71 | :103C600080B50E94A21CE0910601F09107013196F7 72 | :103C7000F0930701E09306012091080230910902B8 73 | :103C80000F5F1F4F0217130708F017CF80910C0228 74 | :103C900080FDE1CF869580FFB4C03196F093070197 75 | :103CA000E0930601EDCF0E94761C803209F0D5CE5C 76 | :103CB00084E10E94A21C8EE10E94A21C84E90E9461 77 | :103CC000A21C86E0F8CE0E94761C0E94761CC82FAB 78 | :103CD0000E94761CCC2309F47CC0C13009F47DC05D 79 | :103CE00086E00E94C31C8FCE80910C02816080937D 80 | :103CF0000C0236CF80910C02816091CF8091070138 81 | :103D000087FD6FC010920B02809106019091070110 82 | :103D1000880F991F909307018093060180910802F4 83 | :103D200080FF09C08091080290910902019690934A 84 | :103D3000090280930802F894F999FECF1127E091C7 85 | :103D40000601F0910701C8E0D1E08091080290914E 86 | :103D50000902103091F40091570001700130D9F33D 87 | :103D600003E000935700E89500915700017001307F 88 | :103D7000D9F301E100935700E8950990199000915B 89 | :103D8000570001700130D9F301E000935700E89526 90 | :103D90001395103498F011270091570001700130ED 91 | :103DA000D9F305E000935700E895009157000170A2 92 | :103DB0000130D9F301E100935700E895329602975C 93 | :103DC00009F0C7CF103011F00296E5CF112484E13D 94 | :103DD00072CE8EE10E94C31C16CE84E90E94C31CE1 95 | :103DE00012CE81E080930B028FCF82E00E94C31C31 96 | :103DF0000ACE81E00E94C31C06CE80E10E94C31C53 97 | :103E000002CE84910E94A21C2091080230910902E6 98 | :103E1000E0910601F091070140CFCF930E94761CFC 99 | :103E2000C82F0E94A21CC13614F0C75503C0C0336E 100 | :103E30000CF0C0538C2F992787FD9095CF91089552 101 | :103E40000F931F930E940D1F082F112707FD109538 102 | :103E500002951295107F1027007F10270E940D1FDA 103 | :103E6000800F992787FD90951F910F910895CF930B 104 | :103E7000C82F85958595859585958A3034F0895A22 105 | :103E8000CF70CA3034F0C95A05C0805DCF70CA30D7 106 | :103E9000D4F7C05D0E94A21C8C2F0E94A21CCF915F 107 | :043EA0000895FFCFB3 108 | :023EA40080009C 109 | :0400000300003800C1 110 | :00000001FF 111 | -------------------------------------------------------------------------------- /src/bootloaders/atmegax8/ATmegaBOOT_168_pro_8MHz.hex: -------------------------------------------------------------------------------- 1 | :103800000C94341C0C94511C0C94511C0C94511CA1 2 | :103810000C94511C0C94511C0C94511C0C94511C74 3 | :103820000C94511C0C94511C0C94511C0C94511C64 4 | :103830000C94511C0C94511C0C94511C0C94511C54 5 | :103840000C94511C0C94511C0C94511C0C94511C44 6 | :103850000C94511C0C94511C0C94511C0C94511C34 7 | :103860000C94511C0C94511C11241FBECFEFD4E0BA 8 | :10387000DEBFCDBF11E0A0E0B1E0EEEAFFE302C0A1 9 | :1038800005900D92A230B107D9F712E0A2E0B1E0A5 10 | :1038900001C01D92AD30B107E1F70E94331D0C94B9 11 | :1038A000D51F0C94001C982F9595959595959595F9 12 | :1038B000905D8F708A307CF0282F295A8091C0004B 13 | :1038C00085FFFCCF9093C6008091C00085FFFCCFA0 14 | :1038D0002093C6000895282F205DF0CF982F809167 15 | :1038E000C00085FFFCCF9093C6000895EF92FF9231 16 | :1038F0000F931F93EE24FF2487018091C00087FD62 17 | :1039000017C00894E11CF11C011D111D81E2E8168D 18 | :1039100081EAF80687E0080780E0180770F3E09175 19 | :103920000401F091050109958091C00087FFE9CF5E 20 | :103930008091C6001F910F91FF90EF9008950E9413 21 | :10394000761C982F8091C00085FFFCCF9093C60015 22 | :1039500091362CF490330CF09053892F089597559D 23 | :10396000892F08951F930E949F1C182F0E949F1C4F 24 | :103970001295107F810F1F9108951F93182F882390 25 | :1039800021F00E94761C1150E1F71F9108951F93BA 26 | :10399000182F0E94761C803249F0809103018F5FBE 27 | :1039A000809303018530C1F01F9108958091C0007C 28 | :1039B00085FFFCCF84E18093C6008091C00085FF25 29 | :1039C000FCCF1093C6008091C00085FFFCCF80E142 30 | :1039D0008093C6001F910895E0910401F0910501C4 31 | :1039E00009951F9108950E94761C803241F08091C4 32 | :1039F00003018F5F80930301853081F008958091EA 33 | :103A0000C00085FFFCCF84E18093C6008091C00098 34 | :103A100085FFFCCF80E18093C6000895E09104010A 35 | :103A2000F09105010995089510920A028823D1F0BA 36 | :103A300090E048EC50E02D9A28EE33E0FA013197FF 37 | :103A4000F1F721503040D1F72D9828EE33E0FA01FC 38 | :103A50003197F1F721503040D1F79F5F981758F315 39 | :103A600080930A0208953F924F925F926F927F92E5 40 | :103A70008F929F92AF92BF92CF92DF92EF92FF927E 41 | :103A80000F931F93CF93DF9394B714BE8091600080 42 | :103A90008861809360001092600091FF0CC289E100 43 | :103AA0008093C4001092C50088E18093C10086E035 44 | :103AB0008093C2005098589A259A81E00E94141D64 45 | :103AC00044E1F42E3EE1E32E24E9D22E96E0C92E05 46 | :103AD00080E1B82EAA24A39401E4902E16E5812E4D 47 | :103AE000B2E57B2EA0E26A2EF9E45F2EE3E54E2ECE 48 | :103AF00070E5372E0E94761C8033B9F18133C1F115 49 | :103B0000803409F470C0813409F477C0823409F438 50 | :103B100086C0853409F489C0803539F1823529F1B0 51 | :103B2000813509F4AFC1853509F485C0863509F4BE 52 | :103B30008DC0843609F435C1843709F4C1C0853796 53 | :103B400009F490C0863709F466C0809103018F5F45 54 | :103B500080930301853071F6E0910401F091050135 55 | :103B600009950E94761C803349F60E94F31CC2CF4F 56 | :103B70000E94761C803249F78091C00085FFFCCFFF 57 | :103B8000F092C6008091C00085FFFCCF9092C600E5 58 | :103B90008091C00085FFFCCF8092C6008091C0005C 59 | :103BA00085FFFCCF7092C6008091C00085FFFCCFDE 60 | :103BB0006092C6008091C00085FFFCCF5092C60085 61 | :103BC0008091C00085FFFCCF4092C6008091C0006C 62 | :103BD00085FFFCCF3092C6008091C00085FFFCCFEE 63 | :103BE000B092C60087CF0E94761C863808F4BDCFFD 64 | :103BF0000E94761C0E94F31C7DCF0E94761C8038A8 65 | :103C000009F45AC0813809F453C0823809F440C11C 66 | :103C1000883909F449C080E00E94C71C6BCF84E159 67 | :103C20000E94BD1C0E94F31C65CF85E00E94BD1C54 68 | :103C30000E94F31C5FCF0E94761C809306010E94B5 69 | :103C4000761C809307010E94F31C54CF0E94761CBF 70 | :103C5000803309F421C183E00E94BD1C80E00E94F2 71 | :103C6000C71C48CF0E94761C803209F06ECF80912D 72 | :103C7000C00085FFFCCFF092C6008091C00085FF98 73 | :103C8000FCCFE092C6008091C00085FFFCCFD092AF 74 | :103C9000C6008091C00085FFFCCFC092C600809115 75 | :103CA000C00085FFFCCF9CCF83E00E94C71C22CFC1 76 | :103CB00081E00E94C71C1ECF82E00E94C71C1ACF61 77 | :103CC0000E94761C809309020E94761C8093080251 78 | :103CD0008091060190910701880F991F9093070129 79 | :103CE000809306010E94761C853409F4C5C080913A 80 | :103CF0000C028E7F80930C020E94761C803209F0A9 81 | :103D0000F9CE8091C00085FFFCCFF092C600609193 82 | :103D10000802709109026115710591F140E050E0CF 83 | :103D200080910C02A82FA170B82FB27010C0BB23D5 84 | :103D300061F1E0910601F09107013196F0930701DE 85 | :103D4000E09306014F5F5F4F46175707C8F4AA2359 86 | :103D500071F3F999FECF209106013091070132BD30 87 | :103D600021BDF89A90B58091C00085FFFCCF90935B 88 | :103D7000C6002F5F3F4F3093070120930601E2CF2B 89 | :103D80008091C00085FFFCCF2BCFE0910601F09120 90 | :103D9000070194918091C00085FFFCCF9093C600ED 91 | :103DA000CCCF0E94761C809309020E94761C8093DF 92 | :103DB000080280910C028E7F80930C020E94761C78 93 | :103DC000853429F480910C02816080930C028091EB 94 | :103DD000080290910902892B89F000E010E00E940E 95 | :103DE000761CF801E85FFE4F80830F5F1F4F8091C4 96 | :103DF0000802909109020817190788F30E94761C9F 97 | :103E0000803209F0A2CE80910C0280FF62C0409106 98 | :103E1000060150910701440F551F5093070140932D 99 | :103E20000601609108027091090261157105C9F0DF 100 | :103E3000E8E0F1E09A01DB01AE0FBF1FF999FECF78 101 | :103E400032BD21BD819180BDFA9AF99A2F5F3F4F13 102 | :103E5000EA17FB0799F7460F571F50930701409346 103 | :103E600006018091C00085FFFCCFF092C6008091D2 104 | :103E7000C00085FFFCCFB4CE80910C02816080939E 105 | :103E80000C023ACF0E94F31C88E080936000FFCFC1 106 | :103E900080E10E94C71C2ECE0E94761C0E94761CD8 107 | :103EA000182F0E94761C112381F0113051F086E00A 108 | :103EB0000E94C71C1FCEE0910401F09105010995F5 109 | :103EC000EECD84E90E94C71C15CE8EE10E94C71C6E 110 | :103ED00011CE809107018823880F880B8A21809357 111 | :103EE0000B028091060190910701880F991F909312 112 | :103EF0000701809306018091080280FF09C080912C 113 | :103F00000802909109020196909309028093080299 114 | :103F1000F894F999FECF1127E0910601F09107017D 115 | :103F2000C8E0D1E08091080290910902103091F42C 116 | :103F30000091570001700130D9F303E0009357005E 117 | :103F4000E8950091570001700130D9F301E1009329 118 | :103F50005700E895099019900091570001700130C1 119 | :103F6000D9F301E000935700E8951395103498F0C9 120 | :103F700011270091570001700130D9F305E000933B 121 | :103F80005700E8950091570001700130D9F301E125 122 | :103F900000935700E8953296029709F0C7CF10308A 123 | :0E3FA00011F00296E5CF11245CCFF894FFCF0C 124 | :023FAE00800091 125 | :0400000300003800C1 126 | :00000001FF 127 | -------------------------------------------------------------------------------- /src/bootloaders/atmegax8/ATmegaBOOT_168_std_16Mhz.hex: -------------------------------------------------------------------------------- 1 | :103800000C94341C0C94511C0C94511C0C94511CA1 2 | :103810000C94511C0C94511C0C94511C0C94511C74 3 | :103820000C94511C0C94511C0C94511C0C94511C64 4 | :103830000C94511C0C94511C0C94511C0C94511C54 5 | :103840000C94511C0C94511C0C94511C0C94511C44 6 | :103850000C94511C0C94511C0C94511C0C94511C34 7 | :103860000C94511C0C94511C11241FBECFEFD4E0BA 8 | :10387000DEBFCDBF11E0A0E0B1E0E4EAFEE302C0AC 9 | :1038800005900D92A230B107D9F712E0A2E0B1E0A5 10 | :1038900001C01D92AD30B107E1F70E940C1D0C94E0 11 | :1038A000501F0C94001C982F95959595959595957E 12 | :1038B000905D8F708A301CF0282F295A02C0282F63 13 | :1038C000205D8091C00085FFFCCF9093C600809161 14 | :1038D000C00085FFFCCF2093C6000895982F8091EB 15 | :1038E000C00085FFFCCF9093C6000895EF92FF9231 16 | :1038F0000F931F93EE24FF24870113C00894E11C4B 17 | :10390000F11C011D111D81E4E81682E4F8068FE028 18 | :10391000080780E0180728F0E0910401F091050104 19 | :1039200009958091C00087FFE9CF8091C6001F9163 20 | :103930000F91FF90EF9008950E94761C982F809130 21 | :10394000C00085FFFCCF9093C600913614F09755C8 22 | :1039500003C090330CF09053892F08951F930E9459 23 | :103960009C1C182F0E949C1C1295107F810F1F9188 24 | :1039700008951F93182F03C00E94761C1150112325 25 | :10398000D9F71F9108951F93182F0E94761C80323B 26 | :10399000A9F48091C00085FFFCCF84E18093C6002C 27 | :1039A0008091C00085FFFCCF1093C6008091C000BD 28 | :1039B00085FFFCCF80E18093C6000CC0809103019D 29 | :1039C0008F5F80930301853029F4E0910401F09129 30 | :1039D000050109951F9108950E94761C803279F4A3 31 | :1039E0008091C00085FFFCCF84E18093C600809168 32 | :1039F000C00085FFFCCF80E18093C60008958091D0 33 | :103A000003018F5F80930301853029F4E091040165 34 | :103A1000F0910501099508953F924F925F926F9240 35 | :103A20007F928F929F92AF92BF92CF92DF92EF924E 36 | :103A3000FF920F931F93CF93DF93000083E3809354 37 | :103A4000C4001092C50088E18093C10086E0809395 38 | :103A5000C2005098589A259A24E1E22E9EE1C92E80 39 | :103A600084E9B82E06E0A02E10E1F12E992493945B 40 | :103A7000B1E48B2EA6E57A2EF2E56F2EE0E25E2E03 41 | :103A800079E4472E63E5362E50E5D52E0E94761C4C 42 | :103A9000803309F45FC08133D1F50E94761C8032F7 43 | :103AA00009F0F0C18091C00085FFFCCFE092C60014 44 | :103AB0008091C00085FFFCCF8092C6008091C0003D 45 | :103AC00085FFFCCF7092C6008091C00085FFFCCFBF 46 | :103AD0006092C6008091C00085FFFCCF5092C60066 47 | :103AE0008091C00085FFFCCF4092C6008091C0004D 48 | :103AF00085FFFCCF3092C6008091C00085FFFCCFCF 49 | :103B0000D092C6008091C00085FFFCCFB2C1803446 50 | :103B100039F40E94761C8638E8F00E94761C1AC0A0 51 | :103B2000813499F40E94761C803811F482E0A7C198 52 | :103B3000813811F481E0A3C1823811F480E19FC182 53 | :103B4000883909F09BC183E09AC1823431F484E161 54 | :103B50000E94B91C0E94EC1C99CF853411F485E0B9 55 | :103B6000F7CF8035B9F38235A9F3813599F38535DF 56 | :103B700049F40E94761C809306010E94761C809373 57 | :103B80000701E8CF8635C9F40E94761C803389F49A 58 | :103B90000E94761C0E94761C182F0E94761C11230E 59 | :103BA00011F48EE16CC1113011F484E968C186E032 60 | :103BB00066C183E00E94B91C61C1843609F0D2C09D 61 | :103BC0000E94761C809309020E94761C8093080252 62 | :103BD00080910C028E7F80930C020E94761C8534AB 63 | :103BE00029F480910C02816080930C0200E010E0C7 64 | :103BF00008C00E94761CF801E85FFE4F80830F5FCB 65 | :103C00001F4F80910802909109020817190788F345 66 | :103C10000E94761C803209F035C180910C0280FF31 67 | :103C20002BC02091060130910701220F331F3093E2 68 | :103C3000070120930601609108027091090240E09B 69 | :103C400050E010C0F999FECFCA01820F931F92BDB8 70 | :103C500081BDFA01E85FFE4F808180BDFA9AF99A32 71 | :103C60004F5F5F4F4617570768F3260F371F309394 72 | :103C70000701209306016BC0809107018823880FFC 73 | :103C8000880B892180930B02809106019091070196 74 | :103C9000880F991F90930701809306018091080275 75 | :103CA00080FF09C0809108029091090201969093CB 76 | :103CB000090280930802F894F999FECF1127E09148 77 | :103CC0000601F0910701C8E0D1E0809108029091CF 78 | :103CD0000902103091F40091570001700130D9F3BE 79 | :103CE00003E000935700E895009157000170013000 80 | :103CF000D9F301E100935700E895099019900091DC 81 | :103D0000570001700130D9F301E000935700E895A6 82 | :103D10001395103498F0112700915700017001306D 83 | :103D2000D9F305E000935700E89500915700017022 84 | :103D30000130D9F301E100935700E89532960297DC 85 | :103D400009F0C7CF103011F00296E5CF1124809111 86 | :103D5000C00085FFFCCFE092C6008091C00085FFC7 87 | :103D6000FCCF87C0843709F062C00E94761C809324 88 | :103D700009020E94761C80930802809106019091AE 89 | :103D80000701880F991F90930701809306010E94F5 90 | :103D9000761C90910C02853411F4916001C09E7FD5 91 | :103DA00090930C020E94761C803209F06FCE8091B5 92 | :103DB000C00085FFFCCFE092C600A0910802B09140 93 | :103DC000090280910C02782F7170682F66956170DE 94 | :103DD0002091060130910701F90140E050E019C03F 95 | :103DE000772359F0F999FECFF2BDE1BDF89A90B56D 96 | :103DF0008091C00085FFFCCF07C0662339F4949101 97 | :103E00008091C00085FFFCCF9093C6004F5F5F4F4D 98 | :103E100031964A175B0720F32A0F3B1F30930701A7 99 | :103E2000209306018091C00085FFFCCF22C085371A 100 | :103E300019F50E94761C803229F58091C00085FF1B 101 | :103E4000FCCFE092C6008091C00085FFFCCFC092FD 102 | :103E5000C6008091C00085FFFCCFB092C600809163 103 | :103E6000C00085FFFCCFA092C6008091C00085FFF6 104 | :103E7000FCCFF092C6000ACE863721F480E00E9483 105 | :103E8000C31C04CE809103018F5F809303018530B2 106 | :103E900009F0FCCDE0910401F09105010995F6CD02 107 | :043EA000F894FFCFC4 108 | :023EA40080009C 109 | :0400000300003800C1 110 | :00000001FF 111 | -------------------------------------------------------------------------------- /src/bootloaders/atmegax8/ATmegaBOOT_88_pro_12MHz.hex: -------------------------------------------------------------------------------- 1 | :1018000019C033C032C031C030C02FC02EC02DC06F 2 | :101810002CC02BC02AC029C028C027C026C025C084 3 | :1018200024C023C022C021C020C01FC01EC01DC0B4 4 | :101830001CC01BC011241FBECFEFD4E0DEBFCDBF44 5 | :1018400011E0A0E0B1E0ECE2FEE102C005900D92F3 6 | :10185000A230B107D9F712E0A2E0B1E001C01D92B9 7 | :10186000AD30B107E1F7B5D0DFC2CACF982F95955B 8 | :10187000959595959595905D8F708A301CF0282FE1 9 | :10188000295A02C0282F205D8091C00085FFFCCF1F 10 | :101890009093C6008091C00085FFFCCF2093C600C6 11 | :1018A0000895982F8091C00085FFFCCF9093C600CB 12 | :1018B0000895EF92FF920F931F93EE24FF24870168 13 | :1018C00013C00894E11CF11C011D111D81EBE816E9 14 | :1018D00081E7F8068BE0080780E0180728F0E09120 15 | :1018E0000401F091050109958091C00087FFE9CFBF 16 | :1018F0008091C6001F910F91FF90EF900895D9DF5E 17 | :10190000982F8091C00085FFFCCF9093C600913640 18 | :1019100014F0975503C090330CF09053892F08951D 19 | :101920001F93EDDF182FEBDF1295107F810F1F91B2 20 | :1019300008951F93182F02C0BCDF11501123E1F747 21 | :101940001F9108951F93182FB4DF8032A9F480915E 22 | :10195000C00085FFFCCF84E18093C6008091C00069 23 | :1019600085FFFCCF1093C6008091C00085FFFCCF9F 24 | :1019700080E18093C6000CC0809103018F5F80934B 25 | :101980000301853029F4E0910401F09105010995E6 26 | :101990001F9108958EDF803279F48091C00085FF19 27 | :1019A000FCCF84E18093C6008091C00085FFFCCF0E 28 | :1019B00080E18093C6000895809103018F5F80933A 29 | :1019C0000301853029F4E0910401F09105010995A6 30 | :1019D00008953F924F925F926F927F928F929F9263 31 | :1019E000AF92BF92CF92DF92EF92FF920F931F932D 32 | :1019F000CF93DF93000086E28093C4001092C5006D 33 | :101A000088E18093C10086E08093C2005098589A84 34 | :101A1000259A24E1E22E9EE1C92E83E9B82E0AE040 35 | :101A2000A02E10E1F12E99249394B1E48B2EA6E51B 36 | :101A30007A2EF2E56F2EE0E25E2E79E4472E63E522 37 | :101A4000362E50E5D52E35DF803309F45AC0813368 38 | :101A5000C9F52FDF803209F0D9C18091C00085FF20 39 | :101A6000FCCFE092C6008091C00085FFFCCF809241 40 | :101A7000C6008091C00085FFFCCF7092C6008091A7 41 | :101A8000C00085FFFCCF6092C6008091C00085FF3A 42 | :101A9000FCCF5092C6008091C00085FFFCCF4092E1 43 | :101AA000C6008091C00085FFFCCF3092C6008091B7 44 | :101AB000C00085FFFCCFD092C6008091C00085FF9A 45 | :101AC000FCCF9CC1803429F4F4DE8638D0F0F1DEFE 46 | :101AD00018C0813491F4EDDE803811F482E094C1B5 47 | :101AE000813811F481E090C1823811F480E18CC119 48 | :101AF000883909F088C183E087C1823421F484E108 49 | :101B000018DF48DFA0CF853411F485E0F9CF8035A8 50 | :101B1000C1F38235B1F38135A1F3853539F4C9DEDE 51 | :101B200080930601C6DE80930701EBCF8635A1F4D2 52 | :101B3000C0DE803371F4BDDEBCDE182FBADE1123A7 53 | :101B400011F48EE161C1113011F483E95DC18AE0C5 54 | :101B50005BC183E0EEDE57C1843609F0CDC0A9DE5B 55 | :101B600080930902A6DE8093080280910C028E7F8A 56 | :101B700080930C029EDE853429F480910C028160F2 57 | :101B800080930C0200E010E007C093DEF801E85FEC 58 | :101B9000FE4F80830F5F1F4F8091080290910902D2 59 | :101BA0000817190790F385DE803209F02FC1809164 60 | :101BB0000C0280FF2BC02091060130910701220FFB 61 | :101BC000331F309307012093060160910802709142 62 | :101BD000090240E050E010C0F999FECFCA01820F1F 63 | :101BE000931F92BD81BDFA01E85FFE4F808180BDE9 64 | :101BF000FA9AF99A4F5F5F4F4617570768F3260F17 65 | :101C0000371F30930701209306016BC080910701B5 66 | :101C10008823880F880B892180930B02809106010D 67 | :101C200090910701880F991F9093070180930601F7 68 | :101C30008091080280FF09C08091080290910902FA 69 | :101C400001969093090280930802F894F999FECFC7 70 | :101C50001127E0910601F0910701C8E0D1E08091E1 71 | :101C6000080290910902103091F400915700017020 72 | :101C70000130D9F303E000935700E8950091570035 73 | :101C800001700130D9F301E100935700E895099004 74 | :101C900019900091570001700130D9F301E00093D1 75 | :101CA0005700E8951395103298F0112700915700CE 76 | :101CB00001700130D9F305E000935700E8950091D9 77 | :101CC000570001700130D9F301E100935700E89506 78 | :101CD0003296029709F0C7CF103011F00296E5CF87 79 | :101CE00011248091C00085FFFCCFE092C600809156 80 | :101CF000C00085FFFCCF82C0843709F05EC0D9DD0B 81 | :101D000080930902D6DD80930802809106019091AC 82 | :101D10000701880F991F9093070180930601C9DD81 83 | :101D200090910C02853411F4916001C09E7F9093D4 84 | :101D30000C02BFDD803209F086CE8091C00085FFA5 85 | :101D4000FCCFE092C600A0910802B09109028091F8 86 | :101D50000C02782F7170682F6695617020910601D2 87 | :101D600030910701F90140E050E019C0772359F0A4 88 | :101D7000F999FECFF2BDE1BDF89A90B58091C0000F 89 | :101D800085FFFCCF07C0662339F494918091C00091 90 | :101D900085FFFCCF9093C6004F5F5F4F31964A1787 91 | :101DA0005B0720F32A0F3B1F3093070120930601A6 92 | :101DB0008091C00085FFFCCF21C0853711F579DD0A 93 | :101DC000803221F58091C00085FFFCCFE092C600F3 94 | :101DD0008091C00085FFFCCFC092C6008091C000FA 95 | :101DE00085FFFCCFB092C6008091C00085FFFCCF7C 96 | :101DF000A092C6008091C00085FFFCCFF092C60083 97 | :101E000022CE863719F480E09DDD1DCE809103013E 98 | :101E10008F5F80930301853009F015CEE0910401B6 99 | :0C1E2000F091050109950FCEF894FFCF5A 100 | :021E2C00800034 101 | :0400000300001800E1 102 | :00000001FF 103 | -------------------------------------------------------------------------------- /src/bootloaders/atmegax8/ATmegaBOOT_88_pro_8MHz.hex: -------------------------------------------------------------------------------- 1 | :1018000019C033C032C031C030C02FC02EC02DC06F 2 | :101810002CC02BC02AC029C028C027C026C025C084 3 | :1018200024C023C022C021C020C01FC01EC01DC0B4 4 | :101830001CC01BC011241FBECFEFD4E0DEBFCDBF44 5 | :1018400011E0A0E0B1E0ECE2FEE102C005900D92F3 6 | :10185000A230B107D9F712E0A2E0B1E001C01D92B9 7 | :10186000AD30B107E1F7B5D0DFC2CACF982F95955B 8 | :10187000959595959595905D8F708A301CF0282FE1 9 | :10188000295A02C0282F205D8091C00085FFFCCF1F 10 | :101890009093C6008091C00085FFFCCF2093C600C6 11 | :1018A0000895982F8091C00085FFFCCF9093C600CB 12 | :1018B0000895EF92FF920F931F93EE24FF24870168 13 | :1018C00013C00894E11CF11C011D111D81E2E816F2 14 | :1018D00081EAF80687E0080780E0180728F0E09121 15 | :1018E0000401F091050109958091C00087FFE9CFBF 16 | :1018F0008091C6001F910F91FF90EF900895D9DF5E 17 | :10190000982F8091C00085FFFCCF9093C600913640 18 | :1019100014F0975503C090330CF09053892F08951D 19 | :101920001F93EDDF182FEBDF1295107F810F1F91B2 20 | :1019300008951F93182F02C0BCDF11501123E1F747 21 | :101940001F9108951F93182FB4DF8032A9F480915E 22 | :10195000C00085FFFCCF84E18093C6008091C00069 23 | :1019600085FFFCCF1093C6008091C00085FFFCCF9F 24 | :1019700080E18093C6000CC0809103018F5F80934B 25 | :101980000301853029F4E0910401F09105010995E6 26 | :101990001F9108958EDF803279F48091C00085FF19 27 | :1019A000FCCF84E18093C6008091C00085FFFCCF0E 28 | :1019B00080E18093C6000895809103018F5F80933A 29 | :1019C0000301853029F4E0910401F09105010995A6 30 | :1019D00008953F924F925F926F927F928F929F9263 31 | :1019E000AF92BF92CF92DF92EF92FF920F931F932D 32 | :1019F000CF93DF93000089E18093C4001092C5006B 33 | :101A000088E18093C10086E08093C2005098589A84 34 | :101A1000259A24E1E22E9EE1C92E83E9B82E0AE040 35 | :101A2000A02E10E1F12E99249394B1E48B2EA6E51B 36 | :101A30007A2EF2E56F2EE0E25E2E79E4472E63E522 37 | :101A4000362E50E5D52E35DF803309F45AC0813368 38 | :101A5000C9F52FDF803209F0D9C18091C00085FF20 39 | :101A6000FCCFE092C6008091C00085FFFCCF809241 40 | :101A7000C6008091C00085FFFCCF7092C6008091A7 41 | :101A8000C00085FFFCCF6092C6008091C00085FF3A 42 | :101A9000FCCF5092C6008091C00085FFFCCF4092E1 43 | :101AA000C6008091C00085FFFCCF3092C6008091B7 44 | :101AB000C00085FFFCCFD092C6008091C00085FF9A 45 | :101AC000FCCF9CC1803429F4F4DE8638D0F0F1DEFE 46 | :101AD00018C0813491F4EDDE803811F482E094C1B5 47 | :101AE000813811F481E090C1823811F480E18CC119 48 | :101AF000883909F088C183E087C1823421F484E108 49 | :101B000018DF48DFA0CF853411F485E0F9CF8035A8 50 | :101B1000C1F38235B1F38135A1F3853539F4C9DEDE 51 | :101B200080930601C6DE80930701EBCF8635A1F4D2 52 | :101B3000C0DE803371F4BDDEBCDE182FBADE1123A7 53 | :101B400011F48EE161C1113011F483E95DC18AE0C5 54 | :101B50005BC183E0EEDE57C1843609F0CDC0A9DE5B 55 | :101B600080930902A6DE8093080280910C028E7F8A 56 | :101B700080930C029EDE853429F480910C028160F2 57 | :101B800080930C0200E010E007C093DEF801E85FEC 58 | :101B9000FE4F80830F5F1F4F8091080290910902D2 59 | :101BA0000817190790F385DE803209F02FC1809164 60 | :101BB0000C0280FF2BC02091060130910701220FFB 61 | :101BC000331F309307012093060160910802709142 62 | :101BD000090240E050E010C0F999FECFCA01820F1F 63 | :101BE000931F92BD81BDFA01E85FFE4F808180BDE9 64 | :101BF000FA9AF99A4F5F5F4F4617570768F3260F17 65 | :101C0000371F30930701209306016BC080910701B5 66 | :101C10008823880F880B892180930B02809106010D 67 | :101C200090910701880F991F9093070180930601F7 68 | :101C30008091080280FF09C08091080290910902FA 69 | :101C400001969093090280930802F894F999FECFC7 70 | :101C50001127E0910601F0910701C8E0D1E08091E1 71 | :101C6000080290910902103091F400915700017020 72 | :101C70000130D9F303E000935700E8950091570035 73 | :101C800001700130D9F301E100935700E895099004 74 | :101C900019900091570001700130D9F301E00093D1 75 | :101CA0005700E8951395103298F0112700915700CE 76 | :101CB00001700130D9F305E000935700E8950091D9 77 | :101CC000570001700130D9F301E100935700E89506 78 | :101CD0003296029709F0C7CF103011F00296E5CF87 79 | :101CE00011248091C00085FFFCCFE092C600809156 80 | :101CF000C00085FFFCCF82C0843709F05EC0D9DD0B 81 | :101D000080930902D6DD80930802809106019091AC 82 | :101D10000701880F991F9093070180930601C9DD81 83 | :101D200090910C02853411F4916001C09E7F9093D4 84 | :101D30000C02BFDD803209F086CE8091C00085FFA5 85 | :101D4000FCCFE092C600A0910802B09109028091F8 86 | :101D50000C02782F7170682F6695617020910601D2 87 | :101D600030910701F90140E050E019C0772359F0A4 88 | :101D7000F999FECFF2BDE1BDF89A90B58091C0000F 89 | :101D800085FFFCCF07C0662339F494918091C00091 90 | :101D900085FFFCCF9093C6004F5F5F4F31964A1787 91 | :101DA0005B0720F32A0F3B1F3093070120930601A6 92 | :101DB0008091C00085FFFCCF21C0853711F579DD0A 93 | :101DC000803221F58091C00085FFFCCFE092C600F3 94 | :101DD0008091C00085FFFCCFC092C6008091C000FA 95 | :101DE00085FFFCCFB092C6008091C00085FFFCCF7C 96 | :101DF000A092C6008091C00085FFFCCFF092C60083 97 | :101E000022CE863719F480E09DDD1DCE809103013E 98 | :101E10008F5F80930301853009F015CEE0910401B6 99 | :0C1E2000F091050109950FCEF894FFCF5A 100 | :021E2C00800034 101 | :0400000300001800E1 102 | :00000001FF 103 | -------------------------------------------------------------------------------- /src/bootloaders/atmegax8/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for ATmegaBOOT 2 | # E.Lins, 18.7.2005 3 | # $Id$ 4 | # 5 | # Instructions 6 | # 7 | # To make bootloader .hex file: 8 | # make diecimila 9 | # make lilypad 10 | # make ng 11 | # etc... 12 | # 13 | # To burn bootloader .hex file: 14 | # make diecimila_isp 15 | # make lilypad_isp 16 | # make ng_isp 17 | # etc... 18 | DIRAVR = ../../../../../../bin/win32/WinAVR-20090313 19 | DIRAVRBIN = $(DIRAVR)/bin 20 | DIRAVRUTILS = $(DIRAVR)/utils/bin 21 | DIRINC = $(DIRAVR)/include 22 | DIRLIB = $(DIRAVR)/avr/lib 23 | 24 | 25 | # program name should not be changed... 26 | PROGRAM = ATmegaBOOT_168 27 | 28 | # enter the parameters for the avrdude isp tool 29 | ISPTOOL = stk500v2 30 | ISPPORT = usb 31 | ISPSPEED = -b 115200 32 | 33 | MCU_TARGET = atmega168 34 | LDSECTION = --section-start=.text=0x3800 35 | 36 | # the efuse should really be 0xf8; since, however, only the lower 37 | # three bits of that byte are used on the atmega168, avrdude gets 38 | # confused if you specify 1's for the higher bits, see: 39 | # http://tinker.it/now/2007/02/24/the-tale-of-avrdude-atmega168-and-extended-bits-fuses/ 40 | # 41 | # similarly, the lock bits should be 0xff instead of 0x3f (to 42 | # unlock the bootloader section) and 0xcf instead of 0x0f (to 43 | # lock it), but since the high two bits of the lock byte are 44 | # unused, avrdude would get confused. 45 | 46 | ISPFUSES = avrdude -c $(ISPTOOL) -p $(MCU_TARGET) -P $(ISPPORT) $(ISPSPEED) \ 47 | -e -u -U lock:w:0x3f:m -U efuse:w:0x$(EFUSE):m -U hfuse:w:0x$(HFUSE):m -U lfuse:w:0x$(LFUSE):m 48 | ISPFLASH = avrdude -c $(ISPTOOL) -p $(MCU_TARGET) -P $(ISPPORT) $(ISPSPEED) \ 49 | -U flash:w:$(PROGRAM)_$(TARGET).hex -U lock:w:0x0f:m 50 | 51 | STK500 = "C:\Program Files\Atmel\AVR Tools\STK500\Stk500.exe" 52 | STK500-1 = $(STK500) -e -d$(MCU_TARGET) -pf -vf -if$(PROGRAM)_$(TARGET).hex \ 53 | -lFF -LFF -f$(HFUSE)$(LFUSE) -EF8 -ms -q -cUSB -I200kHz -s -wt 54 | STK500-2 = $(STK500) -d$(MCU_TARGET) -ms -q -lCF -LCF -cUSB -I200kHz -s -wt 55 | 56 | 57 | OBJ = $(PROGRAM).o 58 | OPTIMIZE = -Os 59 | 60 | DEFS = 61 | LIBS = 62 | 63 | CC = $(DIRAVRBIN)/avr-gcc 64 | 65 | # Override is only needed by avr-lib build system. 66 | 67 | override CFLAGS = -g -Wall $(OPTIMIZE) -mmcu=$(MCU_TARGET) -DF_CPU=$(AVR_FREQ) $(DEFS) 68 | override LDFLAGS = -Wl,$(LDSECTION) 69 | #override LDFLAGS = -Wl,-Map,$(PROGRAM).map,$(LDSECTION) 70 | 71 | OBJCOPY = $(DIRAVRBIN)/avr-objcopy 72 | OBJDUMP = $(DIRAVRBIN)/avr-objdump 73 | 74 | all: 75 | 76 | lilypad: TARGET = lilypad 77 | lilypad: CFLAGS += '-DMAX_TIME_COUNT=F_CPU>>1' '-DNUM_LED_FLASHES=3' 78 | lilypad: AVR_FREQ = 8000000L 79 | lilypad: $(PROGRAM)_lilypad.hex 80 | 81 | lilypad_isp: lilypad 82 | lilypad_isp: TARGET = lilypad 83 | lilypad_isp: HFUSE = DD 84 | lilypad_isp: LFUSE = E2 85 | lilypad_isp: EFUSE = 00 86 | lilypad_isp: isp 87 | 88 | lilypad_resonator: TARGET = lilypad_resonator 89 | lilypad_resonator: CFLAGS += '-DMAX_TIME_COUNT=F_CPU>>4' '-DNUM_LED_FLASHES=3' 90 | lilypad_resonator: AVR_FREQ = 8000000L 91 | lilypad_resonator: $(PROGRAM)_lilypad_resonator.hex 92 | 93 | lilypad_resonator_isp: lilypad_resonator 94 | lilypad_resonator_isp: TARGET = lilypad_resonator 95 | lilypad_resonator_isp: HFUSE = DD 96 | lilypad_resonator_isp: LFUSE = C6 97 | lilypad_resonator_isp: EFUSE = 00 98 | lilypad_resonator_isp: isp 99 | 100 | pro8: TARGET = pro_8MHz 101 | pro8: CFLAGS += '-DMAX_TIME_COUNT=F_CPU>>4' '-DNUM_LED_FLASHES=1' '-DWATCHDOG_MODS' 102 | pro8: AVR_FREQ = 8000000L 103 | pro8: $(PROGRAM)_pro_8MHz.hex 104 | 105 | pro8_isp: pro8 106 | pro8_isp: TARGET = pro_8MHz 107 | pro8_isp: HFUSE = DD 108 | pro8_isp: LFUSE = C6 109 | pro8_isp: EFUSE = 00 110 | pro8_isp: isp 111 | 112 | pro16: TARGET = pro_16MHz 113 | pro16: CFLAGS += '-DMAX_TIME_COUNT=F_CPU>>4' '-DNUM_LED_FLASHES=1' '-DWATCHDOG_MODS' 114 | pro16: AVR_FREQ = 16000000L 115 | pro16: $(PROGRAM)_pro_16MHz.hex 116 | 117 | pro16_isp: pro16 118 | pro16_isp: TARGET = pro_16MHz 119 | pro16_isp: HFUSE = DD 120 | pro16_isp: LFUSE = C6 121 | pro16_isp: EFUSE = 00 122 | pro16_isp: isp 123 | 124 | pro20: TARGET = pro_20mhz 125 | pro20: CFLAGS += '-DMAX_TIME_COUNT=F_CPU>>4' '-DNUM_LED_FLASHES=1' '-DWATCHDOG_MODS' 126 | pro20: AVR_FREQ = 20000000L 127 | pro20: $(PROGRAM)_pro_20mhz.hex 128 | 129 | pro20_isp: pro20 130 | pro20_isp: TARGET = pro_20mhz 131 | pro20_isp: HFUSE = DD 132 | pro20_isp: LFUSE = C6 133 | pro20_isp: EFUSE = 00 134 | pro20_isp: isp 135 | 136 | diecimila: TARGET = diecimila 137 | diecimila: CFLAGS += '-DMAX_TIME_COUNT=F_CPU>>4' '-DNUM_LED_FLASHES=1' 138 | diecimila: AVR_FREQ = 16000000L 139 | diecimila: $(PROGRAM)_diecimila.hex 140 | 141 | 142 | std_16: TARGET = std_16 143 | std_16: CFLAGS += '-DMAX_TIME_COUNT=F_CPU>>4' 144 | std_16: AVR_FREQ = 16000000L 145 | std_16: $(PROGRAM)_std_16Mhz.hex 146 | 147 | diecimila_isp: diecimila 148 | diecimila_isp: TARGET = diecimila 149 | diecimila_isp: HFUSE = DD 150 | diecimila_isp: LFUSE = FF 151 | diecimila_isp: EFUSE = 00 152 | diecimila_isp: isp 153 | 154 | ng: TARGET = ng 155 | ng: CFLAGS += '-DMAX_TIME_COUNT=F_CPU>>1' '-DNUM_LED_FLASHES=3' 156 | ng: AVR_FREQ = 16000000L 157 | ng: $(PROGRAM)_ng.hex 158 | 159 | ng_isp: ng 160 | ng_isp: TARGET = ng 161 | ng_isp: HFUSE = DD 162 | ng_isp: LFUSE = FF 163 | ng_isp: EFUSE = 00 164 | ng_isp: isp 165 | 166 | atmega328: TARGET = atmega328 167 | atmega328: MCU_TARGET = atmega328p 168 | atmega328: CFLAGS += '-DMAX_TIME_COUNT=F_CPU>>4' '-DNUM_LED_FLASHES=1' -DBAUD_RATE=57600 169 | atmega328: AVR_FREQ = 16000000L 170 | atmega328: LDSECTION = --section-start=.text=0x7800 171 | atmega328: $(PROGRAM)_atmega328.hex 172 | 173 | atmega328_isp: atmega328 174 | atmega328_isp: TARGET = atmega328 175 | atmega328_isp: MCU_TARGET = atmega328p 176 | atmega328_isp: HFUSE = DA 177 | atmega328_isp: LFUSE = FF 178 | atmega328_isp: EFUSE = 05 179 | atmega328_isp: isp 180 | 181 | atmega328_pro8: TARGET = atmega328_pro_8MHz 182 | atmega328_pro8: MCU_TARGET = atmega328p 183 | atmega328_pro8: CFLAGS += '-DMAX_TIME_COUNT=F_CPU>>4' '-DNUM_LED_FLASHES=1' -DBAUD_RATE=57600 -DDOUBLE_SPEED 184 | atmega328_pro8: AVR_FREQ = 8000000L 185 | atmega328_pro8: LDSECTION = --section-start=.text=0x7800 186 | atmega328_pro8: $(PROGRAM)_atmega328_pro_8MHz.hex 187 | 188 | atmega328_pro8_isp: atmega328_pro8 189 | atmega328_pro8_isp: TARGET = atmega328_pro_8MHz 190 | atmega328_pro8_isp: MCU_TARGET = atmega328p 191 | atmega328_pro8_isp: HFUSE = DA 192 | atmega328_pro8_isp: LFUSE = FF 193 | atmega328_pro8_isp: EFUSE = 05 194 | atmega328_pro8_isp: isp 195 | 196 | mega: TARGET = atmega1280 197 | mega: MCU_TARGET = atmega1280 198 | mega: CFLAGS += '-DMAX_TIME_COUNT=F_CPU>>4' '-DNUM_LED_FLASHES=0' -DBAUD_RATE=57600 199 | mega: AVR_FREQ = 16000000L 200 | mega: LDSECTION = --section-start=.text=0x1F000 201 | mega: $(PROGRAM)_atmega1280.hex 202 | 203 | mega_isp: mega 204 | mega_isp: TARGET = atmega1280 205 | mega_isp: MCU_TARGET = atmega1280 206 | mega_isp: HFUSE = DA 207 | mega_isp: LFUSE = FF 208 | mega_isp: EFUSE = F5 209 | mega_isp: isp 210 | 211 | isp: $(TARGET) 212 | $(ISPFUSES) 213 | $(ISPFLASH) 214 | 215 | isp-stk500: $(PROGRAM)_$(TARGET).hex 216 | $(STK500-1) 217 | $(STK500-2) 218 | 219 | %.elf: $(OBJ) 220 | $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) 221 | 222 | clean: 223 | rm -rf *.o *.elf *.lst *.map *.sym *.lss *.eep *.srec *.bin *.hex 224 | 225 | %.lst: %.elf 226 | $(OBJDUMP) -h -S $< > $@ 227 | 228 | %.hex: %.elf 229 | $(OBJCOPY) -j .text -j .data -O ihex $< $@ 230 | 231 | %.srec: %.elf 232 | $(OBJCOPY) -j .text -j .data -O srec $< $@ 233 | 234 | %.bin: %.elf 235 | $(OBJCOPY) -j .text -j .data -O binary $< $@ 236 | 237 | -------------------------------------------------------------------------------- /src/bootloaders/atmegax8/Makefile_mega88: -------------------------------------------------------------------------------- 1 | # Makefile for ATmegaBOOT 2 | # E.Lins, 18.7.2005 3 | # $Id$ 4 | # 5 | # Instructions 6 | # 7 | # To make bootloader .hex file: 8 | # make diecimila 9 | # make lilypad 10 | # make ng 11 | # etc... 12 | # 13 | # To burn bootloader .hex file: 14 | # make diecimila_isp 15 | # make lilypad_isp 16 | # make ng_isp 17 | # etc... 18 | 19 | # program name should not be changed... 20 | PROGRAM = ATmegaBOOT_88 21 | 22 | # enter the parameters for the avrdude isp tool 23 | ISPTOOL = stk500v2 24 | ISPPORT = usb 25 | ISPSPEED = -b 115200 26 | 27 | MCU_TARGET = atmega88 28 | LDSECTION = --section-start=.text=0x1800 29 | 30 | DIRAVR = ../../../../../../bin/win32/WinAVR-20090313 31 | DIRAVRBIN = $(DIRAVR)/bin 32 | DIRAVRUTILS = $(DIRAVR)/utils/bin 33 | DIRINC = $(DIRAVR)/avr/include 34 | DIRLIB = $(DIRAVR)/avr/lib 35 | 36 | # the efuse should really be 0xf8; since, however, only the lower 37 | # three bits of that byte are used on the atmega168, avrdude gets 38 | # confused if you specify 1's for the higher bits, see: 39 | # http://tinker.it/now/2007/02/24/the-tale-of-avrdude-atmega168-and-extended-bits-fuses/ 40 | # 41 | # similarly, the lock bits should be 0xff instead of 0x3f (to 42 | # unlock the bootloader section) and 0xcf instead of 0x0f (to 43 | # lock it), but since the high two bits of the lock byte are 44 | # unused, avrdude would get confused. 45 | 46 | ISPFUSES = avrdude -c $(ISPTOOL) -p $(MCU_TARGET) -P $(ISPPORT) $(ISPSPEED) \ 47 | -e -u -U lock:w:0x3f:m -U efuse:w:0x$(EFUSE):m -U hfuse:w:0x$(HFUSE):m -U lfuse:w:0x$(LFUSE):m 48 | ISPFLASH = avrdude -c $(ISPTOOL) -p $(MCU_TARGET) -P $(ISPPORT) $(ISPSPEED) \ 49 | -U flash:w:$(PROGRAM)_$(TARGET).hex -U lock:w:0x0f:m 50 | 51 | STK500 = "C:\Program Files\Atmel\AVR Tools\STK500\Stk500.exe" 52 | STK500-1 = $(STK500) -e -d$(MCU_TARGET) -pf -vf -if$(PROGRAM)_$(TARGET).hex \ 53 | -lFF -LFF -f$(HFUSE)$(LFUSE) -EF8 -ms -q -cUSB -I200kHz -s -wt 54 | STK500-2 = $(STK500) -d$(MCU_TARGET) -ms -q -lCF -LCF -cUSB -I200kHz -s -wt 55 | 56 | 57 | OBJ = ATmegaBOOT_168.o 58 | OPTIMIZE = -Os 59 | 60 | DEFS = 61 | LIBS = 62 | 63 | CC = $(DIRAVRBIN)/avr-gcc 64 | 65 | # Override is only needed by avr-lib build system. 66 | 67 | override CFLAGS = -g -Wall $(OPTIMIZE) -mmcu=$(MCU_TARGET) -DF_CPU=$(AVR_FREQ) $(DEFS) -I$(DIRINC) 68 | override LDFLAGS = -Wl,$(LDSECTION) 69 | #override LDFLAGS = -Wl,-Map,$(PROGRAM).map,$(LDSECTION) 70 | 71 | OBJCOPY = $(DIRAVRBIN)/avr-objcopy 72 | OBJDUMP = $(DIRAVRBIN)/avr-objdump 73 | 74 | all: 75 | pro12: TARGET = pro_12MHz 76 | pro12: CFLAGS += '-DMAX_TIME_COUNT=F_CPU>>4' '-DNUM_LED_FLASHES=1' 77 | pro12: AVR_FREQ = 12000000L 78 | pro12: $(PROGRAM)_pro_12MHz.hex 79 | 80 | pro12_isp: pro12 81 | pro12_isp: TARGET = pro_12MHz 82 | pro12_isp: HFUSE = DD 83 | pro12_isp: LFUSE = C6 84 | pro12_isp: EFUSE = 00 85 | pro12_isp: isp 86 | 87 | pro8: TARGET = pro_8MHz 88 | pro8: CFLAGS += '-DMAX_TIME_COUNT=F_CPU>>4' '-DNUM_LED_FLASHES=1' 89 | pro8: AVR_FREQ = 8000000L 90 | pro8: $(PROGRAM)_pro_8MHz.hex 91 | 92 | pro8_isp: pro8 93 | pro8_isp: TARGET = pro_8MHz 94 | pro8_isp: HFUSE = DD 95 | pro8_isp: LFUSE = C6 96 | pro8_isp: EFUSE = 00 97 | pro8_isp: isp 98 | 99 | diecimila: TARGET = diecimila 100 | diecimila: CFLAGS += '-DMAX_TIME_COUNT=F_CPU>>4' '-DNUM_LED_FLASHES=1' 101 | diecimila: AVR_FREQ = 16000000L 102 | diecimila: $(PROGRAM)_diecimila.hex 103 | 104 | diecimila_isp: diecimila 105 | diecimila_isp: TARGET = diecimila 106 | diecimila_isp: HFUSE = DD 107 | diecimila_isp: LFUSE = FF 108 | diecimila_isp: EFUSE = 00 109 | diecimila_isp: isp 110 | 111 | 112 | isp: $(TARGET) 113 | $(ISPFUSES) 114 | $(ISPFLASH) 115 | 116 | isp-stk500: $(PROGRAM)_$(TARGET).hex 117 | $(STK500-1) 118 | $(STK500-2) 119 | 120 | %.elf: $(OBJ) 121 | $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) 122 | 123 | clean: 124 | rm -rf *.o *.elf *.lst *.map *.sym *.lss *.eep *.srec *.bin *.hex 125 | 126 | %.lst: %.elf 127 | $(OBJDUMP) -h -S $< > $@ 128 | 129 | %.hex: %.elf 130 | $(OBJCOPY) -j .text -j .data -O ihex $< $@ 131 | 132 | %.srec: %.elf 133 | $(OBJCOPY) -j .text -j .data -O srec $< $@ 134 | 135 | %.bin: %.elf 136 | $(OBJCOPY) -j .text -j .data -O binary $< $@ 137 | 138 | -------------------------------------------------------------------------------- /src/bootloaders/hidbootloader/Makefile_mega168_12M: -------------------------------------------------------------------------------- 1 | # Name: Makefile 2 | # Project: bootloadHID 3 | # Author: Christian Starkjohann 4 | # Creation Date: 2007-03-19 5 | # Tabsize: 4 6 | # Copyright: (c) 2007 by OBJECTIVE DEVELOPMENT Software GmbH 7 | # License: GNU GPL v2 (see License.txt) 8 | # This Revision: $Id: Makefile 684 2008-10-22 18:43:39Z cs $ 9 | 10 | ############################################################################### 11 | # Configure the following variables according to your AVR. The example below 12 | # is for an ATMega8. Program the device with 13 | # make fuse # to set the clock generator, boot section size etc. 14 | # make flash # to load the boot loader into flash 15 | # make lock # to protect the boot loader from overwriting 16 | 17 | DEVICE = atmega168 18 | BOOTLOADER_ADDRESS = 0x3800 19 | F_CPU = 12000000 20 | FUSEH = 0xc0 21 | FUSEL = 0x9f 22 | # Fuse high byte: 23 | # 0xc0 = 1 1 0 0 0 0 0 0 <-- BOOTRST (boot reset vector at 0x1800) 24 | # ^ ^ ^ ^ ^ ^ ^------ BOOTSZ0 25 | # | | | | | +-------- BOOTSZ1 26 | # | | | | + --------- EESAVE (preserve EEPROM over chip erase) 27 | # | | | +-------------- CKOPT (full output swing) 28 | # | | +---------------- SPIEN (allow serial programming) 29 | # | +------------------ WDTON (WDT not always on) 30 | # +-------------------- RSTDISBL (reset pin is enabled) 31 | # Fuse low byte: 32 | # 0x9f = 1 0 0 1 1 1 1 1 33 | # ^ ^ \ / \--+--/ 34 | # | | | +------- CKSEL 3..0 (external >8M crystal) 35 | # | | +--------------- SUT 1..0 (crystal osc, BOD enabled) 36 | # | +------------------ BODEN (BrownOut Detector enabled) 37 | # +-------------------- BODLEVEL (2.7V) 38 | 39 | ############################################################################### 40 | 41 | DIRAVR = ../../../../../../bin/win32/WinAVR-20090313 42 | DIRAVRBIN = $(DIRAVR)/bin 43 | DIRAVRUTILS = $(DIRAVR)/utils/bin 44 | DIRINC = $(DIRAVR)/avr/include 45 | DIRLIB = $(DIRAVR)/avr/lib 46 | 47 | AVRDUDE = $(DIRAVRBIN)/avrdude -c stk500v2 -P avrdoper -p $(DEVICE) 48 | 49 | LDFLAGS += -Wl,--section-start=.text=$(BOOTLOADER_ADDRESS) 50 | 51 | COMPILE = $(DIRAVRBIN)/avr-gcc -Wall -Os -Iusbdrv -I. -mmcu=$(DEVICE) -DF_CPU=$(F_CPU) -DDEBUG_LEVEL=0 -I$(DIRINC)# -DTEST_MODE 52 | # NEVER compile the final product with debugging! Any debug output will 53 | # distort timing so that the specs can't be met. 54 | 55 | OBJECTS = usbdrv/usbdrvasm.o usbdrv/oddebug.o main.o 56 | 57 | 58 | # symbolic targets: 59 | all: main.hex 60 | 61 | .c.o: 62 | $(COMPILE) -c $< -o $@ 63 | 64 | .S.o: 65 | $(COMPILE) -x assembler-with-cpp -c $< -o $@ 66 | # "-x assembler-with-cpp" should not be necessary since this is the default 67 | # file type for the .S (with capital S) extension. However, upper case 68 | # characters are not always preserved on Windows. To ensure WinAVR 69 | # compatibility define the file type manually. 70 | 71 | .c.s: 72 | $(COMPILE) -S $< -o $@ 73 | 74 | flash: all 75 | $(AVRDUDE) -U flash:w:main.hex:i 76 | 77 | readflash: 78 | $(AVRDUDE) -U flash:r:read.hex:i 79 | 80 | fuse: 81 | $(AVRDUDE) -U hfuse:w:$(FUSEH):m -U lfuse:w:$(FUSEL):m 82 | 83 | lock: 84 | $(AVRDUDE) -U lock:w:0x2f:m 85 | 86 | read_fuses: 87 | $(UISP) --rd_fuses 88 | 89 | clean: 90 | rm -f main.hex main.bin *.o usbdrv/*.o main.s usbdrv/oddebug.s usbdrv/usbdrv.s 91 | 92 | # file targets: 93 | main.bin: $(OBJECTS) 94 | $(COMPILE) -o main.bin $(OBJECTS) $(LDFLAGS) 95 | 96 | main.hex: main.bin 97 | rm -f main.hex main.eep.hex 98 | $(DIRAVRBIN)/avr-objcopy -j .text -j .data -O ihex main.bin main.hex 99 | $(DIRAVRBIN)/avr-size main.bin 100 | 101 | disasm: main.bin 102 | $(DIRAVRBIN)/avr-objdump -d main.bin 103 | 104 | cpp: 105 | $(COMPILE) -E main.c 106 | -------------------------------------------------------------------------------- /src/bootloaders/hidbootloader/Makefile_mega88_12M: -------------------------------------------------------------------------------- 1 | # Name: Makefile 2 | # Project: bootloadHID 3 | # Author: Christian Starkjohann 4 | # Creation Date: 2007-03-19 5 | # Tabsize: 4 6 | # Copyright: (c) 2007 by OBJECTIVE DEVELOPMENT Software GmbH 7 | # License: GNU GPL v2 (see License.txt) 8 | # This Revision: $Id: Makefile 684 2008-10-22 18:43:39Z cs $ 9 | 10 | ############################################################################### 11 | # Configure the following variables according to your AVR. The example below 12 | # is for an ATMega8. Program the device with 13 | # make fuse # to set the clock generator, boot section size etc. 14 | # make flash # to load the boot loader into flash 15 | # make lock # to protect the boot loader from overwriting 16 | 17 | DEVICE = atmega88 18 | BOOTLOADER_ADDRESS = 1800 19 | F_CPU = 12000000 20 | FUSEH = 0xc0 21 | FUSEL = 0x9f 22 | # Fuse high byte: 23 | # 0xc0 = 1 1 0 0 0 0 0 0 <-- BOOTRST (boot reset vector at 0x1800) 24 | # ^ ^ ^ ^ ^ ^ ^------ BOOTSZ0 25 | # | | | | | +-------- BOOTSZ1 26 | # | | | | + --------- EESAVE (preserve EEPROM over chip erase) 27 | # | | | +-------------- CKOPT (full output swing) 28 | # | | +---------------- SPIEN (allow serial programming) 29 | # | +------------------ WDTON (WDT not always on) 30 | # +-------------------- RSTDISBL (reset pin is enabled) 31 | # Fuse low byte: 32 | # 0x9f = 1 0 0 1 1 1 1 1 33 | # ^ ^ \ / \--+--/ 34 | # | | | +------- CKSEL 3..0 (external >8M crystal) 35 | # | | +--------------- SUT 1..0 (crystal osc, BOD enabled) 36 | # | +------------------ BODEN (BrownOut Detector enabled) 37 | # +-------------------- BODLEVEL (2.7V) 38 | 39 | ############################################################################### 40 | 41 | DIRAVR = ../../../../../../bin/win32/WinAVR-20090313 42 | DIRAVRBIN = $(DIRAVR)/bin 43 | DIRAVRUTILS = $(DIRAVR)/utils/bin 44 | DIRINC = $(DIRAVR)/avr/include 45 | DIRLIB = $(DIRAVR)/avr/lib 46 | 47 | AVRDUDE = $(DIRAVRBIN)/avrdude -c stk500v2 -P avrdoper -p $(DEVICE) 48 | 49 | LDFLAGS += -Wl,--section-start=.text=$(BOOTLOADER_ADDRESS) 50 | 51 | COMPILE = $(DIRAVRBIN)/avr-gcc -Wall -Os -Iusbdrv -I. -mmcu=$(DEVICE) -DF_CPU=$(F_CPU) -DDEBUG_LEVEL=0 -I$(DIRINC)# -DTEST_MODE 52 | # NEVER compile the final product with debugging! Any debug output will 53 | # distort timing so that the specs can't be met. 54 | 55 | OBJECTS = usbdrv/usbdrvasm.o usbdrv/oddebug.o main.o 56 | 57 | 58 | # symbolic targets: 59 | all: main.hex 60 | 61 | .c.o: 62 | $(COMPILE) -c $< -o $@ 63 | 64 | .S.o: 65 | $(COMPILE) -x assembler-with-cpp -c $< -o $@ 66 | # "-x assembler-with-cpp" should not be necessary since this is the default 67 | # file type for the .S (with capital S) extension. However, upper case 68 | # characters are not always preserved on Windows. To ensure WinAVR 69 | # compatibility define the file type manually. 70 | 71 | .c.s: 72 | $(COMPILE) -S $< -o $@ 73 | 74 | flash: all 75 | $(AVRDUDE) -U flash:w:main.hex:i 76 | 77 | readflash: 78 | $(AVRDUDE) -U flash:r:read.hex:i 79 | 80 | fuse: 81 | $(AVRDUDE) -U hfuse:w:$(FUSEH):m -U lfuse:w:$(FUSEL):m 82 | 83 | lock: 84 | $(AVRDUDE) -U lock:w:0x2f:m 85 | 86 | read_fuses: 87 | $(UISP) --rd_fuses 88 | 89 | clean: 90 | rm -f main.hex main.bin *.o usbdrv/*.o main.s usbdrv/oddebug.s usbdrv/usbdrv.s 91 | 92 | # file targets: 93 | main.bin: $(OBJECTS) 94 | $(COMPILE) -o main.bin $(OBJECTS) $(LDFLAGS) 95 | 96 | main.hex: main.bin 97 | rm -f main.hex main.eep.hex 98 | $(DIRAVRBIN)/avr-objcopy -j .text -j .data -O ihex main.bin main.hex 99 | $(DIRAVRBIN)/avr-size main.bin 100 | 101 | disasm: main.bin 102 | $(DIRAVRBIN)/avr-objdump -d main.bin 103 | 104 | cpp: 105 | $(COMPILE) -E main.c 106 | -------------------------------------------------------------------------------- /src/bootloaders/hidbootloader/Makefile_mega8_12M: -------------------------------------------------------------------------------- 1 | # Name: Makefile 2 | # Project: bootloadHID 3 | # Author: Christian Starkjohann 4 | # Creation Date: 2007-03-19 5 | # Tabsize: 4 6 | # Copyright: (c) 2007 by OBJECTIVE DEVELOPMENT Software GmbH 7 | # License: GNU GPL v2 (see License.txt) 8 | # This Revision: $Id: Makefile 684 2008-10-22 18:43:39Z cs $ 9 | 10 | ############################################################################### 11 | # Configure the following variables according to your AVR. The example below 12 | # is for an ATMega8. Program the device with 13 | # make fuse # to set the clock generator, boot section size etc. 14 | # make flash # to load the boot loader into flash 15 | # make lock # to protect the boot loader from overwriting 16 | 17 | DEVICE = atmega8 18 | BOOTLOADER_ADDRESS = 1800 19 | F_CPU = 12000000 20 | FUSEH = 0xc0 21 | FUSEL = 0x9f 22 | # Fuse high byte: 23 | # 0xc0 = 1 1 0 0 0 0 0 0 <-- BOOTRST (boot reset vector at 0x1800) 24 | # ^ ^ ^ ^ ^ ^ ^------ BOOTSZ0 25 | # | | | | | +-------- BOOTSZ1 26 | # | | | | + --------- EESAVE (preserve EEPROM over chip erase) 27 | # | | | +-------------- CKOPT (full output swing) 28 | # | | +---------------- SPIEN (allow serial programming) 29 | # | +------------------ WDTON (WDT not always on) 30 | # +-------------------- RSTDISBL (reset pin is enabled) 31 | # Fuse low byte: 32 | # 0x9f = 1 0 0 1 1 1 1 1 33 | # ^ ^ \ / \--+--/ 34 | # | | | +------- CKSEL 3..0 (external >8M crystal) 35 | # | | +--------------- SUT 1..0 (crystal osc, BOD enabled) 36 | # | +------------------ BODEN (BrownOut Detector enabled) 37 | # +-------------------- BODLEVEL (2.7V) 38 | 39 | ############################################################################### 40 | 41 | DIRAVR = ../../../../../../bin/win32/WinAVR-20090313 42 | DIRAVRBIN = $(DIRAVR)/bin 43 | DIRAVRUTILS = $(DIRAVR)/utils/bin 44 | DIRINC = $(DIRAVR)/avr/include 45 | DIRLIB = $(DIRAVR)/avr/lib 46 | 47 | AVRDUDE = $(DIRAVRBIN)/avrdude -c stk500v2 -P avrdoper -p $(DEVICE) 48 | 49 | LDFLAGS += -Wl,--section-start=.text=$(BOOTLOADER_ADDRESS) 50 | 51 | COMPILE = $(DIRAVRBIN)/avr-gcc -Wall -Os -Iusbdrv -I. -mmcu=$(DEVICE) -DF_CPU=$(F_CPU) -DDEBUG_LEVEL=0 -I$(DIRINC)# -DTEST_MODE 52 | # NEVER compile the final product with debugging! Any debug output will 53 | # distort timing so that the specs can't be met. 54 | 55 | OBJECTS = usbdrv/usbdrvasm.o usbdrv/oddebug.o main.o 56 | 57 | 58 | # symbolic targets: 59 | all: main.hex 60 | 61 | .c.o: 62 | $(COMPILE) -c $< -o $@ 63 | 64 | .S.o: 65 | $(COMPILE) -x assembler-with-cpp -c $< -o $@ 66 | # "-x assembler-with-cpp" should not be necessary since this is the default 67 | # file type for the .S (with capital S) extension. However, upper case 68 | # characters are not always preserved on Windows. To ensure WinAVR 69 | # compatibility define the file type manually. 70 | 71 | .c.s: 72 | $(COMPILE) -S $< -o $@ 73 | 74 | flash: all 75 | $(AVRDUDE) -U flash:w:main.hex:i 76 | 77 | readflash: 78 | $(AVRDUDE) -U flash:r:read.hex:i 79 | 80 | fuse: 81 | $(AVRDUDE) -U hfuse:w:$(FUSEH):m -U lfuse:w:$(FUSEL):m 82 | 83 | lock: 84 | $(AVRDUDE) -U lock:w:0x2f:m 85 | 86 | read_fuses: 87 | $(UISP) --rd_fuses 88 | 89 | clean: 90 | rm -f main.hex main.bin *.o usbdrv/*.o main.s usbdrv/oddebug.s usbdrv/usbdrv.s 91 | 92 | # file targets: 93 | main.bin: $(OBJECTS) 94 | $(COMPILE) -o main.bin $(OBJECTS) $(LDFLAGS) 95 | 96 | main.hex: main.bin 97 | rm -f main.hex main.eep.hex 98 | $(DIRAVRBIN)/avr-objcopy -j .text -j .data -O ihex main.bin main.hex 99 | $(DIRAVRBIN)/avr-size main.bin 100 | 101 | disasm: main.bin 102 | $(DIRAVRBIN)/avr-objdump -d main.bin 103 | 104 | cpp: 105 | $(COMPILE) -E main.c 106 | -------------------------------------------------------------------------------- /src/bootloaders/hidbootloader/bootloaderconfig.h: -------------------------------------------------------------------------------- 1 | /* Name: bootloaderconfig.h 2 | * Project: AVR bootloader HID 3 | * Author: Christian Starkjohann 4 | * Creation Date: 2007-03-19 5 | * Tabsize: 4 6 | * Copyright: (c) 2007 by OBJECTIVE DEVELOPMENT Software GmbH 7 | * License: GNU GPL v2 (see License.txt) 8 | * This Revision: $Id: bootloaderconfig.h 699 2008-11-26 19:50:32Z cs $ 9 | */ 10 | 11 | #ifndef __bootloaderconfig_h_included__ 12 | #define __bootloaderconfig_h_included__ 13 | 14 | /* 15 | General Description: 16 | This file (together with some settings in Makefile) configures the boot loader 17 | according to the hardware. 18 | 19 | This file contains (besides the hardware configuration normally found in 20 | usbconfig.h) two functions or macros: bootLoaderInit() and 21 | bootLoaderCondition(). Whether you implement them as macros or as static 22 | inline functions is up to you, decide based on code size and convenience. 23 | 24 | bootLoaderInit() is called as one of the first actions after reset. It should 25 | be a minimum initialization of the hardware so that the boot loader condition 26 | can be read. This will usually consist of activating a pull-up resistor for an 27 | external jumper which selects boot loader mode. You may call leaveBootloader() 28 | from this function if you know that the main code should run. 29 | 30 | bootLoaderCondition() is called immediately after initialization and in each 31 | main loop iteration. If it returns TRUE, the boot loader will be active. If it 32 | returns FALSE, the boot loader jumps to address 0 (the loaded application) 33 | immediately. 34 | 35 | For compatibility with Thomas Fischl's avrusbboot, we also support the macro 36 | names BOOTLOADER_INIT and BOOTLOADER_CONDITION for this functionality. If 37 | these macros are defined, the boot loader usees them. 38 | */ 39 | 40 | /* ---------------------------- Hardware Config ---------------------------- */ 41 | 42 | #define USB_CFG_IOPORTNAME B 43 | /* This is the port where the USB bus is connected. When you configure it to 44 | * "B", the registers PORTB, PINB and DDRB will be used. 45 | */ 46 | #define USB_CFG_DMINUS_BIT 0 47 | /* This is the bit number in USB_CFG_IOPORT where the USB D- line is connected. 48 | * This may be any bit in the port. 49 | */ 50 | #define USB_CFG_DPLUS_BIT 1 51 | /* This is the bit number in USB_CFG_IOPORT where the USB D+ line is connected. 52 | * This may be any bit in the port. Please note that D+ must also be connected 53 | * to interrupt pin INT0! [You can also use other interrupts, see section 54 | * "Optional MCU Description" below, or you can connect D- to the interrupt, as 55 | * it is required if you use the USB_COUNT_SOF feature. If you use D- for the 56 | * interrupt, the USB interrupt will also be triggered at Start-Of-Frame 57 | * markers every millisecond.] 58 | */ 59 | #define USB_CFG_CLOCK_KHZ (F_CPU/1000) 60 | /* Clock rate of the AVR in MHz. Legal values are 12000, 12800, 15000, 16000, 61 | * 16500 and 20000. The 12.8 MHz and 16.5 MHz versions of the code require no 62 | * crystal, they tolerate +/- 1% deviation from the nominal frequency. All 63 | * other rates require a precision of 2000 ppm and thus a crystal! 64 | * Default if not specified: 12 MHz 65 | */ 66 | 67 | /* ----------------------- Optional Hardware Config ------------------------ */ 68 | 69 | /* #define USB_CFG_PULLUP_IOPORTNAME D */ 70 | /* If you connect the 1.5k pullup resistor from D- to a port pin instead of 71 | * V+, you can connect and disconnect the device from firmware by calling 72 | * the macros usbDeviceConnect() and usbDeviceDisconnect() (see usbdrv.h). 73 | * This constant defines the port on which the pullup resistor is connected. 74 | */ 75 | /* #define USB_CFG_PULLUP_BIT 4 */ 76 | /* This constant defines the bit number in USB_CFG_PULLUP_IOPORT (defined 77 | * above) where the 1.5k pullup resistor is connected. See description 78 | * above for details. 79 | */ 80 | 81 | /* --------------------------- Functional Range ---------------------------- */ 82 | 83 | #define BOOTLOADER_CAN_EXIT 0 84 | /* If this macro is defined to 1, the boot loader command line utility can 85 | * initiate a reboot after uploading the FLASH when the "-r" command line 86 | * option is given. If you define it to 0 or leave it undefined, the "-r" 87 | * option won't work and you save a couple of bytes in the boot loader. This 88 | * may be of advantage if you compile with gcc 4 instead of gcc 3 because it 89 | * generates slightly larger code. 90 | * If you need to save even more memory, consider using your own vector table. 91 | * Since only the reset vector and INT0 (the first two vectors) are used, 92 | * this saves quite a bit of flash. See Alexander Neumann's boot loader for 93 | * an example: http://git.lochraster.org:2080/?p=fd0/usbload;a=tree 94 | */ 95 | 96 | /* ------------------------------------------------------------------------- */ 97 | 98 | /* Example configuration: Port D bit 3 is connected to a jumper which ties 99 | * this pin to GND if the boot loader is requested. Initialization allows 100 | * several clock cycles for the input voltage to stabilize before 101 | * bootLoaderCondition() samples the value. 102 | * We use a function for bootLoaderInit() for convenience and a macro for 103 | * bootLoaderCondition() for efficiency. 104 | */ 105 | 106 | #ifndef __ASSEMBLER__ /* assembler cannot parse function definitions */ 107 | #include 108 | 109 | static inline void bootLoaderInit(void) 110 | { 111 | // PORTB = 1 << 2; /* activate pull-up for key */ 112 | _delay_us(10); /* wait for levels to stabilize */ 113 | } 114 | 115 | #define bootLoaderCondition() (PINC & (1 << 1)) /* True if jumper is set */ 116 | 117 | #endif 118 | 119 | /* ------------------------------------------------------------------------- */ 120 | 121 | #endif /* __bootloader_h_included__ */ 122 | -------------------------------------------------------------------------------- /src/bootloaders/hidbootloader/fuse.txt: -------------------------------------------------------------------------------- 1 | Atmega88/168: l: CE h: DD e: F8 2 | 3 | ------------------------------ 4 | Atmega8: l: 9F h: C0 5 | # Fuse high byte: 6 | # 0xc0 = 1 1 0 0 0 0 0 0 <-- BOOTRST (boot reset vector at 0x1800) 7 | # ^ ^ ^ ^ ^ ^ ^------ BOOTSZ0 8 | # | | | | | +-------- BOOTSZ1 9 | # | | | | + --------- EESAVE (preserve EEPROM over chip erase) 10 | # | | | +-------------- CKOPT (full output swing) 11 | # | | +---------------- SPIEN (allow serial programming) 12 | # | +------------------ WDTON (WDT not always on) 13 | # +-------------------- RSTDISBL (reset pin is enabled) 14 | # Fuse low byte: 15 | # 0x9f = 1 0 0 1 1 1 1 1 16 | # ^ ^ \ / \--+--/ 17 | # | | | +------- CKSEL 3..0 (external >8M crystal) 18 | # | | +--------------- SUT 1..0 (crystal osc, BOD enabled) 19 | # | +------------------ BODEN (BrownOut Detector enabled) 20 | # +-------------------- BODLEVEL (2.7V) -------------------------------------------------------------------------------- /src/bootloaders/hidbootloader/hardware_requirement.txt: -------------------------------------------------------------------------------- 1 | This bootloader firmware only support the following chips currently: 2 | Atmega88/Atmega168/Atmega8 3 | 4 | Any other types of AVR chip with a 2k-byte bootloader section is also supported in theory, but some code changes are needed. 5 | 6 | To use this bootloader, make sure a v-usb compatible schematic is used with the 12M cpu clock. 7 | 8 | PIN MAPPING: 9 | ------------------ 10 | The bootloader enabling condition: PC1 == HIGH 11 | USB D+: B1 12 | USB D-: B0 -------------------------------------------------------------------------------- /src/bootloaders/hidbootloader/pre-compiled/mega168_12M.hex: -------------------------------------------------------------------------------- 1 | :103800000C94721C0C94AA1C0C948F1C0C948F1C8E 2 | :103810000C948F1C0C948F1C0C948F1C0C948F1C7C 3 | :103820000C948F1C0C948F1C0C948F1C0C948F1C6C 4 | :103830000C948F1C0C948F1C0C948F1C0C948F1C5C 5 | :103840000C948F1C0C948F1C0C948F1C0C948F1C4C 6 | :103850000C948F1C0C948F1C0C948F1C0C948F1C3C 7 | :103860000C948F1C0C948F1C0403090412036F002A 8 | :1038700062006400650076002E0061007400100391 9 | :1038800048004900440042006F006F0074001201BC 10 | :10389000100100000008C016DF0500010102000150 11 | :1038A0000902220001010080320904000001030026 12 | :1038B0000000092101010001222100070581030800 13 | :1038C00000C80600FF0901A101150026FF007508C8 14 | :1038D000850195060900B20201850295830900B2AF 15 | :1038E0000201C00011241FBECFEFD4E0DEBFCDBF68 16 | :1038F00011E0A0E0B1E0EEE8FFE302C005900D9218 17 | :10390000AA30B107D9F711E0AAE0B1E001C01D92D9 18 | :10391000AA33B107E1F70E94DB1D0C94C51F0C947C 19 | :10392000001CA82FB92F80E090E041E050EA60959C 20 | :103930006F5F58F42D9138EF82279795879510F097 21 | :10394000842795273F5FC8F3F3CF0895EADF8D936F 22 | :103950009D930895CF93CFB7CF93C395189BE9F765 23 | :10396000189B09C0189B07C0189B05C0189B03C073 24 | :10397000189B01C0A3C0DF93C0911D01DD27CC5D62 25 | :10398000DE4F189B02C0DF91EBCF2F930F931F9355 26 | :1039900003B12FEF00FB20F94F933F9313B14FEF8B 27 | :1039A000012700FB21F93BE031C04E7F012F13B10D 28 | :1039B000216028C0102F4D7F2260000003B129C074 29 | :1039C0004B7F2460012F000013B12BC013B1477F40 30 | :1039D00028602AC04F7E03B120612CC04F7D13B1F7 31 | :1039E00020622FC04F7B03B1206432C0422703B155 32 | :1039F00049934FEF0000102710FB20F913B113700B 33 | :103A0000C9F1297F91F2012700FB21F903B1237F3E 34 | :103A100089F2315058F1102710FB22F913B1277E9B 35 | :103A200079F2012700FB23F92F7C81F203B11027E3 36 | :103A300010FB24F92F7971F200C013B1012700FBAC 37 | :103A400025F92F7359F200C003B1102710FB26F996 38 | :103A5000223040F200C013B1012700FB27F92430C7 39 | :103A600028F64F77206813B10000F9CF11E01CBB96 40 | :103A7000002719C03B503195C31BD04011E01CBB3F 41 | :103A80000881033CF9F00B34E9F020911B01198106 42 | :103A9000110F1213EDCF4A81441F093641F10D3247 43 | :103AA00011F0013E29F7009322013F914F911F91A0 44 | :103AB0000F912F91DF91CCB3C0FD4FCFCF91CFBFEE 45 | :103AC000CF91189520912201222379F310912001A2 46 | :103AD000112321F5343022F13093200120931C0171 47 | :103AE00010911D013BE0311B30931D0119C0009165 48 | :103AF000200101309CF40AE54F7081F430910001FF 49 | :103B000034FD10C000930001C0E1D1E00FC0279543 50 | :103B1000A8F45150A9F4220F0000F9CF4AE503C0E0 51 | :103B200042ED01C0432FC4E1D0E032E014B1136094 52 | :103B3000289A14B905B120E413E05F93012756E0F9 53 | :103B400005B9279520F4515021F4220FF9CF012710 54 | :103B500056E000003B5A05B9D0F2279528F45150A1 55 | :103B600029F4220F0000F9CF012756E0279505B967 56 | :103B700020F4515021F4220FF9CF012756E029916A 57 | :103B8000332305B921F60C7F10912101110FC65185 58 | :103B9000D04005B911F010931B0111E01CBB01606E 59 | :103BA00014B11C7F402F4C7F5F9100C000C005B94D 60 | :103BB00014B945B97ACF2F923F924F925F926F928C 61 | :103BC0007F928F929F92AF92BF92CF92DF92EF92AD 62 | :103BD000FF920F931F93DF93CF9300D000D0CDB708 63 | :103BE000DEB788E28A95F1F7319BBFC181E085BFDE 64 | :103BF00082E085BF80916900836080936900E89AC4 65 | :103C0000209A20E048EB5BE0A895CA010197F1F704 66 | :103C10002150D1F72098789403EC62EC262E68E3CB 67 | :103C2000362E5EE7652E58E3752E4CE6442E48E3AB 68 | :103C3000542E38E6C32E38E3D32E2EEEA22E2FEFCD 69 | :103C4000B22E22EB38E3A20EB31E9EE8892E98E333 70 | :103C5000992E82E0E82E81E0F82EA895909120011F 71 | :103C6000292F235027FD27C180911D014CE050E0F2 72 | :103C7000481B51094C5D5E4F5C834B8380911C0156 73 | :103C80008D3209F0B4C0283009F013C1009310013F 74 | :103C90005AE55093000110920A01AB81BC812C912E 75 | :103CA000822F807611969C9111978823B1F09930DC 76 | :103CB00059F412968C91823009F080C010920D0157 77 | :103CC00027FD84C09FEF85C0913009F077C0F09246 78 | :103CD0001F01E0921E0127E072C0EB81FC8122816E 79 | :103CE00010921901992331F410921A0189E191E09F 80 | :103CF00022E05FC0953019F42093210157C096301F 81 | :103D000009F044C0AB81BC8113968C91813029F4B9 82 | :103D100090921F0180921E0118C0823031F4B0923F 83 | :103D20001F01A0921E0122E22DC08330C1F4222384 84 | :103D300031F4D0921F01C0921E0124E023C0213033 85 | :103D400031F450921F0140921E0122E11BC022302B 86 | :103D5000C1F470921F0160921E0120E113C08132F4 87 | :103D600041F4E2EBF8E3F0931F01E0931E0129E038 88 | :103D700009C0823231F430921F0120921E0121E2EB 89 | :103D800001C020E0F0E4F0930A0119C0983019F462 90 | :103D900083E291E009C0993019F42093230106C011 91 | :103DA0009A3021F489E191E021E003C089E191E0BA 92 | :103DB00020E090931F0180931E0101C020E0AB81A1 93 | :103DC000BC8117968C91882341F00DC0EB81FC815A 94 | :103DD000968180E880930A0107C0AB81BC8116966A 95 | :103DE0009C91921708F0922F9093010162C08091EC 96 | :103DF0000A0187FF5EC0E0910B01F0910C01FA838C 97 | :103E0000E98380910D01882389F4AB81BC811196EF 98 | :103E1000BC91B983EB81FC81F281FA832B813C81D7 99 | :103E20002C5F3F4F3C832B83292F2750322F380F95 100 | :103E300030930D0189818F7759F4F89443E0E9813B 101 | :103E4000FA8140935700E895789407B600FCFDCFBF 102 | :103E5000F89449815A81AB81BC818D919C9161E03C 103 | :103E6000FA010C0160935700E8951124789432967A 104 | :103E7000FA83E98389818F7751F4F89465E0FA0138 105 | :103E800060935700E895789407B600FCFDCF225068 106 | :103E900031F08B819C8102969C838B83CBCFA9814F 107 | :103EA000BA81B0930C01A0930B0137FF02C01092AE 108 | :103EB0000101109220018091000184FF4AC080918D 109 | :103EC00001018F3F09F445C0182F893008F018E030 110 | :103ED000811B809301018091100198E889278093CC 111 | :103EE0001001112341F120911E0130911F01809199 112 | :103EF0000A0186FF0DC0A1E1B1E080E090E0F90188 113 | :103F0000E80FF91FE491ED9301961817C1F708C067 114 | :103F1000D901912FE1E1F1E08D9181939150E1F789 115 | :103F20001150812F90E01F5F0196820F931F909395 116 | :103F30001F0180931E0181E191E0612F0E94A61C68 117 | :103F4000612F6C5F6C3019F08FEF809301016093EB 118 | :103F5000000194E183B1837031F49150D9F710924C 119 | :103F6000210110921B01319978CEF89481E1809360 120 | :103F70005700E8951DBA1092690081E085BF15BE13 121 | :0E3F8000E0910E01F0910F010995F894FFCF2A 122 | :0A3F8E005AFF01800000400000000F 123 | :0400000300003800C1 124 | :00000001FF 125 | -------------------------------------------------------------------------------- /src/bootloaders/hidbootloader/pre-compiled/mega88_12M.hex: -------------------------------------------------------------------------------- 1 | :1018000057C08BC070C06FC06EC06DC06CC06BC065 2 | :101810006AC069C068C067C066C065C064C063C094 3 | :1018200062C061C060C05FC05EC05DC05CC05BC0C4 4 | :101830005AC059C00403090412036F006200640017 5 | :10184000650076002E006100740010034800490016 6 | :10185000440042006F006F0074001201100100008C 7 | :101860000008C016DF050001010200010902220084 8 | :101870000101008032090400000103000000092179 9 | :1018800001010001222100070581030800C80600AC 10 | :10189000FF0901A101150026FF00750885019506C5 11 | :1018A0000900B20201850295830900B20201C0005D 12 | :1018B00011241FBECFEFD4E0DEBFCDBF11E0A0E00A 13 | :1018C000B1E0E2E5FFE102C005900D92AA30B10758 14 | :1018D000D9F711E0AAE0B1E001C01D92AA33B10727 15 | :1018E000E1F74CD134C38CCFA82FB92F80E090E022 16 | :1018F00041E050EA60956F5F58F42D9138EF8227F0 17 | :101900009795879510F0842795273F5FC8F3F3CF0D 18 | :101910000895EADF8D939D930895CF93CFB7CF932A 19 | :10192000C395189BE9F7189B09C0189B07C0189B23 20 | :1019300005C0189B03C0189B01C0A3C0DF93C091D2 21 | :101940001D01DD27CC5DDE4F189B02C0DF91EBCF80 22 | :101950002F930F931F9303B12FEF00FB20F94F93A9 23 | :101960003F9313B14FEF012700FB21F93BE031C05A 24 | :101970004E7F012F13B1216028C0102F4D7F2260B0 25 | :10198000000003B129C04B7F2460012F000013B178 26 | :101990002BC013B1477F28602AC04F7E03B120615E 27 | :1019A0002CC04F7D13B120622FC04F7B03B1206448 28 | :1019B00032C0422703B149934FEF0000102710FBBC 29 | :1019C00020F913B11370C9F1297F91F2012700FBAF 30 | :1019D00021F903B1237F89F2315058F1102710FB10 31 | :1019E00022F913B1277E79F2012700FB23F92F7C1E 32 | :1019F00081F203B1102710FB24F92F7971F200C096 33 | :101A000013B1012700FB25F92F7359F200C003B170 34 | :101A1000102710FB26F9223040F200C013B1012735 35 | :101A200000FB27F9243028F64F77206813B1000017 36 | :101A3000F9CF11E01CBB002719C03B503195C31BE7 37 | :101A4000D04011E01CBB0881033CF9F00B34E9F0F5 38 | :101A500020911B011981110F1213EDCF4A81441FF0 39 | :101A6000093641F10D3211F0013E29F700932201B0 40 | :101A70003F914F911F910F912F91DF91CCB3C0FDFA 41 | :101A80004FCFCF91CFBFCF91189520912201222324 42 | :101A900079F310912001112321F5343022F1309394 43 | :101AA000200120931C0110911D013BE0311B30935C 44 | :101AB0001D0119C00091200101309CF40AE54F700E 45 | :101AC00081F43091000134FD10C000930001C0E1A9 46 | :101AD000D1E00FC02795A8F45150A9F4220F0000BF 47 | :101AE000F9CF4AE503C042ED01C0432FC4E1D0E085 48 | :101AF00032E014B11360289A14B905B120E413E060 49 | :101B00005F93012756E005B9279520F4515021F441 50 | :101B1000220FF9CF012756E000003B5A05B9D0F259 51 | :101B2000279528F4515029F4220F0000F9CF0127FE 52 | :101B300056E0279505B920F4515021F4220FF9CF32 53 | :101B4000012756E02991332305B921F60C7F109126 54 | :101B50002101110FC651D04005B911F010931B019E 55 | :101B600011E01CBB016014B11C7F402F4C7F5F91C2 56 | :101B700000C000C005B914B945B97ACF2F923F9281 57 | :101B80004F925F926F927F928F929F92AF92BF928D 58 | :101B9000CF92DF92EF92FF920F931F93DF93CF9339 59 | :101BA00000D000D0CDB7DEB788E28A95F1F7319B3F 60 | :101BB000BEC181E085BF82E085BF809169008360FE 61 | :101BC00080936900E89A209A20E048EB5BE0A895B2 62 | :101BD000CA010197F1F72150D1F72098789403ECCE 63 | :101BE0006EE8262E68E1362E5AE4652E58E1752EF1 64 | :101BF00048E3442E48E1542E34E3C32E38E1D32E7B 65 | :101C00002EEEA22E2FEFB22E2EE738E1A20EB31E3B 66 | :101C10009AE5892E98E1992E82E0E82E81E0F82E4F 67 | :101C2000A89590912001292F235027FD27C180914D 68 | :101C30001D014CE050E0481B51094C5D5E4F5C8338 69 | :101C40004B8380911C018D3209F0B4C0283009F01B 70 | :101C500013C1009310015AE55093000110920A013C 71 | :101C6000AB81BC812C91822F807611969C9111972B 72 | :101C70008823B1F0993059F412968C91823009F092 73 | :101C800080C010920D0127FD84C09FEF85C0913068 74 | :101C900009F077C0F0921F01E0921E0127E072C0A8 75 | :101CA000EB81FC81228110921901992331F4109269 76 | :101CB0001A0189E191E022E05FC0953019F4209388 77 | :101CC000210157C0963009F044C0AB81BC81139606 78 | :101CD0008C91813029F490921F0180921E0118C0CE 79 | :101CE000823031F4B0921F01A0921E0122E22DC079 80 | :101CF0008330C1F4222331F4D0921F01C0921E011F 81 | :101D000024E023C0213031F450921F0140921E0183 82 | :101D100022E11BC02230C1F470921F0160921E01AB 83 | :101D200020E113C0813241F4EEE7F8E1F0931F01A6 84 | :101D3000E0931E0129E009C0823231F430921F0184 85 | :101D400020921E0121E201C020E0F0E4F0930A019C 86 | :101D500019C0983019F483E291E009C0993019F460 87 | :101D60002093230106C09A3021F489E191E021E01B 88 | :101D700003C089E191E020E090931F0180931E0150 89 | :101D800001C020E0AB81BC8117968C91882341F083 90 | :101D90000DC0EB81FC81968180E880930A0107C029 91 | :101DA000AB81BC8116969C91921708F0922F90936C 92 | :101DB000010162C080910A0187FF5EC0E0910B01C2 93 | :101DC000F0910C01FA83E98380910D01882389F455 94 | :101DD000AB81BC811196BC91B983EB81FC81F2810E 95 | :101DE000FA832B813C812C5F3F4F3C832B83292F2F 96 | :101DF0002750322F380F30930D0189818F7359F49A 97 | :101E0000F89443E0E981FA8140935700E89578948B 98 | :101E100007B600FCFDCFF89449815A81AB81BC81A3 99 | :101E20008D919C9161E0FA010C0160935700E89557 100 | :101E3000112478943296FA83E98389818F7351F45F 101 | :101E4000F89465E0FA0160935700E895789407B636 102 | :101E500000FCFDCF225031F08B819C8102969C8347 103 | :101E60008B83CBCFA981BA81B0930C01A0930B01D6 104 | :101E700037FF02C0109201011092200180910001F1 105 | :101E800084FF49C0809101018F3F09F444C0182F9D 106 | :101E9000893008F018E0811B8093010180911001C6 107 | :101EA00098E8892780931001112341F120911E01A8 108 | :101EB00030911F0180910A0186FF0DC0A1E1B1E0C0 109 | :101EC00080E090E0F901E80FF91FE491ED930196AD 110 | :101ED0001817C1F708C0D901912FE1E1F1E08D9108 111 | :101EE00081939150E1F71150812F90E01F5F01968F 112 | :101EF000820F931F90931F0180931E0181E191E057 113 | :101F0000612F07DD612F6C5F6C3019F08FEF8093CC 114 | :101F100001016093000194E183B1837031F4915029 115 | :101F2000D9F71092210110921B01319979CEF894C2 116 | :101F300081E180935700E8951DBA1092690081E015 117 | :101F400085BF15BEE0910E01F0910F010995F8943F 118 | :021F5000FFCFC1 119 | :0A1F52005AFF0140000020000000CB 120 | :0400000300001800E1 121 | :00000001FF 122 | -------------------------------------------------------------------------------- /src/bootloaders/hidbootloader/pre-compiled/mega8_12M.hex: -------------------------------------------------------------------------------- 1 | :1018000050C084C069C068C067C066C065C064C09D 2 | :1018100063C062C061C060C05FC05EC05DC05CC0CC 3 | :101820005BC05AC059C00403090412036F00620070 4 | :101830006400650076002E0061007400100348000B 5 | :101840004900440042006F006F0074001201100153 6 | :1018500000000008C016DF050001010200010902B6 7 | :101860002200010100803209040000010300000091 8 | :10187000092101010001222100070581030800C898 9 | :101880000600FF0901A101150026FF00750885016A 10 | :1018900095060900B20201850295830900B2020192 11 | :1018A000C00011241FBECFE5D4E0DEBFCDBF10E0E5 12 | :1018B000A0E6B0E0E2E4FFE102C005900D92AA3696 13 | :1018C000B107D9F710E0AAE6B0E001C01D92AA392D 14 | :1018D000B107E1F74CD133C393CFA82FB92F80E0E4 15 | :1018E00090E041E050EA60956F5F58F42D9138EF39 16 | :1018F00082279795879510F0842795273F5FC8F337 17 | :10190000F3CF0895EADF8D939D930895CF93CFB7DA 18 | :10191000CF93C395B09BE9F7B09B09C0B09B07C0BC 19 | :10192000B09B05C0B09B03C0B09B01C0A3C0DF93B8 20 | :10193000C0917D00DD27CC57DF4FB09B02C0DF9107 21 | :10194000EBCF2F930F931F9306B32FEF00FB20F9DC 22 | :101950004F933F9316B34FEF012700FB21F93BE074 23 | :1019600031C04E7F012F16B3216028C0102F4D7F4C 24 | :101970002260000006B329C04B7F2460012F0000C5 25 | :1019800016B32BC016B3477F28602AC04F7E06B31C 26 | :1019900020612CC04F7D16B320622FC04F7B06B351 27 | :1019A000206432C0422706B349934FEF000010274E 28 | :1019B00010FB20F916B31370C9F1297F91F20127AA 29 | :1019C00000FB21F906B3237F89F2315058F110272B 30 | :1019D00010FB22F916B3277E79F2012700FB23F9C9 31 | :1019E0002F7C81F206B3102710FB24F92F7971F2B6 32 | :1019F00000C016B3012700FB25F92F7359F200C070 33 | :101A000006B3102710FB26F9223040F200C016B3AF 34 | :101A1000012700FB27F9243028F64F77206816B3FA 35 | :101A20000000F9CF10E41ABF002719C03B503195D0 36 | :101A3000C31BD04010E41ABF0881033CF9F00B34FB 37 | :101A4000E9F020917B001981110F1213EDCF4A812B 38 | :101A5000441F093641F10D3211F0013E29F7009380 39 | :101A600082003F914F911F910F912F91DF91CAB743 40 | :101A7000C6FD4FCFCF91CFBFCF9118952091820057 41 | :101A8000222379F310918000112321F5343022F1C3 42 | :101A90003093800020937C0010917D003BE0311B4F 43 | :101AA00030937D0019C00091800001309CF40AE55C 44 | :101AB0004F7081F43091600034FD10C000936000DD 45 | :101AC000C0E7D0E00FC02795A8F45150A9F4220F29 46 | :101AD0000000F9CF4AE503C042ED01C0432FC4E145 47 | :101AE000D0E032E017B31360C09A17BB08B320E40C 48 | :101AF00013E05F93012756E008BB279520F451506F 49 | :101B000021F4220FF9CF012756E000003B5A08BB11 50 | :101B1000D0F2279528F4515029F4220F0000F9CF74 51 | :101B2000012756E0279508BB20F4515021F4220FDD 52 | :101B3000F9CF012756E02991332308BB21F60C7F0A 53 | :101B400010918100110FC651D04008BB11F01093C5 54 | :101B50007B0010E41ABF016017B31C7F402F4C7F3D 55 | :101B60005F9100C000C008BB17BB48BB7ACF2F9263 56 | :101B70003F924F925F926F927F928F929F92AF921D 57 | :101B8000BF92CF92DF92EF92FF920F931F93DF935A 58 | :101B9000CF9300D000D0CDB7DEB788E28A95F1F7B9 59 | :101BA000999BBEC181E08BBF82E08BBF85B783600C 60 | :101BB00085BF8BB780648BBFB89A20E048EB5BE0B1 61 | :101BC000A895CA010197F1F72150D1F7B8987894F8 62 | :101BD00003EC60E8262E68E1362E5CE3652E58E1C2 63 | :101BE000752E4AE2442E48E1542E36E2C32E38E1E7 64 | :101BF000D32E2EEEA22E2FEFB22E20E738E1A20E2A 65 | :101C0000B31E9CE4892E98E1992E82E6E82E80E0AE 66 | :101C1000F82EA89590918000292F235027FD27C1E9 67 | :101C200080917D004CE050E0481B51094C575F4FBC 68 | :101C30005C834B8380917C008D3209F0B4C02830E6 69 | :101C400009F013C1009370005AE5509360001092A0 70 | :101C50006A00AB81BC812C91822F807611969C9179 71 | :101C600011978823B1F0993059F412968C918230F3 72 | :101C700009F080C010926D0027FD84C09FEF85C0E1 73 | :101C8000913009F077C0F0927F00E0927E0027E06B 74 | :101C900072C0EB81FC81228110927900992331F48A 75 | :101CA00010927A0089E790E022E05FC0953019F445 76 | :101CB0002093810057C0963009F044C0AB81BC81AD 77 | :101CC00013968C91813029F490927F0080927E004F 78 | :101CD00018C0823031F4B0927F00A0927E0022E2E0 79 | :101CE0002DC08330C1F4222331F4D0927F00C09202 80 | :101CF0007E0024E023C0213031F450927F004092D6 81 | :101D00007E0022E11BC02230C1F470927F006092FD 82 | :101D10007E0020E113C0813241F4E0E7F8E1F09366 83 | :101D20007F00E0937E0029E009C0823231F43092D6 84 | :101D30007F0020927E0021E201C020E0F0E4F093D9 85 | :101D40006A0019C0983019F483E890E009C099300E 86 | :101D500019F42093830006C09A3021F489E790E0BB 87 | :101D600021E003C089E790E020E090937F0080931A 88 | :101D70007E0001C020E0AB81BC8117968C91882346 89 | :101D800041F00DC0EB81FC81968180E880936A0070 90 | :101D900007C0AB81BC8116969C91921708F0922FD8 91 | :101DA0009093610062C080916A0087FF5EC0E091FD 92 | :101DB0006B00F0916C00FA83E98380916D008823B9 93 | :101DC00089F4AB81BC811196BC91B983EB81FC8114 94 | :101DD000F281FA832B813C812C5F3F4F3C832B8324 95 | :101DE000292F2750322F380F30936D0089818F7340 96 | :101DF00059F4F89443E0E981FA8140935700E8955B 97 | :101E0000789407B600FCFDCFF89449815A81AB81E4 98 | :101E1000BC818D919C9161E0FA010C0160935700A7 99 | :101E2000E895112478943296FA83E98389818F7337 100 | :101E300051F4F89465E0FA0160935700E8957894BE 101 | :101E400007B600FCFDCF225031F08B819C810296B9 102 | :101E50009C838B83CBCFA981BA81B0936C00A09374 103 | :101E60006B0037FF02C010926100109280008091D9 104 | :101E7000600084FF49C0809161008F3F09F444C035 105 | :101E8000182F893008F018E0811B80936100809141 106 | :101E9000700098E8892780937000112341F1209108 107 | :101EA0007E0030917F0080916A0086FF0DC0A1E71F 108 | :101EB000B0E080E090E0F901E80FF91FE491ED93C4 109 | :101EC00001961817C1F708C0D901912FE1E7F0E09A 110 | :101ED0008D9181939150E1F71150812F90E01F5F18 111 | :101EE0000196820F931F90937F0080937E0081E77D 112 | :101EF00090E0612F07DD612F6C5F6C3019F08FEF80 113 | :101F0000809361006093600094E186B3837031F444 114 | :101F10009150D9F71092810010927B00999979CE57 115 | :101F2000F89481E180935700E8951BBE15BE81E0CF 116 | :101F30008BBF1BBEE0916E00F0916F000995F89485 117 | :021F4000FFCFD1 118 | :0A1F42005AFF0140000020000000DB 119 | :0400000300001800E1 120 | :00000001FF 121 | -------------------------------------------------------------------------------- /src/bootloaders/hidbootloader/usbdrv/CommercialLicense.txt: -------------------------------------------------------------------------------- 1 | AVR-USB Driver Software License Agreement 2 | Version 2008-10-07 3 | 4 | THIS LICENSE AGREEMENT GRANTS YOU CERTAIN RIGHTS IN A SOFTWARE. YOU CAN 5 | ENTER INTO THIS AGREEMENT AND ACQUIRE THE RIGHTS OUTLINED BELOW BY PAYING 6 | THE AMOUNT ACCORDING TO SECTION 4 ("PAYMENT") TO OBJECTIVE DEVELOPMENT. 7 | 8 | 9 | 1 DEFINITIONS 10 | 11 | 1.1 "OBJECTIVE DEVELOPMENT" shall mean OBJECTIVE DEVELOPMENT Software GmbH, 12 | Grosse Schiffgasse 1A/7, 1020 Wien, AUSTRIA. 13 | 14 | 1.2 "You" shall mean the Licensee. 15 | 16 | 1.3 "AVR-USB" shall mean all files included in the package distributed under 17 | the name "avrusb" by OBJECTIVE DEVELOPMENT (http://www.obdev.at/avrusb/) 18 | unless otherwise noted. This includes the firmware-only USB device 19 | implementation for Atmel AVR microcontrollers, some simple device examples 20 | and host side software examples and libraries. 21 | 22 | 23 | 2 LICENSE GRANTS 24 | 25 | 2.1 Source Code. OBJECTIVE DEVELOPMENT shall furnish you with the source 26 | code of AVR-USB. 27 | 28 | 2.2 Distribution and Use. OBJECTIVE DEVELOPMENT grants you the 29 | non-exclusive right to use, copy and distribute AVR-USB with your hardware 30 | product(s), restricted by the limitations in section 3 below. 31 | 32 | 2.3 Modifications. OBJECTIVE DEVELOPMENT grants you the right to modify 33 | the source code and your copy of AVR-USB according to your needs. 34 | 35 | 2.4 USB IDs. OBJECTIVE DEVELOPMENT grants you the exclusive rights to use 36 | USB Product ID(s) sent to you in e-mail after receiving your payment in 37 | conjunction with USB Vendor ID 5824. OBJECTIVE DEVELOPMENT has acquired an 38 | exclusive license for this pair of USB identifiers from Wouter van Ooijen 39 | (www.voti.nl), who has licensed the VID from the USB Implementers Forum, 40 | Inc. (www.usb.org). 41 | 42 | 43 | 3 LICENSE RESTRICTIONS 44 | 45 | 3.1 Number of Units. Only one of the following three definitions is 46 | applicable. Which one is determined by the amount you pay to OBJECTIVE 47 | DEVELOPMENT, see section 4 ("Payment") below. 48 | 49 | Hobby License: You may use AVR-USB according to section 2 above in no more 50 | than 5 hardware units. These units must not be sold for profit. 51 | 52 | Entry Level License: You may use AVR-USB according to section 2 above in no 53 | more than 150 hardware units. 54 | 55 | Professional License: You may use AVR-USB according to section 2 above in 56 | any number of hardware units, except for large scale production ("unlimited 57 | fair use"). Quantities below 10,000 units are not considered large scale 58 | production. If your reach quantities which are obviously large scale 59 | production, you must pay a license fee of 0.10 EUR per unit for all units 60 | above 10,000. 61 | 62 | 3.2 Rental. You may not rent, lease, or lend AVR-USB or otherwise encumber 63 | any copy of AVR-USB, or any of the rights granted herein. 64 | 65 | 3.3 Transfer. You may not transfer your rights under this Agreement to 66 | another party without OBJECTIVE DEVELOPMENT's prior written consent. If 67 | such consent is obtained, you may permanently transfer this License to 68 | another party. The recipient of such transfer must agree to all terms and 69 | conditions of this Agreement. 70 | 71 | 3.4 Reservation of Rights. OBJECTIVE DEVELOPMENT retains all rights not 72 | expressly granted. 73 | 74 | 3.5 Non-Exclusive Rights. Your license rights under this Agreement are 75 | non-exclusive. 76 | 77 | 3.6 Third Party Rights. This Agreement cannot grant you rights controlled 78 | by third parties. In particular, you are not allowed to use the USB logo or 79 | other trademarks owned by the USB Implementers Forum, Inc. without their 80 | consent. Since such consent depends on USB certification, it should be 81 | noted that AVR-USB will not pass certification because it does not 82 | implement checksum verification and the microcontroller ports do not meet 83 | the electrical specifications. 84 | 85 | 86 | 4 PAYMENT 87 | 88 | The payment amount depends on the variation of this agreement (according to 89 | section 3.1) into which you want to enter. Concrete prices are listed on 90 | OBJECTIVE DEVELOPMENT's web site, usually at 91 | http://www.obdev.at/avrusb/license.html. You agree to pay the amount listed 92 | there to OBJECTIVE DEVELOPMENT or OBJECTIVE DEVELOPMENT's payment processor 93 | or reseller. 94 | 95 | 96 | 5 COPYRIGHT AND OWNERSHIP 97 | 98 | AVR-USB is protected by copyright laws and international copyright 99 | treaties, as well as other intellectual property laws and treaties. AVR-USB 100 | is licensed, not sold. 101 | 102 | 103 | 6 TERM AND TERMINATION 104 | 105 | 6.1 Term. This Agreement shall continue indefinitely. However, OBJECTIVE 106 | DEVELOPMENT may terminate this Agreement and revoke the granted license and 107 | USB-IDs if you fail to comply with any of its terms and conditions. 108 | 109 | 6.2 Survival of Terms. All provisions regarding secrecy, confidentiality 110 | and limitation of liability shall survive termination of this agreement. 111 | 112 | 113 | 7 DISCLAIMER OF WARRANTY AND LIABILITY 114 | 115 | LIMITED WARRANTY. AVR-USB IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY 116 | KIND. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, OBJECTIVE 117 | DEVELOPMENT AND ITS SUPPLIERS HEREBY DISCLAIM ALL WARRANTIES, EITHER 118 | EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 119 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND 120 | NON-INFRINGEMENT, WITH REGARD TO AVR-USB, AND THE PROVISION OF OR FAILURE 121 | TO PROVIDE SUPPORT SERVICES. THIS LIMITED WARRANTY GIVES YOU SPECIFIC LEGAL 122 | RIGHTS. YOU MAY HAVE OTHERS, WHICH VARY FROM STATE/JURISDICTION TO 123 | STATE/JURISDICTION. 124 | 125 | LIMITATION OF LIABILITY. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, 126 | IN NO EVENT SHALL OBJECTIVE DEVELOPMENT OR ITS SUPPLIERS BE LIABLE FOR ANY 127 | SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER 128 | (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, 129 | BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR ANY OTHER PECUNIARY 130 | LOSS) ARISING OUT OF THE USE OF OR INABILITY TO USE AVR-USB OR THE 131 | PROVISION OF OR FAILURE TO PROVIDE SUPPORT SERVICES, EVEN IF OBJECTIVE 132 | DEVELOPMENT HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. IN ANY 133 | CASE, OBJECTIVE DEVELOPMENT'S ENTIRE LIABILITY UNDER ANY PROVISION OF THIS 134 | AGREEMENT SHALL BE LIMITED TO THE AMOUNT ACTUALLY PAID BY YOU FOR AVR-USB. 135 | 136 | 137 | 8 MISCELLANEOUS TERMS 138 | 139 | 8.1 Marketing. OBJECTIVE DEVELOPMENT has the right to mention for marketing 140 | purposes that you entered into this agreement. 141 | 142 | 8.2 Entire Agreement. This document represents the entire agreement between 143 | OBJECTIVE DEVELOPMENT and you. It may only be modified in writing signed by 144 | an authorized representative of both, OBJECTIVE DEVELOPMENT and you. 145 | 146 | 8.3 Severability. In case a provision of these terms and conditions should 147 | be or become partly or entirely invalid, ineffective, or not executable, 148 | the validity of all other provisions shall not be affected. 149 | 150 | 8.4 Applicable Law. This agreement is governed by the laws of the Republic 151 | of Austria. 152 | 153 | 8.5 Responsible Courts. The responsible courts in Vienna/Austria will have 154 | exclusive jurisdiction regarding all disputes in connection with this 155 | agreement. 156 | 157 | -------------------------------------------------------------------------------- /src/bootloaders/hidbootloader/usbdrv/Readme.txt: -------------------------------------------------------------------------------- 1 | This is the Readme file to Objective Development's firmware-only USB driver 2 | for Atmel AVR microcontrollers. For more information please visit 3 | http://www.obdev.at/avrusb/ 4 | 5 | This directory contains the USB firmware only. Copy it as-is to your own 6 | project and add all .c and .S files to your project (these files are marked 7 | with an asterisk in the list below). Then copy usbconfig-prototype.h as 8 | usbconfig.h to your project and edit it according to your configuration. 9 | 10 | 11 | TECHNICAL DOCUMENTATION 12 | ======================= 13 | The technical documentation (API) for the firmware driver is contained in the 14 | file "usbdrv.h". Please read all of it carefully! Configuration options are 15 | documented in "usbconfig-prototype.h". 16 | 17 | The driver consists of the following files: 18 | Readme.txt ............. The file you are currently reading. 19 | Changelog.txt .......... Release notes for all versions of the driver. 20 | usbdrv.h ............... Driver interface definitions and technical docs. 21 | * usbdrv.c ............... High level language part of the driver. Link this 22 | module to your code! 23 | * usbdrvasm.S ............ Assembler part of the driver. This module is mostly 24 | a stub and includes one of the usbdrvasm*.S files 25 | depending on processor clock. Link this module to 26 | your code! 27 | usbdrvasm*.inc ......... Assembler routines for particular clock frequencies. 28 | Included by usbdrvasm.S, don't link it directly! 29 | asmcommon.inc .......... Common assembler routines. Included by 30 | usbdrvasm*.inc, don't link it directly! 31 | usbconfig-prototype.h .. Prototype for your own usbdrv.h file. 32 | * oddebug.c .............. Debug functions. Only used when DEBUG_LEVEL is 33 | defined to a value greater than 0. Link this module 34 | to your code! 35 | oddebug.h .............. Interface definitions of the debug module. 36 | usbportability.h ....... Header with compiler-dependent stuff. 37 | usbdrvasm.asm .......... Compatibility stub for IAR-C-compiler. Use this 38 | module instead of usbdrvasm.S when you assembler 39 | with IAR's tools. 40 | License.txt ............ Open Source license for this driver. 41 | CommercialLicense.txt .. Optional commercial license for this driver. 42 | USBID-License.txt ...... Terms and conditions for using particular USB ID 43 | values for particular purposes. 44 | 45 | (*) ... These files should be linked to your project. 46 | 47 | 48 | CPU CORE CLOCK FREQUENCY 49 | ======================== 50 | We supply assembler modules for clock frequencies of 12 MHz, 12.8 MHz, 15 MHz, 51 | 16 MHz, 16.5 MHz and 20 MHz. Other clock rates are not supported. The actual 52 | clock rate must be configured in usbdrv.h unless you use the default 12 MHz. 53 | 54 | 12 MHz Clock 55 | This is the traditional clock rate of AVR-USB because it's the lowest clock 56 | rate where the timing constraints of the USB spec can be met. 57 | 58 | 15 MHz Clock 59 | Similar to 12 MHz, but some NOPs inserted. On the other hand, the higher clock 60 | rate allows for some loops which make the resulting code size somewhat smaller 61 | than the 12 MHz version. 62 | 63 | 16 MHz Clock 64 | This clock rate has been added for users of the Arduino board and other 65 | ready-made boards which come with a fixed 16 MHz crystal. It's also an option 66 | if you need the slightly higher clock rate for performance reasons. Since 67 | 16 MHz is not divisible by the USB low speed bit clock of 1.5 MHz, the code 68 | is somewhat tricky and has to insert a leap cycle every third byte. 69 | 70 | 12.8 MHz and 16.5 MHz Clock 71 | The assembler modules for these clock rates differ from the other modules 72 | because they have been built for an RC oscillator with only 1% precision. The 73 | receiver code inserts leap cycles to compensate for clock deviations. 1% is 74 | also the precision which can be achieved by calibrating the internal RC 75 | oscillator of the AVR. Please note that only AVRs with internal 64 MHz PLL 76 | oscillator can reach 16.5 MHz with the RC oscillator. This includes the very 77 | popular ATTiny25, ATTiny45, ATTiny85 series as well as the ATTiny26. Almost 78 | all AVRs can reach 12.8 MHz, although this is outside the specified range. 79 | 80 | See the EasyLogger example at http://www.obdev.at/avrusb/easylogger.html for 81 | code which calibrates the RC oscillator based on the USB frame clock. 82 | 83 | 20 MHz Clock 84 | This module is for people who won't do it with less than the maximum. Since 85 | 20 MHz is not divisible by the USB low speed bit clock of 1.5 MHz, the code 86 | uses similar tricks as the 16 MHz module to insert leap cycles. 87 | 88 | 89 | USB IDENTIFIERS 90 | =============== 91 | Every USB device needs a vendor- and a product-identifier (VID and PID). VIDs 92 | are obtained from usb.org for a price of 1,500 USD. Once you have a VID, you 93 | can assign PIDs at will. 94 | 95 | Since an entry level cost of 1,500 USD is too high for most small companies 96 | and hobbyists, we provide some VID/PID pairs for free. See the file 97 | USBID-License.txt for details. 98 | 99 | Objective Development also has some license offerings which include product 100 | IDs. See http://www.obdev.at/avrusb/ for details. 101 | 102 | 103 | DEVELOPMENT SYSTEM 104 | ================== 105 | This driver has been developed and optimized for the GNU compiler version 3 106 | (gcc 3). It does work well with gcc 4, but with bigger code size. We recommend 107 | that you use the GNU compiler suite because it is freely available. AVR-USB 108 | has also been ported to the IAR compiler and assembler. It has been tested 109 | with IAR 4.10B/W32 and 4.12A/W32 on an ATmega8 with the "small" and "tiny" 110 | memory model. Not every release is tested with IAR CC and the driver may 111 | therefore fail to compile with IAR. Please note that gcc is more efficient for 112 | usbdrv.c because this module has been deliberately optimized for gcc. 113 | 114 | 115 | USING AVR-USB FOR FREE 116 | ====================== 117 | The AVR firmware driver is published under the GNU General Public License 118 | Version 2 (GPL2) and the GNU General Public License Version 3 (GPL3). It is 119 | your choice whether you apply the terms of version 2 or version 3. 120 | 121 | If you decide for the free GPL2 or GPL3, we STRONGLY ENCOURAGE you to do the 122 | following things IN ADDITION to the obligations from the GPL: 123 | 124 | (1) Publish your entire project on a web site and drop us a note with the URL. 125 | Use the form at http://www.obdev.at/avrusb/feedback.html for your submission. 126 | If you don't have a web site, you can publish the project in obdev's 127 | documentation wiki at 128 | http://www.obdev.at/goto.php?t=avrusb-wiki&p=hosted-projects. 129 | 130 | (2) Adhere to minimum publication standards. Please include AT LEAST: 131 | - a circuit diagram in PDF, PNG or GIF format 132 | - full source code for the host software 133 | - a Readme.txt file in ASCII format which describes the purpose of the 134 | project and what can be found in which directories and which files 135 | - a reference to http://www.obdev.at/avrusb/ 136 | 137 | (3) If you improve the driver firmware itself, please give us a free license 138 | to your modifications for our commercial license offerings. 139 | 140 | 141 | COMMERCIAL LICENSES FOR AVR-USB 142 | =============================== 143 | If you don't want to publish your source code under the terms of the GPL, 144 | you can simply pay money for AVR-USB. As an additional benefit you get 145 | USB PIDs for free, licensed exclusively to you. See the file 146 | "CommercialLicense.txt" for details. 147 | 148 | -------------------------------------------------------------------------------- /src/bootloaders/hidbootloader/usbdrv/USBID-License.txt: -------------------------------------------------------------------------------- 1 | Royalty-Free Non-Exclusive License USB Product-ID 2 | ================================================= 3 | 4 | Version 2008-04-07 5 | 6 | OBJECTIVE DEVELOPMENT Software GmbH hereby grants you the non-exclusive 7 | right to use three USB.org vendor-ID (VID) / product-ID (PID) pairs with 8 | products based on Objective Development's firmware-only USB driver for 9 | Atmel AVR microcontrollers: 10 | 11 | * VID = 5824 (=0x16c0) / PID = 1500 (=0x5dc) for devices implementing no 12 | USB device class (vendor-class devices with USB class = 0xff). Devices 13 | using this pair will be referred to as "VENDOR CLASS" devices. 14 | 15 | * VID = 5824 (=0x16c0) / PID = 1503 (=0x5df) for HID class devices 16 | (excluding mice and keyboards). Devices using this pair will be referred 17 | to as "HID CLASS" devices. 18 | 19 | * VID = 5824 (=0x16c0) / PID = 1505 (=0x5e1) for CDC class modem devices 20 | Devices using this pair will be referred to as "CDC-ACM CLASS" devices. 21 | 22 | * VID = 5824 (=0x16c0) / PID = 1508 (=0x5e4) for MIDI class devices 23 | Devices using this pair will be referred to as "MIDI CLASS" devices. 24 | 25 | Since the granted right is non-exclusive, the same VID/PID pairs may be 26 | used by many companies and individuals for different products. To avoid 27 | conflicts, your device and host driver software MUST adhere to the rules 28 | outlined below. 29 | 30 | OBJECTIVE DEVELOPMENT Software GmbH has licensed these VID/PID pairs from 31 | Wouter van Ooijen (see www.voti.nl), who has licensed the VID from the USB 32 | Implementers Forum, Inc. (see www.usb.org). The VID is registered for the 33 | company name "Van Ooijen Technische Informatica". 34 | 35 | 36 | RULES AND RESTRICTIONS 37 | ====================== 38 | 39 | (1) The USB device MUST provide a textual representation of the 40 | manufacturer and product identification. The manufacturer identification 41 | MUST be available at least in USB language 0x0409 (English/US). 42 | 43 | (2) The textual manufacturer identification MUST contain either an Internet 44 | domain name (e.g. "mycompany.com") registered and owned by you, or an 45 | e-mail address under your control (e.g. "myname@gmx.net"). You can embed 46 | the domain name or e-mail address in any string you like, e.g. "Objective 47 | Development http://www.obdev.at/avrusb/". 48 | 49 | (3) You are responsible for retaining ownership of the domain or e-mail 50 | address for as long as any of your products are in use. 51 | 52 | (4) You may choose any string for the textual product identification, as 53 | long as this string is unique within the scope of your textual manufacturer 54 | identification. 55 | 56 | (5) Matching of device-specific drivers MUST be based on the textual 57 | manufacturer and product identification in addition to the usual VID/PID 58 | matching. This means that operating system features which are based on 59 | VID/PID matching only (e.g. Windows kernel level drivers, automatic actions 60 | when the device is plugged in etc) MUST NOT be used. The driver matching 61 | MUST be a comparison of the entire strings, NOT a sub-string match. For 62 | CDC-ACM CLASS and MIDI CLASS devices, a generic class driver should be used 63 | and the matching is based on the USB device class. 64 | 65 | (6) The extent to which VID/PID matching is allowed for non device-specific 66 | drivers or features depends on the operating system and particular VID/PID 67 | pair used: 68 | 69 | * Mac OS X, Linux, FreeBSD and other Unixes: No VID/PID matching is 70 | required and hence no VID/PID-only matching is allowed at all. 71 | 72 | * Windows: The operating system performs VID/PID matching for the kernel 73 | level driver. You are REQUIRED to use libusb-win32 (see 74 | http://libusb-win32.sourceforge.net/) as the kernel level driver for 75 | VENDOR CLASS devices. HID CLASS devices all use the generic HID class 76 | driver shipped with Windows, except mice and keyboards. You therefore 77 | MUST NOT use any of the shared VID/PID pairs for mice or keyboards. 78 | CDC-ACM CLASS devices require a ".inf" file which matches on the VID/PID 79 | pair. This ".inf" file MUST load the "usbser" driver to configure the 80 | device as modem (COM-port). 81 | 82 | (7) OBJECTIVE DEVELOPMENT Software GmbH disclaims all liability for any 83 | problems which are caused by the shared use of these VID/PID pairs. You 84 | have been warned that the sharing of VID/PID pairs may cause problems. If 85 | you want to avoid them, get your own VID/PID pair for exclusive use. 86 | 87 | 88 | HOW TO IMPLEMENT THESE RULES 89 | ============================ 90 | 91 | The following rules are for VENDOR CLASS and HID CLASS devices. CDC-ACM 92 | CLASS and MIDI CLASS devices use the operating system's class driver and 93 | don't need a custom driver. 94 | 95 | The host driver MUST iterate over all devices with the given VID/PID 96 | numbers in their device descriptors and query the string representation for 97 | the manufacturer name in USB language 0x0409 (English/US). It MUST compare 98 | the ENTIRE string with your textual manufacturer identification chosen in 99 | (2) above. A substring search for your domain or e-mail address is NOT 100 | acceptable. The driver MUST NOT touch the device (other than querying the 101 | descriptors) unless the strings match. 102 | 103 | For all USB devices with matching VID/PID and textual manufacturer 104 | identification, the host driver must query the textual product 105 | identification and string-compare it with the name of the product it can 106 | control. It may only initialize the device if the product matches exactly. 107 | 108 | Objective Development provides examples for these matching rules with the 109 | "PowerSwitch" project (using libusb) and with the "Automator" project 110 | (using Windows calls on Windows and libusb on Unix). 111 | 112 | 113 | Technical Notes: 114 | ================ 115 | 116 | Sharing the same VID/PID pair among devices is possible as long as ALL 117 | drivers which match the VID/PID also perform matching on the textual 118 | identification strings. This is easy on all operating systems except 119 | Windows, since Windows establishes a static connection between the VID/PID 120 | pair and a kernel level driver. All devices with the same VID/PID pair must 121 | therefore use THE SAME kernel level driver. 122 | 123 | We therefore demand that you use libusb-win32 for VENDOR CLASS devices. 124 | This is a generic kernel level driver which allows all types of USB access 125 | for user space applications. This is only a partial solution of the 126 | problem, though, because different device drivers may come with different 127 | versions of libusb-win32 and they may not work with the libusb version of 128 | the respective other driver. You are therefore encouraged to test your 129 | driver against a broad range of libusb-win32 versions. Do not use new 130 | features in new versions, or check for their existence before you use them. 131 | When a new libusb-win32 becomes available, make sure that your driver is 132 | compatible with it. 133 | 134 | For HID CLASS devices it is necessary that all those devices bind to the 135 | same kernel driver: Microsoft's generic USB HID driver. This is true for 136 | all HID devices except those with a specialized driver. Currently, the only 137 | HIDs with specialized drivers are mice and keyboards. You therefore MUST 138 | NOT use a shared VID/PID with mouse and keyboard devices. 139 | 140 | Sharing the same VID/PID among different products is unusual and probably 141 | violates the USB specification. If you do it, you do it at your own risk. 142 | 143 | To avoid possible incompatibilities, we highly recommend that you get your 144 | own VID/PID pair if you intend to sell your product. Objective 145 | Development's commercial licenses for AVR-USB include a PID for 146 | unrestricted exclusive use. 147 | -------------------------------------------------------------------------------- /src/bootloaders/hidbootloader/usbdrv/oddebug.c: -------------------------------------------------------------------------------- 1 | /* Name: oddebug.c 2 | * Project: AVR library 3 | * Author: Christian Starkjohann 4 | * Creation Date: 2005-01-16 5 | * Tabsize: 4 6 | * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH 7 | * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) 8 | * This Revision: $Id: oddebug.c 692 2008-11-07 15:07:40Z cs $ 9 | */ 10 | 11 | #include "oddebug.h" 12 | 13 | #if DEBUG_LEVEL > 0 14 | 15 | #warning "Never compile production devices with debugging enabled" 16 | 17 | static void uartPutc(char c) 18 | { 19 | while(!(ODDBG_USR & (1 << ODDBG_UDRE))); /* wait for data register empty */ 20 | ODDBG_UDR = c; 21 | } 22 | 23 | static uchar hexAscii(uchar h) 24 | { 25 | h &= 0xf; 26 | if(h >= 10) 27 | h += 'a' - (uchar)10 - '0'; 28 | h += '0'; 29 | return h; 30 | } 31 | 32 | static void printHex(uchar c) 33 | { 34 | uartPutc(hexAscii(c >> 4)); 35 | uartPutc(hexAscii(c)); 36 | } 37 | 38 | void odDebug(uchar prefix, uchar *data, uchar len) 39 | { 40 | printHex(prefix); 41 | uartPutc(':'); 42 | while(len--){ 43 | uartPutc(' '); 44 | printHex(*data++); 45 | } 46 | uartPutc('\r'); 47 | uartPutc('\n'); 48 | } 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /src/bootloaders/hidbootloader/usbdrv/oddebug.h: -------------------------------------------------------------------------------- 1 | /* Name: oddebug.h 2 | * Project: AVR library 3 | * Author: Christian Starkjohann 4 | * Creation Date: 2005-01-16 5 | * Tabsize: 4 6 | * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH 7 | * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) 8 | * This Revision: $Id: oddebug.h 692 2008-11-07 15:07:40Z cs $ 9 | */ 10 | 11 | #ifndef __oddebug_h_included__ 12 | #define __oddebug_h_included__ 13 | 14 | /* 15 | General Description: 16 | This module implements a function for debug logs on the serial line of the 17 | AVR microcontroller. Debugging can be configured with the define 18 | 'DEBUG_LEVEL'. If this macro is not defined or defined to 0, all debugging 19 | calls are no-ops. If it is 1, DBG1 logs will appear, but not DBG2. If it is 20 | 2, DBG1 and DBG2 logs will be printed. 21 | 22 | A debug log consists of a label ('prefix') to indicate which debug log created 23 | the output and a memory block to dump in hex ('data' and 'len'). 24 | */ 25 | 26 | 27 | #ifndef F_CPU 28 | # define F_CPU 12000000 /* 12 MHz */ 29 | #endif 30 | 31 | /* make sure we have the UART defines: */ 32 | #include "usbportability.h" 33 | 34 | #ifndef uchar 35 | # define uchar unsigned char 36 | #endif 37 | 38 | #if DEBUG_LEVEL > 0 && !(defined TXEN || defined TXEN0) /* no UART in device */ 39 | # warning "Debugging disabled because device has no UART" 40 | # undef DEBUG_LEVEL 41 | #endif 42 | 43 | #ifndef DEBUG_LEVEL 44 | # define DEBUG_LEVEL 0 45 | #endif 46 | 47 | /* ------------------------------------------------------------------------- */ 48 | 49 | #if DEBUG_LEVEL > 0 50 | # define DBG1(prefix, data, len) odDebug(prefix, data, len) 51 | #else 52 | # define DBG1(prefix, data, len) 53 | #endif 54 | 55 | #if DEBUG_LEVEL > 1 56 | # define DBG2(prefix, data, len) odDebug(prefix, data, len) 57 | #else 58 | # define DBG2(prefix, data, len) 59 | #endif 60 | 61 | /* ------------------------------------------------------------------------- */ 62 | 63 | #if DEBUG_LEVEL > 0 64 | extern void odDebug(uchar prefix, uchar *data, uchar len); 65 | 66 | /* Try to find our control registers; ATMEL likes to rename these */ 67 | 68 | #if defined UBRR 69 | # define ODDBG_UBRR UBRR 70 | #elif defined UBRRL 71 | # define ODDBG_UBRR UBRRL 72 | #elif defined UBRR0 73 | # define ODDBG_UBRR UBRR0 74 | #elif defined UBRR0L 75 | # define ODDBG_UBRR UBRR0L 76 | #endif 77 | 78 | #if defined UCR 79 | # define ODDBG_UCR UCR 80 | #elif defined UCSRB 81 | # define ODDBG_UCR UCSRB 82 | #elif defined UCSR0B 83 | # define ODDBG_UCR UCSR0B 84 | #endif 85 | 86 | #if defined TXEN 87 | # define ODDBG_TXEN TXEN 88 | #else 89 | # define ODDBG_TXEN TXEN0 90 | #endif 91 | 92 | #if defined USR 93 | # define ODDBG_USR USR 94 | #elif defined UCSRA 95 | # define ODDBG_USR UCSRA 96 | #elif defined UCSR0A 97 | # define ODDBG_USR UCSR0A 98 | #endif 99 | 100 | #if defined UDRE 101 | # define ODDBG_UDRE UDRE 102 | #else 103 | # define ODDBG_UDRE UDRE0 104 | #endif 105 | 106 | #if defined UDR 107 | # define ODDBG_UDR UDR 108 | #elif defined UDR0 109 | # define ODDBG_UDR UDR0 110 | #endif 111 | 112 | static inline void odDebugInit(void) 113 | { 114 | ODDBG_UCR |= (1< 39 | #ifndef __IAR_SYSTEMS_ASM__ 40 | # include 41 | #endif 42 | 43 | #define __attribute__(arg) /* not supported on IAR */ 44 | 45 | #ifdef __IAR_SYSTEMS_ASM__ 46 | # define __ASSEMBLER__ /* IAR does not define standard macro for asm */ 47 | #endif 48 | 49 | #ifdef __HAS_ELPM__ 50 | # define PROGMEM __farflash 51 | #else 52 | # define PROGMEM __flash 53 | #endif 54 | 55 | #define USB_READ_FLASH(addr) (*(PROGMEM char *)(addr)) 56 | 57 | /* The following definitions are not needed by the driver, but may be of some 58 | * help if you port a gcc based project to IAR. 59 | */ 60 | #define cli() __disable_interrupt() 61 | #define sei() __enable_interrupt() 62 | #define wdt_reset() __watchdog_reset() 63 | #define _BV(x) (1 << (x)) 64 | 65 | /* assembler compatibility macros */ 66 | #define nop2 rjmp $+2 /* jump to next instruction */ 67 | #define XL r26 68 | #define XH r27 69 | #define YL r28 70 | #define YH r29 71 | #define ZL r30 72 | #define ZH r31 73 | #define lo8(x) LOW(x) 74 | #define hi8(x) (((x)>>8) & 0xff) /* not HIGH to allow XLINK to make a proper range check */ 75 | 76 | /* Depending on the device you use, you may get problems with the way usbdrv.h 77 | * handles the differences between devices. Since IAR does not use #defines 78 | * for MCU registers, we can't check for the existence of a particular 79 | * register with an #ifdef. If the autodetection mechanism fails, include 80 | * definitions for the required USB_INTR_* macros in your usbconfig.h. See 81 | * usbconfig-prototype.h and usbdrv.h for details. 82 | */ 83 | 84 | /* ------------------------------------------------------------------------- */ 85 | #elif __CODEVISIONAVR__ /* check for CodeVision AVR */ 86 | /* ------------------------------------------------------------------------- */ 87 | /* This port is not working (yet) */ 88 | 89 | /* #define F_CPU _MCU_CLOCK_FREQUENCY_ seems to be defined automatically */ 90 | 91 | #include 92 | #include 93 | 94 | #define __attribute__(arg) /* not supported on IAR */ 95 | 96 | #define PROGMEM __flash 97 | #define USB_READ_FLASH(addr) (*(PROGMEM char *)(addr)) 98 | 99 | #ifndef __ASSEMBLER__ 100 | static inline void cli(void) 101 | { 102 | #asm("cli"); 103 | } 104 | static inline void sei(void) 105 | { 106 | #asm("sei"); 107 | } 108 | #endif 109 | #define _delay_ms(t) delay_ms(t) 110 | #define _BV(x) (1 << (x)) 111 | #define USB_CFG_USE_SWITCH_STATEMENT 1 /* macro for if() cascase fails for unknown reason */ 112 | 113 | #define macro .macro 114 | #define endm .endmacro 115 | #define nop2 rjmp .+0 /* jump to next instruction */ 116 | 117 | /* ------------------------------------------------------------------------- */ 118 | #else /* default development environment is avr-gcc/avr-libc */ 119 | /* ------------------------------------------------------------------------- */ 120 | 121 | #include 122 | #ifdef __ASSEMBLER__ 123 | # define _VECTOR(N) __vector_ ## N /* io.h does not define this for asm */ 124 | #else 125 | # include 126 | #endif 127 | 128 | #define USB_READ_FLASH(addr) pgm_read_byte(addr) 129 | 130 | #define macro .macro 131 | #define endm .endm 132 | #define nop2 rjmp .+0 /* jump to next instruction */ 133 | 134 | #endif /* development environment */ 135 | 136 | /* for conveniecne, ensure that PRG_RDB exists */ 137 | #ifndef PRG_RDB 138 | # define PRG_RDB(addr) USB_READ_FLASH(addr) 139 | #endif 140 | #endif /* __usbportability_h_INCLUDED__ */ 141 | -------------------------------------------------------------------------------- /src/core/WConstants.h: -------------------------------------------------------------------------------- 1 | #include "wiring.h" 2 | -------------------------------------------------------------------------------- /src/core/WInterrupts.c: -------------------------------------------------------------------------------- 1 | /* -*- mode: jde; c-basic-offset: 2; indent-tabs-mode: nil -*- */ 2 | 3 | /* 4 | Part of the Wiring project - http://wiring.uniandes.edu.co 5 | 6 | Copyright (c) 2004-05 Hernando Barragan 7 | 8 | This library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU Lesser General Public 10 | License as published by the Free Software Foundation; either 11 | version 2.1 of the License, or (at your option) any later version. 12 | 13 | This library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General 19 | Public License along with this library; if not, write to the 20 | Free Software Foundation, Inc., 59 Temple Place, Suite 330, 21 | Boston, MA 02111-1307 USA 22 | 23 | Modified 24 November 2006 by David A. Mellis 24 | */ 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | 32 | #include "WConstants.h" 33 | #include "wiring_private.h" 34 | 35 | volatile static voidFuncPtr intFunc[EXTERNAL_NUM_INTERRUPTS]; 36 | // volatile static voidFuncPtr twiIntFunc; 37 | 38 | void attachInterrupt(uint8_t interruptNum, void (*userFunc)(void), int mode) { 39 | if(interruptNum < EXTERNAL_NUM_INTERRUPTS) { 40 | intFunc[interruptNum] = userFunc; 41 | 42 | // Configure the interrupt mode (trigger on low input, any change, rising 43 | // edge, or falling edge). The mode constants were chosen to correspond 44 | // to the configuration bits in the hardware register, so we simply shift 45 | // the mode into place. 46 | 47 | // Enable the interrupt. 48 | 49 | switch (interruptNum) { 50 | #if defined(__AVR_ATmega1280__) 51 | case 2: 52 | EICRA = (EICRA & ~((1 << ISC00) | (1 << ISC01))) | (mode << ISC00); 53 | EIMSK |= (1 << INT0); 54 | break; 55 | case 3: 56 | EICRA = (EICRA & ~((1 << ISC10) | (1 << ISC11))) | (mode << ISC10); 57 | EIMSK |= (1 << INT1); 58 | break; 59 | case 4: 60 | EICRA = (EICRA & ~((1 << ISC20) | (1 << ISC21))) | (mode << ISC20); 61 | EIMSK |= (1 << INT2); 62 | break; 63 | case 5: 64 | EICRA = (EICRA & ~((1 << ISC30) | (1 << ISC31))) | (mode << ISC30); 65 | EIMSK |= (1 << INT3); 66 | break; 67 | case 0: 68 | EICRB = (EICRB & ~((1 << ISC40) | (1 << ISC41))) | (mode << ISC40); 69 | EIMSK |= (1 << INT4); 70 | break; 71 | case 1: 72 | EICRB = (EICRB & ~((1 << ISC50) | (1 << ISC51))) | (mode << ISC50); 73 | EIMSK |= (1 << INT5); 74 | break; 75 | case 6: 76 | EICRB = (EICRB & ~((1 << ISC60) | (1 << ISC61))) | (mode << ISC60); 77 | EIMSK |= (1 << INT6); 78 | break; 79 | case 7: 80 | EICRB = (EICRB & ~((1 << ISC70) | (1 << ISC71))) | (mode << ISC70); 81 | EIMSK |= (1 << INT7); 82 | break; 83 | #else 84 | case 0: 85 | EICRA = (EICRA & ~((1 << ISC00) | (1 << ISC01))) | (mode << ISC00); 86 | EIMSK |= (1 << INT0); 87 | break; 88 | #if !defined(__AVR_ATtiny26__) 89 | case 1: 90 | EICRA = (EICRA & ~((1 << ISC10) | (1 << ISC11))) | (mode << ISC10); 91 | EIMSK |= (1 << INT1); 92 | break; 93 | #endif 94 | #endif 95 | } 96 | } 97 | } 98 | 99 | void detachInterrupt(uint8_t interruptNum) { 100 | if(interruptNum < EXTERNAL_NUM_INTERRUPTS) { 101 | // Disable the interrupt. (We can't assume that interruptNum is equal 102 | // to the number of the EIMSK bit to clear, as this isn't true on the 103 | // ATmega8. There, INT0 is 6 and INT1 is 7.) 104 | switch (interruptNum) { 105 | #if defined(__AVR_ATmega1280__) 106 | case 2: 107 | EIMSK &= ~(1 << INT0); 108 | break; 109 | case 3: 110 | EIMSK &= ~(1 << INT1); 111 | break; 112 | case 4: 113 | EIMSK &= ~(1 << INT2); 114 | break; 115 | case 5: 116 | EIMSK &= ~(1 << INT3); 117 | break; 118 | case 0: 119 | EIMSK &= ~(1 << INT4); 120 | break; 121 | case 1: 122 | EIMSK &= ~(1 << INT5); 123 | break; 124 | case 6: 125 | EIMSK &= ~(1 << INT6); 126 | break; 127 | case 7: 128 | EIMSK &= ~(1 << INT7); 129 | break; 130 | #else 131 | case 0: 132 | EIMSK &= ~(1 << INT0); 133 | break; 134 | #if !defined(__AVR_ATtiny26__) 135 | case 1: 136 | EIMSK &= ~(1 << INT1); 137 | break; 138 | #endif 139 | #endif 140 | } 141 | 142 | intFunc[interruptNum] = 0; 143 | } 144 | } 145 | 146 | /* 147 | void attachInterruptTwi(void (*userFunc)(void) ) { 148 | twiIntFunc = userFunc; 149 | } 150 | */ 151 | 152 | #if defined(__AVR_ATmega1280__) 153 | 154 | ISR(INT0_vect) { 155 | if(intFunc[EXTERNAL_INT_2]) 156 | intFunc[EXTERNAL_INT_2](); 157 | } 158 | 159 | ISR(INT1_vect) { 160 | if(intFunc[EXTERNAL_INT_3]) 161 | intFunc[EXTERNAL_INT_3](); 162 | } 163 | 164 | ISR(INT2_vect) { 165 | if(intFunc[EXTERNAL_INT_4]) 166 | intFunc[EXTERNAL_INT_4](); 167 | } 168 | 169 | ISR(INT3_vect) { 170 | if(intFunc[EXTERNAL_INT_5]) 171 | intFunc[EXTERNAL_INT_5](); 172 | } 173 | 174 | ISR(INT4_vect) { 175 | if(intFunc[EXTERNAL_INT_0]) 176 | intFunc[EXTERNAL_INT_0](); 177 | } 178 | 179 | ISR(INT5_vect) { 180 | if(intFunc[EXTERNAL_INT_1]) 181 | intFunc[EXTERNAL_INT_1](); 182 | } 183 | 184 | ISR(INT6_vect) { 185 | if(intFunc[EXTERNAL_INT_6]) 186 | intFunc[EXTERNAL_INT_6](); 187 | } 188 | 189 | ISR(INT7_vect) { 190 | if(intFunc[EXTERNAL_INT_7]) 191 | intFunc[EXTERNAL_INT_7](); 192 | } 193 | 194 | #else 195 | 196 | ISR(INT0_vect) { 197 | if(intFunc[EXTERNAL_INT_0]) 198 | intFunc[EXTERNAL_INT_0](); 199 | } 200 | 201 | #if !defined(__AVR_ATtiny26__) 202 | 203 | ISR(INT1_vect) { 204 | if(intFunc[EXTERNAL_INT_1]) 205 | intFunc[EXTERNAL_INT_1](); 206 | } 207 | 208 | #endif 209 | 210 | #endif 211 | 212 | /* 213 | SIGNAL(SIG_2WIRE_SERIAL) { 214 | if(twiIntFunc) 215 | twiIntFunc(); 216 | } 217 | */ 218 | 219 | -------------------------------------------------------------------------------- /src/core/WMath.c: -------------------------------------------------------------------------------- 1 | /* -*- mode: jde; c-basic-offset: 2; indent-tabs-mode: nil -*- */ 2 | 3 | /* 4 | Part of the Wiring project - http://wiring.org.co 5 | Copyright (c) 2004-06 Hernando Barragan 6 | Modified 13 August 2006, David A. Mellis for Arduino - http://www.arduino.cc/ 7 | 8 | This library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU Lesser General Public 10 | License as published by the Free Software Foundation; either 11 | version 2.1 of the License, or (at your option) any later version. 12 | 13 | This library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General 19 | Public License along with this library; if not, write to the 20 | Free Software Foundation, Inc., 59 Temple Place, Suite 330, 21 | Boston, MA 02111-1307 USA 22 | 23 | $Id$ 24 | */ 25 | 26 | 27 | #include "stdlib.h" 28 | 29 | #if 0 30 | 31 | void randomSeed(unsigned int seed) 32 | { 33 | if (seed != 0) { 34 | srandom(seed); 35 | } 36 | } 37 | 38 | long random(long howbig) 39 | { 40 | if (howbig == 0) { 41 | return 0; 42 | } 43 | return random() % howbig; 44 | } 45 | 46 | long random(long howsmall, long howbig) 47 | { 48 | if (howsmall >= howbig) { 49 | return howsmall; 50 | } 51 | long diff = howbig - howsmall; 52 | return random(diff) + howsmall; 53 | } 54 | 55 | #endif 56 | 57 | long map(long x, long in_min, long in_max, long out_min, long out_max) 58 | { 59 | return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min; 60 | } 61 | -------------------------------------------------------------------------------- /src/core/WProgram.h: -------------------------------------------------------------------------------- 1 | #include "arduino_lit.h" 2 | -------------------------------------------------------------------------------- /src/core/abs_io.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ArduinoLite 3 | * A lightweight runtime system for AVR chips based on arduino project 4 | * by Shikai Chen (csk@live.com, http://www.csksoft.net) 5 | * 6 | * abs_io.h abstract In/Out layer 7 | * 8 | */ 9 | 10 | #ifndef _ABSTRACT_IO_LAYER_H 11 | #define _ABSTRACT_IO_LAYER_H 12 | 13 | #include 14 | 15 | // 16 | typedef int (*getc_func)(void); 17 | typedef void (*putc_func)( uint8_t); 18 | 19 | typedef unsigned int (*read_func)(uint8_t *, unsigned int); 20 | typedef void (*write_func)(uint8_t *, unsigned int); 21 | 22 | typedef unsigned int (*gets_func)(uint8_t *); 23 | typedef void (*puts_func)(uint8_t *); 24 | 25 | #endif -------------------------------------------------------------------------------- /src/core/arduino_lit.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ArduinoLite 3 | * A lightweight and efficient runtime system for AVR chips 4 | * by Shikai Chen (csk@live.com, http://www.csksoft.net) 5 | * 6 | * arduino_lit.h the ArduinoLite's main header file 7 | * Original file name : WProgram.h 8 | * 9 | * ArduinoLite is based on the work of Arduino Project (arduino.cc) 10 | * 11 | */ 12 | 13 | #ifndef WProgram_h 14 | #define WProgram_h 15 | 16 | #include 17 | #include 18 | #include 19 | 20 | #include 21 | #include 22 | #include "wiring.h" 23 | #include "simp_print.h" 24 | #include "net_serial.h" 25 | 26 | static inline uint16_t makeWord(uint16_t w) 27 | { 28 | return w; 29 | } 30 | static inline uint16_t makeWord(byte h, byte l) 31 | { 32 | return (((uint16_t)h)<<8 | l); 33 | } 34 | 35 | #define word(...) makeWord(__VA_ARGS__) 36 | 37 | unsigned long pulseIn(uint8_t pin, uint8_t state, unsigned long timeout = 1000000L); 38 | 39 | 40 | // WMath prototype 41 | // ArduinoLite: The random/randomSeed funtions have been removed from ArduinoLite lib. 42 | // Please use rand() in libc. 43 | #if 0 44 | long random(long); 45 | long random(long, long); 46 | void randomSeed(unsigned int); 47 | #endif 48 | extern "C" long map(long, long, long, long, long); 49 | 50 | 51 | // Helper Functions 52 | 53 | 54 | #define PRINT(x, ...) print(x, ##__VA_ARGS__, serial_puts) 55 | 56 | #if defined(_DEBUG) 57 | #define DBG_PRINT(x, ...) print(x, ##__VA_ARGS__, serial_puts) 58 | #else 59 | #define DBG_PRINT(x, ...) 60 | #endif 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /src/core/net_serial.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ArduinoLite 3 | * A lightweight runtime system for AVR chips 4 | * by Shikai Chen (csk@live.com, http://www.csksoft.net) 5 | * 6 | * net_serial.h - AVR serial library for arduino_lite 7 | * Original file name : HardwareSerial.h 8 | * 9 | * ArduinoLite is based on the work of Arduino Project (arduino.cc) 10 | * 11 | */ 12 | /* 13 | HardwareSerial.h - Hardware serial library for Wiring 14 | Copyright (c) 2006 Nicholas Zambetti. All right reserved. 15 | 16 | This library is free software; you can redistribute it and/or 17 | modify it under the terms of the GNU Lesser General Public 18 | License as published by the Free Software Foundation; either 19 | version 2.1 of the License, or (at your option) any later version. 20 | 21 | This library is distributed in the hope that it will be useful, 22 | but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 24 | Lesser General Public License for more details. 25 | 26 | You should have received a copy of the GNU Lesser General Public 27 | License along with this library; if not, write to the Free Software 28 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 29 | */ 30 | 31 | #ifndef HardwareSerial_h 32 | #define HardwareSerial_h 33 | 34 | #if defined (__AVR_ATtiny26__) 35 | //no serial port for Attiny26 36 | #else 37 | 38 | #include 39 | 40 | #if defined(__AVR_ATmega8__) 41 | 42 | #define _UBRRH UBRRH 43 | #define _UBRRL UBRRL 44 | #define _UCSRA UCSRA 45 | #define _UCSRB UCSRB 46 | #define _UDR UDR 47 | #define _RXEN RXEN 48 | #define _TXEN TXEN 49 | #define _RXCIE RXCIE 50 | #define _UDRE UDRE 51 | #define _U2X U2X 52 | 53 | #elif defined(__AVR_ATtiny2313__) 54 | 55 | #define _UBRRH UBRRH 56 | #define _UBRRL UBRRL 57 | #define _UCSRA UCSRA 58 | #define _UCSRB UCSRB 59 | #define _UDR UDR 60 | #define _RXEN RXEN 61 | #define _TXEN TXEN 62 | #define _RXCIE RXCIE 63 | #define _UDRE UDRE 64 | #define _U2X U2X 65 | #else 66 | 67 | #define _UBRRH UBRR0H 68 | #define _UBRRL UBRR0L 69 | #define _UCSRA UCSR0A 70 | #define _UCSRB UCSR0B 71 | #define _UDR UDR0 72 | #define _RXEN RXEN0 73 | #define _TXEN TXEN0 74 | #define _RXCIE RXCIE0 75 | #define _UDRE UDRE0 76 | #define _U2X U2X0 77 | #endif 78 | 79 | 80 | // Define constants and variables for buffering incoming serial data. We're 81 | // using a ring buffer (I think), in which rx_buffer_head is the index of the 82 | // location to which to write the next incoming character and rx_buffer_tail 83 | // is the index of the location from which to read. 84 | #define RX_BUFFER_SIZE 128 85 | 86 | typedef struct ring_buffer { 87 | unsigned char buffer[RX_BUFFER_SIZE]; 88 | volatile unsigned char head; 89 | volatile unsigned char tail; 90 | } ring_buffer_t; 91 | 92 | typedef struct usart_desc 93 | { 94 | // TODO: change to const value if the compiler allows 95 | #if !defined(__AVR_ATtiny13__) //no ring buffer for tiny2313 96 | ring_buffer_t rx_buffer; 97 | #endif 98 | 99 | #if defined(_ENABLE_MULTI_SERIAL_) && !defined(__AVR_ATtiny2313__) 100 | volatile uint8_t *ubrrh; 101 | volatile uint8_t *ubrrl; 102 | volatile uint8_t *ucsra; 103 | volatile uint8_t *ucsrb; 104 | volatile uint8_t *udr; 105 | uint8_t rxen; 106 | uint8_t txen; 107 | uint8_t rxcie; 108 | uint8_t udre; 109 | uint8_t u2x; 110 | #endif 111 | } usart_desc_t; 112 | 113 | 114 | 115 | #if !defined(__AVR_ATtiny2313__) && !defined(_SERIAL_CUSTOM_RX_ROUTINE_) 116 | //no ring buffer for tiny2313 or the macro _SERIAL_CUSTOM_RX_ROUTINE_ is defined 117 | extern usart_desc_t g_usart; 118 | #endif 119 | 120 | #if defined(__AVR_ATmega1280__) 121 | extern usart_desc_t g_usart1; 122 | extern usart_desc_t g_usart2; 123 | extern usart_desc_t g_usart3; 124 | #endif 125 | 126 | 127 | void serial_begin(unsigned long baud); 128 | 129 | //require the macro BAUD to be defined 130 | inline static void SERIAL_BEGIN() 131 | { 132 | #ifndef BAUD 133 | #define BAUD 19200 //set BAUD to 19200 as default 134 | #endif 135 | #include 136 | 137 | _UBRRH = UBRRH_VALUE; 138 | _UBRRL = UBRRL_VALUE; 139 | 140 | #if USE_2X 141 | sbi(_UCSRA, _U2X); 142 | #else 143 | cbi(_UCSRA, _U2X); 144 | #endif 145 | 146 | sbi(_UCSRB, _RXEN); 147 | sbi(_UCSRB, _TXEN); 148 | sbi(_UCSRB, _RXCIE); 149 | 150 | } 151 | 152 | #if !defined(__AVR_ATtiny2313__) && !defined(_SERIAL_CUSTOM_RX_ROUTINE_) 153 | //////////////// 154 | #ifdef _ENABLE_SERIAL_CALLBACK 155 | typedef unsigned char (*onByteProc_t)(unsigned char); 156 | extern volatile onByteProc_t g_onDataProc; 157 | static inline void serial_SetDataProc(onByteProc_t proc) 158 | { 159 | g_onDataProc = proc; 160 | } 161 | #endif 162 | //////////////// 163 | uint8_t serial_available(void); 164 | int serial_getc(void); 165 | void serial_flush(void); 166 | #endif 167 | 168 | 169 | ////////////////////////////////////////////////////////////// 170 | // Tx routines operate on the default port( the first port ) 171 | void serial_putc(uint8_t c); 172 | void serial_puts(uint8_t *buf, size_t size); 173 | void serial_puts(uint8_t *buf); 174 | 175 | ////////////////////////////// 176 | // Multiple Serial Support 177 | #if defined(_ENABLE_MULTI_SERIAL_) && !defined(__AVR_ATtiny2313__) 178 | 179 | void serial_begin_at (usart_desc_t * desc, unsigned long baud); 180 | uint8_t serial_available_at (usart_desc_t * desc); 181 | int serial_readc_at (usart_desc_t * desc); 182 | void serial_flush_at (usart_desc_t * desc); 183 | void serial_putc_at (usart_desc_t * desc, uint8_t c); 184 | void serial_puts_at (usart_desc_t * desc,uint8_t *buf, size_t size); 185 | void serial_puts_at (usart_desc_t * desc,uint8_t *buf); 186 | 187 | #endif 188 | 189 | 190 | #endif 191 | 192 | #endif 193 | -------------------------------------------------------------------------------- /src/core/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | pins_arduino.h - Pin definition functions for Arduino 3 | Part of Arduino - http://www.arduino.cc/ 4 | 5 | Copyright (c) 2007 David A. Mellis 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General 18 | Public License along with this library; if not, write to the 19 | Free Software Foundation, Inc., 59 Temple Place, Suite 330, 20 | Boston, MA 02111-1307 USA 21 | 22 | $Id: wiring.h 249 2007-02-03 16:52:51Z mellis $ 23 | */ 24 | 25 | #ifndef Pins_Arduino_h 26 | #define Pins_Arduino_h 27 | 28 | #include 29 | 30 | #define NOT_A_PIN 0 31 | #define NOT_A_PORT 0 32 | 33 | #define NOT_ON_TIMER 0 34 | #define TIMER0A 1 35 | #define TIMER0B 2 36 | #define TIMER1A 3 37 | #define TIMER1B 4 38 | #define TIMER2 5 39 | #define TIMER2A 6 40 | #define TIMER2B 7 41 | 42 | #define TIMER3A 8 43 | #define TIMER3B 9 44 | #define TIMER3C 10 45 | #define TIMER4A 11 46 | #define TIMER4B 12 47 | #define TIMER4C 13 48 | #define TIMER5A 14 49 | #define TIMER5B 15 50 | #define TIMER5C 16 51 | 52 | 53 | #define PA 1 54 | #define PB 2 55 | #define PC 3 56 | #define PD 4 57 | #define PE 5 58 | #define PF 6 59 | #define PG 7 60 | #define PH 8 61 | #define PJ 10 62 | #define PK 11 63 | #define PL 12 64 | 65 | #if defined(__AVR_ATmega1280__) 66 | // On the ATmega1280, the addresses of some of the port registers are 67 | // greater than 255, so we can't store them in uint8_t's. 68 | extern const uint16_t PROGMEM port_to_mode_PGM[]; 69 | extern const uint16_t PROGMEM port_to_input_PGM[]; 70 | extern const uint16_t PROGMEM port_to_output_PGM[]; 71 | #else 72 | extern const uint8_t PROGMEM port_to_mode_PGM[]; 73 | extern const uint8_t PROGMEM port_to_input_PGM[]; 74 | extern const uint8_t PROGMEM port_to_output_PGM[]; 75 | #endif 76 | 77 | #if !defined(__AVR_ATtiny2313__) && !defined(__AVR_ATtiny26__)//no mapping table for tiny series, please use the MARCO version instead 78 | extern const uint8_t PROGMEM digital_pin_to_port_PGM[]; 79 | // extern const uint8_t PROGMEM digital_pin_to_bit_PGM[]; 80 | extern const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[]; 81 | extern const uint8_t PROGMEM digital_pin_to_timer_PGM[]; 82 | #endif 83 | // Get the bit location within the hardware port of the given virtual pin. 84 | // This comes from the pins_*.c file for the active board configuration. 85 | // 86 | // These perform slightly better as macros compared to inline functions 87 | // 88 | #if !defined(__AVR_ATtiny2313__) && !defined(__AVR_ATtiny26__)//no mapping table for tiny series, please use the MARCO version instead 89 | #define digitalPinToPort(P) ( pgm_read_byte( digital_pin_to_port_PGM + (P) ) ) 90 | #define digitalPinToBitMask(P) ( pgm_read_byte( digital_pin_to_bit_mask_PGM + (P) ) ) 91 | #define digitalPinToTimer(P) ( pgm_read_byte( digital_pin_to_timer_PGM + (P) ) ) 92 | #define analogInPinToBit(P) (P) 93 | #endif 94 | 95 | #if defined(__AVR_ATmega1280__) 96 | #define portOutputRegister(P) ( (volatile uint8_t *)( pgm_read_word( port_to_output_PGM + (P))) ) 97 | #define portInputRegister(P) ( (volatile uint8_t *)( pgm_read_word( port_to_input_PGM + (P))) ) 98 | #define portModeRegister(P) ( (volatile uint8_t *)( pgm_read_word( port_to_mode_PGM + (P))) ) 99 | #else 100 | 101 | #if !defined(__AVR_ATtiny2313__) && !defined(__AVR_ATtiny26__)//no mapping table for tiny series, please use the MARCO version instead 102 | #define portOutputRegister(P) ( (volatile uint8_t *)(uint16_t)( pgm_read_byte( port_to_output_PGM + (P))) ) 103 | #define portInputRegister(P) ( (volatile uint8_t *)(uint16_t)( pgm_read_byte( port_to_input_PGM + (P))) ) 104 | #define portModeRegister(P) ( (volatile uint8_t *)(uint16_t)( pgm_read_byte( port_to_mode_PGM + (P))) ) 105 | #endif 106 | 107 | #endif 108 | 109 | #endif 110 | -------------------------------------------------------------------------------- /src/core/simp_print.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * ArduinoLite 3 | * A lightweight runtime system for AVR chips 4 | * by Shikai Chen (csk@live.com, http://www.csksoft.net) 5 | * 6 | * simp_print.c - simple and lightweight text serialize lib for arduino_lite 7 | * Original file name : Print.cpp 8 | * 9 | * ArduinoLite is based on the work of Arduino Project (arduino.cc) 10 | */ 11 | 12 | /* 13 | Print.cpp - Base class that provides print() and println() 14 | Copyright (c) 2008 David A. Mellis. All right reserved. 15 | 16 | This library is free software; you can redistribute it and/or 17 | modify it under the terms of the GNU Lesser General Public 18 | License as published by the Free Software Foundation; either 19 | version 2.1 of the License, or (at your option) any later version. 20 | 21 | This library is distributed in the hope that it will be useful, 22 | but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 24 | Lesser General Public License for more details. 25 | 26 | You should have received a copy of the GNU Lesser General Public 27 | License along with this library; if not, write to the Free Software 28 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 29 | 30 | Modified 23 November 2006 by David A. Mellis 31 | */ 32 | 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include "wiring.h" 38 | 39 | #include "simp_print.h" 40 | 41 | static void printNumber(unsigned long n, uint8_t base, puts_func func); 42 | static void printFloat(double number, uint8_t digits, puts_func func); 43 | void print(uint8_t b, putc_func func) 44 | { 45 | func(b); 46 | } 47 | 48 | void print(char c, putc_func func) 49 | { 50 | func(c); 51 | } 52 | 53 | void print(const char str[], puts_func func) 54 | { 55 | func((uint8_t *)str); 56 | } 57 | 58 | void print(int n, puts_func func) 59 | { 60 | print((long) n, func); 61 | } 62 | 63 | void print(unsigned int n, puts_func func) 64 | { 65 | print((unsigned long) n, func); 66 | } 67 | 68 | void print(long n, puts_func func) 69 | { 70 | if (n < 0) { 71 | print('-',func); 72 | n = -n; 73 | } 74 | printNumber(n, 10,func); 75 | } 76 | 77 | void print(unsigned long n, puts_func func) 78 | { 79 | printNumber(n, 10, func); 80 | } 81 | 82 | void print(long n, int base, puts_func func) 83 | { 84 | if (base == 0) 85 | print((char) n, func); 86 | else if (base == 10) 87 | print(n, func); 88 | else 89 | printNumber(n, base, func); 90 | } 91 | 92 | void print(double n, puts_func func) 93 | { 94 | printFloat(n, 2, func); 95 | } 96 | 97 | void println(puts_func func) 98 | { 99 | print("\r\n", func); 100 | } 101 | 102 | void println(char c, puts_func func) 103 | { 104 | print(c, func); 105 | println(func); 106 | } 107 | 108 | void println(const char c[], puts_func func) 109 | { 110 | print(c, func); 111 | println(func); 112 | } 113 | 114 | void println(uint8_t b, puts_func func) 115 | { 116 | print(b, func); 117 | println(func); 118 | } 119 | 120 | void println(int n, puts_func func) 121 | { 122 | print(n, func); 123 | println(func); 124 | } 125 | 126 | void println(unsigned int n, puts_func func) 127 | { 128 | print(n, func); 129 | println(func); 130 | } 131 | 132 | void println(long n, puts_func func) 133 | { 134 | print(n, func); 135 | println(func); 136 | } 137 | 138 | void println(unsigned long n, puts_func func) 139 | { 140 | print(n, func); 141 | println(func); 142 | } 143 | 144 | void println(long n, int base, puts_func func) 145 | { 146 | print(n, base, func); 147 | println(func); 148 | } 149 | 150 | void println(double n, puts_func func) 151 | { 152 | print(n, func); 153 | println(func); 154 | } 155 | 156 | 157 | 158 | void printNumber(unsigned long n, uint8_t base, puts_func func) 159 | { 160 | unsigned char buf[8 * sizeof(long)]; // Assumes 8-bit chars. 161 | 162 | if (n == 0) { 163 | print("0", func); 164 | return; 165 | } 166 | 167 | ultoa(n, (char *)buf, base); 168 | func(buf); 169 | } 170 | 171 | void printFloat(double number, uint8_t digits, puts_func func) 172 | { 173 | #define MAX_FLOAT_DIGITS 16 174 | if (digits > MAX_FLOAT_DIGITS) return; 175 | unsigned char buf[32]; // 176 | dtostrf(number, 1, digits, (char *)buf); 177 | func(buf); 178 | } 179 | -------------------------------------------------------------------------------- /src/core/simp_print.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ArduinoLite 3 | * A lightweight runtime system for AVR chips 4 | * by Shikai Chen (csk@live.com, http://www.csksoft.net) 5 | * 6 | * simp_print.h - simple and lightweight text serialize lib for arduino_lite 7 | * Original file name : Print.h 8 | * 9 | * ArduinoLite is based on the work of Arduino Project (arduino.cc) 10 | */ 11 | 12 | /* 13 | Print.h - Base class that provides print() and println() 14 | Copyright (c) 2008 David A. Mellis. All right reserved. 15 | 16 | This library is free software; you can redistribute it and/or 17 | modify it under the terms of the GNU Lesser General Public 18 | License as published by the Free Software Foundation; either 19 | version 2.1 of the License, or (at your option) any later version. 20 | 21 | This library is distributed in the hope that it will be useful, 22 | but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 24 | Lesser General Public License for more details. 25 | 26 | You should have received a copy of the GNU Lesser General Public 27 | License along with this library; if not, write to the Free Software 28 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 29 | */ 30 | 31 | #ifndef Print_h 32 | #define Print_h 33 | 34 | #include 35 | #include // for size_t 36 | #include "abs_io.h" 37 | 38 | #define DEC 10 39 | #define HEX 16 40 | #define OCT 8 41 | #define BIN 2 42 | #define BYTE 0 43 | 44 | 45 | 46 | void print(char, putc_func); 47 | void print(const char[], puts_func); 48 | void print(uint8_t, putc_func); 49 | void print(int, puts_func); 50 | void print(unsigned int, puts_func); 51 | void print(long, puts_func); 52 | void print(unsigned long, puts_func); 53 | void print(long, int, puts_func); 54 | void print(double, puts_func); 55 | void println(puts_func); 56 | void println(char, puts_func); 57 | void println(const char[], puts_func); 58 | void println(uint8_t, puts_func); 59 | void println(int, puts_func); 60 | void println(unsigned int, puts_func); 61 | void println(long, puts_func); 62 | void println(unsigned long, puts_func); 63 | void println(long, int, puts_func); 64 | void println(double, puts_func); 65 | 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /src/core/wiring.h: -------------------------------------------------------------------------------- 1 | /* 2 | wiring.h - Partial implementation of the Wiring API for the ATmega8. 3 | Part of Arduino - http://www.arduino.cc/ 4 | 5 | Copyright (c) 2005-2006 David A. Mellis 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General 18 | Public License along with this library; if not, write to the 19 | Free Software Foundation, Inc., 59 Temple Place, Suite 330, 20 | Boston, MA 02111-1307 USA 21 | 22 | $Id: wiring.h 602 2009-06-01 08:32:11Z dmellis $ 23 | */ 24 | 25 | #ifndef Wiring_h 26 | #define Wiring_h 27 | 28 | #include 29 | #include 30 | #include 31 | #include "binary.h" 32 | 33 | #ifdef __cplusplus 34 | extern "C"{ 35 | #endif 36 | 37 | #ifndef ARDUINO 38 | #define ARDUINO 16 39 | #endif 40 | 41 | #define HIGH 0x1 42 | #define LOW 0x0 43 | 44 | #define INPUT 0x0 45 | #define OUTPUT 0x1 46 | 47 | #define true 0x1 48 | #define false 0x0 49 | 50 | #define PI 3.1415926535897932384626433832795 51 | #define HALF_PI 1.5707963267948966192313216916398 52 | #define TWO_PI 6.283185307179586476925286766559 53 | #define DEG_TO_RAD 0.017453292519943295769236907684886 54 | #define RAD_TO_DEG 57.295779513082320876798154814105 55 | 56 | #define SERIAL 0x0 57 | #define DISPLAY 0x1 58 | 59 | #define LSBFIRST 0 60 | #define MSBFIRST 1 61 | 62 | #define CHANGE 1 63 | #define FALLING 2 64 | #define RISING 3 65 | 66 | #define INTERNAL 3 67 | #define DEFAULT 1 68 | #define EXTERNAL 0 69 | 70 | 71 | #if defined(EIMSK) 72 | 73 | #elif defined(GIMSK) 74 | #define EIMSK GIMSK 75 | #elif defined(GICR) 76 | #define EIMSK GICR 77 | #endif 78 | 79 | #if defined(EICRA) 80 | 81 | #elif defined(MCUCR) 82 | #define EICRA MCUCR 83 | #else 84 | #error EICRA not defined! 85 | #endif 86 | 87 | #if !defined(ADCSRA) && defined(ADCSR) 88 | #define ADCSRA ADCSR 89 | #endif 90 | 91 | #ifndef cbi 92 | #define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit)) 93 | #endif 94 | #ifndef sbi 95 | #define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit)) 96 | #endif 97 | 98 | 99 | #ifndef offsetof 100 | #define offsetof(type, member) __builtin_offsetof (type, member) 101 | #endif 102 | /* 103 | // undefine stdlib's abs if encountered 104 | #ifdef abs 105 | #undef abs 106 | #endif 107 | */ 108 | 109 | #define min(a,b) ((a)<(b)?(a):(b)) 110 | 111 | #define max(a,b) ((a)>(b)?(a):(b)) 112 | /* 113 | #define abs(x) ((x)>0?(x):-(x)) 114 | */ 115 | #define constrain(amt,low,high) ((amt)<(low)?(low):((amt)>(high)?(high):(amt))) 116 | #define round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5)) 117 | #define radians(deg) ((deg)*DEG_TO_RAD) 118 | #define degrees(rad) ((rad)*RAD_TO_DEG) 119 | #define sq(x) ((x)*(x)) 120 | 121 | #define interrupts() sei() 122 | #define noInterrupts() cli() 123 | 124 | 125 | #define clockCyclesPerMicrosecond() ( F_CPU / 1000000L ) 126 | #define clockCyclesToMicroseconds(a) ( (a) / clockCyclesPerMicrosecond() ) 127 | #define microsecondsToClockCycles(a) ( (a) * clockCyclesPerMicrosecond() ) 128 | 129 | #define lowByte(w) ((uint8_t) ((w) & 0xff)) 130 | #define highByte(w) ((uint8_t) ((w) >> 8)) 131 | 132 | #define bitRead(value, bit) (((value) >> (bit)) & 0x01) 133 | #define bitSet(value, bit) ((value) |= (1UL << (bit))) 134 | #define bitClear(value, bit) ((value) &= ~(1UL << (bit))) 135 | #define bitWrite(value, bit, bitvalue) (bitvalue ? bitSet(value, bit) : bitClear(value, bit)) 136 | 137 | typedef unsigned int word; 138 | 139 | #define bit(b) (1UL << (b)) 140 | 141 | typedef uint8_t boolean; 142 | typedef uint8_t byte; 143 | 144 | void init(void); 145 | 146 | #if !defined(__AVR_ATtiny2313__) && !defined(__AVR_ATtiny26__) //no mapping table for tiny series, please use the MARCO version instead 147 | void pinMode(uint8_t, uint8_t); 148 | void digitalWrite(uint8_t, uint8_t); 149 | int digitalRead(uint8_t); 150 | void analogWrite(uint8_t, uint8_t); 151 | #endif 152 | 153 | #if !defined(__AVR_ATtiny2313__) 154 | int analogRead(uint8_t); 155 | void analogReference(uint8_t mode); 156 | #endif 157 | 158 | unsigned long millis(void); 159 | unsigned long micros(void); 160 | void delay(unsigned long); 161 | void delayMicroseconds(unsigned int us); 162 | unsigned long pulseIn(uint8_t pin, uint8_t state, unsigned long timeout); 163 | 164 | void shiftOut(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder, byte val); 165 | 166 | void attachInterrupt(uint8_t, void (*)(void), int mode); 167 | void detachInterrupt(uint8_t); 168 | 169 | void setup(void); 170 | void loop(void); 171 | 172 | extern volatile unsigned char g_alert_flag; 173 | inline static void alert(void) __attribute__ ((always_inline)); 174 | inline static void alert(void) 175 | { 176 | g_alert_flag = 1; 177 | } 178 | inline static void clear_alert(void) __attribute__ ((always_inline)); 179 | inline static void clear_alert(void) 180 | { 181 | g_alert_flag = 0; 182 | } 183 | inline static unsigned char is_alert(void) __attribute__ ((always_inline)); 184 | inline static unsigned char is_alert(void) 185 | { 186 | return g_alert_flag; 187 | } 188 | inline static void nop(void) __attribute__ ((always_inline)); 189 | inline static void nop(void) 190 | { 191 | asm volatile("nop\n\t"); 192 | } 193 | 194 | void delay_alert(unsigned long ms); 195 | void sleep(unsigned long ms); 196 | 197 | #if !defined(__AVR_ATtiny2313__) //no adc for tiny2313 198 | 199 | inline static void enable_adc(void) __attribute__ ((always_inline)); 200 | inline static void enable_adc(void) 201 | { 202 | sbi(ADCSRA, ADEN); 203 | } 204 | 205 | inline static void disable_adc(void) __attribute__ ((always_inline)); 206 | inline static void disable_adc(void) 207 | { 208 | cbi(ADCSRA, ADEN); 209 | } 210 | 211 | #endif 212 | 213 | #include "wiring_lit.h" 214 | 215 | #define _ENABLE_INT(vector, mode) \ 216 | do{ \ 217 | EICRA = (EICRA & ~((1 << ISC##vector##0) | (1 << ISC##vector##1))) | (mode << ISC##vector##0); \ 218 | EIMSK |= (1 << INT##vector); \ 219 | }while(0) 220 | 221 | #define _DISABLE_INT(vector) \ 222 | EIMSK &= ~(1 << INT##vector) 223 | 224 | 225 | #define ENABLE_INT(vector, mode) EXPAND_WRAPPER(_ENABLE_INT,vector, mode) 226 | #define DISABLE_INT(vector) EXPAND_WRAPPER(_DISABLE_INT,vector) 227 | 228 | #ifdef __cplusplus 229 | } // extern "C" 230 | #endif 231 | 232 | #endif 233 | -------------------------------------------------------------------------------- /src/core/wiring_analog.c: -------------------------------------------------------------------------------- 1 | /* 2 | wiring_analog.c - analog input and output 3 | Part of Arduino - http://www.arduino.cc/ 4 | 5 | Copyright (c) 2005-2006 David A. Mellis 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General 18 | Public License along with this library; if not, write to the 19 | Free Software Foundation, Inc., 59 Temple Place, Suite 330, 20 | Boston, MA 02111-1307 USA 21 | 22 | $Id: wiring.c 248 2007-02-03 15:36:30Z mellis $ 23 | */ 24 | 25 | #if !defined(__AVR_ATtiny2313__) //no mapping table for tiny series, please use the MARCO version instead 26 | 27 | #include "wiring_private.h" 28 | #include "pins_arduino.h" 29 | 30 | uint8_t analog_reference = DEFAULT; 31 | 32 | void analogReference(uint8_t mode) 33 | { 34 | // can't actually set the register here because the default setting 35 | // will connect AVCC and the AREF pin, which would cause a short if 36 | // there's something connected to AREF. 37 | analog_reference = mode; 38 | } 39 | 40 | int analogRead(uint8_t pin) 41 | { 42 | uint8_t low, high; 43 | 44 | // set the analog reference (high two bits of ADMUX) and select the 45 | // channel (low 4 bits). this also sets ADLAR (left-adjust result) 46 | // to 0 (the default). 47 | #if defined(__AVR_ATtiny26__) 48 | ADMUX = (analog_reference << 6) | (pin & 0x07); 49 | #else 50 | ADMUX = (analog_reference << 6) | (pin & 0x0F); 51 | #endif 52 | 53 | #if defined(__AVR_ATmega1280__) 54 | // the MUX5 bit of ADCSRB selects whether we're reading from channels 55 | // 0 to 7 (MUX5 low) or 8 to 15 (MUX5 high). 56 | ADCSRB = (ADCSRB & ~(1 << MUX5)) | (((pin >> 3) & 0x01) << MUX5); 57 | #endif 58 | 59 | // without a delay, we seem to read from the wrong channel 60 | //delay(1); 61 | 62 | // start the conversion 63 | sbi(ADCSRA, ADSC); 64 | 65 | // ADSC is cleared when the conversion finishes 66 | while (bit_is_set(ADCSRA, ADSC)); 67 | // we have to read ADCL first; doing so locks both ADCL 68 | // and ADCH until ADCH is read. reading ADCL second would 69 | // cause the results of each conversion to be discarded, 70 | // as ADCL and ADCH would be locked when it completed. 71 | low = ADCL; 72 | high = ADCH; 73 | 74 | // combine the two bytes 75 | return (high << 8) | low; 76 | } 77 | 78 | #if !defined(__AVR_ATtiny26__) 79 | // Right now, PWM output only works on the pins with 80 | // hardware support. These are defined in the appropriate 81 | // pins_*.c file. For the rest of the pins, we default 82 | // to digital output. 83 | void analogWrite(uint8_t pin, uint8_t val) 84 | { 85 | // We need to make sure the PWM output is enabled for those pins 86 | // that support it, as we turn it off when digitally reading or 87 | // writing with them. Also, make sure the pin is in output mode 88 | // for consistenty with Wiring, which doesn't require a pinMode 89 | // call for the analog output pins. 90 | pinMode(pin, OUTPUT); 91 | 92 | if (digitalPinToTimer(pin) == TIMER1A) { 93 | // connect pwm to pin on timer 1, channel A 94 | sbi(TCCR1A, COM1A1); 95 | // set pwm duty 96 | OCR1A = val; 97 | } else if (digitalPinToTimer(pin) == TIMER1B) { 98 | // connect pwm to pin on timer 1, channel B 99 | sbi(TCCR1A, COM1B1); 100 | // set pwm duty 101 | OCR1B = val; 102 | #if defined(__AVR_ATmega8__) 103 | } else if (digitalPinToTimer(pin) == TIMER2) { 104 | // connect pwm to pin on timer 2, channel B 105 | sbi(TCCR2, COM21); 106 | // set pwm duty 107 | OCR2 = val; 108 | #else 109 | } else if (digitalPinToTimer(pin) == TIMER0A) { 110 | if (val == 0) { 111 | digitalWrite(pin, LOW); 112 | } else { 113 | // connect pwm to pin on timer 0, channel A 114 | sbi(TCCR0A, COM0A1); 115 | // set pwm duty 116 | OCR0A = val; 117 | } 118 | } else if (digitalPinToTimer(pin) == TIMER0B) { 119 | if (val == 0) { 120 | digitalWrite(pin, LOW); 121 | } else { 122 | // connect pwm to pin on timer 0, channel B 123 | sbi(TCCR0A, COM0B1); 124 | // set pwm duty 125 | OCR0B = val; 126 | } 127 | } else if (digitalPinToTimer(pin) == TIMER2A) { 128 | // connect pwm to pin on timer 2, channel A 129 | sbi(TCCR2A, COM2A1); 130 | // set pwm duty 131 | OCR2A = val; 132 | } else if (digitalPinToTimer(pin) == TIMER2B) { 133 | // connect pwm to pin on timer 2, channel B 134 | sbi(TCCR2A, COM2B1); 135 | // set pwm duty 136 | OCR2B = val; 137 | #endif 138 | #if defined(__AVR_ATmega1280__) 139 | // XXX: need to handle other timers here 140 | } else if (digitalPinToTimer(pin) == TIMER3A) { 141 | // connect pwm to pin on timer 3, channel A 142 | sbi(TCCR3A, COM3A1); 143 | // set pwm duty 144 | OCR3A = val; 145 | } else if (digitalPinToTimer(pin) == TIMER3B) { 146 | // connect pwm to pin on timer 3, channel B 147 | sbi(TCCR3A, COM3B1); 148 | // set pwm duty 149 | OCR3B = val; 150 | } else if (digitalPinToTimer(pin) == TIMER3C) { 151 | // connect pwm to pin on timer 3, channel C 152 | sbi(TCCR3A, COM3C1); 153 | // set pwm duty 154 | OCR3C = val; 155 | } else if (digitalPinToTimer(pin) == TIMER4A) { 156 | // connect pwm to pin on timer 4, channel A 157 | sbi(TCCR4A, COM4A1); 158 | // set pwm duty 159 | OCR4A = val; 160 | } else if (digitalPinToTimer(pin) == TIMER4B) { 161 | // connect pwm to pin on timer 4, channel B 162 | sbi(TCCR4A, COM4B1); 163 | // set pwm duty 164 | OCR4B = val; 165 | } else if (digitalPinToTimer(pin) == TIMER4C) { 166 | // connect pwm to pin on timer 4, channel C 167 | sbi(TCCR4A, COM4C1); 168 | // set pwm duty 169 | OCR4C = val; 170 | } else if (digitalPinToTimer(pin) == TIMER5A) { 171 | // connect pwm to pin on timer 5, channel A 172 | sbi(TCCR5A, COM5A1); 173 | // set pwm duty 174 | OCR5A = val; 175 | } else if (digitalPinToTimer(pin) == TIMER5B) { 176 | // connect pwm to pin on timer 5, channel B 177 | sbi(TCCR5A, COM5B1); 178 | // set pwm duty 179 | OCR5B = val; 180 | #endif 181 | } else if (val < 128) 182 | digitalWrite(pin, LOW); 183 | else 184 | digitalWrite(pin, HIGH); 185 | } 186 | 187 | #endif 188 | 189 | #endif 190 | -------------------------------------------------------------------------------- /src/core/wiring_digital.c: -------------------------------------------------------------------------------- 1 | /* 2 | wiring_digital.c - digital input and output functions 3 | Part of Arduino - http://www.arduino.cc/ 4 | 5 | Copyright (c) 2005-2006 David A. Mellis 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General 18 | Public License along with this library; if not, write to the 19 | Free Software Foundation, Inc., 59 Temple Place, Suite 330, 20 | Boston, MA 02111-1307 USA 21 | 22 | $Id: wiring.c 248 2007-02-03 15:36:30Z mellis $ 23 | */ 24 | #if !defined(__AVR_ATtiny2313__) && !defined(__AVR_ATtiny26__)//no mapping table for tiny series, please use the MARCO version instead 25 | 26 | #include "wiring_private.h" 27 | #include "pins_arduino.h" 28 | 29 | void pinMode(uint8_t pin, uint8_t mode) 30 | { 31 | uint8_t bit = digitalPinToBitMask(pin); 32 | uint8_t port = digitalPinToPort(pin); 33 | volatile uint8_t *reg; 34 | 35 | if (port == NOT_A_PIN) return; 36 | 37 | // JWS: can I let the optimizer do this? 38 | reg = portModeRegister(port); 39 | 40 | if (mode == INPUT) *reg &= ~bit; 41 | else *reg |= bit; 42 | } 43 | 44 | // Forcing this inline keeps the callers from having to push their own stuff 45 | // on the stack. It is a good performance win and only takes 1 more byte per 46 | // user than calling. (It will take more bytes on the 168.) 47 | // 48 | // But shouldn't this be moved into pinMode? Seems silly to check and do on 49 | // each digitalread or write. 50 | // 51 | static inline void turnOffPWM(uint8_t timer) __attribute__ ((always_inline)); 52 | static inline void turnOffPWM(uint8_t timer) 53 | { 54 | if (timer == TIMER1A) cbi(TCCR1A, COM1A1); 55 | if (timer == TIMER1B) cbi(TCCR1A, COM1B1); 56 | 57 | #if defined(__AVR_ATmega8__) 58 | if (timer == TIMER2) cbi(TCCR2, COM21); 59 | #else 60 | if (timer == TIMER0A) cbi(TCCR0A, COM0A1); 61 | if (timer == TIMER0B) cbi(TCCR0A, COM0B1); 62 | if (timer == TIMER2A) cbi(TCCR2A, COM2A1); 63 | if (timer == TIMER2B) cbi(TCCR2A, COM2B1); 64 | #endif 65 | 66 | #if defined(__AVR_ATmega1280__) 67 | if (timer == TIMER3A) cbi(TCCR3A, COM3A1); 68 | if (timer == TIMER3B) cbi(TCCR3A, COM3B1); 69 | if (timer == TIMER3C) cbi(TCCR3A, COM3C1); 70 | if (timer == TIMER4A) cbi(TCCR4A, COM4A1); 71 | if (timer == TIMER4B) cbi(TCCR4A, COM4B1); 72 | if (timer == TIMER4C) cbi(TCCR4A, COM4C1); 73 | if (timer == TIMER5A) cbi(TCCR5A, COM5A1); 74 | if (timer == TIMER5B) cbi(TCCR5A, COM5B1); 75 | if (timer == TIMER5C) cbi(TCCR5A, COM5C1); 76 | #endif 77 | } 78 | 79 | void digitalWrite(uint8_t pin, uint8_t val) 80 | { 81 | uint8_t timer = digitalPinToTimer(pin); 82 | uint8_t bit = digitalPinToBitMask(pin); 83 | uint8_t port = digitalPinToPort(pin); 84 | volatile uint8_t *out; 85 | 86 | if (port == NOT_A_PIN) return; 87 | 88 | // If the pin that support PWM output, we need to turn it off 89 | // before doing a digital write. 90 | if (timer != NOT_ON_TIMER) turnOffPWM(timer); 91 | 92 | out = portOutputRegister(port); 93 | 94 | if (val == LOW) *out &= ~bit; 95 | else *out |= bit; 96 | } 97 | 98 | int digitalRead(uint8_t pin) 99 | { 100 | uint8_t timer = digitalPinToTimer(pin); 101 | uint8_t bit = digitalPinToBitMask(pin); 102 | uint8_t port = digitalPinToPort(pin); 103 | 104 | if (port == NOT_A_PIN) return LOW; 105 | 106 | // If the pin that support PWM output, we need to turn it off 107 | // before getting a digital reading. 108 | if (timer != NOT_ON_TIMER) turnOffPWM(timer); 109 | 110 | if (*portInputRegister(port) & bit) return HIGH; 111 | return LOW; 112 | } 113 | 114 | #endif 115 | -------------------------------------------------------------------------------- /src/core/wiring_lit.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ArduinoLite 3 | * A lightweight runtime system for AVR chips 4 | * by Shikai Chen (csk@live.com, http://www.csksoft.net) 5 | * 6 | * wiring_lit.h - a very fast wiring lib implemention 7 | * 8 | * 9 | * ArduinoLite is based on the work of Arduino Project (arduino.cc) 10 | * 11 | * Support AVR Chips 12 | * Atmega8 13 | * Atmegax8 series: Atmega48 Atmega88 Atmega168 ... 14 | * Attiny2313 15 | * Attiny26 16 | * Atmega1280 (not vaildated yet) 17 | */ 18 | 19 | #include "pins_arduino.h" 20 | #include "pins_arduino_lit.h" 21 | #ifndef _WIRING_LIT_H 22 | #define _WIRING_LIT_H 23 | 24 | #define MERGE_TO_FUNC(prefix, id) prefix##_##id 25 | #define EXPAND_WRAPPER( NEXTLEVEL, ...) NEXTLEVEL( __VA_ARGS__ ) 26 | 27 | 28 | 29 | #define _PWM_SET(id, val) \ 30 | do{ \ 31 | OCR##id = val; \ 32 | } \ 33 | while(0) 34 | 35 | #define _PWM_ENABLE(TCCR, id) sbi(TCCR, COM##id##1) 36 | #define _PWM_DISABLE(TCCR, id) cbi(TCCR, COM##id##1) 37 | 38 | #define _SET_OUTPUT(port_id, msk) PORTID_TO_DIR_REG(port_id) |= (msk) 39 | #define _SET_INTPUT(port_id, msk) PORTID_TO_DIR_REG(port_id) &= ~(msk) 40 | 41 | #define _D_WRITE_HIGH(port_id, msk) PORTID_TO_OUTPUT_REG(port_id) |= (msk) 42 | #define _D_WRITE_LOW(port_id, msk) PORTID_TO_OUTPUT_REG(port_id) &= ~(msk) 43 | 44 | #define _D_READ(port_id, msk) ((PORTID_TO_INPUT_REG(port_id)) & (msk)) 45 | /* 46 | * 47 | * NOTICE: for pins at timer0A/0B, 48 | * if the duty cycle to be set equals to zero, using the following code: 49 | * DIGITAL_WRITE(pin, LOW); 50 | * -- or -- 51 | * digitalWrite(pin, LOW); 52 | * The caller should make sure the current pin has been set to OUTPUT mode first 53 | */ 54 | 55 | #define SET_1(pin) SET_OUTPUT(pin) 56 | #define SET_0(pin) SET_INPUT(pin) 57 | 58 | #define SET_0x1(pin) SET_OUTPUT(pin) 59 | #define SET_0x0(pin) SET_INPUT(pin) 60 | 61 | #define D_WRITE_HIGH(pin) EXPAND_WRAPPER(_D_WRITE_HIGH, ARDUINOPIN_TO_PORTID(pin), ARDUINOPIN_TO_PORTMSK(pin) ) 62 | #define D_WRITE_LOW(pin) EXPAND_WRAPPER(_D_WRITE_LOW, ARDUINOPIN_TO_PORTID(pin), ARDUINOPIN_TO_PORTMSK(pin) ) 63 | 64 | #define D_WRITE_1(pin) D_WRITE_HIGH(pin) 65 | #define D_WRITE_0(pin) D_WRITE_LOW(pin) 66 | 67 | #define D_WRITE_0x1(pin) D_WRITE_HIGH(pin) 68 | #define D_WRITE_0x0(pin) D_WRITE_LOW(pin) 69 | 70 | 71 | #define PWM_ENABLE(pin) EXPAND_WRAPPER(_PWM_ENABLE ,ARDUINOPIN_TO_TCCRID(pin) , ARDUINOPIN_TO_TIMERID(pin) ) 72 | #define PWM_DISABLE(pin) EXPAND_WRAPPER(_PWM_DISABLE ,ARDUINOPIN_TO_TCCRID(pin) , ARDUINOPIN_TO_TIMERID(pin) ) 73 | #define PWM_SET(pin, val) EXPAND_WRAPPER(_PWM_SET, ARDUINOPIN_TO_TIMERID(pin), val ) 74 | 75 | #define SET_OUTPUT(pin) EXPAND_WRAPPER(_SET_OUTPUT, ARDUINOPIN_TO_PORTID(pin), ARDUINOPIN_TO_PORTMSK(pin) ) 76 | #define SET_INPUT(pin) EXPAND_WRAPPER(_SET_INTPUT, ARDUINOPIN_TO_PORTID(pin), ARDUINOPIN_TO_PORTMSK(pin) ) 77 | 78 | #define DIGITAL_READ(pin) EXPAND_WRAPPER(_D_READ, ARDUINOPIN_TO_PORTID(pin), ARDUINOPIN_TO_PORTMSK(pin) ) 79 | #define DIGITAL_WRITE(pin, val) D_WRITE_##val(pin) 80 | #define PIN_MODE(pin, mode) SET_##mode(pin) 81 | #define ANALOG_WRITE( pin, val ) \ 82 | do{ \ 83 | PWM_ENABLE(pin); \ 84 | PWM_SET(pin,val); \ 85 | } \ 86 | while(0) 87 | 88 | #define PWM_SET_SAFE(pin, val) \ 89 | do{ \ 90 | if (val) {PIN_MODE(pin,OUTPUT);PWM_SET(pin, val);} \ 91 | else PIN_MODE(pin, INPUT); \ 92 | }while(0) 93 | 94 | #endif 95 | -------------------------------------------------------------------------------- /src/core/wiring_private.h: -------------------------------------------------------------------------------- 1 | /* 2 | wiring_private.h - Internal header file. 3 | Part of Arduino - http://www.arduino.cc/ 4 | 5 | Copyright (c) 2005-2006 David A. Mellis 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General 18 | Public License along with this library; if not, write to the 19 | Free Software Foundation, Inc., 59 Temple Place, Suite 330, 20 | Boston, MA 02111-1307 USA 21 | 22 | $Id: wiring.h 239 2007-01-12 17:58:39Z mellis $ 23 | */ 24 | 25 | #ifndef WiringPrivate_h 26 | #define WiringPrivate_h 27 | 28 | #include 29 | #include 30 | #include //keep the deprecated lib for back compatiblity 31 | #include 32 | #include 33 | 34 | #include "wiring.h" 35 | 36 | #ifdef __cplusplus 37 | extern "C"{ 38 | #endif 39 | 40 | 41 | #define EXTERNAL_INT_0 0 42 | #define EXTERNAL_INT_1 1 43 | #define EXTERNAL_INT_2 2 44 | #define EXTERNAL_INT_3 3 45 | #define EXTERNAL_INT_4 4 46 | #define EXTERNAL_INT_5 5 47 | #define EXTERNAL_INT_6 6 48 | #define EXTERNAL_INT_7 7 49 | 50 | #if defined(__AVR_ATmega1280__) 51 | #define EXTERNAL_NUM_INTERRUPTS 8 52 | #else 53 | #if defined(__AVR_ATtiny26__) 54 | #define EXTERNAL_NUM_INTERRUPTS 1 55 | #else 56 | #define EXTERNAL_NUM_INTERRUPTS 2 57 | #endif 58 | #endif 59 | 60 | typedef void (*voidFuncPtr)(void); 61 | 62 | #ifdef __cplusplus 63 | } // extern "C" 64 | #endif 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /src/core/wiring_pulse.c: -------------------------------------------------------------------------------- 1 | /* 2 | wiring_pulse.c - pulseIn() function 3 | Part of Arduino - http://www.arduino.cc/ 4 | 5 | Copyright (c) 2005-2006 David A. Mellis 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General 18 | Public License along with this library; if not, write to the 19 | Free Software Foundation, Inc., 59 Temple Place, Suite 330, 20 | Boston, MA 02111-1307 USA 21 | 22 | $Id: wiring.c 248 2007-02-03 15:36:30Z mellis $ 23 | */ 24 | 25 | #if !defined(__AVR_ATtiny2313__) && !defined(__AVR_ATtiny26__)//no mapping table for tiny series, please use the MARCO version instead 26 | #include "wiring_private.h" 27 | #include "pins_arduino.h" 28 | 29 | /* Measures the length (in microseconds) of a pulse on the pin; state is HIGH 30 | * or LOW, the type of pulse to measure. Works on pulses from 2-3 microseconds 31 | * to 3 minutes in length, but must be called at least a few dozen microseconds 32 | * before the start of the pulse. */ 33 | unsigned long pulseIn(uint8_t pin, uint8_t state, unsigned long timeout) 34 | { 35 | // cache the port and bit of the pin in order to speed up the 36 | // pulse width measuring loop and achieve finer resolution. calling 37 | // digitalRead() instead yields much coarser resolution. 38 | uint8_t bit = digitalPinToBitMask(pin); 39 | uint8_t port = digitalPinToPort(pin); 40 | uint8_t stateMask = (state ? bit : 0); 41 | unsigned long width = 0; // keep initialization out of time critical area 42 | 43 | // convert the timeout from microseconds to a number of times through 44 | // the initial loop; it takes 16 clock cycles per iteration. 45 | unsigned long numloops = 0; 46 | unsigned long maxloops = microsecondsToClockCycles(timeout) / 16; 47 | 48 | // wait for any previous pulse to end 49 | while ((*portInputRegister(port) & bit) == stateMask) 50 | if (numloops++ == maxloops) 51 | return 0; 52 | 53 | // wait for the pulse to start 54 | while ((*portInputRegister(port) & bit) != stateMask) 55 | if (numloops++ == maxloops) 56 | return 0; 57 | 58 | // wait for the pulse to stop 59 | while ((*portInputRegister(port) & bit) == stateMask) 60 | width++; 61 | 62 | // convert the reading to microseconds. The loop has been determined 63 | // to be 10 clock cycles long and have about 16 clocks between the edge 64 | // and the start of the loop. There will be some error introduced by 65 | // the interrupt handlers. 66 | return clockCyclesToMicroseconds(width * 10 + 16); 67 | } 68 | 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /src/core/wiring_shift.c: -------------------------------------------------------------------------------- 1 | /* 2 | wiring_shift.c - shiftOut() function 3 | Part of Arduino - http://www.arduino.cc/ 4 | 5 | Copyright (c) 2005-2006 David A. Mellis 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General 18 | Public License along with this library; if not, write to the 19 | Free Software Foundation, Inc., 59 Temple Place, Suite 330, 20 | Boston, MA 02111-1307 USA 21 | 22 | $Id: wiring.c 248 2007-02-03 15:36:30Z mellis $ 23 | */ 24 | 25 | #if !defined(__AVR_ATtiny2313__) && !defined(__AVR_ATtiny26__)//no mapping table for tiny series, please use the MARCO version instead 26 | #include "wiring_private.h" 27 | 28 | void shiftOut(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder, byte val) 29 | { 30 | int i; 31 | 32 | for (i = 0; i < 8; i++) { 33 | if (bitOrder == LSBFIRST) 34 | digitalWrite(dataPin, !!(val & (1 << i))); 35 | else 36 | digitalWrite(dataPin, !!(val & (1 << (7 - i)))); 37 | 38 | digitalWrite(clockPin, HIGH); 39 | digitalWrite(clockPin, LOW); 40 | } 41 | } 42 | #endif 43 | --------------------------------------------------------------------------------