/Modules/AVR/AVRUSB01A/SW/fw_usbasp/!____!.txt
0,0 → 1,30
USBasp firmware customized for MLAB hardware AVRUSB01
http://www.mlab.cz/PermaLink/AVRUSB01
-----------------------------------------------------
 
- original firmare from http://www.fischl.de/usbasp/usbasp.2011-05-28.tar.gz
- the original package contains drivers as well, please use them
 
- hardware supports Green LED (always on)
- hardware supports Red LED (busy indicator)
- hardware supports jumper for slowing down SPI clocks (just install jumper on J6 to position RX-GND)
 
- the code itself has to be modifyied so that it vas possible to reconfigure IO pins for
different hardware (minor changes in main function and in header file)
- make process was automated so that "make all" creates all configuraed target binaries
(for ATmega8 and ATmega88)
 
- binary files for MLAB hardware is in bin directory
 
- hardware configuration is this:
 
XTAL 12.0MHz
USB D+ PD2/INT0
USB D- PD4
ISP_RES# PB2
ISP_MOSI PB3
ISP_MISO PB4
ISP_SCK PB5
GreenLED PC1 (active L)
RedLedLED PC0 (active L)
Slow SPI CLK PD0 (to GND)
/Modules/AVR/AVRUSB01A/SW/fw_usbasp/Makefile
2,16 → 2,38
# Makefile for usbasp
# 20061119 Thomas Fischl original
# 20061120 Hanns-Konrad Unger help: and TARGET=atmega48 added
#
# 20140209 Milan Horkel added automatic built for more targets
 
# TARGET=atmega8 HFUSE=0xc9 LFUSE=0xef
# TARGET=atmega48 HFUSE=0xdd LFUSE=0xff
# TARGET=at90s2313
TARGET=atmega8
HFUSE=0xc9
LFUSE=0xef
ALL_TARGETS=atmega8 atmega88
 
# Default target
# --------------
 
ifndef $(TARGET)
TARGET=atmega88
endif
 
 
# Define target dependent constants
# ---------------------------------
 
ifeq ($(TARGET), atmega88)
HFUSE=0xc9
LFUSE=0xef
endif
 
ifeq ($(TARGET), atmega8)
HFUSE=0xc9
LFUSE=0xef
endif
 
ifeq ($(TARGET), atmega8)
HFUSE=0xdd
LFUSE=0xff
endif
 
 
 
# ISP=bsd PORT=/dev/parport0
# ISP=ponyser PORT=/dev/ttyS1
# ISP=stk500 PORT=/dev/ttyS1
23,11 → 45,12
help:
@echo "Usage: make same as make help"
@echo " make help same as make"
@echo " make main.hex create main.hex"
@echo " make all build HEX for all target CPUs"
@echo " make hex create HEX for default target CPU"
@echo " make clean remove redundant data"
@echo " make disasm disasm main"
@echo " make flash upload main.hex into flash"
@echo " make fuses program fuses"
@echo " make disasm create listing"
@echo " make flash upload HEX into flash (for default target CPU)"
@echo " make fuses program fuses (for default target CPU)"
@echo " make avrdude test avrdude"
@echo "Current values:"
@echo " TARGET=${TARGET}"
55,28 → 78,33
.c.s:
$(COMPILE) -S $< -o $@
 
