USBasp 2005.11.14.
authorPeter Henn <Peter.Henn@web.de>
Mon, 14 Nov 2005 11:00:00 +0000 (12:00 +0100)
committerPeter Henn <Peter.Henn@web.de>
Mon, 14 Nov 2005 11:00:00 +0000 (12:00 +0100)
unmodified content from archive usbasp.2005-11-14.tar.gz

12 files changed:
Changelog.txt
Readme.txt
bin/firmware/usbasp.2005-07-03.hex [deleted file]
bin/firmware/usbasp.2005-11-14.hex [new file with mode: 0644]
bin/win-avrdude/avrdude.conf
bin/win-avrdude/avrdude.exe
firmware/isp.c
firmware/main.c
firmware/usbdrv/License.txt
software/avrdude_usbasp.2005-04-21.patch [deleted file]
software/avrdude_usbasp.2005-11-14.patch [new file with mode: 0644]
software/usbasp.c

index 4d3480a..7b71dd4 100644 (file)
@@ -1,10 +1,15 @@
+usbasp.2005-11-14
+----------------------
+- fixed blocksize restriction (programming the Mega128 now works)
+  by Thomas Pfeifer (TP)
+- update patch for avrdude-5.0
+
 usbasp.2005-07-03
 -----------------
 - set USB_CFG_SAMPLE_EXACT in usbconfig.h to reduce problems with long cables
 - corrected vendor string
 - added notes on setting fuse bits
 
-
 usbasp.2005-04-21
 -----------------
 - first public version