clean:
rm -f main.hex main.lst main.obj main.cof main.list main.map main.eep.hex main.bin *.o main.s usbdrv/*.o
cleantmp:
rm -f usbasp.lst usbasp.obj usbasp.cof usbasp.list usbasp.map usbasp.bin *.o main.s usbdrv/*.o
 
clean: cleantmp
rm -f usbasp_$(TARGET).hex usbasp_$(TARGET).eep.hex
 
# file targets:
main.bin: $(OBJECTS)
$(COMPILE) -o main.bin $(OBJECTS) -Wl,-Map,main.map
usbasp.bin: $(OBJECTS)
$(COMPILE) -o usbasp.bin $(OBJECTS) -Wl,-Map,usbasp.map
 
main.hex: main.bin
rm -f main.hex main.eep.hex
avr-objcopy -j .text -j .data -O ihex main.bin main.hex
# ./checksize main.bin
usbasp.hex: usbasp_$(TARGET).hex
 
usbasp_$(TARGET).hex: usbasp.bin
rm -f usbasp_$(TARGET).hex usbasp_$(TARGET).eep.hex
avr-objcopy -j .text -j .data -O ihex usbasp.bin $@
# ./checksize usbasp.bin
# do the checksize script as our last action to allow successful compilation
# on Windows with WinAVR where the Unix commands will fail.
 
disasm: main.bin
avr-objdump -d main.bin
disasm: usbasp.bin
avr-objdump -d usbasp.bin
 
cpp:
$(COMPILE) -E main.c
 
flash:
avrdude -c ${ISP} -p ${TARGET} -P ${PORT} -U flash:w:main.hex
avrdude -c ${ISP} -p ${TARGET} -P ${PORT} -U flash:w:usbasp.hex
 
fuses:
avrdude -c ${ISP} -p ${TARGET} -P ${PORT} -u -U hfuse:w:$(HFUSE):m -U lfuse:w:$(LFUSE):m
131,5 → 159,17
 
uisp: all
$(UISP) --erase
$(UISP) --upload --verify if=main.hex
$(UISP) --upload --verify if=usbasp_$(TARGET).hex
 
# Execute these steps for each target CPU
# Do not remove empty line in this definition!
define EXEC
rm -f usbasp_$(1).hex
make TARGET=$(1) cleantmp
make TARGET=$(1) usbasp_$(1).hex
 
endef
 
ALL:
@$(foreach III,$(ALL_TARGETS),$(call EXEC,$(III)))
@make cleantmp
/Modules/AVR/AVRUSB01A/SW/fw_usbasp/bin/usbasp_atmega8.hex
0,0 → 1,297
:100000003BC0A6C154C053C052C051C050C04FC025
:100010004EC04DC04CC04BC04AC049C048C047C08C
:1000200046C045C044C0040309041C0377007700A0
:1000300077002E00660069007300630068006C00A2
:100040002E00640065000E0355005300420061005D
:100050007300700012011001FF000008C016DC05DB
:1000600004010102000109021200010100801909C6
:10007000040000000000000011241FBECFE5D4E002
:10008000DEBFCDBF10E0A0E6B0E0E8E6F2E102C0DE
:1000900005900D92A236B107D9F710E0A2E6B0E0C4
:1000A00001C01D92AA3AB107E1F766D5DBC8A8CF17
:1000B00085B7826085BF8BB780648BBF08951F931F
:1000C000CF93DF9360918800635067FD13C08091E8
:1000D0008500CCE0D0E0C81BD109C457DF4F809128
:1000E00084008D3209F462C08091620087FD84C073
:1000F000109288008091600084FF4AC06091610086
:100100006F3F09F445C0693070F168506093610039
:100110008091780098E889278093780068E0809142
:10012000620087FD8BC0209186003091870086FF9A
:100130006DC0A9E7B0E080E090E0F901E80FF91F99
:10014000E491ED9301966817C1F76150862F90E016
:100150006F5F0196820F931F9093870080938600B4
:10016000162F1C5F0BC0109261008091780098E8F8
:10017000892780937800662391F614E089E790E060
:10018000E3D01C3019F08FEF809361001093600072
:1001900094E180B3847131F49150D9F710928900C1
:1001A00010928300DF91CF911F910895683009F07C
:1001B0009FCF83EC809378008AE580936000109253
:1001C00062008881807659F59A8110928100898138
:1001D000882309F043C01092820022E081E890E079
:1001E00090938700809386008F81882319F49E81E5
:1001F000921708F1922F1FC0CE01D6D48F3F51F134
:10020000882309F475CF1092610072CF962FD9011F
:10021000E9E7F0E08D9181939150E1F796CFCE011F
:100220000BD6282F8F3F01F7888187FD25C09FEFD0
:1002300080E880936200909361005ACF89E790E054
:1002400089D5682F893008F453C08FEF80936100FF
:100250001EE19CCF8EE1809360004ACF853071F023
:10026000863091F0883031F1893061F18A3031F196
:1002700020E081E890E0B4CF9E81DACF90938900AE
:1002800020E081E890E0ACCF8B81813049F1823071
:10029000F9F0833029F020E080E480936200A4CF5D
:1002A000992349F586E290E0909387008093860039
:1002B00024E0F2CF21E08BE890E092CF21E081E8CA
:1002C00090E08ECF90938B0020E081E890E088CF83
:1002D00086E690E0909387008093860022E1DCCF51
:1002E00084E590E0909387008093860022E1D4CF4C
:1002F000182F1C5F43CF913051F0923061F686E4A5
:1003000090E090938700809386002EE0C5CF8AE22C
:1003100090E090938700809386002CE1BDCFA82FBA
:10032000B92F80E090E041E050EA609530E009C0EC
:100330002D9182279795879510F084279527305E19
:10034000C8F36F5FA8F30895EADF8D939D93089536
:10035000CF93CFB7CF93C395849BE9F7849B09C014
:10036000849B07C0849B05C0849B03C0849B01C001
:10037000A1C0DF93C0918500DD27C457DF4F849B68
:1003800002C0DF91EBCF2F930F931F9300B32FEF9A
:1003900004FB20F94F933F9310B34FEF012704FB69
:1003A00021F93BE031C04E7F012F10B3216028C0FE
:1003B000102F4D7F2260000000B329C04B7F2460C6
:1003C000012F000010B32BC010B3477F28602AC054
:1003D0004F7E00B320612CC04F7D10B320622FC030
:1003E0004F7B00B3206432C0422700B349934FEFE4
:1003F0000000102714FB20F910B31471C9F1297FF4
:1004000091F2012704FB21F900B3237F89F23150D7
:1004100058F1102714FB22F910B3277E79F2012737
:1004200004FB23F92F7C81F200B3102714FB24F97D
:100430002F7971F200C010B3012704FB25F92F7347
:1004400059F200C000B3102714FB26F9223040F205
:1004500000C010B3012704FB27F9243028F64F779A
:10046000206810B30000F9CF10E41ABF002717C0AE
:100470003B503195C31BD04010E41ABF0881033CA8
:10048000E9F00B34D9F0209183001981110F121378
:10049000EDCF093641F10D3211F0013E39F70093ED
:1004A0008A003F914F911F910F912F91DF91CAB711
:1004B000C6FD51CFCF91CFBFCF91189520918A0023
:1004C000222379F310918800112311F5343012F1B1
:1004D0003093880020938400109185003BE0311B0D
:1004E0003093850017C00091880001308CF40AE534
:1004F0003091600034FD10C000936000C8E7D0E088
:100500000FC02795A8F45150A9F4220F0000F9CF8D
:100510004AE503C042ED01C0432FC4E1D0E032E020
:1005200011B31461949A11BB02B320E414E15F93F8
:10053000012756E002BB279520F4515021F4220FE9
:10054000F9CF012756E000003B5A02BBD0F22795B5
:1005500028F4515029F4220F0000F9CF012756E06A
:10056000279502BB20F4515021F4220FF9CF012727
:1005700056E02991332302BB21F60B7E10918900AE
:10058000110FC651D04002BB11F01093830010E44C
:100590001ABF006111B31B7E402F4B7E5F9100C0DC
:1005A00000C002BB11BB42BB7CCF8091A5008DB9BE
:1005B0008091A2008EB90895282F8823A1F0883059
:1005C00008F042C08EE793E09093A4008093A300CC
:1005D000243019F12530B8F0263099F1263068F131
:1005E0002730F9F008958FE993E09093A400809369
:1005F000A30081E08093A70082E58093A50081E0BD
:100600008093A20008952230A1F0233070F42130AD
:1006100049F780EC8093A700089588E18093A700B4
:10062000089583E08093A700089580E38093A70056
:10063000089580E68093A70008958CE08093A7003A
:1006400008952093A70008958FE993E09093A40064
:100650008093A3001092A20081E08093A70029302C
:1006600041F02A3050F4283039F683E58093A50014
:10067000089582E58093A50008952B3029F02C3051
:1006800009F0BACF8093A20081E58093A500089578
:1006900022B79091A70082B7821B8917E0F30895D3
:1006A00087B38C6287BBC298C59892B72091A70088
:1006B00082B7891B8217E0F3C29A92B782B7891B6F
:1006C0008217E0F3C2988091A3009091A4008F5903
:1006D000934019F01092A60008958091A5008DB95D
:1006E0008091A2008EB91092A600089587B3837DF1
:1006F00087BB88B3837D88BB1DB80895582F209190
:10070000A70040E030E057FD16C0C398440FB499ED
:100710004F5FC59A92B782B7891B8217E0F3C598DD
:1007200092B782B7891B8217E0F33F5F383029F018
:10073000550F57FFEACFC39AE9CF842F08958FB999
:10074000779BFECF8FB108950F931F930FE1E09138
:10075000A300F091A4008CEA0995E091A300F09128
:10076000A40083E50995E091A300F091A40080E046
:100770000995182FE091A300F091A40080E009955D
:10078000133561F11DB822B79091A70082B7821B83
:100790008917E0F3C29A22B782B7821B8917E0F368
:1007A000C29822B782B7821B8917E0F3E091A300B9
:1007B000F091A40083E0EF39F80721F0002351F015
:1007C0000150C9CF8091A5008DB98091A2008EB94A
:1007D0000023B1F781E01F910F91089580E01F91F0
:1007E0000F9108959B01AC0181E15695479537958E
:1007F00027958A95D1F78091A6008217D9F020938A
:10080000A600E091A300F091A4008DE40995E09189
:10081000A300F091A40080E00995E091A300F0917D
:10082000A4008091A6000995E091A300F091A40096
:1008300080E009950895EF92FF920F931F937B013B
:100840008C01D0DF8E2D8170880F880F880FE0918A
:10085000A300F091A40080620995D801C70129E0A6
:10086000B695A795979587952A95D1F7E091A3001E
:10087000F091A400099516950795F794E794E091F7
:10088000A300F091A4008E2D0995E091A300F091B2
:10089000A40080E009951F910F91FF90EF900895BB
:1008A0000F931F938C01E091A300F091A40080EAC4
:1008B0000995E091A300F091A400812F0995E091A2
:1008C000A300F091A400802F0995E091A300F0917E
:1008D000A40080E009951F910F910895FF920F9356
:1008E0001F938C01F62EE091A300F091A40080EC00
:1008F0000995E091A300F091A400812F0995E09162
:10090000A300F091A400802F0995E091A300F0913D
:10091000A4008F2D09958EE1B9D080E01F910F9131
:10092000FF900895CF92DF92EF92FF920F931F9363
:100930006B017C01142F56DFE091A300F091A4001D
:100940008CE40995D701C60149E0B695A79597951E
:1009500087954A95D1F7E091A300F091A4000995FD
:10096000D701C601B695A79597958795E091A30005
:10097000F091A4000995E091A300F091A40080E01B
:1009800009951F3FF1F012B70EE1C701B60153DF21
:100990008F3F79F482B7811B8D33B8F312B70150C2
:1009A000A1F781E01F910F91FF90EF90DF90CF9022
:1009B000089580E01F910F91FF90EF90DF90CF900E
:1009C00008958FE063D080E01F910F91FF90EF902A
:1009D000DF90CF900895CF92DF92EF92FF920F9326
:1009E0001F936B017C01042F122FFCDE8C2D817074
:1009F000880F880F880FE091A300F091A400806415
:100A00000995D701C60169E0B695A7959795879591
:100A10006A95D1F7E091A300F091A4000995D70160
:100A2000C601B695A79597958795E091A300F0919B
:100A3000A4000995E091A300F091A400802F0995EE
:100A40001123C1F00F37F1F012B70EE1C701B60163
:100A5000F2DE8F3779F482B7811B8D33B8F312B78A
:100A60000150A1F781E01F910F91FF90EF90DF906F
:100A7000CF90089580E01F910F91FF90EF90DF904D
:100A8000CF9008958FE002D080E0F5CF382F8823F3
:100A900049F020E092B782B7891B8C33E0F32F5FD7
:100AA0002317C0F30895BD9ABB98C39A50E217D09C
:100AB0005A95E9F70895AC0188E605D0842F03D054
:100AC00089E601D0852F0FD028E030E0382780FB61
:100AD000869506D02A95D1F730FB02D000D06894D5
:100AE000BB98C39A16F0C398BB9AE091A800F09106
:100AF000A9003197F0F7C59AE6B3E3FBE091A800AF
:100B0000F091A9003197F0F7C598089520ECE7DF40
:100B100046F42A95E1F780E02AE1E5DF2A95E9F736
:100B2000DECF28E030E0DBDF869587F938272A958D
:100B3000D1F7D5DF27F9322772F3D1DFD0CFDB0130
:100B4000742FB9DF84E2BFDFE1DF8D937A95D1F7AF
:100B50000895DB01742FAFDF83EFB5DF8DE1B3DFE5
:100B600084E6B1DF8D91AFDF82E7ADDFCFDF807844
:100B7000D9F77A9589F7089593E098BB8CE385BB04
:100B80008AEE82BBA09AA19AA998A89A8898909A6E
:100B900081B3846181BB81B38B7E81BB93BF88DAD3
:100BA00078948DDA8CDAFDCFFF920F931F93CF9359
:100BB000DF93082F792FF62E40916300413069F0C2
:100BC000443059F0463009F492C01FEF812FDF9175
:100BD000CF911F910F91FF900895FF2009F4B2C0AB
:100BE000802F972F9C01E90110E053C08091740081
:100BF00090917500892B09F058C060917000709138
:100C000071008091720090917300488121E0E3DED1
:100C100080916400909165000197909365008093A6
:100C20006400892BD9F4109263008091760081FFD3
:100C30003AC08091770090E0209174003091750067
:100C40008217930781F1609170007091710080911B
:100C5000720090917300488165DE11E08091700010
:100C600090917100A0917200B09173000196A11D46
:100C7000B11D8093700090937100A0937200B093A7
:100C8000730021969E01201B2F1508F09FCF4091E5
:100C90006300413009F4AACF8091700090917100F7
:100CA00068811CDEB5CF11E0D9CF609170007091E2
:100CB00071008091720090917300488120E08BDE7A
:100CC00080917700815080937700882309F0A0CF2E
:100CD000609170007091710080917200909173002A
:100CE000488120DE809174008093770091CF8091BD
:100CF000700090917100602F4F2D2BDF809170005C
:100D000090917100A0917200B09173008F0D911DB0
:100D1000A11DB11D8093700090937100A09372008B
:100D2000B093730080916400909165008F199109D0
:100D30009093650080936400892B21F410926300E6
:100D400011E044CF10E0812FDF91CF911F910F91DF
:100D5000FF9008950F931F93CF93DF93082F792F60
:100D6000162F40916300842F8250823050F045301E
:100D700009F446C01FEF812FDF91CF911F910F9192
:100D800008954530E9F1662399F1802F9C01E9012E
:100D900020C0809170009091710082DD88838091E5
:100DA000700090917100A0917200B0917300019653
:100DB000A11DB11D8093700090937100A0937200EB
:100DC000B093730021969E01201B211778F4409167
:100DD00063004230F1F66091700070917100809173
:100DE00072009091730027DD8883D9CF183018F6F0
:100DF00010926300812FDF91CF911F910F91089581
:100E00008091700090917100602F412F98DE809149
:100E1000700090917100A0917200B0917300810FE9
:100E2000911DA11DB11D8093700090937100A0933E
:100E30007200B09373009FCF0F931F93CF93DF93F4
:100E40008C01DC0111968C91813009F44EC0823006
:100E500009F4E7C0833009F455C0843009F4B5C003
:100E6000873009F486C0853009F45AC1863009F408
:100E700010C1883009F4DBC0893009F458C18A30C8
:100E800009F469C18B3009F49CC18C3009F4B7C1F5
:100E90008D3009F4CBC18E3009F4CFC18F3009F009
:100EA00065C1F801938180E0228130E0822B932B91
:100EB000AA2797FDA095BA2F809370009093710098
:100EC000A0937200B0937300978180E0268130E098
:100ED000822B932B909365008093640085E0809330
:100EE00063008FEFC8E6D0E038C0809B3FC08091A0
:100EF000660062DB10926700A898D2DB80E0C8E64B
:100F0000D0E02BC0E091A300F091A400D80112968C
:100F10008C910995C8E6D0E080936800E091A30029
:100F2000F091A400D80113968C91099580936900E3
:100F3000E091A300F091A400D80114968C9109953A
:100F400080936A00E091A300F091A400D801159667
:100F50008C91099580936B0084E0D0938700C093B7
:100F60008600DF91CF911F910F91089585E024DBDA
:100F7000C1CF80916700882399F4F801938180E0C4
:100F8000228130E0822B932BAA2797FDA095BA2FC0
:100F90008093700090937100A0937200B0937300DF
:100FA000D80117969C91179780E016962C9130E007
:100FB000822B932B909365008093640083E0809351
:100FC00063008FEFC8E6D0E0C8CF80916700882328
:100FD00099F4F801938180E0228130E0822B932BF9
:100FE000AA2797FDA095BA2F809370009093710067
:100FF000A0937200B0937300D80117969C91179735
:1010000080E016962C9130E0822B932B9093650014
:101010008093640082E0809363008FEFC8E6D0E0A5
:101020009CCF64DBA89A80E0C8E6D0E096CF8091A0
:1010300067008823B1F4D80113969C91139780E040
:1010400012962C9130E0822B932BAA2797FDA09526
:10105000BA2F8093700090937100A0937200B093A8
:101060007300109275001092740010927600F801CF
:10107000978180E0268130E0822B932B909365004E
:101080008093640084E0809363008FEFC8E6D0E033
:1010900064CF80916700882399F4F801938180E000
:1010A000228130E0822B932BAA2797FDA095BA2F9F
:1010B0008093700090937100A0937200B0937300BE
:1010C000D80114968C91149715969C91292F2F7006
:1010D00020937600492F50E0407F50704295529502
:1010E000507F5427407F5427480F511D509375005F
:1010F0004093740020FF02C040937700F80197816D
:1011000080E0268130E0822B932B909365008093C2
:10111000640081E0809363008FEFC8E6D0E01DCFCC
:1011200013DBC8E6D0E08093680081E016CF81E051
:1011300080936700F80182819381A481B5818093B7
:10114000700090937100A0937200B093730080E0E0
:10115000C8E6D0E002CFD80112968C918093660049
:10116000C8E6D0E01092680081E0F7CE803109F047
:1011700040C0D80113969C91139780E012962C9151
:1011800030E0822B932BAA2797FDA095BA2F80934E
:10119000700090937100A0937200B0937300F801F7
:1011A000978180E0268130E0822B932B909365001D
:1011B0008093640086E0809363008FEFC8E6D0E000
:1011C000CCCEF801938180E0228130E0822B932BFA
:1011D0009093A9008093A800C29ABA9A83E056DC43
:1011E000C298A89880E152DC5EDC80E0C8E6D0E0DE
:1011F000B4CE8F3751F180E0C8E6D0E0AECE80ECBF
:1012000062DC80E060DC8AE041DCC29A85E03EDCA2
:10121000C29885E03BDC87B3837D87BB88B3837D41
:1012200088BBA89A80E0C8E6D0E097CE6FDCC8E61D
:10123000D0E08093680081E090CED80112968C9126
:1012400042DC80E0C8E6D0E088CEC8E6D0E081E0AD
:10125000809368001092690010926A0010926B00EF
:0812600084E07BCEF894FFCF7F
:021268005AFF2B
:00000001FF
/Modules/AVR/AVRUSB01A/SW/fw_usbasp/bin/usbasp_atmega88.hex
0,0 → 1,298
:1000000042C0ADC15BC05AC059C058C057C056C0ED
:1000100055C054C053C052C051C050C04FC04EC054
:100020004DC04CC04BC04AC049C048C047C046C084
:1000300045C044C0040309041C037700770077001F
:100040002E00660069007300630068006C002E00DB
:10005000640065000E035500530042006100730008
:10006000700012011001FF000008C016DC05040139
:1000700001020001090212000101008019090400B7
:1000800000000000000011241FBECFEFD4E0DEBF4F
:10009000CDBF11E0A0E0B1E0E8E7F2E102C00590D9
:1000A0000D92A230B107D9F711E0A2E0B1E001C092
:1000B0001D92AA34B107E1F767D5DCC8A1CFE9E604
:1000C000F0E0808182608083E89A08951F93CF9347
:1000D000DF9360912801635067FD13C08091250173
:1000E000CCE0D0E0C81BD109C45DDE4F8091240173
:1000F0008D3209F462C08091020187FD84C01092A4
:1001000028018091000184FF4AC0609101016F3F86
:1001100009F445C0693070F1685060930101809125
:10012000180198E889278093180168E080910201FE
:1001300087FD8BC0209126013091270186FF6DC07D
:10014000A9E1B1E080E090E0F901E80FF91FE49146
:10015000ED9301966817C1F76150862F90E06F5FAD
:100160000196820F931F9093270180932601162FEB
:100170001C5F0BC0109201018091180198E889273B
:1001800080931801662391F614E089E191E0E3D0B1
:100190001C3019F08FEF809301011093000194E15E
:1001A00089B1847131F49150D9F7109229011092DC
:1001B0002301DF91CF911F910895683009F09FCFFF
:1001C00083EC809318018AE580930001109202016C
:1001D0008881807659F59A8110922101898188233E
:1001E00009F043C01092220122E081E291E0909355
:1001F0002701809326018F81882319F49E8192170D
:1002000008F1922F1FC0CE01D7D48F3F51F1882320
:1002100009F475CF1092010172CFD901962FE9E14F
:10022000F1E08D9181939150E1F796CFCE010CD6FC
:10023000282F8F3F01F7888187FD25C09FEF80E839
:1002400080930201909301015ACF89E191E08AD510
:10025000682F893008F453C08FEF809301011EE1AD
:100260009CCF8EE1809300014ACF853071F08630BB
:1002700091F0883031F1893061F18A3031F120E03C
:1002800081E291E0B4CF9E81DACF9093290120E002
:1002900081E291E0ACCF8B81813049F18230F9F07D
:1002A000833029F020E080E480930201A4CF9923D9
:1002B00049F584E390E0909327018093260124E0A0
:1002C000F2CF21E08BE291E092CF21E081E291E058
:1002D0008ECF90932B0120E081E291E088CF84E7DC
:1002E00090E0909327018093260122E1DCCF82E603
:1002F00090E0909327018093260122E1D4CF182F1C
:100300001C5F43CF913051F0923061F684E590E06C
:1003100090932701809326012EE0C5CF88E390E0DB
:1003200090932701809326012CE1BDCFA82FB92FF0
:1003300080E090E041E050EA609530E009C02D9106
:1003400082279795879510F084279527305EC8F30C
:100350006F5FA8F30895EADF8D939D930895CF937F
:10036000CFB7CF93C3954C9BE9F74C9B09C04C9BEF
:1003700007C04C9B05C04C9B03C04C9B01C0A1C057
:10038000DF93C0912501DD27C45DDE4F4C9B02C089
:10039000DF91EBCF2F930F931F9309B12FEF04FB46
:1003A00020F94F933F9319B14FEF012704FB21F937
:1003B0003BE031C04E7F012F19B1216028C0102FC2
:1003C0004D7F2260000009B129C04B7F2460012FBE
:1003D000000019B12BC019B1477F28602AC04F7E99
:1003E00009B120612CC04F7D19B120622FC04F7B15
:1003F00009B1206432C0422709B149934FEF000090
:10040000102714FB20F919B11471C9F1297F91F259
:10041000012704FB21F909B1237F89F2315058F1FA
:10042000102714FB22F919B1277E79F2012704FB6A
:1004300023F92F7C81F209B1102714FB24F92F79BD
:1004400071F200C019B1012704FB25F92F7359F28D
:1004500000C009B1102714FB26F9223040F200C079
:1004600019B1012704FB27F9243028F64F772068BB
:1004700019B10000F9CF11E01CBB002717C03B5099
:100480003195C31BD04011E01CBB0881033CE9F04F
:100490000B34D9F0209123011981110F1213EDCFE4
:1004A000093641F10D3211F0013E39F700932A016E
:1004B0003F914F911F910F912F91DF91CCB3C0FDD0
:1004C00051CFCF91CFBFCF91189520912A012223F0
:1004D00079F310912801112311F5343012F1309382
:1004E000280120932401109125013BE0311B30931A
:1004F000250117C00091280101308CF40AE53091E4
:10050000000134FD10C000930001C8E1D1E00FC02C
:100510002795A8F45150A9F4220F0000F9CF4AE51D
:1005200003C042ED01C0432FC4E1D0E032E01AB174
:1005300014615C9A1AB90BB120E414E15F930127AE
:1005400056E00BB9279520F4515021F4220FF9CF32
:10055000012756E000003B5A0BB9D0F2279528F44A
:10056000515029F4220F0000F9CF012756E02795BA
:100570000BB920F4515021F4220FF9CF012756E096
:10058000299133230BB921F60B7E10912901110F0C
:10059000C651D0400BB911F01093230111E01CBBE0
:1005A00000611AB11B7E402F4B7E5F9100C000C0DE
:1005B0000BB91AB94BB97CCF809145018CBD8091A4
:1005C00042018DBD0895282F8823A1F0883008F0BE
:1005D00042C085E893E09093440180934301243026
:1005E00019F12530B8F0263099F1263068F127301E
:1005F000F9F0089586EA93E09093440180934301D3
:1006000081E08093470182E58093450181E08093FA
:10061000420108952230A1F0233070F4213049F7CF
:1006200080EC80934701089588E180934701089505
:1006300083E080934701089580E380934701089504
:1006400080E68093470108958CE0809347010895E8
:1006500020934701089586EA93E0909344018093A4
:1006600043011092420181E080934701293041F01B
:100670002A3050F4283039F683E5809345010895F7
:1006800082E58093450108952B3029F02C3009F044
:10069000BACF8093420181E580934501089526B544
:1006A0009091470186B5821B8917E0F3089584B1C4
:1006B0008C6284B92A982D9896B52091470186B509
:1006C000891B8217E0F32A9A96B586B5891B821793
:1006D000E0F32A988091430190914401865A934017
:1006E00019F0109246010895809145018CBD8091CA
:1006F00042018DBD10924601089584B1837D84B975
:1007000085B1837D85B91CBC0895582F2091470180
:1007100040E030E057FD16C02B98440F1C994F5F06
:100720002D9A96B586B5891B8217E0F32D9896B55C
:1007300086B5891B8217E0F33F5F383029F0550FEB
:1007400057FFEACF2B9AE9CF842F08958EBD0DB4C1
:1007500007FEFDCF8EB508950F931F930FE1E09133
:100760004301F09144018CEA0995E0914301F09135
:10077000440183E50995E0914301F091440180E053
:100780000995182FE0914301F091440180E009950B
:10079000133561F11CBC26B59091470186B5821BCB
:1007A0008917E0F32A9A26B586B5821B8917E0F3EC
:1007B0002A9826B586B5821B8917E0F3E09143019C
:1007C000F091440183E0E63AF80721F0002351F06C
:1007D0000150C9CF809145018CBD809142018DBDF2
:1007E0000023B1F781E01F910F91089580E01F91E0
:1007F0000F9108959B01AC0181E15695479537957E
:1008000027958A95D1F7809146018217D9F02093D8
:100810004601E0914301F09144018DE40995E09196
:100820004301F091440180E00995E0914301F0918A
:100830004401809146010995E0914301F091440102
:1008400080E009950895EF92FF920F931F937B012B
:100850008C01D0DF8E2D8170880F880F880FE0917A
:100860004301F091440180620995D801C70129E054
:10087000B695A795979587952A95D1F7E09143016D
:10088000F0914401099516950795F794E794E09146
:100890004301F09144018E2D0995E0914301F091BF
:1008A000440180E009951F910F91FF90EF9008950A
:1008B0000F931F938C01E0914301F091440180EA72
:1008C0000995E0914301F0914401812F0995E09150
:1008D0004301F0914401802F0995E0914301F0918B
:1008E000440180E009951F910F910895FF920F93A5
:1008F0001F938C01F62EE0914301F091440180ECAE
:100900000995E0914301F0914401812F0995E0910F
:100910004301F0914401802F0995E0914301F0914A
:1009200044018F2D09958EE1B9D080E01F910F9180
:10093000FF900895CF92DF92EF92FF920F931F9353
:100940006B017C01142F56DFE0914301F0914401CB
:100950008CE40995D701C60149E0B695A79597950E
:1009600087954A95D1F7E0914301F09144010995AB
:10097000D701C601B695A79597958795E091430154
:10098000F09144010995E0914301F091440180E028
:1009900009951F3FF1F016B50EE1C701B60153DF0F
:1009A0008F3F79F486B5811B8D33B8F316B50150AE
:1009B000A1F781E01F910F91FF90EF90DF90CF9012
:1009C000089580E01F910F91FF90EF90DF90CF90FE
:1009D00008958FE063D080E01F910F91FF90EF901A
:1009E000DF90CF900895CF92DF92EF92FF920F9316
:1009F0001F936B017C01042F122FFCDE8C2D817064
:100A0000880F880F880FE0914301F09144018064C2
:100A10000995D701C60169E0B695A7959795879581
:100A20006A95D1F7E0914301F09144010995D7010E
:100A3000C601B695A79597958795E0914301F091EA
:100A400044010995E0914301F0914401802F0995FB
:100A50001123C1F00F37F1F016B50EE1C701B60151
:100A6000F2DE8F3779F486B5811B8D33B8F316B576
:100A70000150A1F781E01F910F91FF90EF90DF905F
:100A8000CF90089580E01F910F91FF90EF90DF903D
:100A9000CF9008958FE002D080E0F5CF382F8823E3
:100AA00049F020E096B586B5891B8C33E0F32F5FC3
:100AB0002317C0F30895259A23982B9A50E217D054
:100AC0005A95E9F70895AC0188E605D0842F03D044
:100AD00089E601D0852F0FD028E030E0382780FB51
:100AE000869506D02A95D1F730FB02D000D06894C5
:100AF00023982B9A16F02B98239AE0914801F091B5
:100B000049013197F0F72D9AE3B1E3FBE0914801F9
:100B1000F09149013197F0F72D98089520ECE7DF27
:100B200046F42A95E1F780E02AE1E5DF2A95E9F726
:100B3000DECF28E030E0DBDF869587F938272A957D
:100B4000D1F7D5DF27F9322772F3D1DFD0CFDB0120
:100B5000742FB9DF84E2BFDFE1DF8D937A95D1F79F
:100B60000895DB01742FAFDF83EFB5DF8DE1B3DFD5
:100B700084E6B1DF8D91AFDF82E7ADDFCFDF807834
:100B8000D9F77A9589F7089593E095B98CE388B9F8
:100B90008AEE8BB9389A399A4198409A5098589A67
:100BA0008AB184618AB98AB18B7E8AB995BD87DAA8
:100BB00078948CDA8BDAFDCFFF920F931F93CF934B
:100BC000DF93082F792FF62E40910301413069F011
:100BD000443059F0463009F492C01FEF812FDF9165
:100BE000CF911F910F91FF900895FF2009F4B2C09B
:100BF000802F972F9C01E90110E053C080911401D0
:100C000090911501892B09F058C0609110017091E5
:100C100011018091120190911301488121E0E3DEDE
:100C200080910401909105010197909305018093B3
:100C30000401892BD9F4109203018091160181FFE0
:100C40003AC08091170190E0209114013091150174
:100C50008217930781F160911001709111018091C9
:100C6000120190911301488165DE11E0809110011D
:100C700090911101A0911201B09113010196A11D53
:100C8000B11D8093100190931101A0931201B093B4
:100C9000130121969E01201B2F1508F09FCF409134
:100CA0000301413009F4AACF809110019091110104
:100CB00068811CDEB5CF11E0D9CF60911001709131
:100CC00011018091120190911301488120E08BDE87
:100CD00080911701815080931701882309F0A0CFDC
:100CE0006091100170911101809112019091130196
:100CF000488120DE809114018093170191CF80916B
:100D0000100190911101602F4F2D2BDF8091100168
:100D100090911101A0911201B09113018F0D911DBD
:100D2000A11DB11D8093100190931101A093120198
:100D3000B093130180910401909105018F199109DD
:100D40009093050180930401892B21F410920301F3
:100D500011E044CF10E0812FDF91CF911F910F91CF
:100D6000FF9008950F931F93CF93DF93082F792F50
:100D7000162F40910301842F8250823050F045306D
:100D800009F446C01FEF812FDF91CF911F910F9182
:100D900008954530E9F1662399F1802F9C01E9011E
:100DA00020C0809110019091110182DD8883809193
:100DB000100190911101A0911201B09113010196BF
:100DC000A11DB11D8093100190931101A0931201F8
:100DD000B093130121969E01201B211778F44091B6
:100DE00003014230F1F66091100170911101809180
:100DF00012019091130127DD8883D9CF183018F69E
:100E000010920301812FDF91CF911F910F910895CF
:100E10008091100190911101602F412F98DE8091F7
:100E2000100190911101A0911201B0911301810F55
:100E3000911DA11DB11D8093100190931101A093EC
:100E40001201B09313019FCF0F931F93CF93DF93A2
:100E50008C01DC0111968C91813009F44EC08230F6
:100E600009F4E7C0833009F455C0843009F4B5C0F3
:100E7000873009F486C0853009F45AC1863009F4F8
:100E800010C1883009F4DBC0893009F458C18A30B8
:100E900009F469C18B3009F49CC18C3009F4B7C1E5
:100EA0008D3009F4CBC18E3009F4CFC18F3009F0F9
:100EB00065C1F801938180E0228130E0822B932B81
:100EC000AA2797FDA095BA2F809310019093110146
:100ED000A0931201B0931301978180E0268130E046
:100EE000822B932B909305018093040185E08093DE
:100EF00003018FEFC8E0D1E038C0489B3FC080912C
:100F0000060161DB109207014098D1DB80E0C8E068
:100F1000D1E02BC0E0914301F0914401D801129639
:100F20008C910995C8E0D1E080930801E0914301DC
:100F3000F0914401D80113968C9109958093090191
:100F4000E0914301F0914401D80114968C910995E8
:100F500080930A01E0914301F0914401D801159674
:100F60008C91099580930B0184E0D0932701C09365
:100F70002601DF91CF911F910F91089585E023DB2A
:100F8000C1CF80910701882399F4F801938180E013
:100F9000228130E0822B932BAA2797FDA095BA2FB0
:100FA0008093100190931101A0931201B09313014B
:100FB000D80117969C91179780E016962C9130E0F7
:100FC000822B932B909305018093040183E08093FF
:100FD00003018FEFC8E0D1E0C8CF809107018823DB
:100FE00099F4F801938180E0228130E0822B932BE9
:100FF000AA2797FDA095BA2F809310019093110115
:10100000A0931201B0931301D80117969C911797E2
:1010100080E016962C9130E0822B932B9093050163
:101020008093040182E0809303018FEFC8E0D1E058
:101030009CCF63DB409A80E0C8E0D1E096CF8091FE
:1010400007018823B1F4D80113969C91139780E08F
:1010500012962C9130E0822B932BAA2797FDA09516
:10106000BA2F8093100190931101A0931201B093B5
:101070001301109215011092140110921601F8013B
:10108000978180E0268130E0822B932B909305019D
:101090008093040184E0809303018FEFC8E0D1E0E6
:1010A00064CF80910701882399F4F801938180E04F
:1010B000228130E0822B932BAA2797FDA095BA2F8F
:1010C0008093100190931101A0931201B09313012A
:1010D000D80114968C91149715969C91292F2F70F6
:1010E00020931601492F50E0407F50704295529551
:1010F000507F5427407F5427480F511D50931501AE
:101100004093140120FF02C040931701F80197811A
:1011100080E0268130E0822B932B90930501809311
:10112000040181E0809303018FEFC8E0D1E01DCF7F
:1011300013DBC8E0D1E08093080181E016CF81E0A5
:1011400080930701F80182819381A481B581809306
:10115000100190931101A0931201B093130180E04C
:10116000C8E0D1E002CFD80112968C91809306019D
:10117000C8E0D1E01092080181E0F7CE803109F09B
:1011800040C0D80113969C91139780E012962C9141
:1011900030E0822B932BAA2797FDA095BA2F80933E
:1011A000100190931101A0931201B0931301F80163
:1011B000978180E0268130E0822B932B909305016C
:1011C0008093040186E0809303018FEFC8E0D1E0B3
:1011D000CCCEF801938180E0228130E0822B932BEA
:1011E00090934901809348012A9A229A83E056DC21
:1011F0002A98409880E152DC5EDC80E0C8E0D1E0D3
:10120000B4CE8F3751F180E0C8E0D1E0AECE80ECB3
:1012100062DC80E060DC8AE041DC2A9A85E03EDC2A
:101220002A9885E03BDC84B1837D84B985B1837DD8
:1012300085B9409A80E0C8E0D1E097CE6FDCC8E085
:10124000D1E08093080181E090CED80112968C9174
:1012500042DC80E0C8E0D1E088CEC8E0D1E081E0A7
:10126000809308011092090110920A0110920B015B
:0812700084E07BCEF894FFCF6F
:021278005AFF1B
:00000001FF
/Modules/AVR/AVRUSB01A/SW/fw_usbasp/main.c
11,6 → 11,9
* PC2 SCK speed option.
* GND -> slow (8khz SCK),
* open -> software set speed (default is 375kHz SCK)
*
* 2014_02_09 miho@mlab.cz - cleaned code and defined IO port better, automatic compile prodcess for more target CPUs
*
*/
 
#include <avr/io.h>
44,7 → 47,7
if (data[1] == USBASP_FUNC_CONNECT) {
 
/* set SCK speed */
if ((PINC & (1 << PC2)) == 0) {
if ((PIN(CLKSW_PORT) & (1 << CLKSW_BIT)) == 0) {
ispSetSCKOption(USBASP_ISP_SCK_8);
} else {
ispSetSCKOption(prog_sck);
303,16 → 306,24
int main(void) {
uchar i, j;
 
/* no pullups on USB and ISP pins */
PORTD = 0;
PORTB = 0;
/* all outputs except PD2 = INT0 */
DDRD = ~(1 << 2);
/* unused pins with pullups */
PORTB = PORTB_UNUSED_MASK;
PORTC = PORTC_UNUSED_MASK;
PORTD = PORTD_UNUSED_MASK;
 
/* LED ports as output */
ledInit();
ledGreenOn();
ledRedOff();
 
/* CLKSW input with PullUp (external jumper to GND) */
clkswInit();
 
/* output SE0 for USB reset */
DDRB = ~0;
DDR(USB_CFG_IOPORTNAME) |= (1 << USB_CFG_DPLUS_BIT | 1<<USB_CFG_DMINUS_BIT);
 
/* USB Reset by device only required on Watchdog Reset */
j = 0;
/* USB Reset by device only required on Watchdog Reset */
while (--j) {
i = 0;
/* delay >10ms for USB reset */
319,13 → 330,10
while (--i)
;
}
 
/* all USB and ISP pins inputs */
DDRB = 0;
DDR(USB_CFG_IOPORTNAME) &= ~(1 << USB_CFG_DPLUS_BIT | 1<<USB_CFG_DMINUS_BIT);
 
/* all inputs except PC0, PC1 */
DDRC = 0x03;
PORTC = 0xfe;
 
/* init timer */
clockInit();
 
337,4 → 345,3
}
return 0;
}
 
/Modules/AVR/AVRUSB01A/SW/fw_usbasp/usbasp.h
11,6 → 11,17
#ifndef USBASP_H_
#define USBASP_H_
 
/* PORTS Definitions */
#define LED_RED_PORT C
#define LED_RED_BIT 0
#define LED_GREEN_PORT C
#define LED_GREEN_BIT 1
#define CLKSW_PORT D
#define CLKSW_BIT 0
#define PORTB_UNUSED_MASK (1<<PB1 | 1<<PB0)
#define PORTC_UNUSED_MASK (1<<PC5 | 1<<PC4 | 1<<PC3 | 1<<PC2)
#define PORTD_UNUSED_MASK (1<<PD7 | 1<<PD6 | 1<<PD5 | 1<<PD3 | 1<<PD1)
 
/* USB function call identifiers */
#define USBASP_FUNC_CONNECT 1
#define USBASP_FUNC_DISCONNECT 2
61,10 → 72,20
#define USBASP_ISP_SCK_750 11 /* 750 kHz */
#define USBASP_ISP_SCK_1500 12 /* 1.5 MHz */
 
/* Macros for Port (enables to easily define IO signals) */
#define GLUE(A,B) A##B
#define DDR(PORT_LETTER) GLUE(DDR, PORT_LETTER) // Makes DDRC from DDR(C) etc.
#define PORT(PORT_LETTER) GLUE(PORT,PORT_LETTER) // Makes PORTC from PORT(C)
#define PIN(PORT_LETTER) GLUE(PIN, PORT_LETTER) // Makes PINC from PIN(C)
 
/* macros for gpio functions */
#define ledRedOn() PORTC &= ~(1 << PC1)
#define ledRedOff() PORTC |= (1 << PC1)
#define ledGreenOn() PORTC &= ~(1 << PC0)
#define ledGreenOff() PORTC |= (1 << PC0)
#define ledRedOn() PORT(LED_RED_PORT) &= ~(1 << LED_RED_BIT) // Active L
#define ledRedOff() PORT(LED_RED_PORT) |= (1 << LED_RED_BIT)
#define ledGreenOn() PORT(LED_GREEN_PORT) &= ~(1 << LED_GREEN_BIT) // Active L
#define ledGreenOff() PORT(LED_GREEN_PORT) |= (1 << LED_GREEN_BIT)
#define ledInit() DDR(LED_RED_PORT) |= (1 << LED_RED_BIT),\
DDR(LED_GREEN_PORT) |= (1 << LED_GREEN_BIT) // Outputs
#define clkswInit() DDR(CLKSW_PORT) &= ~(1 << CLKSW_BIT),\
PORT(CLKSW_PORT) |= (1 << CLKSW_BIT) // Input with PullUp
 
#endif /* USBASP_H_ */
/Modules/AVR/AVRUSB01A/SW/fw_usbasp/usbconfig.h
22,15 → 22,19
 
/* ---------------------------- Hardware Config ---------------------------- */
 
#define USB_CFG_IOPORTNAME B
#define USB_COUNT_SOF 0
/* Define this to 1 if interrupt is conected to D- signal
*/
 
#define USB_CFG_IOPORTNAME D
/* This is the port where the USB bus is connected. When you configure it to
* "B", the registers PORTB, PINB and DDRB will be used.
*/
#define USB_CFG_DMINUS_BIT 0
#define USB_CFG_DMINUS_BIT 4
/* This is the bit number in USB_CFG_IOPORT where the USB D- line is connected.
* This may be any bit in the port.
*/
#define USB_CFG_DPLUS_BIT 1
#define USB_CFG_DPLUS_BIT 2
/* This is the bit number in USB_CFG_IOPORT where the USB D+ line is connected.
* This may be any bit in the port. Please note that D+ must also be connected
* to interrupt pin INT0!