index 11c7804..c31681f 100644 (file)
@@ -84,13 +84,12 @@ Software (avrdude):
 An extension to avrdude (http://www.nongnu.org/avrdude/) was written.
 To compile the software:
 1. install libusb: http://libusb.sourceforge.net/
-2. get the csv version of avrdude:
-   export CVS_RSH="ssh"
-   cvs -z3 -d:ext:anoncvs@savannah.nongnu.org:/cvsroot/avrdude co avrdude
-3. cp usbasp/software/usbasp.* avrdude/
-4. cd avrdude
+2. get avrdude-5.0.tar.gz and extract it:
+   tar xvzf avrdude-5.0.tar.gz
+3. cp usbasp/software/usbasp.* avrdude-5.0/
+4. cd avrdude-5.0
 5. apply the patch:
-   patch < ../usbasp/software/avrdude_usbasp.xxxx-xx-xx.patch
+   patch -p1 < ../usbasp/software/avrdude_usbasp.xxxx-xx-xx.patch
 6. configure to your environment:
    ./bootstrap (I had to comment out the two if-blocks which verify the
                 installed versions of autoconf and automake)
@@ -140,5 +139,5 @@ libusb .......................... http://libusb.sourceforge.net/
 libusb-win32 .................... http://libusb-win32.sourceforge.net/
 
 
-2005-07-03 Thomas Fischl <tfischl@gmx.de>
+2005-11-14 Thomas Fischl <tfischl@gmx.de>
 http://www.fischl.de
diff --git a/bin/firmware/usbasp.2005-07-03.hex b/bin/firmware/usbasp.2005-07-03.hex
deleted file mode 100644 (file)
index 673db57..0000000
+++ /dev/null
@@ -1,205 +0,0 @@
-:100000003BC072C153C052C051C050C04FC04EC05F
-:100010004DC04CC04BC04AC049C048C047C046C094
-:1000200045C044C043C00E03550053004200610068
-:10003000730070001C037700770077002E006600C5
-:1000400069007300630068006C002E0064006500A6
-:1000500004030904090212000101008019090400C7
-:1000600000000000000012010101FF000008EB0386
-:10007000B4C700010102000111241FBECFE5D4E086
-:10008000DEBFCDBF10E0A0E6B0E0EAEAFCE002C0CF
-:1000900005900D92A436B107D9F710E0A4E6B0E0C0
-:1000A00001C01D92A23AB107E1F7EAC5A9CF1F939B
-:1000B000CF93FC0180919B008D3269F080917A0092
-:1000C00087FD04C0CF014DD58F3F71F010926300C2
-:1000D00010927A0066C0C0E010E8683061F0C0930A
-:1000E000630010937A005DC08EE180938D0082E002
-:1000F0008093620056C080818076F9F426E930E072
-:10010000C093960081818823A1F08530E9F0863084
-:10011000F9F0883061F18A3071F130939D002093BD
-:100120009C0087818823D9F686818C17C0F6C82F5A
-:10013000D6CFC0939700C2E0F0CFC681CF0104D4E0
-:100140008F3FA9F710E0CBCF828180937B00E5CF72
-:1001500010EC8381813089F0823099F08330E9F6A8
-:100160008281882391F4C4E020E530E0D6CFC1E05D
-:10017000C0939600D2CFC1E0D0CFC2E126E630E0F6
-:10018000CCCFC2E124E530E0C8CF813031F08230FD
-:1001900021F6CEE026E230E0C0CFCCE124E330E02F
-:1001A000BCCFCF911F910895CF9360919E0066239D
-:1001B00051F0635067FD05C0809199009927019621
-:1001C00076DF10929E008091620087FD1AC086B390
-:1001D000837019F010927C0077C080917C00882396
-:1001E00009F072C094E686B3837009F06DC0915037
-:1001F000D1F781E080937C009093980090937B00EE
-:1002000063C0809163008F3F31F12BE490917A00BD
-:1002100090FD23EC9F5F90937A0020938D00682FD0
-:10022000893008F068E0861B80936300AEE8B0E098
-:1002300097FD30C0662349F560E070E0C62F693055
-:10024000A0F08EE180938D0092E08FEF80936300A9
-:1002500090936200BCCF80917B00882309F4B7CFD4
-:100260008093980010927B00B2CF8EE890E0C1D1CD
-:10027000EC2FFF27E357FF4F818392839C2F9C5FD6
-:10028000C83018F390936200A2CFCD012DD4682F0F
-:100290007727D4CFE0919C00F0919D0096FF0DC090
-:1002A000962F03C084918D9331969150D8F7F09397
-:1002B0009D00E0939C007727C1CF962F02C08191CB
-:1002C0008D939150E0F7F3CFCF91089584E690E0BD
-:1002D00080939A000B968093990085B7836085BFC1
-:1002E0008BB780648BBF08950F930FB70F93B09BAC
-:1002F000FECFB09B06C0B09B04C0B09B02C0000004
-:1003000000C01F933F932F9331E012E006B31027F4
-:1003100010FD32E0102F3A95C9F700FDE4C006B396
-:10032000102717952FE72795DF9316B30127079519
-:100330002795CF93C0919A0006B31027179527955C
-:100340003BE0DD274F9316B30127079527954FEF25
-:10035000000055C0B09BFECFB09B06C0B09B04C050
-:10036000B09B02C0000000C0DF9100C0CDCF16B32B
-:10037000137079F1407C2C6F13C006B3037049F100
-:1003800041782C6F15C0037021F1102F2C6F06B32C
-:1003900019C006B30370E9F04E7F2C6F18C038F314
-:1003A00006B30370B1F0102717952795243028F372
-:1003B00016B3012707952795422749934FEF06B3B8
-:1003C000243008F3102717952795243010F316B31F
-:1003D0001370E1F10127079527952430F0F006B35B
-:1003E0000370A1F11027179527952430E0F016B37C
-:1003F0000127079527953A9541F12430D0F006B3AF
-:10040000037021F11027179527952430C0F016B3FB
-:100410000127079527952430C2CF16B31370B1F08A
-:100420004C7F2C6FDCCF06B3037081F0487F2C6FBC
-:10043000DECF16B3137051F0407F2C6FE0CF06B3C0
-:10044000037021F0407E2C6FE2CF3AC03C2FC09168
-:100450009A003C1B00E433300ABF90F108811981F7
-:10046000412F1F77209198000D3271F1013E61F10B
-:100470000936B9F0033C11F00B3411F510919F00CF
-:100480001123F1F000919E000030B1F530939E00F1
-:1004900010939B0000919900C093990000939A00DB
-:1004A0002EC0121769F4309162003F3F29F10FEF1F
-:1004B00000936200CDE8D0E025C0002700939F00A4
-:1004C0004F91CF91DF910FC01217B9F700939F00A2
-:1004D0000FEF00936300009362004F91CF910AB732
-:1004E00006FD38CFDF9100E40ABF2F913F911F91A5
-:1004F0000F910FBF0F911895C0E6D0E002C0C1E682
-:10050000D0E032E05F9308B30C7F016008BB53E09A
-:1005100017B3136017BB20E80FC0052710E008BB16
-:1005200010C0052710E0089408BB13C0052710E091
-:1005300015C0052710E019C020FF052708BB279527
-:1005400017951C3F50F720FF0527279508BB1795E7
-:100550001C3F38F720FF05272795179508BB1C3F40
-:1005600028F720FF0527279517951C3F08BB08F79C
-:1005700000C0499120FF052708BB279517951C3F10
-:1005800048F520FF0527279508BB17951C3F30F538
-:1005900020FF05272795179508BB1C3F20F520FF56
-:1005A0000527279517951C3F08BB00F5242F3A9582
-:1005B00019F60C7F5F9108BB34E03A95F1F70160C2
-:1005C00017B31C7F08BB0C7F4F91CF9117BB08BBA3
-:1005D000DF9189CF052710E008BBD1CF052710E0B8
-:1005E000089408BBD4CF052710E0D6CF052710E02C
-:1005F000DACFA82FB92F8FEF9FEF41E050EA61507B
-:1006000070F02D9138E0722F782796958795269572
-:1006100070FF02C0842795273A95A9F7F0CF8095FF
-:100620009095089582E58DB981E08EB9089588236B
-:1006300039F488E493E09093A1008093A00008959A
-:1006400085E693E09093A1008093A000089592B76F
-:1006500082B7891B8C30E0F3089587B38C6287BB27
-:10066000C298C598F4DFC29AF2DFC2988091A000C8
-:100670009091A1008556934009F00895D3DF089525
-:1006800087B3837D87BB88B3837D88BB1DB80895FE
-:100690000F931F93CF93C82F00E017E00CC0C398AF
-:1006A000CC0F000FB4990F5FC59AD1DFC598CFDF8B
-:1006B000115017FD04C0C7FFF2CFC39AF1CF802FAE
-:1006C0009927CF911F910F9108958FB9779BFECFF6
-:1006D0008FB1992708951F93CF93CFE103C0C150E5
-:1006E000CF3F51F1E091A000F091A1008CEA099573
-:1006F000E091A000F091A10083E50995E091A000B0
-:10070000F091A10080E00995182FE091A000F091F0
-:10071000A10080E00995133591F01DB8C59A97DFC7
-:10072000C59895DF8091A0009091A10085569340D7
-:10073000B1F678DFC150B0F681E090E002C080E011
-:1007400090E0CF911F9108950F931F938C018170BA
-:10075000880F880F880FE091A000F091A1008062BF
-:100760000995C801892F99278695E091A000F091FD
-:10077000A100099516950795E091A000F091A100C0
-:10078000802F0995E091A000F091A10080E00995EB
-:1007900099271F910F9108950F931F93CF93DF9384
-:1007A000EC01062F142F8170880F880F880FE091BD
-:1007B000A000F091A10080640995CE01892F9927AE
-:1007C0008695E091A000F091A1000995CE01969543
-:1007D0008795E091A000F091A1000995E091A0001B
-:1007E000F091A100802F09951123A9F00F3789F00E
-:1007F0001EE102B7CE01A8DF8F3769F482B7801BF4
-:100800008D3310F002B711501123A1F781E090E071
-:1008100004C08FE08CD080E090E0DF91CF911F91F9
-:100820000F9108950F931F93CF93DF93EC01162F31
-:10083000E091A000F091A1008CE40995CE01892FF0
-:1008400099278695E091A000F091A1000995CE012D
-:1008500096958795E091A000F091A1000995E0910F
-:10086000A000F091A10080E009951F3F89F01EE1F2
-:1008700002B7CE0169DF8F3F69F482B7801B8D33E9
-:1008800010F002B711501123A1F781E090E004C0ED
-:100890008FE04DD080E090E0DF91CF911F910F91DC
-:1008A00008950F931F938C01E091A000F091A10097
-:1008B00080EA0995812F9927E091A000F091A1008D
-:1008C0000995E091A000F091A100802F0995E09199
-:1008D000A000F091A10080E0099599271F910F9148
-:1008E0000895FF920F931F938C01F62EE091A000C4
-:1008F000F091A10080EC0995812F9927E091A0004B
-:10090000F091A1000995E091A000F091A100802F45
-:100910000995E091A000F091A1008F2D09958EE13D
-:1009200006D080E090E01F910F91FF900895382F3E
-:1009300020E0231740F492B782B7891B8C33E0F391
-:100940002F5F2317C0F308951F93CF93DF93EC011C
-:1009500010E089818130A1F0823009F472C08330C7
-:1009600009F472C0843091F0873009F450C08530AA
-:1009700009F4AAC0863039F1883009F0A9C086C0D0
-:100980009A9B812F54DE69DEA998A2C08B8199279A
-:10099000982F88272A813327822B932B90938900C5
-:1009A000809388008F819927982F88272E8133275D
-:1009B000822B932B90937E0080937D0082E0809326
-:1009C0007F001FEF85C08B819927982F88272A8168
-:1009D0003327822B932B90938900809388009C81EE
-:1009E00090938A008D8180938B0080FF02C090934A
-:1009F0008C008F819927982F88272E813327822B6F
-:100A0000932B90937E0080937D0081E0D8CF8B81E3
-:100A10009927982F88272A813327822B932B90930D
-:100A20008900809388008F819927982F88272E81AD
-:100A30003327822B932B90937E0080937D0083E05D
-:100A4000BECF1EDEA99A44C0E091A000F091A100A3
-:100A50008A81099580938000E091A000F091A10027
-:100A60008B81099580938100E091A000F091A10015
-:100A70008C81099580938200E091A000F091A10003
-:100A80008D8109958093830014E022C08B81992782
-:100A9000982F88272A813327822B932B90938900C4
-:100AA0008093880010938A0010938B008F81992780
-:100AB000982F88272E813327822B932B90937E00AB
-:100AC00080937D0084E07BCF06DE8093800011E080
-:100AD00080E890E090939D0080939C00812F99275F
-:100AE000DF91CF911F910895EF92FF921F93CF93C3
-:100AF0007C01162F90917F00892F8250823050F513
-:100B0000C0E0C617C0F01FC0809188009091890096
-:100B1000C8DEF701EC0FF11D808380918800909171
-:100B2000890001969093890080938800CF5FC11758
-:100B300050F490917F00923039F780918800909125
-:100B4000890002DEE6CF183010F410927F00812F6A
-:100B5000992702C08FEF90E0CF911F91FF90EF9007
-:100B60000895CF92DF92EF92FF920F931F93CF934E
-:100B7000DF936C01062F40917F00413019F0443023
-:100B800009F073C010E01017F0F16CC080918A007A
-:100B9000882309F046C0C12FDD27FE01EC0DFD1DA5
-:100BA00060818091880090918900F6DD80917D00C0
-:100BB00090917E00019790937E0080937D00892B19
-:100BC000A1F410927F0080918B0081FF0EC0909164
-:100BD0008C0080918A00981741F0CC0DDD1D688152
-:100BE00080918800909189001DDE8091880090910D
-:100BF0008900019690938900809388001F5F1017E9
-:100C000088F540917F00413009F2C12FDD27FE01B8
-:100C1000EC0DFD1D6081809188009091890061DE5E
-:100C2000C5CFC12FDD277E01EC0CFD1C40E0F70194
-:100C300060818091880090918900AEDD80918C0068
-:100C4000815080938C00882309F0B0CFF701608138
-:100C50008091880090918900E5DD80918A008093E1
-:100C60008C00A4CF80E090E002C08FEF90E0DF9195
-:100C7000CF911F910F91FF90EF90DF90CF9008954B
-:100C8000CFE5D4E0DEBFCDBF12BA18BA8BEF81BB7F
-:100C900017BA93E094BB8EEF85BB93BF81E0C7DCAE
-:0A0CA00015DB789481DA80DAFDCFCD
-:040CAA005AD2FFFF1C
-:00000001FF
diff --git a/bin/firmware/usbasp.2005-11-14.hex b/bin/firmware/usbasp.2005-11-14.hex
new file mode 100644 (file)
index 0000000..e790d5c
--- /dev/null
@@ -0,0 +1,209 @@
+:100000003BC072C153C052C051C050C04FC04EC05F
+:100010004DC04CC04BC04AC049C048C047C046C094
+:1000200045C044C043C00E03550053004200610068
+:10003000730070001C037700770077002E006600C5
+:1000400069007300630068006C002E0064006500A6
+:1000500004030904090212000101008019090400C7
+:1000600000000000000012010101FF000008EB0386
+:10007000B4C700010102000111241FBECFE5D4E086
+:10008000DEBFCDBF10E0A0E6B0E0EEEEFCE002C0C7
+:1000900005900D92A436B107D9F710E0A4E6B0E0C0
+:1000A00001C01D92A33AB107E1F70CC6A9CF1F9377
+:1000B000CF93FC0180919C008D3269F080917A0091
+:1000C00087FD04C0CF0166D58F3F71F010926300A9
+:1000D00010927A0066C0C0E010E8683061F0C0930A
+:1000E000630010937A005DC08EE180938E0082E001
+:1000F0008093620056C080818076F9F427E930E071
+:10010000C093970081818823A1F08530E9F0863083
+:10011000F9F0883061F18A3071F130939E002093BC
+:100120009D0087818823D9F686818C17C0F6C82F59
+:10013000D6CFC0939800C2E0F0CFC681CF0104D4DF
+:100140008F3FA9F710E0CBCF828180937B00E5CF72
+:1001500010EC8381813089F0823099F08330E9F6A8
+:100160008281882391F4C4E020E530E0D6CFC1E05D
+:10017000C0939700D2CFC1E0D0CFC2E126E630E0F5
+:10018000CCCFC2E124E530E0C8CF813031F08230FD
+:1001900021F6CEE026E230E0C0CFCCE124E330E02F
+:1001A000BCCFCF911F910895CF9360919F0066239C
+:1001B00051F0635067FD05C080919A009927019620
+:1001C00076DF10929F008091620087FD1AC086B38F
+:1001D000837019F010927C0077C080917C00882396
+:1001E00009F072C094E686B3837009F06DC0915037
+:1001F000D1F781E080937C009093990090937B00ED
+:1002000063C0809163008F3F31F12BE490917A00BD
+:1002100090FD23EC9F5F90937A0020938E00682FCF
+:10022000893008F068E0861B80936300AFE8B0E097
+:1002300097FD30C0662349F560E070E0C62F693055
+:10024000A0F08EE180938E0092E08FEF80936300A8
+:1002500090936200BCCF80917B00882309F4B7CFD4
+:100260008093990010927B00B2CF8FE890E0C1D1CB
+:10027000EC2FFF27E257FF4F818392839C2F9C5FD7
+:10028000C83018F390936200A2CFCD0146D4682FF6
+:100290007727D4CFE0919D00F0919E0096FF0DC08E
+:1002A000962F03C084918D9331969150D8F7F09397
+:1002B0009E00E0939D007727C1CF962F02C08191C9
+:1002C0008D939150E0F7F3CFCF91089584E690E0BD
+:1002D00080939B000B9680939A0085B7836085BFBF
+:1002E0008BB780648BBF08950F930FB70F93B09BAC
+:1002F000FECFB09B06C0B09B04C0B09B02C0000004
+:1003000000C01F933F932F9331E012E006B31027F4
+:1003100010FD32E0102F3A95C9F700FDE4C006B396
+:10032000102717952FE72795DF9316B30127079519
+:100330002795CF93C0919B0006B31027179527955B
+:100340003BE0DD274F9316B30127079527954FEF25
+:10035000000055C0B09BFECFB09B06C0B09B04C050
+:10036000B09B02C0000000C0DF9100C0CDCF16B32B
+:10037000137079F1407C2C6F13C006B3037049F100
+:1003800041782C6F15C0037021F1102F2C6F06B32C
+:1003900019C006B30370E9F04E7F2C6F18C038F314
+:1003A00006B30370B1F0102717952795243028F372
+:1003B00016B3012707952795422749934FEF06B3B8
+:1003C000243008F3102717952795243010F316B31F
+:1003D0001370E1F10127079527952430F0F006B35B
+:1003E0000370A1F11027179527952430E0F016B37C
+:1003F0000127079527953A9541F12430D0F006B3AF
+:10040000037021F11027179527952430C0F016B3FB
+:100410000127079527952430C2CF16B31370B1F08A
+:100420004C7F2C6FDCCF06B3037081F0487F2C6FBC
+:10043000DECF16B3137051F0407F2C6FE0CF06B3C0
+:10044000037021F0407E2C6FE2CF3AC03C2FC09168
+:100450009B003C1B00E433300ABF90F108811981F6
+:10046000412F1F77209199000D3271F1013E61F10A
+:100470000936B9F0033C11F00B3411F51091A000CE
+:100480001123F1F000919F000030B1F530939F00EF
+:1004900010939C0000919A00C0939A0000939B00D7
+:1004A0002EC0121769F4309162003F3F29F10FEF1F
+:1004B00000936200CEE8D0E025C000270093A000A2
+:1004C0004F91CF91DF910FC01217B9F70093A000A1
+:1004D0000FEF00936300009362004F91CF910AB732
+:1004E00006FD38CFDF9100E40ABF2F913F911F91A5
+:1004F0000F910FBF0F911895C0E6D0E002C0C1E682
+:10050000D0E032E05F9308B30C7F016008BB53E09A
+:1005100017B3136017BB20E80FC0052710E008BB16
+:1005200010C0052710E0089408BB13C0052710E091
+:1005300015C0052710E019C020FF052708BB279527
+:1005400017951C3F50F720FF0527279508BB1795E7
+:100550001C3F38F720FF05272795179508BB1C3F40
+:1005600028F720FF0527279517951C3F08BB08F79C
+:1005700000C0499120FF052708BB279517951C3F10
+:1005800048F520FF0527279508BB17951C3F30F538
+:1005900020FF05272795179508BB1C3F20F520FF56
+:1005A0000527279517951C3F08BB00F5242F3A9582
+:1005B00019F60C7F5F9108BB34E03A95F1F70160C2
+:1005C00017B31C7F08BB0C7F4F91CF9117BB08BBA3
+:1005D000DF9189CF052710E008BBD1CF052710E0B8
+:1005E000089408BBD4CF052710E0D6CF052710E02C
+:1005F000DACFA82FB92F8FEF9FEF41E050EA61507B
+:1006000070F02D9138E0722F782796958795269572
+:1006100070FF02C0842795273A95A9F7F0CF8095FF
+:100620009095089582E58DB981E08EB9089588236B
+:1006300039F488E493E09093A2008093A100089598
+:1006400085E693E09093A2008093A100089592B76D
+:1006500082B7891B8C30E0F3089587B38C6287BB27
+:10066000C298C598F4DFC29AF2DFC2988091A100C7
+:100670009091A2008556934009F00895D3DF089524
+:1006800087B3837D87BB88B3837D88BB1DB80895FE
+:100690000F931F93CF93C82F00E017E00CC0C398AF
+:1006A000CC0F000FB4990F5FC59AD1DFC598CFDF8B
+:1006B000115017FD04C0C7FFF2CFC39AF1CF802FAE
+:1006C0009927CF911F910F9108958FB9779BFECFF6
+:1006D0008FB1992708951F93CF93CFE103C0C150E5
+:1006E000CF3F51F1E091A100F091A2008CEA099571
+:1006F000E091A100F091A20083E50995E091A100AD
+:10070000F091A20080E00995182FE091A100F091EE
+:10071000A20080E00995133591F01DB8C59A97DFC6
+:10072000C59895DF8091A1009091A20085569340D5
+:10073000B1F678DFC150B0F681E090E002C080E011
+:1007400090E0CF911F9108950F931F938C018170BA
+:10075000880F880F880FE091A100F091A2008062BD
+:100760000995C801892F99278695E091A100F091FC
+:10077000A200099516950795E091A100F091A200BD
+:10078000802F0995E091A100F091A20080E00995E9
+:1007900099271F910F9108950F931F93CF93DF9384
+:1007A000EC01062F142F8170880F880F880FE091BD
+:1007B000A100F091A20080640995CE01892F9927AC
+:1007C0008695E091A100F091A2000995CE01969541
+:1007D0008795E091A100F091A2000995E091A10018
+:1007E000F091A200802F09951123A9F00F3789F00D
+:1007F0001EE102B7CE01A8DF8F3769F482B7801BF4
+:100800008D3310F002B711501123A1F781E090E071
+:1008100004C08FE08CD080E090E0DF91CF911F91F9
+:100820000F9108950F931F93CF93DF93EC01162F31
+:10083000E091A100F091A2008CE40995CE01892FEE
+:1008400099278695E091A100F091A2000995CE012B
+:1008500096958795E091A100F091A2000995E0910D
+:10086000A100F091A20080E009951F3F89F01EE1F0
+:1008700002B7CE0169DF8F3F69F482B7801B8D33E9
+:1008800010F002B711501123A1F781E090E004C0ED
+:100890008FE04DD080E090E0DF91CF911F910F91DC
+:1008A00008950F931F938C01E091A100F091A20095
+:1008B00080EA0995812F9927E091A100F091A2008B
+:1008C0000995E091A100F091A200802F0995E09197
+:1008D000A100F091A20080E0099599271F910F9146
+:1008E0000895FF920F931F938C01F62EE091A100C3
+:1008F000F091A20080EC0995812F9927E091A10049
+:10090000F091A2000995E091A100F091A200802F42
+:100910000995E091A100F091A2008F2D09958EE13B
+:1009200006D080E090E01F910F91FF900895382F3E
+:1009300020E0231740F492B782B7891B8C33E0F391
+:100940002F5F2317C0F308951F93CF93DF93EC011C
+:1009500010E089818130A1F0823009F489C08330B0
+:1009600009F489C0843091F0873009F467C085307C
+:1009700009F4C3C0863039F1883009F0C2C09DC087
+:100980009A9B812F54DE69DEA998BBC08B81992781
+:10099000982F88272A813327822B932B90938900C5
+:1009A000809388008F819927982F88272E8133275D
+:1009B000822B932B90937E0080937D0082E0809326
+:1009C0007F001FEF9EC08B819927982F88272A814F
+:1009D0003327822B932B90938900809388008C81FE
+:1009E000482F552750938B0040938A002D812F70FC
+:1009F00020938C008D819927807F907082959295AD
+:100A0000907F9827807F9827840F951F90938B0065
+:100A100080938A0020FF04C080918A0080938D001B
+:100A20008F819927982F88272E813327822B932B0C
+:100A300090937E0080937D0081E0C1CF8B819927C8
+:100A4000982F88272A813327822B932B9093890014
+:100A5000809388008F819927982F88272E813327AC
+:100A6000822B932B90937E0080937D0083E0A7CF11
+:100A700007DEA99A46C0E091A100F091A2008A8108
+:100A8000099580938000E091A100F091A2008B81F4
+:100A9000099580938100E091A100F091A2008C81E2
+:100AA000099580938200E091A100F091A2008D81D0
+:100AB00009958093830014E024C08B819927982F97
+:100AC00088272A813327822B932B90938900809348
+:100AD000880010928B0010928A0010938C008F81F6
+:100AE0009927982F88272E813327822B932B909339
+:100AF0007E0080937D0084E062CFEDDD80938000F6
+:100B000011E080E890E090939E0080939D00812FFB
+:100B10009927DF91CF911F910895EF92FF921F9334
+:100B2000CF937C01162F90917F00892F82508230C5
+:100B300050F5C0E0C617C0F01FC0809188009091AA
+:100B40008900AFDEF701EC0FF11D808380918800F2
+:100B50009091890001969093890080938800CF5FDF
+:100B6000C11750F490917F00923039F7809188003E
+:100B700090918900E9DDE6CF183010F410927F00E3
+:100B8000812F992702C08FEF90E0CF911F91FF90A6
+:100B9000EF900895CF92DF92EF92FF920F931F9301
+:100BA000CF93DF936C01062F40917F00413019F005
+:100BB000443009F07CC010E0101708F445C074C040
+:100BC00080918A0090918B00892B09F04CC0C12F35
+:100BD000DD27FE01EC0DFD1D608180918800909164
+:100BE0008900DADD80917D0090917E0001979093DD
+:100BF0007E0080937D00892BC9F410927F00809144
+:100C00008C0081FF13C080918D00282F33278091A5
+:100C10008A0090918B002817390741F0CC0DDD1D1B
+:100C200068818091880090918900FCDD8091880026
+:100C300090918900019690938900809388001F5FAE
+:100C4000101790F540917F00413009F4B9CFC12FC2
+:100C5000DD27FE01EC0DFD1D6081809188009091E3
+:100C600089003FDEBFCFC12FDD277E01EC0CFD1CCC
+:100C700040E0F701608180918800909189008CDDCF
+:100C800080918D00815080938D00882309F0AACF38
+:100C9000F70160818091880090918900C3DD809187
+:100CA0008A0080938D009ECF80E090E002C08FEF9D
+:100CB00090E0DF91CF911F910F91FF90EF90DF9027
+:100CC000CF900895CFE5D4E0DEBFCDBF12BA18BAF9
+:100CD0008BEF81BB17BA93E094BB8EEF85BB93BFBC
+:0E0CE00081E0A5DCF3DA78945FDA5EDAFDCF0E
+:040CEE005AD2FFFFD8
+:00000001FF
index a74de19..10d4ca6 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: avrdude.conf.in,v 1.36 2004/12/22 01:30:30 bdean Exp $
+# $Id: avrdude.conf.in,v 1.58 2005/09/18 00:44:20 bdean Exp $
 #
 # AVRDUDE Configuration File
 #
@@ -15,7 +15,7 @@
 #   programmer
 #       id       = <id1> [, <id2> [, <id3>] ...] ;  # <idN> are quoted strings
 #       desc     = <description> ;                  # quoted string
-#       type     = par | stk500 | avr910;           # programmer type
+#       type     = par | stk500 | stk500v2 | avr910 | jtagmkii; # programmer type
 #       baudrate = <num> ;                          # baudrate for avr910-programmer
 #       vcc      = <num1> [, <num2> ... ] ;         # pin number(s)
 #       reset    = <num> ;                          # pin number
 #   part
 #       id               = <id> ;                 # quoted string
 #       desc             = <description> ;        # quoted string
+#       has_jtag         = <yes/no> ;             # part has JTAG i/f
 #       devicecode       = <num> ;            # deprecated, use stk500_devcode
 #       stk500_devcode   = <num> ;                # numeric
 #       avr910_devcode   = <num> ;                # numeric
 #       chip_erase_delay = <num> ;                # micro-seconds
-#       pagel            = <num> ;                # pin name in hex, i.e., 0xD7
-#       bs2              = <num> ;                # pin name in hex, i.e., 0xA0
 #       reset            = dedicated | io;
 #       retry_pulse      = reset | sck;
 #       pgm_enable       = <instruction format> ;
 #       chip_erase       = <instruction format> ;
+#       chip_erase_delay = <num> ;                # chip erase delay (us)
+#       # STK500 parameters (parallel programming IO lines)
+#       pagel            = <num> ;                # pin name in hex, i.e., 0xD7
+#       bs2              = <num> ;                # pin name in hex, i.e., 0xA0
+#       serial           = <yes/no> ;             # can use serial downloading
+#       parallel         = <yes/no/pseudo>;       # can use par. programming
+#       # STK500v2 parameters, to be taken from Atmel's XML files
+#       timeout          = <num> ;
+#       stabdelay        = <num> ;
+#       cmdexdelay       = <num> ;
+#       synchloops       = <num> ;
+#       bytedelay        = <num> ;
+#       pollvalue        = <num> ;
+#       pollindex        = <num> ;
+#       predelay         = <num> ;
+#       postdelay        = <num> ;
+#       pollmethod       = <num> ;
+#       mode             = <num> ;
+#       delay            = <num> ;
+#       blocksize        = <num> ;
+#       readsize         = <num> ;
+#       # JTAG ICE mkII parameters, also from XML files
+#       allowfullpagebitstream = <yes/no> ;
+#       enablepageprogramming = <yes/no> ;
+#       idr              = <num> ;                # IO addr of IDR (OCD) reg.
+#       rampz            = <num> ;                # IO addr of RAMPZ reg.
+#       spmcr            = <num> ;                # mem addr of SPMC[S]R reg.
+#       eecr             = <num> ;                # mem addr of EECR reg.
+#                                                 # (only when != 0x3c)
+#
 #       memory <memtype>
 #           paged           = <yes/no> ;          # yes / no
 #           size            = <num> ;             # bytes
 #
 # Overall avrdude defaults
 #
-default_parallel   = "/dev/parport0";
-default_serial     = "/dev/ttyS0";
+default_parallel   = "lpt1";
+default_serial     = "com1";
 
 
 #
@@ -209,9 +238,9 @@ programmer
 ;
 
 programmer
-  id    = "usbasp";
-  desc  = "usbasp";
-  type  = usbasp;
+  id    = "avrispv2";
+  desc  = "Atmel AVR ISP V2";
+  type  =  stk500v2;
 ;
 
 programmer
@@ -221,18 +250,73 @@ programmer
 ;
 
 programmer
+  id    = "stk500v2";
+  desc  = "Atmel STK500 V2";
+  type  = stk500v2;
+;
+
+programmer
   id    = "avr910";
   desc  = "Atmel Low Cost Serial Programmer";
   type  = avr910;
 ;
 
 programmer
+  id    = "usbasp";
+  desc  = "usbasp";
+  type  = usbasp;
+;
+
+programmer
   id    = "butterfly";
   desc  = "Atmel Butterfly Development Board";
   type  = butterfly;
 ;
 
 programmer
+  id    = "avr109";
+  desc  = "Atmel AppNote AVR109 Boot Loader";
+  type  = butterfly;
+;
+
+programmer
+  id    = "avr911";
+  desc  = "Atmel AppNote AVR911 AVROSP";
+  type  = butterfly;
+;
+
+programmer
+  id    = "jtagmkII";
+  desc  = "Atmel JTAG ICE mkII";
+  baudrate = 19200;    # default is 19200
+  type  = jtagmkii;
+;
+
+# easier to type
+programmer
+  id    = "jtag2slow";
+  desc  = "Atmel JTAG ICE mkII";
+  baudrate = 19200;    # default is 19200
+  type  = jtagmkii;
+;
+
+# JTAG ICE mkII @ 115200 Bd
+programmer
+  id    = "jtag2fast";
+  desc  = "Atmel JTAG ICE mkII";
+  baudrate = 115200;
+  type  = jtagmkii;
+;
+
+# make the fast one the default, people will love that
+programmer
+  id    = "jtag2";
+  desc  = "Atmel JTAG ICE mkII";
+  baudrate = 115200;
+  type  = jtagmkii;
+;
+
+programmer
   id    = "pavr";
   desc  = "Jason Kyle's pAVR Serial Programmer";
   type  = avr910;
@@ -363,6 +447,62 @@ programmer
 ;
 
 
+programmer
+  id = "dapa";
+  desc = "Direct AVR Parallel Access cable";
+  type = par;
+  vcc   = 3;
+  reset = 16;
+  sck = 1;
+  mosi = 2;
+  miso = 11;
+;
+
+
+#
+# some ultra cheap programmers use bitbanging on the
+# serialport.
+#
+
+# serial ponyprog design (dasa2 in uisp)
+# reset=!txd sck=rts mosi=dtr miso=cts
+
+programmer
+  id    = "ponyser";
+  desc  = "serial port banging, design ponyprog serial";
+  type  = serbb;
+  reset = ~3;
+  sck   = 6;
+  mosi  = 4;
+  miso  = 7;
+;
+
+# unknown (dasa in uisp)
+# reset=rts sck=dtr mosi=txd miso=cts
+
+programmer
+  id    = "dasa";
+  desc  = "serial port banging, reset=rts sck=dtr mosi=txd miso=cts";
+  type  = serbb;
+  reset = 6;
+  sck   = 4;
+  mosi  = 3;
+  miso  = 7;
+;
+
+# unknown (dasa3 in uisp)
+# reset=!dtr sck=rts mosi=txd miso=cts
+
+programmer
+  id    = "dasa3";
+  desc  = "serial port banging, reset=!dtr sck=rts mosi=txd miso=cts";
+  type  = serbb;
+  reset = ~4;
+  sck   = 6;
+  mosi  = 3;
+  miso  = 7;
+;
+
 #
 # PART DEFINITIONS
 #
@@ -383,6 +523,17 @@ part
     chip_erase          = "1 0 1 0  1 1 0 0   1 0 0 x  x x x x",
                           "x x x x  x x x x   x x x x  x x x x";
 
+    timeout            = 200;
+    stabdelay          = 100;
+    cmdexedelay                = 25;
+    synchloops         = 32;
+    bytedelay          = 0;
+    pollindex          = 3;
+    pollvalue          = 0x53;
+    predelay           = 1;
+    postdelay          = 1;
+    pollmethod         = 0;
+
     memory "eeprom"
         size            = 64;
         min_write_delay = 9000;
@@ -394,6 +545,11 @@ part
 
         write           = "1  1  0  0   0  0  0  0    x x x x  x x x x",
                           "x  x a5 a4  a3 a2 a1 a0    i i i i  i i i i";
+
+       mode            = 0x04;
+       delay           = 8;
+       blocksize       = 64;
+       readsize        = 256;
     ;
 
     memory "flash"
@@ -421,6 +577,11 @@ part
                           "  x  x  x  x   x  x  x a8",
                           " a7 a6 a5 a4  a3 a2 a1 a0",
                           "  i  i  i  i   i  i  i  i";
+
+       mode            = 0x04;
+       delay           = 5;
+       blocksize       = 128;
+       readsize        = 256;
     ;
 
     memory "signature"
@@ -469,6 +630,17 @@ part
     chip_erase          = "1 0 1 0  1 1 0 0   1 0 0 x  x x x x",
                           "x x x x  x x x x   x x x x  x x x x";
 
+    timeout            = 200;
+    stabdelay          = 100;
+    cmdexedelay                = 25;
+    synchloops         = 32;
+    bytedelay          = 0;
+    pollindex          = 3;
+    pollvalue          = 0x53;
+    predelay           = 1;
+    postdelay          = 1;
+    pollmethod         = 1;
+
     memory "eeprom"
         size            = 64;
         min_write_delay = 4000;
@@ -480,6 +652,11 @@ part
 
         write           = "1  1  0  0   0  0  0  0    0 0 0 x  x x x x",
                           "x  x a5 a4  a3 a2 a1 a0    i i i i  i i i i";
+
+       mode            = 0x41;
+       delay           = 5;
+       blocksize       = 4;
+       readsize        = 256;
     ;
 
     memory "flash"
@@ -515,6 +692,11 @@ part
                           "  0  0  0  0   0  0  0 a8",
                           " a7 a6 a5 a4   x  x  x  x",
                           "  x  x  x  x   x  x  x  x";
+
+       mode            = 0x41;
+       delay           = 6;
+       blocksize       = 32;
+       readsize        = 256;
     ;
 
     memory "signature"
@@ -584,6 +766,17 @@ part
     chip_erase          = "1 0 1 0  1 1 0 0   1 0 0 x  x x x x",
                           "x x x x  x x x x   x x x x  x x x x";
 
+    timeout            = 200;
+    stabdelay          = 100;
+    cmdexedelay                = 25;
+    synchloops         = 32;
+    bytedelay          = 0;
+    pollindex          = 3;
+    pollvalue          = 0x53;
+    predelay           = 1;
+    postdelay          = 1;
+    pollmethod         = 0;
+
     memory "eeprom"
         size            = 64;
         min_write_delay = 8200;
@@ -595,6 +788,11 @@ part
 
         write           = "1  1  0  0   0  0  0  0    x x x x  x x x x",
                           "x  x a5 a4  a3 a2 a1 a0    i i i i  i i i i";
+
+       mode            = 0x04;
+       delay           = 10;
+       blocksize       = 64;
+       readsize        = 256;
     ;
 
     memory "flash"
@@ -622,6 +820,11 @@ part
                           "  x  x  x  x   x  x  x a8",
                           " a7 a6 a5 a4  a3 a2 a1 a0",
                           "  i  i  i  i   i  i  i  i";
+
+       mode            = 0x04;
+       delay           = 5;
+       blocksize       = 128;
+       readsize        = 256;
     ;
 
     memory "signature"
@@ -655,7 +858,6 @@ part
     ;
 ;
 
-
 #------------------------------------------------------------
 # AT90s1200
 #------------------------------------------------------------
@@ -674,6 +876,17 @@ part
     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
                        "x x x x  x x x x    x x x x  x x x x";
 
+    timeout            = 200;
+    stabdelay          = 100;
+    cmdexedelay                = 25;
+    synchloops         = 1;
+    bytedelay          = 0;
+    pollindex          = 0;
+    pollvalue          = 0xFF;
+    predelay           = 1;
+    postdelay          = 1;
+    pollmethod         = 0;
+
     memory "eeprom"
         size            = 64;
         min_write_delay = 4000;
@@ -685,6 +898,11 @@ part
 
         write           = "1 1  0  0   0  0  0  0   x x x x  x x x x",
                           "x x a5 a4  a3 a2 a1 a0   i i i i  i i i i";
+
+       mode            = 0x04;
+       delay           = 20;
+       blocksize       = 32;
+       readsize        = 256;
       ;
     memory "flash"
         size            = 1024;
@@ -711,6 +929,11 @@ part
                           "  x   x   x   x    x   x   x  a8",
                           " a7  a6  a5  a4   a3  a2  a1  a0",
                           "  i   i   i   i    i   i   i   i";
+
+       mode            = 0x02;
+       delay           = 15;
+       blocksize       = 128;
+       readsize        = 256;
       ;
     memory "signature"
         size            = 3;
@@ -755,6 +978,17 @@ part
     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
                        "x x x x  x x x x    x x x x  x x x x";
 
+    timeout            = 200;
+    stabdelay          = 100;
+    cmdexedelay                = 25;
+    synchloops         = 32;
+    bytedelay          = 0;
+    pollindex          = 3;
+    pollvalue          = 0x53;
+    predelay           = 1;
+    postdelay          = 1;
+    pollmethod         = 0;
+
     memory "eeprom"
         size            = 256;
         min_write_delay = 9000;
@@ -766,6 +1000,11 @@ part
 
         write           = " 1  1  0  0   0  0  0  0   x x x x  x x x a8",
                           "a7 a6 a5 a4  a3 a2 a1 a0   i i i i  i i i i";
+
+       mode            = 0x04;
+       delay           = 12;
+       blocksize       = 64;
+       readsize        = 256;
       ;
     memory "flash"
         size            = 4096;
@@ -792,6 +1031,11 @@ part
                           "  x   x   x   x  a11 a10  a9  a8",
                           " a7  a6  a5  a4   a3  a2  a1  a0",
                           "  i   i   i   i    i   i   i   i";
+
+       mode            = 0x04;
+       delay           = 12;
+       blocksize       = 64;
+       readsize        = 256;
       ;
     memory "signature"
         size            = 3;
@@ -816,6 +1060,17 @@ part
     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
                        "x x x x  x x x x    x x x x  x x x x";
 
+    timeout            = 200;
+    stabdelay          = 100;
+    cmdexedelay                = 25;
+    synchloops         = 32;
+    bytedelay          = 0;
+    pollindex          = 3;
+    pollvalue          = 0x53;
+    predelay           = 1;
+    postdelay          = 1;
+    pollmethod         = 0;
+
     memory "eeprom"
         size            = 128;
         min_write_delay = 4000;
@@ -827,6 +1082,11 @@ part
 
         write           = "1  1  0  0   0  0  0  0   x x x x  x x x x",
                           "x a6 a5 a4  a3 a2 a1 a0   i i i i  i i i i";
+
+       mode            = 0x04;
+       delay           = 12;
+       blocksize       = 64;
+       readsize        = 256;
       ;
     memory "flash"
         size            = 2048;
@@ -853,6 +1113,11 @@ part
                           "  x   x   x   x    x   x  a9  a8",
                           " a7  a6  a5  a4   a3  a2  a1  a0",
                           "  i   i   i   i    i   i   i   i";
+
+       mode            = 0x04;
+       delay           = 12;
+       blocksize       = 128;
+       readsize        = 256;
       ;
     memory "signature"
         size            = 3;
@@ -872,6 +1137,7 @@ part
 
 part
     id               = "2333";
+##### WARNING: No XML file for device 'AT90S2333'! #####
     desc             = "AT90S2333";
     stk500_devcode   = 0x42;
     avr910_devcode   = 0x34;
@@ -950,7 +1216,7 @@ part
 
 
 #------------------------------------------------------------
-# AT90s2343
+# AT90s2343 (also AT90s2323 and ATtiny22)
 #------------------------------------------------------------
 
 part
@@ -965,6 +1231,17 @@ part
     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
                        "x x x x  x x x x    x x x x  x x x x";
 
+    timeout            = 200;
+    stabdelay          = 100;
+    cmdexedelay                = 25;
+    synchloops         = 32;
+    bytedelay          = 0;
+    pollindex          = 3;
+    pollvalue          = 0x53;
+    predelay           = 1;
+    postdelay          = 1;
+    pollmethod         = 0;
+
     memory "eeprom"
         size            = 128;
         min_write_delay = 9000;
@@ -976,6 +1253,11 @@ part
 
         write           = "1  1  0  0   0  0  0  0   0 0 0 0  0 0 0 0",
                           "x a6 a5 a4  a3 a2 a1 a0   i i i i  i i i i";
+
+       mode            = 0x04;
+       delay           = 12;
+       blocksize       = 64;
+       readsize        = 256;
       ;
     memory "flash"
         size            = 2048;
@@ -1002,6 +1284,11 @@ part
                           "  x   x   x   x    x   x  a9  a8",
                           " a7  a6  a5  a4   a3  a2  a1  a0",
                           "  i   i   i   i    i   i   i   i";
+
+       mode            = 0x04;
+       delay           = 12;
+       blocksize       = 128;
+       readsize        = 128;
       ;
     memory "signature"
         size            = 3;
@@ -1047,6 +1334,17 @@ part
     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
                        "x x x x  x x x x    x x x x  x x x x";
 
+    timeout            = 200;
+    stabdelay          = 100;
+    cmdexedelay                = 25;
+    synchloops         = 32;
+    bytedelay          = 0;
+    pollindex          = 3;
+    pollvalue          = 0x53;
+    predelay           = 1;
+    postdelay          = 1;
+    pollmethod         = 0;
+
     memory "eeprom"
         size            = 256;
         min_write_delay = 9000;
@@ -1058,6 +1356,11 @@ part
 
         write           = " 1  1  0  0   0  0  0  0   x x x x  x x x x",
                           "a7 a6 a5 a4  a3 a2 a1 a0   i i i i  i i i i";
+
+       mode            = 0x04;
+       delay           = 12;
+       blocksize       = 128;
+       readsize        = 256;
       ;
     memory "flash"
         size            = 4096;
@@ -1084,6 +1387,11 @@ part
                           "  x   x   x   x    x a10  a9  a8",
                           " a7  a6  a5  a4   a3  a2  a1  a0",
                           "  i   i   i   i    i   i   i   i";
+
+       mode            = 0x04;
+       delay           = 12;
+       blocksize       = 128;
+       readsize        = 256;
       ;
     memory "signature"
         size            = 3;
@@ -1119,6 +1427,7 @@ part
 
 part
     id               = "4434";
+##### WARNING: No XML file for device 'AT90S4434'! #####
     desc             = "AT90S4434";
     stk500_devcode   = 0x52;
     avr910_devcode   = 0x6c;
@@ -1210,6 +1519,17 @@ part
     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
                        "x x x x  x x x x    x x x x  x x x x";
 
+    timeout            = 200;
+    stabdelay          = 100;
+    cmdexedelay                = 25;
+    synchloops         = 32;
+    bytedelay          = 0;
+    pollindex          = 3;
+    pollvalue          = 0x53;
+    predelay           = 1;
+    postdelay          = 1;
+    pollmethod         = 0;
+
     memory "eeprom"
         size            = 512;
         min_write_delay = 4000;
@@ -1221,6 +1541,11 @@ part
 
         write           = " 1  1  0  0   0  0  0  0   x x x x  x x x a8",
                           "a7 a6 a5 a4  a3 a2 a1 a0   i i i i  i i i i";
+
+       mode            = 0x04;
+       delay           = 12;
+       blocksize       = 128;
+       readsize        = 256;
       ;
     memory "flash"
         size            = 8192;
@@ -1247,6 +1572,11 @@ part
                           "  x   x   x   x  a11 a10  a9  a8",
                           " a7  a6  a5  a4   a3  a2  a1  a0",
                           "  i   i   i   i    i   i   i   i";
+
+       mode            = 0x04;
+       delay           = 12;
+       blocksize       = 128;
+       readsize        = 256;
       ;
     memory "signature"
         size            = 3;
@@ -1285,6 +1615,17 @@ part
     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
                        "x x x x  x x x x    x x x x  x x x x";
 
+    timeout            = 200;
+    stabdelay          = 100;
+    cmdexedelay                = 25;
+    synchloops         = 32;
+    bytedelay          = 0;
+    pollindex          = 3;
+    pollvalue          = 0x53;
+    predelay           = 1;
+    postdelay          = 1;
+    pollmethod         = 0;
+
     memory "eeprom"
         size            = 512;
         min_write_delay = 9000;
@@ -1296,6 +1637,11 @@ part
 
         write           = " 1  1  0  0   0  0  0  0   x x x x  x x x a8",
                           "a7 a6 a5 a4  a3 a2 a1 a0   i i i i  i i i i";
+
+       mode            = 0x04;
+       delay           = 12;
+       blocksize       = 128;
+       readsize        = 256;
       ;
     memory "flash"
         size            = 8192;
@@ -1322,6 +1668,11 @@ part
                           "  x   x   x   x  a11 a10  a9  a8",
                           " a7  a6  a5  a4   a3  a2  a1  a0",
                           "  i   i   i   i    i   i   i   i";
+
+       mode            = 0x04;
+       delay           = 12;
+       blocksize       = 128;
+       readsize        = 256;
       ;
     memory "signature"
         size            = 3;
@@ -1360,12 +1711,23 @@ part
     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
                        "x x x x  x x x x    x x x x  x x x x";
 
+    timeout            = 200;
+    stabdelay          = 100;
+    cmdexedelay                = 25;
+    synchloops         = 32;
+    bytedelay          = 0;
+    pollindex          = 3;
+    pollvalue          = 0x53;
+    predelay           = 1;
+    postdelay          = 1;
+    pollmethod         = 0;
+
     memory "eeprom"
         size            = 4096;
         min_write_delay = 4000;
         max_write_delay = 9000;
-        readback_p1     = 0x00;
-        readback_p2     = 0xff;
+        readback_p1     = 0x80;
+        readback_p2     = 0x7f;
        read            = "  1   0   1   0      0   0   0   0",
                           "  x   x   x   x    a11 a10  a9  a8",
                           " a7  a6  a5  a4     a3  a2  a1  a0",
@@ -1375,6 +1737,11 @@ part
                           "  x   x   x   x    a11 a10  a9  a8",
                           " a7  a6  a5  a4     a3  a2  a1  a0",
                           "  i   i   i   i      i   i   i   i";
+
+       mode            = 0x04;
+       delay           = 12;
+       blocksize       = 64;
+       readsize        = 256;
       ;
 
     memory "flash"
@@ -1410,6 +1777,11 @@ part
                           "a15 a14 a13 a12    a11 a10  a9  a8",
                           " a7   x   x   x      x   x   x   x",
                           "  x   x   x   x      x   x   x   x";
+
+       mode            = 0x11;
+       delay           = 70;
+       blocksize       = 256;
+       readsize        = 256;
       ;
 
     memory "fuse"
@@ -1445,6 +1817,7 @@ part
 part
     id               = "m64";
     desc             = "ATMEGA64";
+    has_jtag         = yes;
     stk500_devcode   = 0xA0;
     chip_erase_delay = 9000;
     pagel            = 0xD7;
@@ -1456,6 +1829,21 @@ part
     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
                        "x x x x  x x x x    x x x x  x x x x";
 
+    timeout            = 200;
+    stabdelay          = 100;
+    cmdexedelay                = 25;
+    synchloops         = 32;
+    bytedelay          = 0;
+    pollindex          = 3;
+    pollvalue          = 0x53;
+    predelay           = 1;
+    postdelay          = 1;
+    pollmethod         = 0;
+
+    idr                 = 0x22;
+    spmcr               = 0x68;
+    allowfullpagebitstream = yes;
+
     memory "eeprom"
         paged           = no; /* leave this "no" */
         page_size       = 8;  /* for parallel programming */
@@ -1464,15 +1852,20 @@ part
         max_write_delay = 9000;
         readback_p1     = 0xff;
         readback_p2     = 0xff;
-       read            = "  1   0   1   0      0   0   0   0",
+        read            = "  1   0   1   0      0   0   0   0",
                           "  x   x   x   x    a11 a10  a9  a8",
                           " a7  a6  a5  a4     a3  a2  a1  a0",
                           "  o   o   o   o      o   o   o   o";
 
-       write           = "  1   1   0   0      0   0   0   0",
+        write           = "  1   1   0   0      0   0   0   0",
                           "  x   x   x   x    a11 a10  a9  a8",
                           " a7  a6  a5  a4     a3  a2  a1  a0",
                           "  i   i   i   i      i   i   i   i";
+
+       mode            = 0x04;
+       delay           = 20;
+       blocksize       = 64;
+       readsize        = 256;
       ;
 
     memory "flash"
@@ -1494,6 +1887,7 @@ part
                           " a7  a6  a5  a4     a3  a2  a1  a0",
                           "  o   o   o   o      o   o   o   o";
 
+
         loadpage_lo     = "  0   1   0   0      0   0   0   0",
                           "  x   x   x   x      x   x   x   x",
                           "  x  a6  a5  a4     a3  a2  a1  a0",
@@ -1508,6 +1902,11 @@ part
                           "  x a14 a13 a12    a11 a10  a9  a8",
                           " a7   x   x   x      x   x   x   x",
                           "  x   x   x   x      x   x   x   x";
+
+       mode            = 0x21;
+       delay           = 6;
+       blocksize       = 128;
+       readsize        = 256;
       ;
 
     memory "lfuse"
@@ -1569,6 +1968,7 @@ part
 part
     id               = "m128";
     desc             = "ATMEGA128";
+    has_jtag         = yes;
     stk500_devcode   = 0xB2;
     avr910_devcode   = 0x43;
     chip_erase_delay = 9000;
@@ -1581,6 +1981,22 @@ part
     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
                        "x x x x  x x x x    x x x x  x x x x";
 
+    timeout            = 200;
+    stabdelay          = 100;
+    cmdexedelay                = 25;
+    synchloops         = 32;
+    bytedelay          = 0;
+    pollindex          = 3;
+    pollvalue          = 0x53;
+    predelay           = 1;
+    postdelay          = 1;
+    pollmethod         = 0;
+
+    idr                 = 0x22;
+    spmcr               = 0x68;
+    rampz               = 0x3b;
+    allowfullpagebitstream = yes;
+
     memory "eeprom"
         paged           = no; /* leave this "no" */
         page_size       = 8;  /* for parallel programming */
@@ -1589,15 +2005,20 @@ part
         max_write_delay = 9000;
         readback_p1     = 0xff;
         readback_p2     = 0xff;
-       read            = "  1   0   1   0      0   0   0   0",
+        read            = "  1   0   1   0      0   0   0   0",
                           "  x   x   x   x    a11 a10  a9  a8",
                           " a7  a6  a5  a4     a3  a2  a1  a0",
                           "  o   o   o   o      o   o   o   o";
 
-       write           = "  1   1   0   0      0   0   0   0",
+        write           = "  1   1   0   0      0   0   0   0",
                           "  x   x   x   x    a11 a10  a9  a8",
                           " a7  a6  a5  a4     a3  a2  a1  a0",
                           "  i   i   i   i      i   i   i   i";
+
+       mode            = 0x04;
+       delay           = 12;
+       blocksize       = 64;
+       readsize        = 256;
       ;
 
     memory "flash"
@@ -1633,6 +2054,11 @@ part
                           "a15 a14 a13 a12    a11 a10  a9  a8",
                           " a7   x   x   x      x   x   x   x",
                           "  x   x   x   x      x   x   x   x";
+
+       mode            = 0x21;
+       delay           = 6;
+       blocksize       = 128;
+       readsize        = 256;
       ;
 
     memory "lfuse"
@@ -1672,9 +2098,9 @@ part
       ;
 
     memory "calibration"
-        size            = 1;
-        read            = "0 0 1 1  1 0 0 0  x x x x  x x x x",
-                          "0 0 0 0  0 0 0  o o o o  o o o o";
+        size            = 4;
+        read            = "0 0 1 1  1 0 0 0    x x x x  x x x x",
+                          "0 0 0 0  0 0 a1 a0  o o o o  o o o o";
       ;
 
     memory "signature"
@@ -1691,6 +2117,7 @@ part
 part
     id               = "c128";
     desc             = "AT90CAN128";
+    has_jtag         = yes;
     stk500_devcode   = 0xB3;
 #    avr910_devcode   = 0x43;
     chip_erase_delay = 9000;
@@ -1703,6 +2130,23 @@ part
     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
                        "x x x x  x x x x    x x x x  x x x x";
 
+    timeout            = 200;
+    stabdelay          = 100;
+    cmdexedelay                = 25;
+    synchloops         = 32;
+    bytedelay          = 0;
+    pollindex          = 3;
+    pollvalue          = 0x53;
+    predelay           = 1;
+    postdelay          = 1;
+    pollmethod         = 1;
+
+    idr                 = 0x31;
+    spmcr               = 0x57;
+    rampz               = 0x3b;
+    eecr                = 0x3f;
+    allowfullpagebitstream = no;
+
     memory "eeprom"
         paged           = no; /* leave this "no" */
         page_size       = 8;  /* for parallel programming */
@@ -1720,6 +2164,11 @@ part
                           "  0   0   0   x    a11 a10  a9  a8",
                           " a7  a6  a5  a4     a3  a2  a1  a0",
                           "  i   i   i   i      i   i   i   i";
+
+       mode            = 0x41;
+       delay           = 20;
+       blocksize       = 8;
+       readsize        = 256;
       ;
 
     memory "flash"
@@ -1755,6 +2204,11 @@ part
                           "a15 a14 a13 a12    a11 a10  a9  a8",
                           " a7   x   x   x      x   x   x   x",
                           "  x   x   x   x      x   x   x   x";
+
+       mode            = 0x41;
+       delay           = 6;
+       blocksize       = 256;
+       readsize        = 256;
       ;
 
     memory "lfuse"
@@ -1814,6 +2268,7 @@ part
 part
     id               = "m16";
     desc             = "ATMEGA16";
+    has_jtag         = yes;
     stk500_devcode   = 0x82;
     avr910_devcode   = 0x74;
     pagel            = 0xd7;
@@ -1825,7 +2280,24 @@ part
     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
                        "x x x x  x x x x    x x x x  x x x x";
 
+    timeout            = 200;
+    stabdelay          = 100;
+    cmdexedelay                = 25;
+    synchloops         = 32;
+    bytedelay          = 0;
+    pollindex          = 3;
+    pollvalue          = 0x53;
+    predelay           = 1;
+    postdelay          = 1;
+    pollmethod         = 0;
+
+    idr                 = 0x31;
+    spmcr               = 0x57;
+    allowfullpagebitstream = yes;
+
     memory "eeprom"
+        paged           = no; /* leave this "no" */
+        page_size       = 4;  /* for parallel programming */
         size            = 512;
         min_write_delay = 9000;
         max_write_delay = 9000;
@@ -1840,6 +2312,11 @@ part
                           "  0   0   x   x      x   x  a9  a8",
                           " a7  a6  a5  a4     a3  a2  a1  a0",
                           "  i   i   i   i      i   i   i   i";
+
+       mode            = 0x04;
+       delay           = 10;
+       blocksize       = 128;
+       readsize        = 256;
       ;
 
     memory "flash"
@@ -1875,6 +2352,11 @@ part
                           "  0   0 a13 a12    a11 a10  a9  a8",
                           " a7  a6   x   x      x   x   x   x",
                           "  x   x   x   x      x   x   x   x";
+
+       mode            = 0x21;
+       delay           = 6;
+       blocksize       = 128;
+       readsize        = 256;
       ;
 
     memory "lock"
@@ -1912,21 +2394,66 @@ part
 
 
 #------------------------------------------------------------
-# ATmega162
+# ATmega164
 #------------------------------------------------------------
 
+# close to ATmega16
+
 part
-    id               = "m162";
-    desc             = "ATMEGA162";
-    stk500_devcode   = 0x83;
+    id               = "m164";
+    desc             = "ATMEGA164";
+    has_jtag         = yes;
+#   stk500_devcode   = 0x82; # no STK500v1 support
+#   avr910_devcode   = 0x?;  # try the ATmega16 one:^
+    avr910_devcode   = 0x74;
+    pagel            = 0xd7;
+    bs2              = 0xa0;
     chip_erase_delay = 9000;
-
     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
                        "x x x x  x x x x    x x x x  x x x x";
 
     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
                        "x x x x  x x x x    x x x x  x x x x";
 
+    timeout            = 200;
+    stabdelay          = 100;
+    cmdexedelay                = 25;
+    synchloops         = 32;
+    bytedelay          = 0;
+    pollindex          = 3;
+    pollvalue          = 0x53;
+    predelay           = 1;
+    postdelay          = 1;
+    pollmethod         = 0;
+
+    idr                 = 0x31;
+    spmcr               = 0x57;
+    allowfullpagebitstream = no;
+
+    memory "eeprom"
+        paged           = no; /* leave this "no" */
+        page_size       = 4;  /* for parallel programming */
+        size            = 512;
+        min_write_delay = 9000;
+        max_write_delay = 9000;
+        readback_p1     = 0xff;
+        readback_p2     = 0xff;
+       read            = "  1   0   1   0      0   0   0   0",
+                          "  0   0   x   x      x   x  a9  a8",
+                          " a7  a6  a5  a4     a3  a2  a1  a0",
+                          "  o   o   o   o      o   o   o   o";
+
+       write           = "  1   1   0   0      0   0   0   0",
+                          "  0   0   x   x      x   x  a9  a8",
+                          " a7  a6  a5  a4     a3  a2  a1  a0",
+                          "  i   i   i   i      i   i   i   i";
+
+       mode            = 0x04;
+       delay           = 10;
+       blocksize       = 128;
+       readsize        = 256;
+      ;
+
     memory "flash"
         paged           = yes;
         size            = 16384;
@@ -1936,7 +2463,6 @@ part
         max_write_delay = 4500;
         readback_p1     = 0xff;
         readback_p2     = 0xff;
-
         read_lo         = "  0   0   1   0      0   0   0   0",
                           "  0   0 a13 a12    a11 a10  a9  a8",
                           " a7  a6  a5  a4     a3  a2  a1  a0",
@@ -1961,190 +2487,201 @@ part
                           "  0   0 a13 a12    a11 a10  a9  a8",
                           " a7  a6   x   x      x   x   x   x",
                           "  x   x   x   x      x   x   x   x";
-      ;
 
-    memory "eeprom"
-        size            = 512;
-        min_write_delay = 9000;
-        max_write_delay = 9000;
-        readback_p1     = 0xff;
-        readback_p2     = 0xff;
+       mode            = 0x21;
+       delay           = 6;
+       blocksize       = 128;
+       readsize        = 256;
+      ;
 
-                read            = "  1   0   1   0      0   0   0   0",
-                          "  0   0   x   x      x   x  a9  a8",
-                          " a7  a6  a5  a4     a3  a2  a1  a0",
-                          "  o   o   o   o      o   o   o   o";
+    memory "lock"
+        size            = 1;
+        read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
+                          "x x x x  x x x x   x x o o  o o o o";
 
-                write           = "  1   1   0   0      0   0   0   0",
-                          "  0   0   x   x      x   x  a9  a8",
-                          " a7  a6  a5  a4     a3  a2  a1  a0",
-                          "  i   i   i   i      i   i   i   i";
-        ;
+        write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
+                          "x x x x  x x x x   1 1 i i  i i i i";
+      ;
 
     memory "lfuse"
         size            = 1;
-        min_write_delay = 16000;
-        max_write_delay = 16000;
         read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
                           "x x x x  x x x x   o o o o  o o o o";
 
         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
                           "x x x x  x x x x   i i i i  i i i i";
-        ;
+      ;
 
     memory "hfuse"
         size            = 1;
-        min_write_delay = 16000;
-        max_write_delay = 16000;
-
         read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
                           "x x x x  x x x x   o o o o  o o o o";
 
         write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
                           "x x x x  x x x x   i i i i  i i i i";
-        ;
+      ;
 
     memory "efuse"
         size            = 1;
-        min_write_delay = 16000;
-        max_write_delay = 16000;
 
         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
                           "x x x x  x x x x  o o o o  o o o o";
 
         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
-                          "x x x x  x x x x  1 1 1 i  i i i 1";
+                          "x x x x  x x x x  1 1 1 1  1 i i i";
       ;
 
-    memory "lock"
-        size            = 1;
-        min_write_delay = 16000;
-        max_write_delay = 16000;
-
-        read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
-                          "x x x x  x x x x   x x o o  o o o o";
-
-        write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
-                          "x x x x  x x x x   1 1 i i  i i i i";
-        ;
-
     memory "signature"
         size            = 3;
-
-        read            = "0  0  1  1   0  0  0  0   0  0  x  x   x  x  x  x",
+        read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
-        ;
+      ;
 
     memory "calibration"
         size            = 1;
 
-        read            = "0 0 1 1  1 0 0 0   0 0 x x  x x x x",
+        read            = "0 0 1 1  1 0 0 0   0 0 0 x  x x x x",
                           "0 0 0 0  0 0 0 0   o o o o  o o o o";
         ;
-;
-
+  ;
 
 
 #------------------------------------------------------------
-# ATmega163
+# ATmega324
 #------------------------------------------------------------
 
+# similar to ATmega164
+
 part
-    id               = "m163";
-    desc             = "ATMEGA163";
-    stk500_devcode   = 0x81;
-    avr910_devcode   = 0x64;
-    chip_erase_delay = 32000;
+    id               = "m324";
+    desc             = "ATMEGA324";
+    has_jtag         = yes;
+#   stk500_devcode   = 0x82; # no STK500v1 support
+#   avr910_devcode   = 0x?;  # try the ATmega16 one:^
+    avr910_devcode   = 0x74;
     pagel            = 0xd7;
     bs2              = 0xa0;
+    chip_erase_delay = 9000;
     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
                        "x x x x  x x x x    x x x x  x x x x";
 
-    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
+    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
                        "x x x x  x x x x    x x x x  x x x x";
-   memory "eeprom"
-        size            = 512;
-        min_write_delay = 4000;
-        max_write_delay = 4000;
+
+    timeout            = 200;
+    stabdelay          = 100;
+    cmdexedelay                = 25;
+    synchloops         = 32;
+    bytedelay          = 0;
+    pollindex          = 3;
+    pollvalue          = 0x53;
+    predelay           = 1;
+    postdelay          = 1;
+    pollmethod         = 0;
+
+    idr                 = 0x31;
+    spmcr               = 0x57;
+    allowfullpagebitstream = no;
+
+    memory "eeprom"
+        paged           = no; /* leave this "no" */
+        page_size       = 4;  /* for parallel programming */
+        size            = 1024;
+        min_write_delay = 9000;
+        max_write_delay = 9000;
         readback_p1     = 0xff;
         readback_p2     = 0xff;
        read            = "  1   0   1   0      0   0   0   0",
-                          "  x   x   x   x      x   x   x  a8",
+                          "  0   0   x   x      x a10  a9  a8",
                           " a7  a6  a5  a4     a3  a2  a1  a0",
                           "  o   o   o   o      o   o   o   o";
 
        write           = "  1   1   0   0      0   0   0   0",
-                          "  x   x   x   x      x   x   x  a8",
+                          "  0   0   x   x      x a10  a9  a8",
                           " a7  a6  a5  a4     a3  a2  a1  a0",
                           "  i   i   i   i      i   i   i   i";
+
+       mode            = 0x04;
+       delay           = 10;
+       blocksize       = 128;
+       readsize        = 256;
       ;
 
     memory "flash"
         paged           = yes;
-        size            = 16384;
-        page_size       = 128;
+        size            = 32768;
+        page_size       = 256;
         num_pages       = 128;
-        min_write_delay = 16000;
-        max_write_delay = 16000;
+        min_write_delay = 4500;
+        max_write_delay = 4500;
         readback_p1     = 0xff;
         readback_p2     = 0xff;
         read_lo         = "  0   0   1   0      0   0   0   0",
-                          "  x   x   x a12    a11 a10  a9  a8",
+                          "  0 a14 a13 a12    a11 a10  a9  a8",
                           " a7  a6  a5  a4     a3  a2  a1  a0",
                           "  o   o   o   o      o   o   o   o";
 
         read_hi         = "  0   0   1   0      1   0   0   0",
-                          "  x   x   x a12    a11 a10  a9  a8",
+                          "  0 a14 a13 a12    a11 a10  a9  a8",
                           " a7  a6  a5  a4     a3  a2  a1  a0",
                           "  o   o   o   o      o   o   o   o";
 
         loadpage_lo     = "  0   1   0   0      0   0   0   0",
-                          "  x   x   x   x      x   x   x   x",
-                          "  x   x  a5  a4     a3  a2  a1  a0",
+                          "  0   0   x   x      x   x   x   x",
+                          "  x  a6  a5  a4     a3  a2  a1  a0",
                           "  i   i   i   i      i   i   i   i";
 
         loadpage_hi     = "  0   1   0   0      1   0   0   0",
-                          "  x   x   x   x      x   x   x   x",
-                          "  x   x  a5  a4     a3  a2  a1  a0",
+                          "  0   0   x   x      x   x   x   x",
+                          "  x  a6  a5  a4     a3  a2  a1  a0",
                           "  i   i   i   i      i   i   i   i";
 
         writepage       = "  0   1   0   0      1   1   0   0",
-                          "  x   x   x a12    a11 a10  a9  a8",
-                          " a7  a6   x   x      x   x   x   x",
+                          "  0 a14 a13 a12    a11 a10  a9  a8",
+                          " a7   x   x   x      x   x   x   x",
                           "  x   x   x   x      x   x   x   x";
+
+       mode            = 0x21;
+       delay           = 6;
+       blocksize       = 256;
+       readsize        = 256;
+      ;
+
+    memory "lock"
+        size            = 1;
+        read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
+                          "x x x x  x x x x   x x o o  o o o o";
+
+        write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
+                          "x x x x  x x x x   1 1 i i  i i i i";
       ;
 
     memory "lfuse"
         size            = 1;
-        min_write_delay = 2000;
-        max_write_delay = 2000;
         read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
-                          "x x x x  x x x x   o o x x  o o o o";
+                          "x x x x  x x x x   o o o o  o o o o";
 
         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
-                          "x x x x  x x x x   i i 1 1  i i i i";
+                          "x x x x  x x x x   i i i i  i i i i";
       ;
 
     memory "hfuse"
         size            = 1;
-        min_write_delay = 2000;
-        max_write_delay = 2000;
         read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
-                          "x x x x  x x x x   x x x x  1 o o o";
+                          "x x x x  x x x x   o o o o  o o o o";
 
         write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
-                          "x x x x  x x x x   1 1 1 1  1 i i i";
+                          "x x x x  x x x x   i i i i  i i i i";
       ;
 
-    memory "lock"
+    memory "efuse"
         size            = 1;
-        min_write_delay = 2000;
-        max_write_delay = 2000;
-        read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
-                          "x x x x  0 x x x   x x o o  o o o o";
 
-        write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
-                          "x x x x  x x x x   1 1 i i  i i i i";
+        read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
+                          "x x x x  x x x x  o o o o  o o o o";
+
+        write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
+                          "x x x x  x x x x  1 1 1 1  1 i i i";
       ;
 
     memory "signature"
@@ -2155,82 +2692,125 @@ part
 
     memory "calibration"
         size            = 1;
-        read            = "0 0 1 1  1 0 0 0   x x x x  x x x x",
+
+        read            = "0 0 1 1  1 0 0 0   0 0 0 x  x x x x",
                           "0 0 0 0  0 0 0 0   o o o o  o o o o";
-      ;
+        ;
   ;
 
+
 #------------------------------------------------------------
-# ATmega169
+# ATmega644
 #------------------------------------------------------------
 
+# similar to ATmega164
+
 part
-    id               = "m169";
-    desc             = "ATMEGA169";
-    stk500_devcode   = 0x85;
-    avr910_devcode   = 0x75;
+    id               = "m644";
+    desc             = "ATMEGA644";
+    has_jtag         = yes;
+#   stk500_devcode   = 0x82; # no STK500v1 support
+#   avr910_devcode   = 0x?;  # try the ATmega16 one:^
+    avr910_devcode   = 0x74;
+    pagel            = 0xd7;
+    bs2              = 0xa0;
     chip_erase_delay = 9000;
     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
                        "x x x x  x x x x    x x x x  x x x x";
 
-    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
+    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
                        "x x x x  x x x x    x x x x  x x x x";
-   memory "eeprom"
-        size            = 512;
+
+    timeout            = 200;
+    stabdelay          = 100;
+    cmdexedelay                = 25;
+    synchloops         = 32;
+    bytedelay          = 0;
+    pollindex          = 3;
+    pollvalue          = 0x53;
+    predelay           = 1;
+    postdelay          = 1;
+    pollmethod         = 0;
+
+    idr                 = 0x31;
+    spmcr               = 0x57;
+    allowfullpagebitstream = no;
+
+    memory "eeprom"
+        paged           = no; /* leave this "no" */
+        page_size       = 8;  /* for parallel programming */
+        size            = 2048;
         min_write_delay = 9000;
         max_write_delay = 9000;
         readback_p1     = 0xff;
         readback_p2     = 0xff;
        read            = "  1   0   1   0      0   0   0   0",
-                          "  x   x   x   x      x   x   x  a8",
+                          "  0   0   x   x    a11 a10  a9  a8",
                           " a7  a6  a5  a4     a3  a2  a1  a0",
                           "  o   o   o   o      o   o   o   o";
 
        write           = "  1   1   0   0      0   0   0   0",
-                          "  x   x   x   x      x   x   x  a8",
+                          "  0   0   x   x    a11 a10  a9  a8",
                           " a7  a6  a5  a4     a3  a2  a1  a0",
                           "  i   i   i   i      i   i   i   i";
+
+       mode            = 0x04;
+       delay           = 10;
+       blocksize       = 128;
+       readsize        = 256;
       ;
 
     memory "flash"
         paged           = yes;
-        size            = 16384;
-        page_size       = 128;
-        num_pages       = 128;
+        size            = 65536;
+        page_size       = 256;
+        num_pages       = 256;
         min_write_delay = 4500;
         max_write_delay = 4500;
         readback_p1     = 0xff;
         readback_p2     = 0xff;
         read_lo         = "  0   0   1   0      0   0   0   0",
-                          "  x   x   x a12    a11 a10  a9  a8",
+                          "a15 a14 a13 a12    a11 a10  a9  a8",
                           " a7  a6  a5  a4     a3  a2  a1  a0",
                           "  o   o   o   o      o   o   o   o";
 
         read_hi         = "  0   0   1   0      1   0   0   0",
-                          "  x   x   x a12    a11 a10  a9  a8",
+                          "a15 a14 a13 a12    a11 a10  a9  a8",
                           " a7  a6  a5  a4     a3  a2  a1  a0",
                           "  o   o   o   o      o   o   o   o";
 
         loadpage_lo     = "  0   1   0   0      0   0   0   0",
-                          "  x   x   x   x      x   x   x   x",
-                          "  x   x  a5  a4     a3  a2  a1  a0",
+                          "  0   0   x   x      x   x   x   x",
+                          "  x  a6  a5  a4     a3  a2  a1  a0",
                           "  i   i   i   i      i   i   i   i";
 
         loadpage_hi     = "  0   1   0   0      1   0   0   0",
-                          "  x   x   x   x      x   x   x   x",
-                          "  x   x  a5  a4     a3  a2  a1  a0",
+                          "  0   0   x   x      x   x   x   x",
+                          "  x  a6  a5  a4     a3  a2  a1  a0",
                           "  i   i   i   i      i   i   i   i";
 
         writepage       = "  0   1   0   0      1   1   0   0",
-                          "  x   x   x a12    a11 a10  a9  a8",
-                          " a7  a6   x   x      x   x   x   x",
+                          "a15 a14 a13 a12    a11 a10  a9  a8",
+                          " a7   x   x   x      x   x   x   x",
                           "  x   x   x   x      x   x   x   x";
+
+       mode            = 0x21;
+       delay           = 6;
+       blocksize       = 256;
+       readsize        = 256;
+      ;
+
+    memory "lock"
+        size            = 1;
+        read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
+                          "x x x x  x x x x   x x o o  o o o o";
+
+        write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
+                          "x x x x  x x x x   1 1 i i  i i i i";
       ;
 
     memory "lfuse"
         size            = 1;
-        min_write_delay = 2000;
-        max_write_delay = 2000;
         read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
                           "x x x x  x x x x   o o o o  o o o o";
 
@@ -2240,8 +2820,6 @@ part
 
     memory "hfuse"
         size            = 1;
-        min_write_delay = 2000;
-        max_write_delay = 2000;
         read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
                           "x x x x  x x x x   o o o o  o o o o";
 
@@ -2251,83 +2829,60 @@ part
 
     memory "efuse"
         size            = 1;
-        write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
-                          "x x x x  x x x x  x x x x  i i i x";
 
         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
                           "x x x x  x x x x  o o o o  o o o o";
-      ;
-
-    memory "lock"
-        size            = 1;
-        min_write_delay = 2000;
-        max_write_delay = 2000;
-        read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
-                          "x x x x  x x x x   x x o o  o o o o";
 
-        write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
-                          "x x x x  x x x x   1 1 i i  i i i i";
+        write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
+                          "x x x x  x x x x  1 1 1 1  1 i i i";
       ;
 
     memory "signature"
         size            = 3;
-        read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
+        read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
       ;
 
     memory "calibration"
         size            = 1;
+
         read            = "0 0 1 1  1 0 0 0   0 0 0 x  x x x x",
                           "0 0 0 0  0 0 0 0   o o o o  o o o o";
-      ;
+        ;
   ;
 
+
 #------------------------------------------------------------
-# ATmega32
+# ATmega162
 #------------------------------------------------------------
 
 part
-    id               = "m32";
-    desc             = "ATMEGA32";
-    stk500_devcode   = 0x91;
-    avr910_devcode   = 0x72;
+    id               = "m162";
+    desc             = "ATMEGA162";
+    has_jtag         = yes;
+    stk500_devcode   = 0x83;
     chip_erase_delay = 9000;
-    pagel            = 0xd7;
-    bs2              = 0xa0;
-    reset            = dedicated;
+
+    idr              = 0x04;
+    spmcr            = 0x57;
+    allowfullpagebitstream = yes;
+
     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
                        "x x x x  x x x x    x x x x  x x x x";
 
-    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
+    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
                        "x x x x  x x x x    x x x x  x x x x";
-   memory "eeprom"
-        paged           = no;   /* leave this "no" */
-        page_size       = 4;    /* for parallel programming */
-        size            = 1024;
-        min_write_delay = 9000;
-        max_write_delay = 9000;
-        readback_p1     = 0xff;
-        readback_p2     = 0xff;
-        read            = "  1   0   1   0      0   0   0   0",
-                          "  0   0   x   x      x   x  a9  a8",
-                          " a7  a6  a5  a4     a3  a2  a1  a0",
-                          "  o   o   o   o      o   o   o   o";
-
-        write           = "  1   1   0   0      0   0   0   0",
-                          "  0   0   x   x      x   x  a9  a8",
-                          " a7  a6  a5  a4     a3  a2  a1  a0",
-                          "  i   i   i   i      i   i   i   i";
-      ;
 
     memory "flash"
         paged           = yes;
-        size            = 32768;
+        size            = 16384;
         page_size       = 128;
-        num_pages       = 256;
+        num_pages       = 128;
         min_write_delay = 4500;
         max_write_delay = 4500;
         readback_p1     = 0xff;
         readback_p2     = 0xff;
+
         read_lo         = "  0   0   1   0      0   0   0   0",
                           "  0   0 a13 a12    a11 a10  a9  a8",
                           " a7  a6  a5  a4     a3  a2  a1  a0",
@@ -2354,62 +2909,116 @@ part
                           "  x   x   x   x      x   x   x   x";
       ;
 
+    timeout            = 200;
+    stabdelay          = 100;
+    cmdexedelay                = 25;
+    synchloops         = 32;
+    bytedelay          = 0;
+    pollindex          = 3;
+    pollvalue          = 0x53;
+    predelay           = 1;
+    postdelay          = 1;
+    pollmethod         = 0;
+
+    memory "eeprom"
+        paged           = no; /* leave this "no" */
+        page_size       = 4;  /* for parallel programming */
+        size            = 512;
+        min_write_delay = 9000;
+        max_write_delay = 9000;
+        readback_p1     = 0xff;
+        readback_p2     = 0xff;
+
+                read            = "  1   0   1   0      0   0   0   0",
+                          "  0   0   x   x      x   x  a9  a8",
+                          " a7  a6  a5  a4     a3  a2  a1  a0",
+                          "  o   o   o   o      o   o   o   o";
+
+                write           = "  1   1   0   0      0   0   0   0",
+                          "  0   0   x   x      x   x  a9  a8",
+                          " a7  a6  a5  a4     a3  a2  a1  a0",
+                          "  i   i   i   i      i   i   i   i";
+
+       mode            = 0x41;
+       delay           = 20;
+       blocksize       = 4;
+       readsize        = 256;
+        ;
+
     memory "lfuse"
         size            = 1;
-        min_write_delay = 2000;
-        max_write_delay = 2000;
+        min_write_delay = 16000;
+        max_write_delay = 16000;
         read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
                           "x x x x  x x x x   o o o o  o o o o";
 
         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
                           "x x x x  x x x x   i i i i  i i i i";
-      ;
+        ;
 
     memory "hfuse"
         size            = 1;
-        min_write_delay = 2000;
-        max_write_delay = 2000;
+        min_write_delay = 16000;
+        max_write_delay = 16000;
+
         read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
                           "x x x x  x x x x   o o o o  o o o o";
 
         write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
                           "x x x x  x x x x   i i i i  i i i i";
+        ;
+
+    memory "efuse"
+        size            = 1;
+        min_write_delay = 16000;
+        max_write_delay = 16000;
+
+        read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
+                          "x x x x  x x x x  o o o o  o o o o";
+
+        write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
+                          "x x x x  x x x x  1 1 1 1  1 i i i";
       ;
 
     memory "lock"
         size            = 1;
-        min_write_delay = 2000;
-        max_write_delay = 2000;
+        min_write_delay = 16000;
+        max_write_delay = 16000;
+
         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
                           "x x x x  x x x x   x x o o  o o o o";
 
         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
                           "x x x x  x x x x   1 1 i i  i i i i";
-      ;
+        ;
 
     memory "signature"
         size            = 3;
-        read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x x",
-                          "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o o";
-      ;
+
+        read            = "0  0  1  1   0  0  0  0   0  0  x  x   x  x  x  x",
+                          "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
+        ;
 
     memory "calibration"
         size            = 1;
+
         read            = "0 0 1 1  1 0 0 0   0 0 x x  x x x x",
                           "0 0 0 0  0 0 0 0   o o o o  o o o o";
-      ;
-  ;
+        ;
+;
+
+
 
 #------------------------------------------------------------
-# ATmega161
+# ATmega163
 #------------------------------------------------------------
 
 part
-    id               = "m161";
-    desc             = "ATMEGA161";
-    stk500_devcode   = 0x80;
-    avr910_devcode   = 0x60;
-    chip_erase_delay = 28000;
+    id               = "m163";
+    desc             = "ATMEGA163";
+    stk500_devcode   = 0x81;
+    avr910_devcode   = 0x64;
+    chip_erase_delay = 32000;
     pagel            = 0xd7;
     bs2              = 0xa0;
     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
@@ -2419,8 +3028,8 @@ part
                        "x x x x  x x x x    x x x x  x x x x";
    memory "eeprom"
         size            = 512;
-        min_write_delay = 3400;
-        max_write_delay = 3400;
+        min_write_delay = 4000;
+        max_write_delay = 4000;
         readback_p1     = 0xff;
         readback_p2     = 0xff;
        read            = "  1   0   1   0      0   0   0   0",
@@ -2439,8 +3048,8 @@ part
         size            = 16384;
         page_size       = 128;
         num_pages       = 128;
-        min_write_delay = 14000;
-        max_write_delay = 14000;
+        min_write_delay = 16000;
+        max_write_delay = 16000;
         readback_p1     = 0xff;
         readback_p2     = 0xff;
         read_lo         = "  0   0   1   0      0   0   0   0",
@@ -2467,104 +3076,151 @@ part
                           "  x   x   x a12    a11 a10  a9  a8",
                           " a7  a6   x   x      x   x   x   x",
                           "  x   x   x   x      x   x   x   x";
+
+       mode            = 0x41;
+       delay           = 6;
+       blocksize       = 128;
+       readsize        = 256;
       ;
 
-    memory "fuse"
+    memory "lfuse"
         size            = 1;
         min_write_delay = 2000;
         max_write_delay = 2000;
-        read            = "0 1 0 1  0 0 0 0   x x x x  x x x x",
-                          "x x x x  x x x x   x o x o  o o o o";
+        read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
+                          "x x x x  x x x x   o o x x  o o o o";
 
-        write           = "1 0 1 0  1 1 0 0   1 0 1 x  x x x x",
-                          "x x x x  x x x x   1 i 1 i  i i i i";
+        write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
+                          "x x x x  x x x x   i i 1 1  i i i i";
       ;
 
-    memory "lock"
+    memory "hfuse"
         size            = 1;
         min_write_delay = 2000;
         max_write_delay = 2000;
-        read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
-                          "x x x x  x x x x   x x o o  o o o o";
+        read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
+                          "x x x x  x x x x   x x x x  1 o o o";
 
-        write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
+        write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
+                          "x x x x  x x x x   1 1 1 1  1 i i i";
+      ;
+
+    memory "lock"
+        size            = 1;
+        min_write_delay = 2000;
+        max_write_delay = 2000;
+        read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
+                          "x x x x  0 x x x   x x o o  o o o o";
+
+        write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
                           "x x x x  x x x x   1 1 i i  i i i i";
       ;
+
     memory "signature"
         size            = 3;
         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
       ;
-  ;
 
+    memory "calibration"
+        size            = 1;
+        read            = "0 0 1 1  1 0 0 0   x x x x  x x x x",
+                          "0 0 0 0  0 0 0 0   o o o o  o o o o";
+      ;
+  ;
 
 #------------------------------------------------------------
-# ATmega8
+# ATmega169
 #------------------------------------------------------------
 
 part
-    id               = "m8";
-    desc             = "ATMEGA8";
-    stk500_devcode   = 0x70;
-    avr910_devcode   = 0x76;
-    pagel            = 0xd7;
-    bs2              = 0xc2;
+    id               = "m169";
+    desc             = "ATMEGA169";
+    has_jtag         = yes;
+    stk500_devcode   = 0x85;
+    avr910_devcode   = 0x75;
     chip_erase_delay = 9000;
     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
                        "x x x x  x x x x    x x x x  x x x x";
 
-    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
+    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
                        "x x x x  x x x x    x x x x  x x x x";
+    timeout            = 200;
+    stabdelay          = 100;
+    cmdexedelay                = 25;
+    synchloops         = 32;
+    bytedelay          = 0;
+    pollindex          = 3;
+    pollvalue          = 0x53;
+    predelay           = 1;
+    postdelay          = 1;
+    pollmethod         = 1;
+
+    idr                 = 0x31;
+    spmcr               = 0x57;
 
-    memory "eeprom"
+   memory "eeprom"
+        paged           = no; /* leave this "no" */
+        page_size       = 4;  /* for parallel programming */
         size            = 512;
         min_write_delay = 9000;
         max_write_delay = 9000;
         readback_p1     = 0xff;
         readback_p2     = 0xff;
        read            = "  1   0   1   0      0   0   0   0",
-                          "  0   0   x   x      x   x   x  a8",
+                          "  x   x   x   x      x   x   x  a8",
                           " a7  a6  a5  a4     a3  a2  a1  a0",
                           "  o   o   o   o      o   o   o   o";
 
        write           = "  1   1   0   0      0   0   0   0",
-                          "  0   0   x   x      x   x   x  a8",
+                          "  x   x   x   x      x   x   x  a8",
                           " a7  a6  a5  a4     a3  a2  a1  a0",
                           "  i   i   i   i      i   i   i   i";
+
+       mode            = 0x41;
+       delay           = 20;
+       blocksize       = 4;
+       readsize        = 256;
       ;
+
     memory "flash"
         paged           = yes;
-        size            = 8192;
-        page_size       = 64;
+        size            = 16384;
+        page_size       = 128;
         num_pages       = 128;
         min_write_delay = 4500;
         max_write_delay = 4500;
         readback_p1     = 0xff;
         readback_p2     = 0xff;
-        read_lo         = "  0   0   1   0    0   0   0   0",
-                          "  0   0   0   0  a11 a10  a9  a8",
-                          " a7  a6  a5  a4   a3  a2  a1  a0",
-                          "  o   o   o   o    o   o   o   o";
+        read_lo         = "  0   0   1   0      0   0   0   0",
+                          "  x   x   x a12    a11 a10  a9  a8",
+                          " a7  a6  a5  a4     a3  a2  a1  a0",
+                          "  o   o   o   o      o   o   o   o";
 
-        read_hi         = "  0   0   1   0    1   0   0   0",
-                          "  0   0   0   0  a11 a10  a9  a8",
-                          " a7  a6  a5  a4   a3  a2  a1  a0",
-                          "  o   o   o   o    o   o   o   o";
+        read_hi         = "  0   0   1   0      1   0   0   0",
+                          "  x   x   x a12    a11 a10  a9  a8",
+                          " a7  a6  a5  a4     a3  a2  a1  a0",
+                          "  o   o   o   o      o   o   o   o";
 
         loadpage_lo     = "  0   1   0   0      0   0   0   0",
-                          "  0   0   0   0      x   x   x   x",
-                          "  x   x   x  a4     a3  a2  a1  a0",
+                          "  x   x   x   x      x   x   x   x",
+                          "  x   x  a5  a4     a3  a2  a1  a0",
                           "  i   i   i   i      i   i   i   i";
 
         loadpage_hi     = "  0   1   0   0      1   0   0   0",
-                          "  0   0   0   0      x   x   x   x",
-                          "  x   x   x  a4     a3  a2  a1  a0",
+                          "  x   x   x   x      x   x   x   x",
+                          "  x   x  a5  a4     a3  a2  a1  a0",
                           "  i   i   i   i      i   i   i   i";
 
         writepage       = "  0   1   0   0      1   1   0   0",
-                          "  0   0   0   0    a11 a10  a9  a8",
-                          " a7  a6  a5   x      x   x   x   x",
+                          "  x   x   x a12    a11 a10  a9  a8",
+                          " a7  a6   x   x      x   x   x   x",
                           "  x   x   x   x      x   x   x   x";
+
+       mode            = 0x41;
+       delay           = 6;
+       blocksize       = 128;
+       readsize        = 256;
       ;
 
     memory "lfuse"
@@ -2589,6 +3245,15 @@ part
                           "x x x x  x x x x   i i i i  i i i i";
       ;
 
+    memory "efuse"
+        size            = 1;
+        write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
+                          "x x x x  x x x x  x x x x  i i i i";
+
+        read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
+                          "x x x x  x x x x  o o o o  o o o o";
+      ;
+
     memory "lock"
         size            = 1;
         min_write_delay = 2000;
@@ -2600,86 +3265,112 @@ part
                           "x x x x  x x x x   1 1 i i  i i i i";
       ;
 
-    memory "calibration"
-        size            = 4;
-        read            = "0  0  1  1   1  0  0  0   0  0  x  x   x  x  x  x",
-                          "0  0  0  0   0  0 a1 a0   o  o  o  o   o  o  o  o";
-      ;
-
     memory "signature"
         size            = 3;
-        read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
+        read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
       ;
-  ;
-
 
+    memory "calibration"
+        size            = 1;
+        read            = "0 0 1 1  1 0 0 0   0 0 0 x  x x x x",
+                          "0 0 0 0  0 0 0 0   o o o o  o o o o";
+      ;
+  ;
 
 #------------------------------------------------------------
-# ATmega8515
+# ATmega329
 #------------------------------------------------------------
 
 part
-    id               = "m8515";
-    desc             = "ATMEGA8515";
-    stk500_devcode   = 0x63;
-    avr910_devcode   = 0x3A;
+    id               = "m329";
+    desc             = "ATMEGA329";
+    has_jtag         = yes;
+#    stk500_devcode   = 0x85; # no STK500 support, only STK500v2
+#    avr910_devcode   = 0x?;  # try the ATmega169 one:
+    avr910_devcode   = 0x75;
     chip_erase_delay = 9000;
     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
                        "x x x x  x x x x    x x x x  x x x x";
 
-    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
+    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
                        "x x x x  x x x x    x x x x  x x x x";
+    timeout            = 200;
+    stabdelay          = 100;
+    cmdexedelay                = 25;
+    synchloops         = 32;
+    bytedelay          = 0;
+    pollindex          = 3;
+    pollvalue          = 0x53;
+    predelay           = 1;
+    postdelay          = 1;
+    pollmethod         = 1;
+
+    idr                 = 0x31;
+    spmcr               = 0x57;
 
-    memory "eeprom"
-        size            = 512;
+   memory "eeprom"
+        paged           = no; /* leave this "no" */
+        page_size       = 4;  /* for parallel programming */
+        size            = 1024;
         min_write_delay = 9000;
         max_write_delay = 9000;
         readback_p1     = 0xff;
         readback_p2     = 0xff;
- read            = "  1   0   1   0      0   0   0   0",
-                          "  0   0   x   x      x   x   x  a8",
      read            = "  1   0   1   0      0   0   0   0",
+                          "  x   x   x   x      x   x  a9  a8",
                           " a7  a6  a5  a4     a3  a2  a1  a0",
                           "  o   o   o   o      o   o   o   o";
 
- write           = "  1   1   0   0      0   0   0   0",
-                          "  0   0   x   x      x   x   x  a8",
      write           = "  1   1   0   0      0   0   0   0",
+                          "  x   x   x   x      x   x  a9  a8",
                           " a7  a6  a5  a4     a3  a2  a1  a0",
                           "  i   i   i   i      i   i   i   i";
+
+       mode            = 0x41;
+       delay           = 20;
+       blocksize       = 8;
+       readsize        = 256;
       ;
+
     memory "flash"
         paged           = yes;
-        size            = 8192;
-        page_size       = 64;
-        num_pages       = 128;
+        size            = 32768;
+        page_size       = 128;
+        num_pages       = 256;
         min_write_delay = 4500;
         max_write_delay = 4500;
         readback_p1     = 0xff;
         readback_p2     = 0xff;
-        read_lo         = "  0   0   1   0    0   0   0   0",
-                          "  0   0   0   0  a11 a10  a9  a8",
-                          " a7  a6  a5  a4   a3  a2  a1  a0",
-                          "  o   o   o   o    o   o   o   o";
+        read_lo         = "  0   0   1   0      0   0   0   0",
+                          "  x a14 a13 a12    a11 a10  a9  a8",
+                          " a7  a6  a5  a4     a3  a2  a1  a0",
+                          "  o   o   o   o      o   o   o   o";
 
-        read_hi         = "  0   0   1   0    1   0   0   0",
-                          "  0   0   0   0  a11 a10  a9  a8",
-                          " a7  a6  a5  a4   a3  a2  a1  a0",
-                          "  o   o   o   o    o   o   o   o";
+        read_hi         = "  0   0   1   0      1   0   0   0",
+                          "  x a14 a13 a12    a11 a10  a9  a8",
+                          " a7  a6  a5  a4     a3  a2  a1  a0",
+                          "  o   o   o   o      o   o   o   o";
 
         loadpage_lo     = "  0   1   0   0      0   0   0   0",
-                          "  0   0   0   0      x   x   x   x",
-                          "  x   x   x  a4     a3  a2  a1  a0",
+                          "  x   x   x   x      x   x   x   x",
+                          "  x   x  a5  a4     a3  a2  a1  a0",
                           "  i   i   i   i      i   i   i   i";
 
         loadpage_hi     = "  0   1   0   0      1   0   0   0",
-                          "  0   0   0   0      x   x   x   x",
-                          "  x   x   x  a4     a3  a2  a1  a0",
+                          "  x   x   x   x      x   x   x   x",
+                          "  x   x  a5  a4     a3  a2  a1  a0",
                           "  i   i   i   i      i   i   i   i";
 
         writepage       = "  0   1   0   0      1   1   0   0",
-                          "  0   0   0   0    a11 a10  a9  a8",
-                          " a7  a6  a5   x      x   x   x   x",
+                          "  x   x   x a12    a11 a10  a9  a8",
+                          " a7  a6   x   x      x   x   x   x",
                           "  x   x   x   x      x   x   x   x";
+
+       mode            = 0x41;
+       delay           = 6;
+       blocksize       = 256;
+       readsize        = 256;
       ;
 
     memory "lfuse"
@@ -2704,6 +3395,15 @@ part
                           "x x x x  x x x x   i i i i  i i i i";
       ;
 
+    memory "efuse"
+        size            = 1;
+        read            = "0 1 0 1  0 0 0 0   0 0 0 0  1 0 0 0",
+                          "x x x x  x x x x   o o o o  o o o o";
+
+        write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 1 0 0",
+                          "x x x x  x x x x   x x x x  i i i x";
+      ;
+
     memory "lock"
         size            = 1;
         min_write_delay = 4500;
@@ -2715,94 +3415,120 @@ part
                           "x x x x  x x x x   1 1 i i  i i i i";
       ;
 
-    memory "calibration"
-        size            = 1;
-        read            = "0 0 1 1  1 0 0 0   0 0 x x  x x x x",
-                          "0 0 0 0  0 0 0 0   o o o o  o o o o";
-      ;
-
     memory "signature"
         size            = 3;
-        read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
+        read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
       ;
-  ;
-
-
 
+    memory "calibration"
+        size            = 1;
+        read            = "0 0 1 1  1 0 0 0   0 0 0 x  x x x x",
+                          "0 0 0 0  0 0 0 0   o o o o  o o o o";
+      ;
+  ;
 
 #------------------------------------------------------------
-# ATmega8535
+# ATmega3290
 #------------------------------------------------------------
 
+# identical to ATmega329
+
 part
-    id               = "m8535";
-    desc             = "ATMEGA8535";
-    stk500_devcode   = 0x64;
-    pagel            = 0xd7;
-    bs2              = 0xa0;
+    id               = "m3290";
+    desc             = "ATMEGA3290";
+    has_jtag         = yes;
+#    stk500_devcode   = 0x85; # no STK500 support, only STK500v2
+#    avr910_devcode   = 0x?;  # try the ATmega169 one:
+    avr910_devcode   = 0x75;
     chip_erase_delay = 9000;
     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
                        "x x x x  x x x x    x x x x  x x x x";
 
-    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
+    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
                        "x x x x  x x x x    x x x x  x x x x";
+    timeout            = 200;
+    stabdelay          = 100;
+    cmdexedelay                = 25;
+    synchloops         = 32;
+    bytedelay          = 0;
+    pollindex          = 3;
+    pollvalue          = 0x53;
+    predelay           = 1;
+    postdelay          = 1;
+    pollmethod         = 1;
+
+    idr                 = 0x31;
+    spmcr               = 0x57;
 
-    memory "eeprom"
-        size            = 512;
+   memory "eeprom"
+        paged           = no; /* leave this "no" */
+        page_size       = 4;  /* for parallel programming */
+        size            = 1024;
         min_write_delay = 9000;
         max_write_delay = 9000;
         readback_p1     = 0xff;
         readback_p2     = 0xff;
        read            = "  1   0   1   0      0   0   0   0",
-                          "  0   0   x   x      x   x   x  a8",
+                          "  x   x   x   x      x   x  a9  a8",
                           " a7  a6  a5  a4     a3  a2  a1  a0",
                           "  o   o   o   o      o   o   o   o";
 
        write           = "  1   1   0   0      0   0   0   0",
-                          "  0   0   x   x      x   x   x  a8",
+                          "  x   x   x   x      x   x  a9  a8",
                           " a7  a6  a5  a4     a3  a2  a1  a0",
                           "  i   i   i   i      i   i   i   i";
+
+       mode            = 0x41;
+       delay           = 20;
+       blocksize       = 8;
+       readsize        = 256;
       ;
+
     memory "flash"
         paged           = yes;
-        size            = 8192;
-        page_size       = 64;
-        num_pages       = 128;
+        size            = 32768;
+        page_size       = 128;
+        num_pages       = 256;
         min_write_delay = 4500;
         max_write_delay = 4500;
         readback_p1     = 0xff;
         readback_p2     = 0xff;
-        read_lo         = "  0   0   1   0    0   0   0   0",
-                          "  0   0   0   0  a11 a10  a9  a8",
-                          " a7  a6  a5  a4   a3  a2  a1  a0",
-                          "  o   o   o   o    o   o   o   o";
+        read_lo         = "  0   0   1   0      0   0   0   0",
+                          "  x a14 a13 a12    a11 a10  a9  a8",
+                          " a7  a6  a5  a4     a3  a2  a1  a0",
+                          "  o   o   o   o      o   o   o   o";
 
-        read_hi         = "  0   0   1   0    1   0   0   0",
-                          "  0   0   0   0  a11 a10  a9  a8",
-                          " a7  a6  a5  a4   a3  a2  a1  a0",
-                          "  o   o   o   o    o   o   o   o";
+        read_hi         = "  0   0   1   0      1   0   0   0",
+                          "  x a14 a13 a12    a11 a10  a9  a8",
+                          " a7  a6  a5  a4     a3  a2  a1  a0",
+                          "  o   o   o   o      o   o   o   o";
 
         loadpage_lo     = "  0   1   0   0      0   0   0   0",
-                          "  0   0   0   0      x   x   x   x",
-                          "  x   x   x  a4     a3  a2  a1  a0",
+                          "  x   x   x   x      x   x   x   x",
+                          "  x   x  a5  a4     a3  a2  a1  a0",
                           "  i   i   i   i      i   i   i   i";
 
         loadpage_hi     = "  0   1   0   0      1   0   0   0",
-                          "  0   0   0   0      x   x   x   x",
-                          "  x   x   x  a4     a3  a2  a1  a0",
+                          "  x   x   x   x      x   x   x   x",
+                          "  x   x  a5  a4     a3  a2  a1  a0",
                           "  i   i   i   i      i   i   i   i";
 
         writepage       = "  0   1   0   0      1   1   0   0",
-                          "  0   0   0   0    a11 a10  a9  a8",
-                          " a7  a6  a5   x      x   x   x   x",
+                          "  x   x   x a12    a11 a10  a9  a8",
+                          " a7  a6   x   x      x   x   x   x",
                           "  x   x   x   x      x   x   x   x";
+
+       mode            = 0x41;
+       delay           = 6;
+       blocksize       = 256;
+       readsize        = 256;
       ;
 
     memory "lfuse"
         size            = 1;
-        min_write_delay = 2000;
-        max_write_delay = 2000;
+        min_write_delay = 4500;
+        max_write_delay = 4500;
         read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
                           "x x x x  x x x x   o o o o  o o o o";
 
@@ -2812,8 +3538,8 @@ part
 
     memory "hfuse"
         size            = 1;
-        min_write_delay = 2000;
-        max_write_delay = 2000;
+        min_write_delay = 4500;
+        max_write_delay = 4500;
         read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
                           "x x x x  x x x x   o o o o  o o o o";
 
@@ -2821,10 +3547,19 @@ part
                           "x x x x  x x x x   i i i i  i i i i";
       ;
 
+    memory "efuse"
+        size            = 1;
+        read            = "0 1 0 1  0 0 0 0   0 0 0 0  1 0 0 0",
+                          "x x x x  x x x x   o o o o  o o o o";
+
+        write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 1 0 0",
+                          "x x x x  x x x x   x x x x  i i i x";
+      ;
+
     memory "lock"
         size            = 1;
-        min_write_delay = 2000;
-        max_write_delay = 2000;
+        min_write_delay = 4500;
+        max_write_delay = 4500;
         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
                           "x x x x  x x x x   x x o o  o o o o";
 
@@ -2832,195 +3567,264 @@ part
                           "x x x x  x x x x   1 1 i i  i i i i";
       ;
 
-    memory "calibration"
-        size            = 1;
-        read            = "0 0 1 1  1 0 0 0   0 0 x x  x x x x",
-                          "0 0 0 0  0 0 0 0   o o o o  o o o o";
-      ;
-
     memory "signature"
         size            = 3;
-        read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
+        read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
       ;
-  ;
 
+    memory "calibration"
+        size            = 1;
+        read            = "0 0 1 1  1 0 0 0   0 0 0 x  x x x x",
+                          "0 0 0 0  0 0 0 0   o o o o  o o o o";
+      ;
+  ;
 
 #------------------------------------------------------------
-# ATtiny26
+# ATmega649
 #------------------------------------------------------------
 
 part
-    id                  = "t26";
-    desc                = "ATTINY26";
-    stk500_devcode      = 0x21;
-    avr910_devcode      = 0x5e;
-    pagel               = 0xb3;
-    bs2                 = 0xb2;
-    chip_erase_delay    = 9000;
-    pgm_enable          = "1 0 1 0  1 1 0 0   0 1 0 1  0 0 1 1",
-                          "x x x x  x x x x   x x x x  x x x x";
+    id               = "m649";
+    desc             = "ATMEGA649";
+    has_jtag         = yes;
+#    stk500_devcode   = 0x85; # no STK500 support, only STK500v2
+#    avr910_devcode   = 0x?;  # try the ATmega169 one:
+    avr910_devcode   = 0x75;
+    chip_erase_delay = 9000;
+    pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
+                       "x x x x  x x x x    x x x x  x x x x";
 
-    chip_erase          = "1 0 1 0  1 1 0 0   1 0 0 x  x x x x",
-                          "x x x x  x x x x   x x x x  x x x x";
+    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
+                       "x x x x  x x x x    x x x x  x x x x";
+    timeout            = 200;
+    stabdelay          = 100;
+    cmdexedelay                = 25;
+    synchloops         = 32;
+    bytedelay          = 0;
+    pollindex          = 3;
+    pollvalue          = 0x53;
+    predelay           = 1;
+    postdelay          = 1;
+    pollmethod         = 1;
+
+    idr                 = 0x31;
+    spmcr               = 0x57;
 
-    memory "eeprom"
-        size            = 128;
+   memory "eeprom"
+        paged           = no; /* leave this "no" */
+        page_size       = 8;  /* for parallel programming */
+        size            = 2048;
         min_write_delay = 9000;
         max_write_delay = 9000;
         readback_p1     = 0xff;
         readback_p2     = 0xff;
-        read            = "1  0  1  0   0  0  0  0    x x x x  x x x x",
-                          "x a6 a5 a4  a3 a2 a1 a0    o o o o  o o o o";
+       read            = "  1   0   1   0      0   0   0   0",
+                          "  x   x   x   x      x a10  a9  a8",
+                          " a7  a6  a5  a4     a3  a2  a1  a0",
+                          "  o   o   o   o      o   o   o   o";
 
-        write           = "1  1  0  0   0  0  0  0    x x x x  x x x x",
-                          "x a6 a5 a4  a3 a2 a1 a0    i i i i  i i i i";
-    ;
+       write           = "  1   1   0   0      0   0   0   0",
+                          "  x   x   x   x      x a10  a9  a8",
+                          " a7  a6  a5  a4     a3  a2  a1  a0",
+                          "  i   i   i   i      i   i   i   i";
+
+       mode            = 0x41;
+       delay           = 20;
+       blocksize       = 8;
+       readsize        = 256;
+      ;
 
     memory "flash"
         paged           = yes;
-        size            = 2048;
-        page_size       = 32;
-        num_pages       = 64;
+        size            = 65536;
+        page_size       = 256;
+        num_pages       = 256;
         min_write_delay = 4500;
         max_write_delay = 4500;
         readback_p1     = 0xff;
         readback_p2     = 0xff;
-        read_lo         = "  0  0  1  0   0  0  0  0",
-                          "  x  x  x  x   x  x a9 a8",
-                          " a7 a6 a5 a4  a3 a2 a1 a0",
-                          "  o  o  o  o   o  o  o  o";
+        read_lo         = "  0   0   1   0      0   0   0   0",
+                          "a15 a14 a13 a12    a11 a10  a9  a8",
+                          " a7  a6  a5  a4     a3  a2  a1  a0",
+                          "  o   o   o   o      o   o   o   o";
 
-        read_hi         = "  0  0  1  0   1  0  0  0",
-                          "  x  x  x  x   x  x a9 a8",
-                          " a7 a6 a5 a4  a3 a2 a1 a0",
-                          "  o  o  o  o   o  o  o  o";
+        read_hi         = "  0   0   1   0      1   0   0   0",
+                          "a15 a14 a13 a12    a11 a10  a9  a8",
+                          " a7  a6  a5  a4     a3  a2  a1  a0",
+                          "  o   o   o   o      o   o   o   o";
 
-        loadpage_lo     = "  0  1  0  0   0  0  0  0",
-                          "  x  x  x  x   x  x  x  x",
-                          "  x  x  x  x  a3 a2 a1 a0",
-                          "  i  i  i  i   i  i  i  i";
+        loadpage_lo     = "  0   1   0   0      0   0   0   0",
+                          "  x   x   x   x      x   x   x   x",
+                          "  x  a6  a5  a4     a3  a2  a1  a0",
+                          "  i   i   i   i      i   i   i   i";
 
-        loadpage_hi     = "  0  1  0  0   1  0  0  0",
-                          "  x  x  x  x   x  x  x  x",
-                          "  x  x  x  x  a3 a2 a1 a0",
-                          "  i  i  i  i   i  i  i  i";
+        loadpage_hi     = "  0   1   0   0      1   0   0   0",
+                          "  x   x   x   x      x   x   x   x",
+                          "  x  a6  a5  a4     a3  a2  a1  a0",
+                          "  i   i   i   i      i   i   i   i";
 
-        writepage       = "  0  1  0  0   1  1  0  0",
-                          "  x  x  x  x   x  x a9 a8",
-                          " a7 a6 a5 a4   x  x  x  x",
-                          "  x  x  x  x   x  x  x  x";
-    ;
+        writepage       = "  0   1   0   0      1   1   0   0",
+                          "  x   x   x a12    a11 a10  a9  a8",
+                          " a7   x   x   x      x   x   x   x",
+                          "  x   x   x   x      x   x   x   x";
 
-    memory "signature"
-        size            = 3;
-        read            = "0  0  1  1   0  0  0  0    x x x x  x x x x",
-                          "0  0  0  0   0  0 a1 a0    o o o o  o o o o";
-    ;
+       mode            = 0x41;
+       delay           = 6;
+       blocksize       = 256;
+       readsize        = 256;
+      ;
 
-    memory "lock"
+    memory "lfuse"
         size            = 1;
-        read            = "0  1  0  1   1  0  0  0    x x x x  x x x x",
-                          "x  x  x  x   x  x  x  x    x x x x  x x o o";
+        min_write_delay = 4500;
+        max_write_delay = 4500;
+        read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
+                          "x x x x  x x x x   o o o o  o o o o";
 
-        write           = "1  0  1  0   1  1  0  0    1 1 1 1  1 1 i i",
-                          "x  x  x  x   x  x  x  x    x x x x  x x x x";
-    ;
+        write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
+                          "x x x x  x x x x   i i i i  i i i i";
+      ;
 
-    memory "lfuse"
+    memory "hfuse"
         size            = 1;
-        write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
-                          "x x x x  x x x x  i i i i  i i i i";
+        min_write_delay = 4500;
+        max_write_delay = 4500;
+        read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
+                          "x x x x  x x x x   o o o o  o o o o";
 
-        read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
-                          "x x x x  x x x x  o o o o  o o o o";
+        write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
+                          "x x x x  x x x x   i i i i  i i i i";
       ;
 
-    memory "hfuse"
+    memory "efuse"
         size            = 1;
-        write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
-                          "x x x x  x x x x  x x x i  i i i i";
+        read            = "0 1 0 1  0 0 0 0   0 0 0 0  1 0 0 0",
+                          "x x x x  x x x x   o o o o  o o o o";
 
-        read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
-                          "x x x x  x x x x  x x x o  o o o o";
+        write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 1 0 0",
+                          "x x x x  x x x x   x x x x  i i i x";
       ;
 
-    memory "calibration"
-        size            = 4;
-        read            = "0  0  1  1   1  0  0  0    x x x x  x x x x",
-                          "0  0  0  0   0  0 a1 a0    o o o o  o o o o";
-    ;
+    memory "lock"
+        size            = 1;
+        min_write_delay = 4500;
+        max_write_delay = 4500;
+        read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
+                          "x x x x  x x x x   x x o o  o o o o";
 
-;
+        write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
+                          "x x x x  x x x x   1 1 i i  i i i i";
+      ;
+
+    memory "signature"
+        size            = 3;
+        read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
+                          "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
+      ;
 
+    memory "calibration"
+        size            = 1;
+        read            = "0 0 1 1  1 0 0 0   0 0 0 x  x x x x",
+                          "0 0 0 0  0 0 0 0   o o o o  o o o o";
+      ;
+  ;
 
 #------------------------------------------------------------
-# ATmega48
+# ATmega6490
 #------------------------------------------------------------
 
+# identical to ATmega649
+
 part
-    id               = "m48";
-    desc             = "ATMEGA48";
-    stk500_devcode   = 0x59;
-#    avr910_devcode   = 0x;
-    pagel            = 0xd7;
-    bs2              = 0xc2;
+    id               = "m6490";
+    desc             = "ATMEGA6490";
+    has_jtag         = yes;
+#    stk500_devcode   = 0x85; # no STK500 support, only STK500v2
+#    avr910_devcode   = 0x?;  # try the ATmega169 one:
+    avr910_devcode   = 0x75;
     chip_erase_delay = 9000;
     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
                        "x x x x  x x x x    x x x x  x x x x";
 
-    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
+    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
                        "x x x x  x x x x    x x x x  x x x x";
+    timeout            = 200;
+    stabdelay          = 100;
+    cmdexedelay                = 25;
+    synchloops         = 32;
+    bytedelay          = 0;
+    pollindex          = 3;
+    pollvalue          = 0x53;
+    predelay           = 1;
+    postdelay          = 1;
+    pollmethod         = 1;
+
+    idr                 = 0x31;
+    spmcr               = 0x57;
 
-    memory "eeprom"
-        size            = 256;
-        min_write_delay = 3600;
-        max_write_delay = 3600;
+   memory "eeprom"
+        paged           = no; /* leave this "no" */
+        page_size       = 8;  /* for parallel programming */
+        size            = 2048;
+        min_write_delay = 9000;
+        max_write_delay = 9000;
         readback_p1     = 0xff;
         readback_p2     = 0xff;
        read            = "  1   0   1   0      0   0   0   0",
-                          "  0   0   0   x      x   x   x   x",
+                          "  x   x   x   x      x a10  a9  a8",
                           " a7  a6  a5  a4     a3  a2  a1  a0",
                           "  o   o   o   o      o   o   o   o";
 
        write           = "  1   1   0   0      0   0   0   0",
-                          "  0   0   0   x      x   x   x   x",
+                          "  x   x   x   x      x a10  a9  a8",
                           " a7  a6  a5  a4     a3  a2  a1  a0",
                           "  i   i   i   i      i   i   i   i";
+
+       mode            = 0x41;
+       delay           = 20;
+       blocksize       = 8;
+       readsize        = 256;
       ;
+
     memory "flash"
         paged           = yes;
-        size            = 4096;
-        page_size       = 64;
-        num_pages       = 64;
+        size            = 65536;
+        page_size       = 256;
+        num_pages       = 256;
         min_write_delay = 4500;
         max_write_delay = 4500;
         readback_p1     = 0xff;
         readback_p2     = 0xff;
-        read_lo         = "  0   0   1   0    0   0   0   0",
-                          "  0   0   0   0    0 a10  a9  a8",
-                          " a7  a6  a5  a4   a3  a2  a1  a0",
-                          "  o   o   o   o    o   o   o   o";
+        read_lo         = "  0   0   1   0      0   0   0   0",
+                          "a15 a14 a13 a12    a11 a10  a9  a8",
+                          " a7  a6  a5  a4     a3  a2  a1  a0",
+                          "  o   o   o   o      o   o   o   o";
 
-        read_hi         = "  0   0   1   0    1   0   0   0",
-                          "  0   0   0   0    0 a10  a9  a8",
-                          " a7  a6  a5  a4   a3  a2  a1  a0",
-                          "  o   o   o   o    o   o   o   o";
+        read_hi         = "  0   0   1   0      1   0   0   0",
+                          "a15 a14 a13 a12    a11 a10  a9  a8",
+                          " a7  a6  a5  a4     a3  a2  a1  a0",
+                          "  o   o   o   o      o   o   o   o";
 
         loadpage_lo     = "  0   1   0   0      0   0   0   0",
-                          "  0   0   0   x      x   x   x   x",
-                          "  x   x   x  a4     a3  a2  a1  a0",
+                          "  x   x   x   x      x   x   x   x",
+                          "  x  a6  a5  a4     a3  a2  a1  a0",
                           "  i   i   i   i      i   i   i   i";
 
         loadpage_hi     = "  0   1   0   0      1   0   0   0",
-                          "  0   0   0   x      x   x   x   x",
-                          "  x   x   x  a4     a3  a2  a1  a0",
+                          "  x   x   x   x      x   x   x   x",
+                          "  x  a6  a5  a4     a3  a2  a1  a0",
                           "  i   i   i   i      i   i   i   i";
 
         writepage       = "  0   1   0   0      1   1   0   0",
-                          "  0   0   0   0      0 a10  a9  a8",
-                          " a7  a6  a5   x      x   x   x   x",
+                          "  x   x   x a12    a11 a10  a9  a8",
+                          " a7   x   x   x      x   x   x   x",
                           "  x   x   x   x      x   x   x   x";
+
+       mode            = 0x41;
+       delay           = 6;
+       blocksize       = 256;
+       readsize        = 256;
       ;
 
     memory "lfuse"
@@ -3047,19 +3851,22 @@ part
 
     memory "efuse"
         size            = 1;
-        min_write_delay = 4500;
-        max_write_delay = 4500;
         read            = "0 1 0 1  0 0 0 0   0 0 0 0  1 0 0 0",
                           "x x x x  x x x x   o o o o  o o o o";
 
         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 1 0 0",
-                          "x x x x  x x x x   i i i i  i i i i";
+                          "x x x x  x x x x   x x x x  i i i x";
       ;
 
-    memory "calibration"
+    memory "lock"
         size            = 1;
-        read            = "0  0  1  1   1  0  0  0   0  0  0  x   x  x  x  x",
-                          "0  0  0  0   0  0  0  0   o  o  o  o   o  o  o  o";
+        min_write_delay = 4500;
+        max_write_delay = 4500;
+        read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
+                          "x x x x  x x x x   x x o o  o o o o";
+
+        write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
+                          "x x x x  x x x x   1 1 i i  i i i i";
       ;
 
     memory "signature"
@@ -3067,42 +3874,326 @@ part
         read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
       ;
-  ;
 
+    memory "calibration"
+        size            = 1;
+        read            = "0 0 1 1  1 0 0 0   0 0 0 x  x x x x",
+                          "0 0 0 0  0 0 0 0   o o o o  o o o o";
+      ;
+  ;
 
 #------------------------------------------------------------
-# ATmega88
+# ATmega32
 #------------------------------------------------------------
 
 part
-    id               = "m88";
-    desc             = "ATMEGA88";
-    stk500_devcode   = 0x73;
-#    avr910_devcode   = 0x;
-    pagel            = 0xd7;
-    bs2              = 0xc2;
+    id               = "m32";
+    desc             = "ATMEGA32";
+    has_jtag         = yes;
+    stk500_devcode   = 0x91;
+    avr910_devcode   = 0x72;
     chip_erase_delay = 9000;
+    pagel            = 0xd7;
+    bs2              = 0xa0;
+    reset            = dedicated;
+    pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
+                       "x x x x  x x x x    x x x x  x x x x";
+
+    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
+                       "x x x x  x x x x    x x x x  x x x x";
+    timeout            = 200;
+    stabdelay          = 100;
+    cmdexedelay                = 25;
+    synchloops         = 32;
+    bytedelay          = 0;
+    pollindex          = 3;
+    pollvalue          = 0x53;
+    predelay           = 1;
+    postdelay          = 1;
+    pollmethod         = 0;
+
+    idr                 = 0x31;
+    spmcr               = 0x57;
+    allowfullpagebitstream = yes;
+
+   memory "eeprom"
+        paged           = no;   /* leave this "no" */
+        page_size       = 4;    /* for parallel programming */
+        size            = 1024;
+        min_write_delay = 9000;
+        max_write_delay = 9000;
+        readback_p1     = 0xff;
+        readback_p2     = 0xff;
+        read            = "  1   0   1   0      0   0   0   0",
+                          "  0   0   x   x      x   x  a9  a8",
+                          " a7  a6  a5  a4     a3  a2  a1  a0",
+                          "  o   o   o   o      o   o   o   o";
+
+        write           = "  1   1   0   0      0   0   0   0",
+                          "  0   0   x   x      x   x  a9  a8",
+                          " a7  a6  a5  a4     a3  a2  a1  a0",
+                          "  i   i   i   i      i   i   i   i";
+
+       mode            = 0x04;
+       delay           = 10;
+       blocksize       = 64;
+       readsize        = 256;
+      ;
+
+    memory "flash"
+        paged           = yes;
+        size            = 32768;
+        page_size       = 128;
+        num_pages       = 256;
+        min_write_delay = 4500;
+        max_write_delay = 4500;
+        readback_p1     = 0xff;
+        readback_p2     = 0xff;
+        read_lo         = "  0   0   1   0      0   0   0   0",
+                          "  0   0 a13 a12    a11 a10  a9  a8",
+                          " a7  a6  a5  a4     a3  a2  a1  a0",
+                          "  o   o   o   o      o   o   o   o";
+
+        read_hi         = "  0   0   1   0      1   0   0   0",
+                          "  0   0 a13 a12    a11 a10  a9  a8",
+                          " a7  a6  a5  a4     a3  a2  a1  a0",
+                          "  o   o   o   o      o   o   o   o";
+
+        loadpage_lo     = "  0   1   0   0      0   0   0   0",
+                          "  0   0   x   x      x   x   x   x",
+                          "  x   x  a5  a4     a3  a2  a1  a0",
+                          "  i   i   i   i      i   i   i   i";
+
+        loadpage_hi     = "  0   1   0   0      1   0   0   0",
+                          "  0   0   x   x      x   x   x   x",
+                          "  x   x  a5  a4     a3  a2  a1  a0",
+                          "  i   i   i   i      i   i   i   i";
+
+        writepage       = "  0   1   0   0      1   1   0   0",
+                          "  0   0 a13 a12    a11 a10  a9  a8",
+                          " a7  a6   x   x      x   x   x   x",
+                          "  x   x   x   x      x   x   x   x";
+
+       mode            = 0x21;
+       delay           = 6;
+       blocksize       = 64;
+       readsize        = 256;
+      ;
+
+    memory "lfuse"
+        size            = 1;
+        min_write_delay = 2000;
+        max_write_delay = 2000;
+        read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
+                          "x x x x  x x x x   o o o o  o o o o";
+
+        write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
+                          "x x x x  x x x x   i i i i  i i i i";
+      ;
+
+    memory "hfuse"
+        size            = 1;
+        min_write_delay = 2000;
+        max_write_delay = 2000;
+        read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
+                          "x x x x  x x x x   o o o o  o o o o";
+
+        write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
+                          "x x x x  x x x x   i i i i  i i i i";
+      ;
+
+    memory "lock"
+        size            = 1;
+        min_write_delay = 2000;
+        max_write_delay = 2000;
+        read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
+                          "x x x x  x x x x   x x o o  o o o o";
+
+        write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
+                          "x x x x  x x x x   1 1 i i  i i i i";
+      ;
+
+    memory "signature"
+        size            = 3;
+        read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x x",
+                          "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o o";
+      ;
+
+    memory "calibration"
+        size            = 1;
+        read            = "0 0 1 1  1 0 0 0   0 0 x x  x x x x",
+                          "0 0 0 0  0 0 0 0   o o o o  o o o o";
+      ;
+  ;
+
+#------------------------------------------------------------
+# ATmega161
+#------------------------------------------------------------
+
+part
+    id               = "m161";
+    desc             = "ATMEGA161";
+    stk500_devcode   = 0x80;
+    avr910_devcode   = 0x60;
+    chip_erase_delay = 28000;
+    pagel            = 0xd7;
+    bs2              = 0xa0;
+    pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
+                       "x x x x  x x x x    x x x x  x x x x";
+
+    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
+                       "x x x x  x x x x    x x x x  x x x x";
+    timeout            = 200;
+    stabdelay          = 100;
+    cmdexedelay                = 25;
+    synchloops         = 32;
+    bytedelay          = 0;
+    pollindex          = 3;
+    pollvalue          = 0x53;
+    predelay           = 1;
+    postdelay          = 1;
+    pollmethod         = 0;
+
+   memory "eeprom"
+        size            = 512;
+        min_write_delay = 3400;
+        max_write_delay = 3400;
+        readback_p1     = 0xff;
+        readback_p2     = 0xff;
+       read            = "  1   0   1   0      0   0   0   0",
+                          "  x   x   x   x      x   x   x  a8",
+                          " a7  a6  a5  a4     a3  a2  a1  a0",
+                          "  o   o   o   o      o   o   o   o";
+
+       write           = "  1   1   0   0      0   0   0   0",
+                          "  x   x   x   x      x   x   x  a8",
+                          " a7  a6  a5  a4     a3  a2  a1  a0",
+                          "  i   i   i   i      i   i   i   i";
+
+       mode            = 0x04;
+       delay           = 5;
+       blocksize       = 128;
+       readsize        = 256;
+      ;
+
+    memory "flash"
+        paged           = yes;
+        size            = 16384;
+        page_size       = 128;
+        num_pages       = 128;
+        min_write_delay = 14000;
+        max_write_delay = 14000;
+        readback_p1     = 0xff;
+        readback_p2     = 0xff;
+        read_lo         = "  0   0   1   0      0   0   0   0",
+                          "  x   x   x a12    a11 a10  a9  a8",
+                          " a7  a6  a5  a4     a3  a2  a1  a0",
+                          "  o   o   o   o      o   o   o   o";
+
+        read_hi         = "  0   0   1   0      1   0   0   0",
+                          "  x   x   x a12    a11 a10  a9  a8",
+                          " a7  a6  a5  a4     a3  a2  a1  a0",
+                          "  o   o   o   o      o   o   o   o";
+
+        loadpage_lo     = "  0   1   0   0      0   0   0   0",
+                          "  x   x   x   x      x   x   x   x",
+                          "  x   x  a5  a4     a3  a2  a1  a0",
+                          "  i   i   i   i      i   i   i   i";
+
+        loadpage_hi     = "  0   1   0   0      1   0   0   0",
+                          "  x   x   x   x      x   x   x   x",
+                          "  x   x  a5  a4     a3  a2  a1  a0",
+                          "  i   i   i   i      i   i   i   i";
+
+        writepage       = "  0   1   0   0      1   1   0   0",
+                          "  x   x   x a12    a11 a10  a9  a8",
+                          " a7  a6   x   x      x   x   x   x",
+                          "  x   x   x   x      x   x   x   x";
+
+       mode            = 0x21;
+       delay           = 16;
+       blocksize       = 128;
+       readsize        = 256;
+      ;
+
+    memory "fuse"
+        size            = 1;
+        min_write_delay = 2000;
+        max_write_delay = 2000;
+        read            = "0 1 0 1  0 0 0 0   x x x x  x x x x",
+                          "x x x x  x x x x   x o x o  o o o o";
+
+        write           = "1 0 1 0  1 1 0 0   1 0 1 x  x x x x",
+                          "x x x x  x x x x   1 i 1 i  i i i i";
+      ;
+
+    memory "lock"
+        size            = 1;
+        min_write_delay = 2000;
+        max_write_delay = 2000;
+        read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
+                          "x x x x  x x x x   x x o o  o o o o";
+
+        write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
+                          "x x x x  x x x x   1 1 i i  i i i i";
+      ;
+    memory "signature"
+        size            = 3;
+        read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
+                          "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
+      ;
+  ;
+
+
+#------------------------------------------------------------
+# ATmega8
+#------------------------------------------------------------
+
+part
+    id               = "m8";
+    desc             = "ATMEGA8";
+    stk500_devcode   = 0x70;
+    avr910_devcode   = 0x76;
+    pagel            = 0xd7;
+    bs2              = 0xc2;
+    chip_erase_delay = 10000;
     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
                        "x x x x  x x x x    x x x x  x x x x";
 
     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
                        "x x x x  x x x x    x x x x  x x x x";
 
+    timeout            = 200;
+    stabdelay          = 100;
+    cmdexedelay                = 25;
+    synchloops         = 32;
+    bytedelay          = 0;
+    pollindex          = 3;
+    pollvalue          = 0x53;
+    predelay           = 1;
+    postdelay          = 1;
+    pollmethod         = 0;
+
     memory "eeprom"
         size            = 512;
-        min_write_delay = 3600;
-        max_write_delay = 3600;
+        min_write_delay = 9000;
+        max_write_delay = 9000;
         readback_p1     = 0xff;
         readback_p2     = 0xff;
        read            = "  1   0   1   0      0   0   0   0",
-                          "  0   0   0   x      x   x   x  a8",
+                          "  0   0   x   x      x   x   x  a8",
                           " a7  a6  a5  a4     a3  a2  a1  a0",
                           "  o   o   o   o      o   o   o   o";
 
        write           = "  1   1   0   0      0   0   0   0",
-                          "  0   0   0   x      x   x   x  a8",
+                          "  0   0   x   x      x   x   x  a8",
                           " a7  a6  a5  a4     a3  a2  a1  a0",
                           "  i   i   i   i      i   i   i   i";
+
+       mode            = 0x04;
+       delay           = 10;
+       blocksize       = 128;
+       readsize        = 256;
       ;
     memory "flash"
         paged           = yes;
@@ -3112,7 +4203,7 @@ part
         min_write_delay = 4500;
         max_write_delay = 4500;
         readback_p1     = 0xff;
-        readback_p2     = 0xff;
+        readback_p2     = 0x00;
         read_lo         = "  0   0   1   0    0   0   0   0",
                           "  0   0   0   0  a11 a10  a9  a8",
                           " a7  a6  a5  a4   a3  a2  a1  a0",
@@ -3124,12 +4215,12 @@ part
                           "  o   o   o   o    o   o   o   o";
 
         loadpage_lo     = "  0   1   0   0      0   0   0   0",
-                          "  0   0   0   x      x   x   x   x",
+                          "  0   0   0   0      x   x   x   x",
                           "  x   x   x  a4     a3  a2  a1  a0",
                           "  i   i   i   i      i   i   i   i";
 
         loadpage_hi     = "  0   1   0   0      1   0   0   0",
-                          "  0   0   0   x      x   x   x   x",
+                          "  0   0   0   0      x   x   x   x",
                           "  x   x   x  a4     a3  a2  a1  a0",
                           "  i   i   i   i      i   i   i   i";
 
@@ -3137,12 +4228,17 @@ part
                           "  0   0   0   0    a11 a10  a9  a8",
                           " a7  a6  a5   x      x   x   x   x",
                           "  x   x   x   x      x   x   x   x";
+
+       mode            = 0x21;
+       delay           = 6;
+       blocksize       = 64;
+       readsize        = 256;
       ;
 
     memory "lfuse"
         size            = 1;
-        min_write_delay = 4500;
-        max_write_delay = 4500;
+        min_write_delay = 2000;
+        max_write_delay = 2000;
         read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
                           "x x x x  x x x x   o o o o  o o o o";
 
@@ -3152,8 +4248,8 @@ part
 
     memory "hfuse"
         size            = 1;
-        min_write_delay = 4500;
-        max_write_delay = 4500;
+        min_write_delay = 2000;
+        max_write_delay = 2000;
         read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
                           "x x x x  x x x x   o o o o  o o o o";
 
@@ -3161,57 +4257,1147 @@ part
                           "x x x x  x x x x   i i i i  i i i i";
       ;
 
-    memory "efuse"
+    memory "lock"
         size            = 1;
-        min_write_delay = 4500;
-        max_write_delay = 4500;
-        read            = "0 1 0 1  0 0 0 0   0 0 0 0  1 0 0 0",
+        min_write_delay = 2000;
+        max_write_delay = 2000;
+        read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
+                          "x x x x  x x x x   x x o o  o o o o";
+
+        write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
+                          "x x x x  x x x x   1 1 i i  i i i i";
+      ;
+
+    memory "calibration"
+        size            = 4;
+        read            = "0  0  1  1   1  0  0  0   0  0  x  x   x  x  x  x",
+                          "0  0  0  0   0  0 a1 a0   o  o  o  o   o  o  o  o";
+      ;
+
+    memory "signature"
+        size            = 3;
+        read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
+                          "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
+      ;
+  ;
+
+
+
+#------------------------------------------------------------
+# ATmega8515
+#------------------------------------------------------------
+
+part
+    id               = "m8515";
+    desc             = "ATMEGA8515";
+    stk500_devcode   = 0x63;
+    avr910_devcode   = 0x3A;
+    chip_erase_delay = 9000;
+    pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
+                       "x x x x  x x x x    x x x x  x x x x";
+
+    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
+                       "x x x x  x x x x    x x x x  x x x x";
+
+    timeout            = 200;
+    stabdelay          = 100;
+    cmdexedelay                = 25;
+    synchloops         = 32;
+    bytedelay          = 0;
+    pollindex          = 3;
+    pollvalue          = 0x53;
+    predelay           = 1;
+    postdelay          = 1;
+    pollmethod         = 0;
+
+    memory "eeprom"
+        size            = 512;
+        min_write_delay = 9000;
+        max_write_delay = 9000;
+        readback_p1     = 0xff;
+        readback_p2     = 0xff;
+ read            = "  1   0   1   0      0   0   0   0",
+                          "  0   0   x   x      x   x   x  a8",
+                          " a7  a6  a5  a4     a3  a2  a1  a0",
+                          "  o   o   o   o      o   o   o   o";
+
+ write           = "  1   1   0   0      0   0   0   0",
+                          "  0   0   x   x      x   x   x  a8",
+                          " a7  a6  a5  a4     a3  a2  a1  a0",
+                          "  i   i   i   i      i   i   i   i";
+
+       mode            = 0x04;
+       delay           = 10;
+       blocksize       = 128;
+       readsize        = 256;
+      ;
+    memory "flash"
+        paged           = yes;
+        size            = 8192;
+        page_size       = 64;
+        num_pages       = 128;
+        min_write_delay = 4500;
+        max_write_delay = 4500;
+        readback_p1     = 0xff;
+        readback_p2     = 0xff;
+        read_lo         = "  0   0   1   0    0   0   0   0",
+                          "  0   0   0   0  a11 a10  a9  a8",
+                          " a7  a6  a5  a4   a3  a2  a1  a0",
+                          "  o   o   o   o    o   o   o   o";
+
+        read_hi         = "  0   0   1   0    1   0   0   0",
+                          "  0   0   0   0  a11 a10  a9  a8",
+                          " a7  a6  a5  a4   a3  a2  a1  a0",
+                          "  o   o   o   o    o   o   o   o";
+
+        loadpage_lo     = "  0   1   0   0      0   0   0   0",
+                          "  0   0   0   0      x   x   x   x",
+                          "  x   x   x  a4     a3  a2  a1  a0",
+                          "  i   i   i   i      i   i   i   i";
+
+        loadpage_hi     = "  0   1   0   0      1   0   0   0",
+                          "  0   0   0   0      x   x   x   x",
+                          "  x   x   x  a4     a3  a2  a1  a0",
+                          "  i   i   i   i      i   i   i   i";
+
+        writepage       = "  0   1   0   0      1   1   0   0",
+                          "  0   0   0   0    a11 a10  a9  a8",
+                          " a7  a6  a5   x      x   x   x   x",
+                          "  x   x   x   x      x   x   x   x";
+
+       mode            = 0x21;
+       delay           = 6;
+       blocksize       = 64;
+       readsize        = 256;
+      ;
+
+    memory "lfuse"
+        size            = 1;
+        min_write_delay = 4500;
+        max_write_delay = 4500;
+        read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
+                          "x x x x  x x x x   o o o o  o o o o";
+
+        write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
+                          "x x x x  x x x x   i i i i  i i i i";
+      ;
+
+    memory "hfuse"
+        size            = 1;
+        min_write_delay = 4500;
+        max_write_delay = 4500;
+        read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
+                          "x x x x  x x x x   o o o o  o o o o";
+
+        write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
+                          "x x x x  x x x x   i i i i  i i i i";
+      ;
+
+    memory "lock"
+        size            = 1;
+        min_write_delay = 4500;
+        max_write_delay = 4500;
+        read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
+                          "x x x x  x x x x   x x o o  o o o o";
+
+        write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
+                          "x x x x  x x x x   1 1 i i  i i i i";
+      ;
+
+    memory "calibration"
+        size            = 1;
+        read            = "0 0 1 1  1 0 0 0   0 0 x x  x x x x",
+                          "0 0 0 0  0 0 0 0   o o o o  o o o o";
+      ;
+
+    memory "signature"
+        size            = 3;
+        read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
+                          "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
+      ;
+  ;
+
+
+
+
+#------------------------------------------------------------
+# ATmega8535
+#------------------------------------------------------------
+
+part
+    id               = "m8535";
+    desc             = "ATMEGA8535";
+    stk500_devcode   = 0x64;
+    pagel            = 0xd7;
+    bs2              = 0xa0;
+    chip_erase_delay = 9000;
+    pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
+                       "x x x x  x x x x    x x x x  x x x x";
+
+    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
+                       "x x x x  x x x x    x x x x  x x x x";
+
+    timeout            = 200;
+    stabdelay          = 100;
+    cmdexedelay                = 25;
+    synchloops         = 32;
+    bytedelay          = 0;
+    pollindex          = 3;
+    pollvalue          = 0x53;
+    predelay           = 1;
+    postdelay          = 1;
+    pollmethod         = 0;
+
+    memory "eeprom"
+        size            = 512;
+        min_write_delay = 9000;
+        max_write_delay = 9000;
+        readback_p1     = 0xff;
+        readback_p2     = 0xff;
+       read            = "  1   0   1   0      0   0   0   0",
+                          "  0   0   x   x      x   x   x  a8",
+                          " a7  a6  a5  a4     a3  a2  a1  a0",
+                          "  o   o   o   o      o   o   o   o";
+
+       write           = "  1   1   0   0      0   0   0   0",
+                          "  0   0   x   x      x   x   x  a8",
+                          " a7  a6  a5  a4     a3  a2  a1  a0",
+                          "  i   i   i   i      i   i   i   i";
+
+       mode            = 0x04;
+       delay           = 10;
+       blocksize       = 128;
+       readsize        = 256;
+      ;
+    memory "flash"
+        paged           = yes;
+        size            = 8192;
+        page_size       = 64;
+        num_pages       = 128;
+        min_write_delay = 4500;
+        max_write_delay = 4500;
+        readback_p1     = 0xff;
+        readback_p2     = 0xff;
+        read_lo         = "  0   0   1   0    0   0   0   0",
+                          "  0   0   0   0  a11 a10  a9  a8",
+                          " a7  a6  a5  a4   a3  a2  a1  a0",
+                          "  o   o   o   o    o   o   o   o";
+
+        read_hi         = "  0   0   1   0    1   0   0   0",
+                          "  0   0   0   0  a11 a10  a9  a8",
+                          " a7  a6  a5  a4   a3  a2  a1  a0",
+                          "  o   o   o   o    o   o   o   o";
+
+        loadpage_lo     = "  0   1   0   0      0   0   0   0",
+                          "  0   0   0   0      x   x   x   x",
+                          "  x   x   x  a4     a3  a2  a1  a0",
+                          "  i   i   i   i      i   i   i   i";
+
+        loadpage_hi     = "  0   1   0   0      1   0   0   0",
+                          "  0   0   0   0      x   x   x   x",
+                          "  x   x   x  a4     a3  a2  a1  a0",
+                          "  i   i   i   i      i   i   i   i";
+
+        writepage       = "  0   1   0   0      1   1   0   0",
+                          "  0   0   0   0    a11 a10  a9  a8",
+                          " a7  a6  a5   x      x   x   x   x",
+                          "  x   x   x   x      x   x   x   x";
+
+       mode            = 0x21;
+       delay           = 6;
+       blocksize       = 64;
+       readsize        = 256;
+      ;
+
+    memory "lfuse"
+        size            = 1;
+        min_write_delay = 2000;
+        max_write_delay = 2000;
+        read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
+                          "x x x x  x x x x   o o o o  o o o o";
+
+        write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
+                          "x x x x  x x x x   i i i i  i i i i";
+      ;
+
+    memory "hfuse"
+        size            = 1;
+        min_write_delay = 2000;
+        max_write_delay = 2000;
+        read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
                           "x x x x  x x x x   o o o o  o o o o";
 
-        write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 1 0 0",
-                          "x x x x  x x x x   i i i i  i i i i";
-      ;
+        write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
+                          "x x x x  x x x x   i i i i  i i i i";
+      ;
+
+    memory "lock"
+        size            = 1;
+        min_write_delay = 2000;
+        max_write_delay = 2000;
+        read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
+                          "x x x x  x x x x   x x o o  o o o o";
+
+        write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
+                          "x x x x  x x x x   1 1 i i  i i i i";
+      ;
+
+    memory "calibration"
+        size            = 1;
+        read            = "0 0 1 1  1 0 0 0   0 0 x x  x x x x",
+                          "0 0 0 0  0 0 0 0   o o o o  o o o o";
+      ;
+
+    memory "signature"
+        size            = 3;
+        read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
+                          "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
+      ;
+  ;
+
+
+#------------------------------------------------------------
+# ATtiny26
+#------------------------------------------------------------
+
+part
+    id                  = "t26";
+    desc                = "ATTINY26";
+    stk500_devcode      = 0x21;
+    avr910_devcode      = 0x5e;
+    pagel               = 0xb3;
+    bs2                 = 0xb2;
+    chip_erase_delay    = 9000;
+    pgm_enable          = "1 0 1 0  1 1 0 0   0 1 0 1  0 0 1 1",
+                          "x x x x  x x x x   x x x x  x x x x";
+
+    chip_erase          = "1 0 1 0  1 1 0 0   1 0 0 x  x x x x",
+                          "x x x x  x x x x   x x x x  x x x x";
+
+    timeout            = 200;
+    stabdelay          = 100;
+    cmdexedelay                = 25;
+    synchloops         = 32;
+    bytedelay          = 0;
+    pollindex          = 3;
+    pollvalue          = 0x53;
+    predelay           = 1;
+    postdelay          = 1;
+    pollmethod         = 0;
+
+    memory "eeprom"
+        size            = 128;
+        min_write_delay = 9000;
+        max_write_delay = 9000;
+        readback_p1     = 0xff;
+        readback_p2     = 0xff;
+        read            = "1  0  1  0   0  0  0  0    x x x x  x x x x",
+                          "x a6 a5 a4  a3 a2 a1 a0    o o o o  o o o o";
+
+        write           = "1  1  0  0   0  0  0  0    x x x x  x x x x",
+                          "x a6 a5 a4  a3 a2 a1 a0    i i i i  i i i i";
+
+       mode            = 0x04;
+       delay           = 10;
+       blocksize       = 64;
+       readsize        = 256;
+    ;
+
+    memory "flash"
+        paged           = yes;
+        size            = 2048;
+        page_size       = 32;
+        num_pages       = 64;
+        min_write_delay = 4500;
+        max_write_delay = 4500;
+        readback_p1     = 0xff;
+        readback_p2     = 0xff;
+        read_lo         = "  0  0  1  0   0  0  0  0",
+                          "  x  x  x  x   x  x a9 a8",
+                          " a7 a6 a5 a4  a3 a2 a1 a0",
+                          "  o  o  o  o   o  o  o  o";
+
+        read_hi         = "  0  0  1  0   1  0  0  0",
+                          "  x  x  x  x   x  x a9 a8",
+                          " a7 a6 a5 a4  a3 a2 a1 a0",
+                          "  o  o  o  o   o  o  o  o";
+
+        loadpage_lo     = "  0  1  0  0   0  0  0  0",
+                          "  x  x  x  x   x  x  x  x",
+                          "  x  x  x  x  a3 a2 a1 a0",
+                          "  i  i  i  i   i  i  i  i";
+
+        loadpage_hi     = "  0  1  0  0   1  0  0  0",
+                          "  x  x  x  x   x  x  x  x",
+                          "  x  x  x  x  a3 a2 a1 a0",
+                          "  i  i  i  i   i  i  i  i";
+
+        writepage       = "  0  1  0  0   1  1  0  0",
+                          "  x  x  x  x   x  x a9 a8",
+                          " a7 a6 a5 a4   x  x  x  x",
+                          "  x  x  x  x   x  x  x  x";
+
+       mode            = 0x21;
+       delay           = 6;
+       blocksize       = 16;
+       readsize        = 256;
+    ;
+
+    memory "signature"
+        size            = 3;
+        read            = "0  0  1  1   0  0  0  0    x x x x  x x x x",
+                          "0  0  0  0   0  0 a1 a0    o o o o  o o o o";
+    ;
+
+    memory "lock"
+        size            = 1;
+        read            = "0  1  0  1   1  0  0  0    x x x x  x x x x",
+                          "x  x  x  x   x  x  x  x    x x x x  x x o o";
+
+        write           = "1  0  1  0   1  1  0  0    1 1 1 1  1 1 i i",
+                          "x  x  x  x   x  x  x  x    x x x x  x x x x";
+    ;
+
+    memory "lfuse"
+        size            = 1;
+        write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
+                          "x x x x  x x x x  i i i i  i i i i";
+
+        read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
+                          "x x x x  x x x x  o o o o  o o o o";
+      ;
+
+    memory "hfuse"
+        size            = 1;
+        write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
+                          "x x x x  x x x x  x x x i  i i i i";
+
+        read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
+                          "x x x x  x x x x  x x x o  o o o o";
+      ;
+
+    memory "calibration"
+        size            = 4;
+        read            = "0  0  1  1   1  0  0  0    x x x x  x x x x",
+                          "0  0  0  0   0  0 a1 a0    o o o o  o o o o";
+    ;
+
+;
+
+
+#------------------------------------------------------------
+# ATmega48
+#------------------------------------------------------------
+
+part
+    id               = "m48";
+    desc             = "ATMEGA48";
+    stk500_devcode   = 0x59;
+#    avr910_devcode   = 0x;
+    pagel            = 0xd7;
+    bs2              = 0xc2;
+    chip_erase_delay = 45000;
+    pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
+                       "x x x x  x x x x    x x x x  x x x x";
+
+    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
+                       "x x x x  x x x x    x x x x  x x x x";
+
+    timeout            = 200;
+    stabdelay          = 100;
+    cmdexedelay                = 25;
+    synchloops         = 32;
+    bytedelay          = 0;
+    pollindex          = 3;
+    pollvalue          = 0x53;
+    predelay           = 1;
+    postdelay          = 1;
+    pollmethod         = 1;
+
+    memory "eeprom"
+        size            = 256;
+        min_write_delay = 3600;
+        max_write_delay = 3600;
+        readback_p1     = 0xff;
+        readback_p2     = 0xff;
+       read            = "  1   0   1   0      0   0   0   0",
+                          "  0   0   0   x      x   x   x   x",
+                          " a7  a6  a5  a4     a3  a2  a1  a0",
+                          "  o   o   o   o      o   o   o   o";
+
+       write           = "  1   1   0   0      0   0   0   0",
+                          "  0   0   0   x      x   x   x   x",
+                          " a7  a6  a5  a4     a3  a2  a1  a0",
+                          "  i   i   i   i      i   i   i   i";
+
+       mode            = 0x41;
+       delay           = 5;
+       blocksize       = 4;
+       readsize        = 256;
+      ;
+    memory "flash"
+        paged           = yes;
+        size            = 4096;
+        page_size       = 64;
+        num_pages       = 64;
+        min_write_delay = 4500;
+        max_write_delay = 4500;
+        readback_p1     = 0x00;
+        readback_p2     = 0x00;
+        read_lo         = "  0   0   1   0    0   0   0   0",
+                          "  0   0   0   0    0 a10  a9  a8",
+                          " a7  a6  a5  a4   a3  a2  a1  a0",
+                          "  o   o   o   o    o   o   o   o";
+
+        read_hi         = "  0   0   1   0    1   0   0   0",
+                          "  0   0   0   0    0 a10  a9  a8",
+                          " a7  a6  a5  a4   a3  a2  a1  a0",
+                          "  o   o   o   o    o   o   o   o";
+
+        loadpage_lo     = "  0   1   0   0      0   0   0   0",
+                          "  0   0   0   x      x   x   x   x",
+                          "  x   x   x  a4     a3  a2  a1  a0",
+                          "  i   i   i   i      i   i   i   i";
+
+        loadpage_hi     = "  0   1   0   0      1   0   0   0",
+                          "  0   0   0   x      x   x   x   x",
+                          "  x   x   x  a4     a3  a2  a1  a0",
+                          "  i   i   i   i      i   i   i   i";
+
+        writepage       = "  0   1   0   0      1   1   0   0",
+                          "  0   0   0   0      0 a10  a9  a8",
+                          " a7  a6  a5   x      x   x   x   x",
+                          "  x   x   x   x      x   x   x   x";
+
+       mode            = 0x41;
+       delay           = 6;
+       blocksize       = 64;
+       readsize        = 256;
+      ;
+
+    memory "lfuse"
+        size            = 1;
+        min_write_delay = 4500;
+        max_write_delay = 4500;
+        read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
+                          "x x x x  x x x x   o o o o  o o o o";
+
+        write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
+                          "x x x x  x x x x   i i i i  i i i i";
+      ;
+
+    memory "hfuse"
+        size            = 1;
+        min_write_delay = 4500;
+        max_write_delay = 4500;
+        read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
+                          "x x x x  x x x x   o o o o  o o o o";
+
+        write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
+                          "x x x x  x x x x   i i i i  i i i i";
+      ;
+
+    memory "efuse"
+        size            = 1;
+        min_write_delay = 4500;
+        max_write_delay = 4500;
+        read            = "0 1 0 1  0 0 0 0   0 0 0 0  1 0 0 0",
+                          "x x x x  x x x x   o o o o  o o o o";
+
+        write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 1 0 0",
+                          "x x x x  x x x x   i i i i  i i i i";
+      ;
+
+    memory "calibration"
+        size            = 1;
+        read            = "0  0  1  1   1  0  0  0   0  0  0  x   x  x  x  x",
+                          "0  0  0  0   0  0  0  0   o  o  o  o   o  o  o  o";
+      ;
+
+    memory "signature"
+        size            = 3;
+        read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
+                          "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
+      ;
+  ;
+
+
+#------------------------------------------------------------
+# ATmega88
+#------------------------------------------------------------
+
+part
+    id               = "m88";
+    desc             = "ATMEGA88";
+    stk500_devcode   = 0x73;
+#    avr910_devcode   = 0x;
+    pagel            = 0xd7;
+    bs2              = 0xc2;
+    chip_erase_delay = 9000;
+    pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
+                       "x x x x  x x x x    x x x x  x x x x";
+
+    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
+                       "x x x x  x x x x    x x x x  x x x x";
+
+    timeout            = 200;
+    stabdelay          = 100;
+    cmdexedelay                = 25;
+    synchloops         = 32;
+    bytedelay          = 0;
+    pollindex          = 3;
+    pollvalue          = 0x53;
+    predelay           = 1;
+    postdelay          = 1;
+    pollmethod         = 1;
+
+    memory "eeprom"
+        size            = 512;
+        min_write_delay = 3600;
+        max_write_delay = 3600;
+        readback_p1     = 0xff;
+        readback_p2     = 0xff;
+       read            = "  1   0   1   0      0   0   0   0",
+                          "  0   0   0   x      x   x   x  a8",
+                          " a7  a6  a5  a4     a3  a2  a1  a0",
+                          "  o   o   o   o      o   o   o   o";
+
+       write           = "  1   1   0   0      0   0   0   0",
+                          "  0   0   0   x      x   x   x  a8",
+                          " a7  a6  a5  a4     a3  a2  a1  a0",
+                          "  i   i   i   i      i   i   i   i";
+
+       mode            = 0x41;
+       delay           = 5;
+       blocksize       = 4;
+       readsize        = 256;
+      ;
+    memory "flash"
+        paged           = yes;
+        size            = 8192;
+        page_size       = 64;
+        num_pages       = 128;
+        min_write_delay = 4500;
+        max_write_delay = 4500;
+        readback_p1     = 0xff;
+        readback_p2     = 0xff;
+        read_lo         = "  0   0   1   0    0   0   0   0",
+                          "  0   0   0   0  a11 a10  a9  a8",
+                          " a7  a6  a5  a4   a3  a2  a1  a0",
+                          "  o   o   o   o    o   o   o   o";
+
+        read_hi         = "  0   0   1   0    1   0   0   0",
+                          "  0   0   0   0  a11 a10  a9  a8",
+                          " a7  a6  a5  a4   a3  a2  a1  a0",
+                          "  o   o   o   o    o   o   o   o";
+
+        loadpage_lo     = "  0   1   0   0      0   0   0   0",
+                          "  0   0   0   x      x   x   x   x",
+                          "  x   x   x  a4     a3  a2  a1  a0",
+                          "  i   i   i   i      i   i   i   i";
+
+        loadpage_hi     = "  0   1   0   0      1   0   0   0",
+                          "  0   0   0   x      x   x   x   x",
+                          "  x   x   x  a4     a3  a2  a1  a0",
+                          "  i   i   i   i      i   i   i   i";
+
+        writepage       = "  0   1   0   0      1   1   0   0",
+                          "  0   0   0   0    a11 a10  a9  a8",
+                          " a7  a6  a5   x      x   x   x   x",
+                          "  x   x   x   x      x   x   x   x";
+
+       mode            = 0x41;
+       delay           = 6;
+       blocksize       = 64;
+       readsize        = 256;
+      ;
+
+    memory "lfuse"
+        size            = 1;
+        min_write_delay = 4500;
+        max_write_delay = 4500;
+        read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
+                          "x x x x  x x x x   o o o o  o o o o";
+
+        write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
+                          "x x x x  x x x x   i i i i  i i i i";
+      ;
+
+    memory "hfuse"
+        size            = 1;
+        min_write_delay = 4500;
+        max_write_delay = 4500;
+        read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
+                          "x x x x  x x x x   o o o o  o o o o";
+
+        write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
+                          "x x x x  x x x x   i i i i  i i i i";
+      ;
+
+    memory "efuse"
+        size            = 1;
+        min_write_delay = 4500;
+        max_write_delay = 4500;
+        read            = "0 1 0 1  0 0 0 0   0 0 0 0  1 0 0 0",
+                          "x x x x  x x x x   o o o o  o o o o";
+
+        write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 1 0 0",
+                          "x x x x  x x x x   i i i i  i i i i";
+      ;
+
+    memory "lock"
+        size            = 1;
+        min_write_delay = 4500;
+        max_write_delay = 4500;
+        read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
+                          "x x x x  x x x x   x x o o  o o o o";
+
+        write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
+                          "x x x x  x x x x   1 1 i i  i i i i";
+      ;
+
+    memory "calibration"
+        size            = 1;
+        read            = "0  0  1  1   1  0  0  0   0  0  0  x   x  x  x  x",
+                          "0  0  0  0   0  0  0  0   o  o  o  o   o  o  o  o";
+      ;
+
+    memory "signature"
+        size            = 3;
+        read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
+                          "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
+      ;
+  ;
+
+
+#------------------------------------------------------------
+# ATtiny2313
+#------------------------------------------------------------
+
+part
+     id            = "t2313";
+     desc          = "ATtiny2313";
+     stk500_devcode   = 0x23;
+##  avr910_devcode   = ?;
+##  Try the AT90S2313 devcode:
+     avr910_devcode   = 0x20;
+     pagel            = 0xD4;
+     bs2              = 0xD6;
+     reset            = io;
+     chip_erase_delay = 9000;
+
+     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
+                        "x x x x  x x x x    x x x x  x x x x";
+
+     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
+                        "x x x x  x x x x    x x x x  x x x x";
+
+    timeout            = 200;
+    stabdelay          = 100;
+    cmdexedelay                = 25;
+    synchloops         = 32;
+    bytedelay          = 0;
+    pollindex          = 3;
+    pollvalue          = 0x53;
+    predelay           = 1;
+    postdelay          = 1;
+    pollmethod         = 1;
+
+     memory "eeprom"
+         size            = 128;
+         min_write_delay = 4000;
+         max_write_delay = 4500;
+         readback_p1     = 0xff;
+         readback_p2     = 0xff;
+         read            = "1  0  1  0   0  0  0  0   0 0 0 x  x x x x",
+                           "x a6 a5 a4  a3 a2 a1 a0   o o o o  o o o o";
+
+         write           = "1  1  0  0   0  0  0  0   0 0 0 x  x x x x",
+                           "x a6 a5 a4  a3 a2 a1 a0   i i i i  i i i i";
+
+       mode            = 0x41;
+       delay           = 6;
+       blocksize       = 4;
+       readsize        = 256;
+       ;
+     memory "flash"
+         paged           = yes;
+         size            = 2048;
+         page_size       = 32;
+         num_pages       = 64;
+         min_write_delay = 4500;
+         max_write_delay = 4500;
+         readback_p1     = 0xff;
+         readback_p2     = 0xff;
+         read_lo         = "  0   0   1   0    0   0   0   0",
+                           "  0   0   0   0    0   0  a9  a8",
+                           " a7  a6  a5  a4   a3  a2  a1  a0",
+                           "  o   o   o   o    o   o   o   o";
+
+         read_hi         = "  0   0   1   0    1   0   0   0",
+                           "  0   0   0   0    0   0  a9  a8",
+                           " a7  a6  a5  a4   a3  a2  a1  a0",
+                           "  o   o   o   o    o   o   o   o";
+
+# The information in the data sheet of April/2004 is wrong, this works:
+         loadpage_lo     = "  0   1   0   0    0   0   0   0",
+                           "  0   0   0   x    x   x   x   x",
+                           "  x   x   x   x   a3  a2  a1  a0",
+                           "  i   i   i   i    i   i   i   i";
+
+# The information in the data sheet of April/2004 is wrong, this works:
+         loadpage_hi     = "  0   1   0   0    1   0   0   0",
+                           "  0   0   0   x    x   x   x   x",
+                           "  x   x   x   x   a3  a2  a1  a0",
+                           "  i   i   i   i    i   i   i   i";
+
+# The information in the data sheet of April/2004 is wrong, this works:
+         writepage       = "  0  1  0  0   1  1  0  0",
+                           "  0  0  0  0   0  0 a9 a8",
+                           " a7 a6 a5 a4   x  x  x  x",
+                           "  x  x  x  x   x  x  x  x";
+
+       mode            = 0x41;
+       delay           = 6;
+       blocksize       = 32;
+       readsize        = 256;
+       ;
+#   ATtiny2313 has Signature Bytes: 0x1E 0x91 0x0A.
+     memory "signature"
+         size            = 3;
+         read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
+                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
+       ;
+     memory "lock"
+         size            = 1;
+         write           = "1 0 1 0  1 1 0 0  1 1 1 x  x x x x",
+                           "x x x x  x x x x  1 1 i i  i i i i";
+       ;
+
+     memory "lfuse"
+         size            = 1;
+         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
+                           "x x x x  x x x x  i i i i  i i i i";
+
+         read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
+                           "x x x x  x x x x  o o o o  o o o o";
+       ;
+
+     memory "hfuse"
+         size            = 1;
+         write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
+                           "x x x x  x x x x  i i i i  i i i i";
+
+         read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
+                           "x x x x  x x x x  o o o o  o o o o";
+       ;
+
+     memory "efuse"
+         size            = 1;
+         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
+                           "x x x x  x x x x  x x x x  x x x i";
+
+         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
+                           "x x x x  x x x x  o o o o  o o o o";
+     ;
+# The Tiny2313 has calibration data for both 4 MHz and 8 MHz.
+# The information in the data sheet of April/2004 is wrong, this works:
+
+     memory "calibration"
+         size            = 2;
+         read            = "0  0  1  1   1  0  0  0    0 0 0 x  x x x x",
+                           "0  0  0  0   0  0  0  a0   o o o o  o o o o";
+     ;
+  ;
+
+#------------------------------------------------------------
+# AT90PWM2
+#------------------------------------------------------------
+
+part
+     id            = "pwm2";
+     desc          = "AT90PWM2";
+     stk500_devcode   = 0x65;
+##  avr910_devcode   = ?;
+     pagel            = 0xD8;
+     bs2              = 0xE2;
+     reset            = io;
+     chip_erase_delay = 9000;
+
+     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
+                        "x x x x  x x x x    x x x x  x x x x";
+
+     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
+                        "x x x x  x x x x    x x x x  x x x x";
+
+    timeout            = 200;
+    stabdelay          = 100;
+    cmdexedelay                = 25;
+    synchloops         = 32;
+    bytedelay          = 0;
+    pollindex          = 3;
+    pollvalue          = 0x53;
+    predelay           = 1;
+    postdelay          = 1;
+    pollmethod         = 1;
+
+     memory "eeprom"
+         size            = 512;
+         min_write_delay = 4000;
+         max_write_delay = 4500;
+         readback_p1     = 0xff;
+         readback_p2     = 0xff;
+         read            = "1  0  1  0   0  0  0  0   0 0 0 x  x x x a8",
+                           "a7 a6 a5 a4  a3 a2 a1 a0  o o o o  o o o o";
+
+         write           = "1  1  0  0   0  0  0  0   0 0 0 x  x x x a8",
+                           "a7 a6 a5 a4  a3 a2 a1 a0  i i i i  i i i i";
+
+       mode            = 0x41;
+       delay           = 6;
+       blocksize       = 4;
+       readsize        = 256;
+       ;
+     memory "flash"
+         paged           = yes;
+         size            = 8192;
+         page_size       = 64;
+         num_pages       = 128;
+         min_write_delay = 4500;
+         max_write_delay = 4500;
+         readback_p1     = 0xff;
+         readback_p2     = 0xff;
+         read_lo         = "  0   0   1   0    0   0   0   0",
+                           "  0   0   0   0   a11 a10 a9  a8",
+                           " a7  a6  a5  a4   a3  a2  a1  a0",
+                           "  o   o   o   o    o   o   o   o";
+
+         read_hi         = "  0   0   1   0    1   0   0   0",
+                           "  0   0   0   0   a11 a10 a9  a8",
+                           " a7  a6  a5  a4   a3  a2  a1  a0",
+                           "  o   o   o   o    o   o   o   o";
+
+         loadpage_lo     = "  0   1   0   0    0   0   0   0",
+                           "  0   0   0   x    x   x   x   x",
+                           "  x   x  a5  a4   a3  a2  a1  a0",
+                           "  i   i   i   i    i   i   i   i";
+
+         loadpage_hi     = "  0   1   0   0    1   0   0   0",
+                           "  0   0   0   x    x   x   x   x",
+                           "  x   x  a5  a4   a3  a2  a1  a0",
+                           "  i   i   i   i    i   i   i   i";
+
+         writepage       = "  0  1  0  0   1   1   0   0",
+                           "  0  0  0  0   a11 a10 a9  a8",
+                           " a7 a6  x  x   x   x   x   x",
+                           "  x  x  x  x   x   x   x   x";
+
+       mode            = 0x41;
+       delay           = 6;
+       blocksize       = 64;
+       readsize        = 256;
+       ;
+#   AT90PWM2 has Signature Bytes: 0x1E 0x93 0x81.
+     memory "signature"
+         size            = 3;
+         read            = "0  0  1  1   0  0  0  0   0  0  x  x   x  x  x  x",
+                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
+       ;
+     memory "lock"
+         size            = 1;
+         write           = "1 0 1 0  1 1 0 0  1 1 1 x  x x x x",
+                           "x x x x  x x x x  1 1 i i  i i i i";
+
+         read            = "0 1 0 1  1 0 0 0  0 0 0 0  0 0 0 0",
+                           "x x x x  x x x x  x x o o  o o o o";
+       ;
+
+     memory "lfuse"
+         size            = 1;
+         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
+                           "x x x x  x x x x  i i i i  i i i i";
+
+         read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
+                           "x x x x  x x x x  o o o o  o o o o";
+       ;
+
+     memory "hfuse"
+         size            = 1;
+         write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
+                           "x x x x  x x x x  i i i i  i i i i";
+
+         read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
+                           "x x x x  x x x x  o o o o  o o o o";
+       ;
+
+     memory "efuse"
+         size            = 1;
+         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
+                           "x x x x  x x x x  x x x x  x x x i";
+
+         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
+                           "x x x x  x x x x  o o o o  o o o o";
+     ;
+
+     memory "calibration"
+         size            = 1;
+         read            = "0  0  1  1   1  0  0  0    0 0 0 x  x x x x",
+                           "0  0  0  0   0  0  0  0    o o o o  o o o o";
+     ;
+  ;
+
+#------------------------------------------------------------
+# AT90PWM3
+#------------------------------------------------------------
+
+# Completely identical to AT90PWM2 (including the signature!)
+
+part
+     id            = "pwm3";
+     desc          = "AT90PWM3";
+     stk500_devcode   = 0x65;
+##  avr910_devcode   = ?;
+     pagel            = 0xD8;
+     bs2              = 0xE2;
+     reset            = io;
+     chip_erase_delay = 9000;
+
+     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
+                        "x x x x  x x x x    x x x x  x x x x";
+
+     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
+                        "x x x x  x x x x    x x x x  x x x x";
+
+    timeout            = 200;
+    stabdelay          = 100;
+    cmdexedelay                = 25;
+    synchloops         = 32;
+    bytedelay          = 0;
+    pollindex          = 3;
+    pollvalue          = 0x53;
+    predelay           = 1;
+    postdelay          = 1;
+    pollmethod         = 1;
+
+     memory "eeprom"
+         size            = 512;
+         min_write_delay = 4000;
+         max_write_delay = 4500;
+         readback_p1     = 0xff;
+         readback_p2     = 0xff;
+         read            = "1  0  1  0   0  0  0  0   0 0 0 x  x x x a8",
+                           "a7 a6 a5 a4  a3 a2 a1 a0  o o o o  o o o o";
+
+         write           = "1  1  0  0   0  0  0  0   0 0 0 x  x x x a8",
+                           "a7 a6 a5 a4  a3 a2 a1 a0  i i i i  i i i i";
+
+       mode            = 0x41;
+       delay           = 6;
+       blocksize       = 4;
+       readsize        = 256;
+       ;
+     memory "flash"
+         paged           = yes;
+         size            = 8192;
+         page_size       = 64;
+         num_pages       = 128;
+         min_write_delay = 4500;
+         max_write_delay = 4500;
+         readback_p1     = 0xff;
+         readback_p2     = 0xff;
+         read_lo         = "  0   0   1   0    0   0   0   0",
+                           "  0   0   0   0   a11 a10 a9  a8",
+                           " a7  a6  a5  a4   a3  a2  a1  a0",
+                           "  o   o   o   o    o   o   o   o";
+
+         read_hi         = "  0   0   1   0    1   0   0   0",
+                           "  0   0   0   0   a11 a10 a9  a8",
+                           " a7  a6  a5  a4   a3  a2  a1  a0",
+                           "  o   o   o   o    o   o   o   o";
+
+         loadpage_lo     = "  0   1   0   0    0   0   0   0",
+                           "  0   0   0   x    x   x   x   x",
+                           "  x   x  a5  a4   a3  a2  a1  a0",
+                           "  i   i   i   i    i   i   i   i";
+
+         loadpage_hi     = "  0   1   0   0    1   0   0   0",
+                           "  0   0   0   x    x   x   x   x",
+                           "  x   x  a5  a4   a3  a2  a1  a0",
+                           "  i   i   i   i    i   i   i   i";
+
+         writepage       = "  0  1  0  0   1   1   0   0",
+                           "  0  0  0  0   a11 a10 a9  a8",
+                           " a7 a6  x  x   x   x   x   x",
+                           "  x  x  x  x   x   x   x   x";
+
+       mode            = 0x41;
+       delay           = 6;
+       blocksize       = 64;
+       readsize        = 256;
+       ;
+#   AT90PWM2 has Signature Bytes: 0x1E 0x93 0x81.
+     memory "signature"
+         size            = 3;
+         read            = "0  0  1  1   0  0  0  0   0  0  x  x   x  x  x  x",
+                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
+       ;
+     memory "lock"
+         size            = 1;
+         write           = "1 0 1 0  1 1 0 0  1 1 1 x  x x x x",
+                           "x x x x  x x x x  1 1 i i  i i i i";
+
+         read            = "0 1 0 1  1 0 0 0  0 0 0 0  0 0 0 0",
+                           "x x x x  x x x x  x x o o  o o o o";
+       ;
+
+     memory "lfuse"
+         size            = 1;
+         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
+                           "x x x x  x x x x  i i i i  i i i i";
+
+         read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
+                           "x x x x  x x x x  o o o o  o o o o";
+       ;
 
-    memory "lock"
-        size            = 1;
-        min_write_delay = 4500;
-        max_write_delay = 4500;
-        read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
-                          "x x x x  x x x x   x x o o  o o o o";
+     memory "hfuse"
+         size            = 1;
+         write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
+                           "x x x x  x x x x  i i i i  i i i i";
 
-        write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
-                          "x x x x  x x x x   1 1 i i  i i i i";
-      ;
+         read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
+                           "x x x x  x x x x  o o o o  o o o o";
+       ;
 
-    memory "calibration"
-        size            = 1;
-        read            = "0  0  1  1   1  0  0  0   0  0  0  x   x  x  x  x",
-                          "0  0  0  0   0  0  0  0   o  o  o  o   o  o  o  o";
-      ;
+     memory "efuse"
+         size            = 1;
+         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
+                           "x x x x  x x x x  x x x x  x x x i";
 
-    memory "signature"
-        size            = 3;
-        read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
-                          "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
-      ;
-  ;
+         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
+                           "x x x x  x x x x  o o o o  o o o o";
+     ;
 
+     memory "calibration"
+         size            = 1;
+         read            = "0  0  1  1   1  0  0  0    0 0 0 x  x x x x",
+                           "0  0  0  0   0  0  0  0    o o o o  o o o o";
+     ;
+  ;
 
 #------------------------------------------------------------
-# ATtiny2313
+# ATtiny25
 #------------------------------------------------------------
 
 part
-     id            = "t2313";
-     desc          = "ATtiny2313";
-     stk500_devcode   = 0x23;
+     id            = "t25";
+     desc          = "ATtiny25";
+## no STK500 devcode in XML file, use the ATtiny45 one
+     stk500_devcode   = 0x14;
 ##  avr910_devcode   = ?;
 ##  Try the AT90S2313 devcode:
      avr910_devcode   = 0x20;
-     pagel            = 0xD4;
-     bs2              = 0xD6;
      reset            = io;
-     chip_erase_delay = 9000;
+     chip_erase_delay = 4500;
 
      pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
                         "x x x x  x x x x    x x x x  x x x x";
@@ -3219,6 +5405,17 @@ part
      chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
                         "x x x x  x x x x    x x x x  x x x x";
 
+    timeout            = 200;
+    stabdelay          = 100;
+    cmdexedelay                = 25;
+    synchloops         = 32;
+    bytedelay          = 0;
+    pollindex          = 3;
+    pollvalue          = 0x53;
+    predelay           = 1;
+    postdelay          = 1;
+    pollmethod         = 1;
+
      memory "eeprom"
          size            = 128;
          min_write_delay = 4000;
@@ -3230,6 +5427,11 @@ part
 
          write           = "1  1  0  0   0  0  0  0   0 0 0 x  x x x x",
                            "x a6 a5 a4  a3 a2 a1 a0   i i i i  i i i i";
+
+       mode            = 0x41;
+       delay           = 6;
+       blocksize       = 4;
+       readsize        = 256;
        ;
      memory "flash"
          paged           = yes;
@@ -3250,25 +5452,27 @@ part
                            " a7  a6  a5  a4   a3  a2  a1  a0",
                            "  o   o   o   o    o   o   o   o";
 
-# The information in the data sheet of April/2004 is wrong, this works:
          loadpage_lo     = "  0   1   0   0    0   0   0   0",
                            "  0   0   0   x    x   x   x   x",
                            "  x   x   x   x   a3  a2  a1  a0",
                            "  i   i   i   i    i   i   i   i";
 
-# The information in the data sheet of April/2004 is wrong, this works:
          loadpage_hi     = "  0   1   0   0    1   0   0   0",
                            "  0   0   0   x    x   x   x   x",
                            "  x   x   x   x   a3  a2  a1  a0",
                            "  i   i   i   i    i   i   i   i";
 
-# The information in the data sheet of April/2004 is wrong, this works:
          writepage       = "  0  1  0  0   1  1  0  0",
                            "  0  0  0  0   0  0 a9 a8",
                            " a7 a6 a5 a4   x  x  x  x",
                            "  x  x  x  x   x  x  x  x";
+
+       mode            = 0x41;
+       delay           = 6;
+       blocksize       = 32;
+       readsize        = 256;
        ;
-#   ATtiny2313 has Signature Bytes: 0x1E 0x91 0x0A.
+#   ATtiny25 has Signature Bytes: 0x1E 0x91 0x08.
      memory "signature"
          size            = 3;
          read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
@@ -3306,11 +5510,276 @@ part
          read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
                            "x x x x  x x x x  o o o o  o o o o";
      ;
-# The Tiny2313 has calibration data for both 4 MHz and 8 MHz.
-# The information in the data sheet of April/2004 is wrong, this works:
 
      memory "calibration"
-         size            = 2;
+         size            = 1;
+         read            = "0  0  1  1   1  0  0  0    0 0 0 x  x x x x",
+                           "0  0  0  0   0  0  0  a0   o o o o  o o o o";
+     ;
+  ;
+
+#------------------------------------------------------------
+# ATtiny45
+#------------------------------------------------------------
+
+part
+     id            = "t45";
+     desc          = "ATtiny45";
+     stk500_devcode   = 0x14;
+##  avr910_devcode   = ?;
+##  Try the AT90S2313 devcode:
+     avr910_devcode   = 0x20;
+     reset            = io;
+     chip_erase_delay = 4500;
+
+     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
+                        "x x x x  x x x x    x x x x  x x x x";
+
+     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
+                        "x x x x  x x x x    x x x x  x x x x";
+
+    timeout            = 200;
+    stabdelay          = 100;
+    cmdexedelay                = 25;
+    synchloops         = 32;
+    bytedelay          = 0;
+    pollindex          = 3;
+    pollvalue          = 0x53;
+    predelay           = 1;
+    postdelay          = 1;
+    pollmethod         = 1;
+
+     memory "eeprom"
+         size            = 256;
+         min_write_delay = 4000;
+         max_write_delay = 4500;
+         readback_p1     = 0xff;
+         readback_p2     = 0xff;
+         read            = "1  0  1  0   0  0  0  0    0 0 0 x  x x x x",
+                           "a7 a6 a5 a4  a3 a2 a1 a0   o o o o  o o o o";
+
+         write           = "1  1  0  0   0  0  0  0    0 0 0 x  x x x x",
+                           "a7 a6 a5 a4  a3 a2 a1 a0   i i i i  i i i i";
+
+       mode            = 0x41;
+       delay           = 6;
+       blocksize       = 4;
+       readsize        = 256;
+       ;
+     memory "flash"
+         paged           = yes;
+         size            = 4096;
+         page_size       = 64;
+         num_pages       = 64;
+         min_write_delay = 4500;
+         max_write_delay = 4500;
+         readback_p1     = 0xff;
+         readback_p2     = 0xff;
+         read_lo         = "  0   0   1   0    0   0   0   0",
+                           "  0   0   0   0    0  a10 a9  a8",
+                           " a7  a6  a5  a4   a3  a2  a1  a0",
+                           "  o   o   o   o    o   o   o   o";
+
+         read_hi         = "  0   0   1   0    1   0   0   0",
+                           "  0   0   0   0    0  a10 a9  a8",
+                           " a7  a6  a5  a4   a3  a2  a1  a0",
+                           "  o   o   o   o    o   o   o   o";
+
+         loadpage_lo     = "  0   1   0   0    0   0   0   0",
+                           "  0   0   0   x    x   x   x   x",
+                           "  x   x   x  a4   a3  a2  a1  a0",
+                           "  i   i   i   i    i   i   i   i";
+
+         loadpage_hi     = "  0   1   0   0    1   0   0   0",
+                           "  0   0   0   x    x   x   x   x",
+                           "  x   x   x  a4   a3  a2  a1  a0",
+                           "  i   i   i   i    i   i   i   i";
+
+         writepage       = "  0  1  0  0   1  1  0  0",
+                           "  0  0  0  0   0 a10 a9 a8",
+                           " a7 a6 a5  x   x  x  x  x",
+                           "  x  x  x  x   x  x  x  x";
+
+       mode            = 0x41;
+       delay           = 6;
+       blocksize       = 32;
+       readsize        = 256;
+       ;
+#   ATtiny45 has Signature Bytes: 0x1E 0x92 0x08.
+     memory "signature"
+         size            = 3;
+         read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
+                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
+       ;
+     memory "lock"
+         size            = 1;
+         write           = "1 0 1 0  1 1 0 0  1 1 1 x  x x x x",
+                           "x x x x  x x x x  1 1 i i  i i i i";
+       ;
+
+     memory "lfuse"
+         size            = 1;
+         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
+                           "x x x x  x x x x  i i i i  i i i i";
+
+         read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
+                           "x x x x  x x x x  o o o o  o o o o";
+       ;
+
+     memory "hfuse"
+         size            = 1;
+         write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
+                           "x x x x  x x x x  i i i i  i i i i";
+
+         read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
+                           "x x x x  x x x x  o o o o  o o o o";
+       ;
+
+     memory "efuse"
+         size            = 1;
+         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
+                           "x x x x  x x x x  x x x x  x x x i";
+
+         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
+                           "x x x x  x x x x  o o o o  o o o o";
+     ;
+
+     memory "calibration"
+         size            = 1;
+         read            = "0  0  1  1   1  0  0  0    0 0 0 x  x x x x",
+                           "0  0  0  0   0  0  0  a0   o o o o  o o o o";
+     ;
+  ;
+
+#------------------------------------------------------------
+# ATtiny85
+#------------------------------------------------------------
+
+part
+     id            = "t85";
+     desc          = "ATtiny85";
+## no STK500 devcode in XML file, use the ATtiny45 one
+     stk500_devcode   = 0x14;
+##  avr910_devcode   = ?;
+##  Try the AT90S2313 devcode:
+     avr910_devcode   = 0x20;
+     reset            = io;
+     chip_erase_delay = 4500;
+
+     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
+                        "x x x x  x x x x    x x x x  x x x x";
+
+     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
+                        "x x x x  x x x x    x x x x  x x x x";
+
+    timeout            = 200;
+    stabdelay          = 100;
+    cmdexedelay                = 25;
+    synchloops         = 32;
+    bytedelay          = 0;
+    pollindex          = 3;
+    pollvalue          = 0x53;
+    predelay           = 1;
+    postdelay          = 1;
+    pollmethod         = 1;
+
+     memory "eeprom"
+         size            = 512;
+         min_write_delay = 4000;
+         max_write_delay = 4500;
+         readback_p1     = 0xff;
+         readback_p2     = 0xff;
+         read            = "1  0  1  0   0  0  0  0    0 0 0 x  x x x a8",
+                           "a7 a6 a5 a4  a3 a2 a1 a0   o o o o  o o o o";
+
+         write           = "1  1  0  0   0  0  0  0    0 0 0 x  x x x a8",
+                           "a8 a6 a5 a4  a3 a2 a1 a0   i i i i  i i i i";
+
+       mode            = 0x41;
+       delay           = 6;
+       blocksize       = 4;
+       readsize        = 256;
+       ;
+     memory "flash"
+         paged           = yes;
+         size            = 8192;
+         page_size       = 64;
+         num_pages       = 128;
+         min_write_delay = 4500;
+         max_write_delay = 4500;
+         readback_p1     = 0xff;
+         readback_p2     = 0xff;
+         read_lo         = "  0   0   1   0    0   0   0   0",
+                           "  0   0   0   0  a11 a10  a9  a8",
+                           " a7  a6  a5  a4   a3  a2  a1  a0",
+                           "  o   o   o   o    o   o   o   o";
+
+         read_hi         = "  0   0   1   0    1   0   0   0",
+                           "  0   0   0   0  a11 a10  a9  a8",
+                           " a7  a6  a5  a4   a3  a2  a1  a0",
+                           "  o   o   o   o    o   o   o   o";
+
+         loadpage_lo     = "  0   1   0   0    0   0   0   0",
+                           "  0   0   0   x    x   x   x   x",
+                           "  x   x   x  a4   a3  a2  a1  a0",
+                           "  i   i   i   i    i   i   i   i";
+
+         loadpage_hi     = "  0   1   0   0    1   0   0   0",
+                           "  0   0   0   x    x   x   x   x",
+                           "  x   x   x  a4   a3  a2  a1  a0",
+                           "  i   i   i   i    i   i   i   i";
+
+         writepage       = "  0  1  0  0   1   1   0  0",
+                           "  0  0  0  0  a11 a10 a9 a8",
+                           " a7 a6 a5  x   x  x  x  x",
+                           "  x  x  x  x   x  x  x  x";
+
+       mode            = 0x41;
+       delay           = 6;
+       blocksize       = 32;
+       readsize        = 256;
+       ;
+#   ATtiny85 has Signature Bytes: 0x1E 0x93 0x08.
+     memory "signature"
+         size            = 3;
+         read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
+                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
+       ;
+     memory "lock"
+         size            = 1;
+         write           = "1 0 1 0  1 1 0 0  1 1 1 x  x x x x",
+                           "x x x x  x x x x  1 1 i i  i i i i";
+       ;
+
+     memory "lfuse"
+         size            = 1;
+         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
+                           "x x x x  x x x x  i i i i  i i i i";
+
+         read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
+                           "x x x x  x x x x  o o o o  o o o o";
+       ;
+
+     memory "hfuse"
+         size            = 1;
+         write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
+                           "x x x x  x x x x  i i i i  i i i i";
+
+         read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
+                           "x x x x  x x x x  o o o o  o o o o";
+       ;
+
+     memory "efuse"
+         size            = 1;
+         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
+                           "x x x x  x x x x  x x x x  x x x i";
+
+         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
+                           "x x x x  x x x x  o o o o  o o o o";
+     ;
+
+     memory "calibration"
+         size            = 1;
          read            = "0  0  1  1   1  0  0  0    0 0 0 x  x x x x",
                            "0  0  0  0   0  0  0  a0   o o o o  o o o o";
      ;
index a564048..93d867c 100755 (executable)
Binary files a/bin/win-avrdude/avrdude.exe and b/bin/win-avrdude/avrdude.exe differ
index af928b4..1bd41d3 100644 (file)
@@ -1,9 +1,9 @@
 /*
-  isp.c - part of USB
+  isp.c - part of USBasp
 
   Autor..........: Thomas Fischl <tfischl@gmx.de>
   Description....: Provides functions for communication/programming
-                   over ISP interf
+                   over ISP interface
   Licence........: Free under certain conditions. See Documentation.
   Creation Date..: 2005-02-23
   Last change....: 2005-04-20
index 9d79354..c5624d3 100644 (file)
@@ -10,7 +10,7 @@
 
   Target.........: ATMega8 at 12 MHz
   Creation Date..: 2005-02-20
-  Last change....: 2005-04-20
+  Last change....: 2005-10-08
 
   PC2 SCK speed option. GND  -> slow (8khz SCK),
                         open -> fast (375kHz SCK)
@@ -55,7 +55,7 @@ static uchar prog_state = PROG_STATE_IDLE;
 
 static unsigned int prog_address;
 static unsigned int prog_nbytes = 0;
-static uchar prog_pagesize;
+static unsigned int prog_pagesize; //TP: Mega128 fix
 static uchar prog_blockflags;
 static uchar prog_pagecounter;
 
@@ -106,7 +106,8 @@ uchar usbFunctionSetup(uchar data[8]) {
   } else if (data[1] == USBASP_FUNC_WRITEFLASH) {
     prog_address = (data[3] << 8) | data[2];
     prog_pagesize = data[4];
-    prog_blockflags = data[5];
+    prog_blockflags = data[5] & 0x0F;
+    prog_pagesize += (((unsigned int)data[5] & 0xF0)<<4); //TP: Mega128 fix
     if (prog_blockflags & PROG_BLOCKFLAG_FIRST) {
       prog_pagecounter = prog_pagesize;
     }
index 93432ee..5d586aa 100644 (file)
@@ -172,7 +172,7 @@ patent must be licensed for everyone's free use or not licensed at all.
 
   The precise terms and conditions for copying, distribution and
 modification follow.
-\f
+
                    GNU GENERAL PUBLIC LICENSE
    TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
 
@@ -227,7 +227,7 @@ above, provided that you also meet all of these conditions:
     License.  (Exception: if the Program itself is interactive but
     does not normally print such an announcement, your work based on
     the Program is not required to print an announcement.)
-\f
+
 These requirements apply to the modified work as a whole.  If
 identifiable sections of that work are not derived from the Program,
 and can be reasonably considered independent and separate works in
@@ -285,7 +285,7 @@ access to copy from a designated place, then offering equivalent
 access to copy the source code from the same place counts as
 distribution of the source code, even though third parties are not
 compelled to copy the source along with the object code.
-\f
+
   4. You may not copy, modify, sublicense, or distribute the Program
 except as expressly provided under this License.  Any attempt
 otherwise to copy, modify, sublicense or distribute the Program is
@@ -342,7 +342,7 @@ impose that choice.
 
 This section is intended to make thoroughly clear what is believed to
 be a consequence of the rest of this License.
-\f
+
   8. If the distribution and/or use of the Program is restricted in
 certain countries either by patents or by copyrighted interfaces, the
 original copyright holder who places the Program under this License
@@ -395,7 +395,7 @@ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
 POSSIBILITY OF SUCH DAMAGES.
 
                     END OF TERMS AND CONDITIONS
-\f
+
            How to Apply These Terms to Your New Programs
 
   If you develop a new program, and you want it to be of the greatest
diff --git a/software/avrdude_usbasp.2005-04-21.patch b/software/avrdude_usbasp.2005-04-21.patch
deleted file mode 100644 (file)
index ebe923d..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-? usbasp.c
-? usbasp.h
-Index: Makefile.am
-===================================================================
-RCS file: /cvsroot/avrdude/avrdude/Makefile.am,v
-retrieving revision 1.23
-diff -u -r1.23 Makefile.am
---- Makefile.am        10 Feb 2005 14:54:57 -0000      1.23
-+++ Makefile.am        9 Apr 2005 09:04:02 -0000
-@@ -85,6 +85,8 @@
-       stk500.c \
-       stk500.h \
-       stk500_private.h \
-+      usbasp.c \
-+      usbasp.h \
-       term.c \
-       term.h
-Index: avrdude.conf.in
-===================================================================
-RCS file: /cvsroot/avrdude/avrdude/avrdude.conf.in,v
-retrieving revision 1.36
-diff -u -r1.36 avrdude.conf.in
---- avrdude.conf.in    22 Dec 2004 01:30:30 -0000      1.36
-+++ avrdude.conf.in    9 Apr 2005 09:04:10 -0000
-@@ -243,6 +243,12 @@
-   miso  = 10;
- ;
-+programmer
-+  id    = "usbasp";
-+  desc  = "usbasp";
-+  type  = usbasp;
-+;
-+
- # The programming dongle used by the popular Ponyprog
- # utility.  It is almost similar to the STK200 one,
- # except that there is a LED indicating that the
-@@ -337,7 +343,6 @@
-   miso  = 10;
- ;
--
- # From the contributor of the "xil" jtag cable:
- # The "vcc" definition isn't really vcc (the cable gets its power from
- # the programming circuit) but is necessary to switch one of the
-Index: config_gram.y
-===================================================================
-RCS file: /cvsroot/avrdude/avrdude/config_gram.y,v
-retrieving revision 1.39
-diff -u -r1.39 config_gram.y
---- config_gram.y      22 Dec 2004 01:52:45 -0000      1.39
-+++ config_gram.y      9 Apr 2005 09:04:11 -0000
-@@ -34,6 +34,7 @@
- #include "pgm.h"
- #include "stk500.h"
- #include "avr910.h"
-+#include "usbasp.h"
- #include "butterfly.h"
- #include "avr.h"
-@@ -112,6 +113,7 @@
- %token K_SIZE
- %token K_STK500
- %token K_AVR910
-+%token K_USBASP
- %token K_BUTTERFLY
- %token K_TYPE
- %token K_VCC
-@@ -302,6 +304,11 @@
-     }
-   } |
-+  K_TYPE TKN_EQUAL K_USBASP {
-+    { 
-+      usbasp_initpgm(current_prog);
-+    }
-+  } |
-   K_TYPE TKN_EQUAL K_BUTTERFLY {
-     { 
-       butterfly_initpgm(current_prog);
-Index: configure.ac
-===================================================================
-RCS file: /cvsroot/avrdude/avrdude/configure.ac,v
-retrieving revision 1.22
-diff -u -r1.22 configure.ac
---- configure.ac       10 Feb 2005 15:39:42 -0000      1.22
-+++ configure.ac       9 Apr 2005 09:04:11 -0000
-@@ -104,6 +104,21 @@
- AC_SUBST(SUBDIRS_AC, $SUBDIRS_AC)     
- AC_SUBST(DIST_SUBDIRS_AC, $DIST_SUBDIRS_AC)
-+# USB stuff
-+AH_TEMPLATE([HAVE_LIBUSB],
-+      [Define if USB support is enabled via libusb])
-+AC_CHECK_LIB(usb, main, have_libusb=yes)
-+if test x$have_libusb = xyes; then
-+   case $target in
-+      *-*-darwin*)
-+              LIBS="$LIBS -lusb -framework CoreFoundation -framework IOKit"
-+              ;;
-+      *)
-+              LIBS="$LIBS -lusb"
-+              ;;
-+   esac
-+   AC_DEFINE([HAVE_LIBUSB])
-+fi
- # Find the parallel serial device files based on target system
- # If a system doesn't have a PC style parallel, mark it as unknown.
-Index: lexer.l
-===================================================================
-RCS file: /cvsroot/avrdude/avrdude/lexer.l,v
-retrieving revision 1.30
-diff -u -r1.30 lexer.l
---- lexer.l    22 Dec 2004 01:52:45 -0000      1.30
-+++ lexer.l    9 Apr 2005 09:04:12 -0000
-@@ -156,6 +156,7 @@
- size             { yylval=NULL; return K_SIZE; }
- stk500           { yylval=NULL; return K_STK500; }
- avr910           { yylval=NULL; return K_AVR910; }
-+usbasp           { yylval=NULL; return K_USBASP; }
- butterfly        { yylval=NULL; return K_BUTTERFLY; }
- type             { yylval=NULL; return K_TYPE; }
- vcc              { yylval=NULL; return K_VCC; }
diff --git a/software/avrdude_usbasp.2005-11-14.patch b/software/avrdude_usbasp.2005-11-14.patch
new file mode 100644 (file)
index 0000000..ba3e86b
--- /dev/null
@@ -0,0 +1,100 @@
+diff -Naur avrdude-5.0/Makefile.am avrdude-5.0-usbasp/Makefile.am
+--- avrdude-5.0/Makefile.am    Sun Sep 18 22:12:23 2005
++++ avrdude-5.0-usbasp/Makefile.am     Mon Nov 14 20:57:20 2005
+@@ -98,6 +98,8 @@
+       stk500v2.c \
+       stk500v2.h \
+       stk500v2_private.h \
++      usbasp.c \
++      usbasp.h \
+       term.c \
+       term.h \
+       usb_libusb.c
+diff -Naur avrdude-5.0/avrdude.conf.in avrdude-5.0-usbasp/avrdude.conf.in
+--- avrdude-5.0/avrdude.conf.in        Sun Sep 18 02:44:20 2005
++++ avrdude-5.0-usbasp/avrdude.conf.in Mon Nov 14 20:57:33 2005
+@@ -262,6 +262,12 @@
+ ;
+ programmer
++  id    = "usbasp";
++  desc  = "usbasp";
++  type  = usbasp;
++;
++
++programmer
+   id    = "butterfly";
+   desc  = "Atmel Butterfly Development Board";
+   type  = butterfly;
+diff -Naur avrdude-5.0/config_gram.y avrdude-5.0-usbasp/config_gram.y
+--- avrdude-5.0/config_gram.y  Sun Sep 18 22:12:23 2005
++++ avrdude-5.0-usbasp/config_gram.y   Mon Nov 14 20:57:50 2005
+@@ -37,6 +37,7 @@
+ #include "stk500v2.h"
+ #include "avr910.h"
+ #include "butterfly.h"
++#include "usbasp.h"
+ #include "avr.h"
+ #include "jtagmkII.h"
+@@ -118,6 +119,7 @@
+ %token K_STK500
+ %token K_STK500V2
+ %token K_AVR910
++%token K_USBASP
+ %token K_BUTTERFLY
+ %token K_TYPE
+ %token K_VCC
+@@ -349,6 +351,12 @@
+   K_TYPE TKN_EQUAL K_AVR910 {
+     { 
+       avr910_initpgm(current_prog);
++    }
++  } |
++
++  K_TYPE TKN_EQUAL K_USBASP {
++    {
++      usbasp_initpgm(current_prog);
+     }
+   } |
+diff -Naur avrdude-5.0/configure.ac avrdude-5.0-usbasp/configure.ac
+--- avrdude-5.0/configure.ac   Wed Sep 21 03:37:02 2005
++++ avrdude-5.0-usbasp/configure.ac    Mon Nov 14 20:58:07 2005
+@@ -46,7 +46,24 @@
+ AC_CHECK_LIB([readline], [readline])
+ # usb_get_string_simple is only available in recent enough
+ # versions of libusb, so use that as a decision base.
+-AC_CHECK_LIB([usb], [usb_get_string_simple])
++#AC_CHECK_LIB([usb], [usb_get_string_simple])
++
++AH_TEMPLATE([HAVE_LIBUSB],
++                  [Define if USB support is enabled via libusb])
++AC_CHECK_LIB(usb, main, have_libusb=yes)
++if test x$have_libusb = xyes; then
++   case $target in
++       *-*-darwin*)
++               LIBS="$LIBS -lusb -framework CoreFoundation -framework IOKit"
++               ;;
++       *)
++               LIBS="$LIBS -lusb"
++;;
++   esac
++   AC_DEFINE([HAVE_LIBUSB])
++fi
++
++
+ # Checks for header files.
+ AC_HEADER_STDC
+diff -Naur avrdude-5.0/lexer.l avrdude-5.0-usbasp/lexer.l
+--- avrdude-5.0/lexer.l        Sun Sep 18 22:12:23 2005
++++ avrdude-5.0-usbasp/lexer.l Mon Nov 14 20:58:24 2005
+@@ -118,6 +118,7 @@
+ allowfullpagebitstream { yylval=NULL; return K_ALLOWFULLPAGEBITSTREAM; }
+ avr910           { yylval=NULL; return K_AVR910; }
+ avr910_devcode   { yylval=NULL; return K_AVR910_DEVCODE; }
++usbasp           { yylval=NULL; return K_USBASP; }
+ bank_size        { yylval=NULL; return K_PAGE_SIZE; }
+ banked           { yylval=NULL; return K_PAGED; }
+ baudrate         { yylval=NULL; return K_BAUDRATE; }
index 439fa3b..464e80d 100644 (file)
@@ -258,7 +258,7 @@ static int usbasp_paged_write(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
     cmd[0] = address & 0xFF;
     cmd[1] = address >> 8;
     cmd[2] = page_size & 0xFF;
-    cmd[3] = blockflags;
+    cmd[3] = (blockflags & 0x0F) + ((page_size & 0xF00) >> 4); //TP: Mega128 fix
     blockflags = 0;
 
     n = usbasp_transmit(0, function, cmd, buffer, blocksize);