diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 01a23f7e..0735df2f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,9 +34,11 @@ jobs: linux-x86_64: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Install prerequisites run: >- + sudo apt-get update + sudo apt-get install -y build-essential cmake @@ -47,9 +49,14 @@ jobs: libusb-1.0-0-dev libhidapi-dev libftdi1-dev + libreadline-dev + texinfo + texlive + texi2html - name: Configure run: >- cmake + -D BUILD_DOC=1 -D DEBUG_CMAKE=1 -D HAVE_LINUXGPIO=1 -D HAVE_LINUXSPI=1 @@ -59,7 +66,7 @@ jobs: run: cmake --build build - name: Archive build artifacts if: always() - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: build-linux-x86_64 path: | @@ -67,7 +74,7 @@ jobs: !**/*.d !**/*.o - name: Archive executables - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: avrdude-linux-x86_64 path: | @@ -84,13 +91,15 @@ jobs: - { arch: armhf, processor: armhf, prefix: arm-linux-gnueabihf, inc-lib: arm-linux-gnueabihf } - { arch: arm64, processor: aarch64, prefix: aarch64-linux-gnu, inc-lib: aarch64-linux-gnu } steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Add architecture run: | dpkg --add-architecture ${{matrix.arch}} apt-get update - name: Install prerequisites run: >- + apt-get update + apt-get install -y git cmake @@ -102,6 +111,7 @@ jobs: libusb-1.0-0-dev:${{matrix.arch}} libhidapi-dev:${{matrix.arch}} libftdi1-dev:${{matrix.arch}} + libreadline-dev:${{matrix.arch}} - name: Configure run: >- cmake @@ -120,7 +130,7 @@ jobs: run: cmake --build build - name: Archive build artifacts if: always() - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: build-linux-${{matrix.processor}} path: | @@ -128,7 +138,7 @@ jobs: !**/*.d !**/*.o - name: Archive executables - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: avrdude-linux-${{matrix.processor}} path: | @@ -138,9 +148,11 @@ jobs: macos-x86_64: runs-on: macos-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Install prerequisites run: >- + # brew update + brew install cmake flex @@ -149,6 +161,7 @@ jobs: libusb hidapi libftdi + readline - name: Configure run: >- cmake @@ -161,7 +174,7 @@ jobs: run: cmake --build build - name: Archive build artifacts if: always() - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: build-macos-x86_64 path: | @@ -169,7 +182,7 @@ jobs: !**/*.d !**/*.o - name: Archive executables - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: avrdude-macos-x86_64 path: | @@ -185,7 +198,7 @@ jobs: - { arch: x64, platform: x64 } - { arch: arm64, platform: ARM64 } steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Install prerequisites # As Chocolatey is notoriously unreliable, install winflexbison3 directly from GitHub. # run: choco install winflexbison3 @@ -202,14 +215,15 @@ jobs: -D CMAKE_C_FLAGS_RELWITHDEBINFO="/MT /GL /Zi /O2 /Ob1 /DNDEBUG" -D CMAKE_CXX_FLAGS_RELWITHDEBINFO="/MT /GL /Zi /O2 /Ob1 /DNDEBUG" -D CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO="/DEBUG /INCREMENTAL:NO /LTCG /OPT:REF /OPT:ICF" + -D HAVE_LIBREADLINE=HAVE_LIBREADLINE-NOTFOUND -D CMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} - -D USE_EXTERNAL=1 + -D USE_EXTERNAL_LIBS=1 -B build - name: Build run: cmake --build build --config ${{env.BUILD_TYPE}} - name: Archive build artifacts if: always() - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: build-msvc-${{matrix.arch}} path: | @@ -221,7 +235,7 @@ jobs: mv build/src/RelWithDebInfo/avrdude.exe build/src mv build/src/RelWithDebInfo/avrdude.pdb build/src - name: Archive executables - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: avrdude-msvc-${{matrix.arch}} path: | @@ -240,7 +254,7 @@ jobs: - { sys: mingw32, env: i686 } - { sys: mingw64, env: x86_64 } steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: msys2/setup-msys2@v2 with: msystem: ${{matrix.sys}} @@ -265,13 +279,13 @@ jobs: run: cmake --build build - name: Archive build artifacts if: always() - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: build-mingw-${{matrix.env}} path: | build/ - name: Archive executables - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: avrdude-mingw-${{matrix.env}} path: | diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 64eddef0..0fd03c3d 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -76,10 +76,3 @@ jobs: asset_path: ./asset.zip asset_name: avrdude-${{github.ref_name}}-windows-${{matrix.arch}}.zip asset_content_type: application/zip - - #deploy: - # needs: [asset-msvc] - # runs-on: ubuntu-latest - # steps: - # - name: Create package (Chocolatey) - # run: echo TODO diff --git a/AUTHORS b/AUTHORS index 54cdad49..116d1290 100644 --- a/AUTHORS +++ b/AUTHORS @@ -2,6 +2,14 @@ AVRDUDE was written by: Brian S. Dean +AVRDUDE is currently maintained by: + + Hans Eirik Bull + Stefan Rueger + Xiaofan Chen + Marius Greuel + Joerg Wunsch + Contributors: Joerg Wunsch @@ -29,6 +37,8 @@ Contributors: Marius Greuel Dawid Buchwald Hans Eirik Bull + Stefan Rueger + Xiaofan Chen Contributors to code no longer present: @@ -36,5 +46,5 @@ Contributors to code no longer present: Paula Tomlinson for the loaddrv sources Chris Liechti for loaddrv modifications -For minor contributions, please see the ChangeLog files. +For minor contributions, please see the ChangeLog files / Git log. diff --git a/CMakeLists.txt b/CMakeLists.txt index 95c89d2b..66ef3a74 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,8 +20,8 @@ # cmake -B build # cmake --build build -cmake_minimum_required(VERSION 3.12) -project(avrdude VERSION 7.0) +cmake_minimum_required(VERSION 3.14) +project(avrdude VERSION 7.1 LANGUAGES C) set(CMAKE_C_STANDARD 11) set(CMAKE_C_STANDARD_REQUIRED True) @@ -30,11 +30,18 @@ option(BUILD_DOC "Enable building documents" OFF) option(HAVE_LINUXGPIO "Enable Linux sysfs GPIO support" OFF) option(HAVE_LINUXSPI "Enable Linux SPI support" OFF) option(HAVE_PARPORT "Enable parallel port support" OFF) -option(USE_EXTERNAL "Use external libraries from AVRDUDE GitHub repositories" OFF) +option(USE_EXTERNAL_LIBS "Use external libraries from AVRDUDE GitHub repositories" OFF) option(USE_LIBUSBWIN32 "Prefer libusb-win32 over libusb" OFF) option(DEBUG_CMAKE "Enable debugging output for this CMake project" OFF) option(BUILD_SHARED_LIBS "Build shared libraries" OFF) +if(WIN32) + # Prefer static libraries over DLLs on Windows + option(USE_STATIC_LIBS "Use static libraries" ON) +else() + option(USE_STATIC_LIBS "Use static libraries" OFF) +endif() + include(CheckIncludeFile) include(CheckSymbolExists) include(FetchContent) @@ -110,14 +117,14 @@ endif() # Detect installed libraries # ===================================== -# Prefer static libraries over DLLs on Windows -if(WIN32) +if(USE_STATIC_LIBS) set(PREFERRED_LIBELF libelf.a elf) set(PREFERRED_LIBUSB libusb.a usb) set(PREFERRED_LIBUSB_1_0 libusb-1.0.a usb-1.0) set(PREFERRED_LIBHIDAPI libhidapi.a libhidapi-libusb.a libhidapi-hidraw.a hidapi hidapi-libusb hidapi-hidraw) set(PREFERRED_LIBFTDI libftdi.a ftdi) set(PREFERRED_LIBFTDI1 libftdi1.a ftdi1) + set(PREFERRED_LIBREADLINE libreadline.a) else() set(PREFERRED_LIBELF elf) set(PREFERRED_LIBUSB usb) @@ -125,6 +132,7 @@ else() set(PREFERRED_LIBHIDAPI hidapi hidapi-libusb hidapi-hidraw) set(PREFERRED_LIBFTDI ftdi) set(PREFERRED_LIBFTDI1 ftdi1) + set(PREFERRED_LIBREADLINE readline) endif() # ------------------------------------- @@ -212,16 +220,18 @@ endif() # ------------------------------------- # Find libreadline -find_library(HAVE_LIBREADLINE NAMES readline) +find_library(HAVE_LIBREADLINE NAMES ${PREFERRED_LIBREADLINE}) if(HAVE_LIBREADLINE) set(LIB_LIBREADLINE ${HAVE_LIBREADLINE}) +elseif(MSVC) + set(HAVE_LIBREADLINE 1) endif() # ===================================== # Use external libraries if requested # ===================================== -if(USE_EXTERNAL) +if(USE_EXTERNAL_LIBS) FetchContent_Declare(libelf GIT_REPOSITORY https://github.com/avrdudes/libelf.git GIT_TAG e5a39bf19bd6598c42e09172be5a78ceec2a065c @@ -234,12 +244,12 @@ if(USE_EXTERNAL) FetchContent_Declare(libhidapi GIT_REPOSITORY https://github.com/avrdudes/libhidapi.git - GIT_TAG e3700e951f762ef92871ff4fc94586e4d1c042a6 + GIT_TAG d1307487973c857bc158e27ecc99644b2f5e68ea ) FetchContent_Declare(libftdi GIT_REPOSITORY https://github.com/avrdudes/libftdi.git - GIT_TAG f3a54da710002a7d25a32a69e667a69ef84cc120 + GIT_TAG f9fe6e96b97c3a08efd081632c1859cb83aa14e3 ) message(STATUS "Fetching external libraries, please wait...") @@ -273,25 +283,8 @@ endif() add_subdirectory(src) -# ===================================== -# Setup default port names -# ===================================== - -if (CMAKE_SYSTEM_NAME STREQUAL "Linux") - set(DEFAULT_PAR_PORT "/dev/parport0") - set(DEFAULT_SER_PORT "/dev/ttyS0") -elseif (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") - set(DEFAULT_PAR_PORT "/dev/ppi0") - set(DEFAULT_SER_PORT "/dev/cuad0") -elseif (CMAKE_SYSTEM_NAME STREQUAL "Solaris") - set(DEFAULT_PAR_PORT "/dev/printers/0") - set(DEFAULT_SER_PORT "/dev/term/a") -elseif (CMAKE_SYSTEM_NAME STREQUAL "Windows") - set(DEFAULT_PAR_PORT "lpt1") - set(DEFAULT_SER_PORT "com1") -else() - set(DEFAULT_PAR_PORT "unknown") - set(DEFAULT_SER_PORT "unknown") +if(BUILD_DOC) + add_subdirectory(src/doc) endif() # ===================================== @@ -308,7 +301,7 @@ if (DEBUG_CMAKE) message(STATUS "CMAKE_C_COMPILER: ${CMAKE_C_COMPILER}") message(STATUS "CONFIG_DIR: ${CONFIG_DIR}") message(STATUS "AVRDUDE_FULL_VERSION: ${AVRDUDE_FULL_VERSION}") - message(STATUS "USE_EXTERNAL: ${USE_EXTERNAL}") + message(STATUS "USE_EXTERNAL_LIBS: ${USE_EXTERNAL_LIBS}") message(STATUS "USE_LIBUSBWIN32: ${USE_LIBUSBWIN32}") message(STATUS "HAVE_LIBELF: ${HAVE_LIBELF}") message(STATUS "HAVE_LIBUSB: ${HAVE_LIBUSB}") @@ -370,6 +363,12 @@ else() message(STATUS "DON'T HAVE libftdi1") endif() +if(HAVE_LIBREADLINE) + message(STATUS "DO HAVE libreadline") +else() + message(STATUS "DON'T HAVE libreadline") +endif() + if(BUILD_DOC) message(STATUS "ENABLED doc") else() diff --git a/CMakeSettings.json b/CMakeSettings.json index aa05f9ee..7be75397 100644 --- a/CMakeSettings.json +++ b/CMakeSettings.json @@ -1,85 +1,19 @@ { "configurations": [ - { - "name": "x86-Debug", - "generator": "Visual Studio 17 2022", - "configurationType": "Debug", - "buildRoot": "${projectDir}\\out\\build\\${name}", - "installRoot": "${projectDir}\\out\\install\\${name}", - "cmakeCommandArgs": "", - "buildCommandArgs": "", - "ctestCommandArgs": "", - "inheritEnvironments": [ "msvc_x86" ], - "variables": [ - { - "name": "DEBUG_CMAKE", - "value": "True", - "type": "BOOL" - }, - { - "name": "USE_EXTERNAL", - "value": "True", - "type": "BOOL" - } - ] - }, - { - "name": "x86-Release", - "generator": "Ninja", - "configurationType": "RelWithDebInfo", - "buildRoot": "${projectDir}\\out\\build\\${name}", - "installRoot": "${projectDir}\\out\\install\\${name}", - "cmakeCommandArgs": "", - "buildCommandArgs": "", - "ctestCommandArgs": "", - "inheritEnvironments": [ "msvc_x86" ], - "variables": [ - { - "name": "DEBUG_CMAKE", - "value": "True", - "type": "BOOL" - }, - { - "name": "USE_EXTERNAL", - "value": "True", - "type": "BOOL" - }, - { - "name": "CMAKE_C_FLAGS_RELWITHDEBINFO", - "value": "/MT /GL /Zi /O2 /Ob1 /DNDEBUG", - "type": "STRING" - }, - { - "name": "CMAKE_CXX_FLAGS_RELWITHDEBINFO", - "value": "/MT /GL /Zi /O2 /Ob1 /DNDEBUG", - "type": "STRING" - }, - { - "name": "CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO", - "value": "/debug /INCREMENTAL:NO /LTCG /OPT:REF /OPT:ICF", - "type": "STRING" - } - ] - }, { "name": "x64-Debug", - "generator": "Visual Studio 17 2022 Win64", + "generator": "Ninja", "configurationType": "Debug", + "inheritEnvironments": [ "msvc_x64_x64" ], "buildRoot": "${projectDir}\\out\\build\\${name}", "installRoot": "${projectDir}\\out\\install\\${name}", "cmakeCommandArgs": "", "buildCommandArgs": "", "ctestCommandArgs": "", - "inheritEnvironments": [ "msvc_x64_x64" ], "variables": [ { - "name": "DEBUG_CMAKE", - "value": "True", - "type": "BOOL" - }, - { - "name": "USE_EXTERNAL", - "value": "True", + "name": "USE_EXTERNAL_LIBS", + "value": "true", "type": "BOOL" } ] @@ -96,31 +30,47 @@ "inheritEnvironments": [ "msvc_x64_x64" ], "variables": [ { - "name": "DEBUG_CMAKE", - "value": "True", + "name": "USE_EXTERNAL_LIBS", + "value": "true", "type": "BOOL" - }, + } + ] + }, + { + "name": "x86-Debug", + "generator": "Ninja", + "configurationType": "Debug", + "buildRoot": "${projectDir}\\out\\build\\${name}", + "installRoot": "${projectDir}\\out\\install\\${name}", + "cmakeCommandArgs": "", + "buildCommandArgs": "", + "ctestCommandArgs": "", + "inheritEnvironments": [ "msvc_x86" ], + "variables": [ { - "name": "USE_EXTERNAL", - "value": "True", + "name": "USE_EXTERNAL_LIBS", + "value": "true", "type": "BOOL" - }, + } + ] + }, + { + "name": "x86-Release", + "generator": "Ninja", + "configurationType": "RelWithDebInfo", + "buildRoot": "${projectDir}\\out\\build\\${name}", + "installRoot": "${projectDir}\\out\\install\\${name}", + "cmakeCommandArgs": "", + "buildCommandArgs": "", + "ctestCommandArgs": "", + "inheritEnvironments": [ "msvc_x86" ], + "variables": [ { - "name": "CMAKE_C_FLAGS_RELWITHDEBINFO", - "value": "/MT /GL /Zi /O2 /Ob1 /DNDEBUG", - "type": "STRING" - }, - { - "name": "CMAKE_CXX_FLAGS_RELWITHDEBINFO", - "value": "/MT /GL /Zi /O2 /Ob1 /DNDEBUG", - "type": "STRING" - }, - { - "name": "CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO", - "value": "/debug /INCREMENTAL:NO /LTCG /OPT:REF /OPT:ICF", - "type": "STRING" + "name": "USE_EXTERNAL_LIBS", + "value": "true", + "type": "BOOL" } ] } ] -} +} \ No newline at end of file diff --git a/NEWS b/NEWS index 2a190861..b1b1c7d7 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,317 @@ Approximate change log for AVRDUDE by version. (For detailed changes, see the version control system logs.) ---------------------------------------------------------------------- +Changes since version 7.1: + + * Major changes compared to the previous version: + + * New devices supported: none + + * New programmers supported: + + * Issues fixed: + + * Pull requests: + + * Internals: + + +Changes in version 7.1: + + * Major changes compared to the previous version: + + - Provide a new programmer -c urclock for bootloader urprotocol + + Urclock fully supports vector bootloaders at no extra code size + + Uprotocol + https://github.com/stefanrueger/urboot/blob/main/urprotocol.md + allows programming much shorter bootloaders with more features: + * Exports a pgm_write_page(sram, progmem) function that the + application can call at FLASHEND-4+1 to use flash as storage + * Supports EEPROM reads/writes + * Protects itself from overwriting + * Vector bootloaders: can protect the reset vector + * Offers Chip Erase function (quicker than uploading 0xff's) + + Urclock when compiled with libreadline supports bootloaders in + terminal mode (preventing them from WDT timeout) + + The -c urclock programmer provides a metadata interface that + allows unused flash to be used as storage + + avrdude -c urclock is backward compatible with avrdude -c arduino + + - Add TPI support for Microchip tools #1205 + + - Add C-strings, C characters and double to terminal write + + - Provide write flash in the terminal (using a cache) + + - Provide page erase in the terminal as pgerase + + - Add support for NetBSD and OpenBSD to build.sh + + * New devices supported: none + + * New programmers supported: + + - urclock = Urclock programmer for bootloaders using urprotocol + - xplainedmini_tpi = Atmel AVR XplainedMini in TPI mode + - xplainedpro_pdi = Atmel AVR XplainedPro in PDI mode + - atmelice_tpi = Atmel-ICE (ARM/AVR) in TPI mode + - powerdebugger_tpi = Atmel PowerDebugger (ARM/AVR) in TPI mode + - pickit4 = MPLAB(R) PICkit 4 in JTAG mode + - pickit4_tpi = MPLAB(R) PICkit 4 in TPI mode + - snap = MPLAB(R) SNAP in JTAG mode + - snap_tpi = MPLAB(R) SNAP in TPI mode + - arduino_gemma = Arduino Gemma bootloader disguised as USBtiny + - adafruit_gemma = Adafruit Trinket Gemma bootloader disguised as USBtiny + - digilent-hs2 = Digilient JTAG HS2 (MPSSE) + - tigard = Tigard interface board + + * Issues fixed: + + - Fix micronucleus bootloader to check for unresponsive USB + devices #945 + - Fix src/CMakeLists.txt to honor CMAKE_INSTALL_LIBDIR #972 + - [bug #43898] atmega644p remains stopped after JTAG + transaction #366 + - Wrong timings for ATmega328PB and other parts in avrdude.conf + #976 + - FT232R based programmer ATmega2560 Flash Reading Problem #995 + also #474 + - Enable avrdude to send full input file incl trailing 0xff + #936 + - Portname default for linuxspi programmer not recognized #926 + - JTAG1 unable to write fuse and lock bits #443 + - Unknown option '-s' on command line (legacy) #1032 + - STK500/arduino/xbee programmers fail EEPROM r/w for some + parts #967 also #421 + - Design issue: jtag2updi is hardcoded to fail for parts with + has_pdi = yes #1037 + - Option parse error: after -U flash:w:program_to_upload.hex, + subsequent -V ignored #441 + - Automatic verification is designed to fail for stdin #1044 + - Display correct number of bytes when input file has holes + #1005 + - Cmake installs avrdude.1 in the wrong place on Linux #1064 + - avr910 -qq prompt too verbose #1081 + - avrftdi.c: paged write can fail at addr 0 #1073 + - Permission denied accessing /sys/class/gpio/gpioX/direction + would leave pin exported #472 also #372 + - Raspberry Pi sysfs bug workaround for linuxgpio driver #386 + - Fix CMake avrdude.conf dependency to avrdude.conf.in #1035 + - CMake infrastructure does not handle documentation #947 + - New feature: ability to reset FLIPv2 targets #733 + - Fix Extended address not sent with avr109/butterfly #360 + and #454 + - Enable AVR JTAG ICE mkI program EEPROM in terminal mode + #1054 + - Make flash writes work in terminal mode #1020 + - Add support for XMEGA specific AVR109 protocol extensions + used by XBoot #200 + - jtag2updi can not write EEPROM in terminal mode #1116 + - Make UPDI programmers less verbose during initialization + #1084 + - Quell mode isn't handled systematically #1114 + - Mixing the progress bar with warning messages #1136 + - Inconsistent terminal output re stdout and stderr #1130 + - Supress the warning for Microchip SNAP #1135 + - ATtiny85 communication problem with default bitclock #1133 + - [Regression] Optiboot for "modern AVRs" no longer works #1120 + - Cannot access EEPROM on some bootloader/part combos #970 + - -U writes sometimes more bytes to flash/memory than input + file has #1050 + - debugWire using dragon_dw and jtag2dw not working #1168 + - && echo OK does not work after -c urclock #1192 + - Serial drain timeout needs calibrating for -c urclock #1193 + - avrdude -U file.elf misses second and following suitable + sections in elf segements #1204 + - Avrdude on macOS has problems with libedit #1173 + - urclock support for optiboot_x and optiboot_dx #1200 + - Terminal does not continue read/dump correctly #1201 + - JTAG3 programmer info not available in ISP mode #1212 + - Extra avrdude> prompt with -qqt in terminal mode #1214 + - PICkit4 and SNAP serial numbers not read by Avrdude #1038 + - Optiboot EEPROM support cannot be detected by avrdude #1224 + - megaAVR JTAG programming doesn't work for SNAP and PICkit4 + #1052 + - urclock/FTDI communication issues #1245 + - stk500v2.c dumps core on open #1254 + - linuxgpio cannot use pin 0 #1228 + - Remove non-working butterfly page erase function + - linuxgpio and linuxspi: input files with unset bytes don't program + correctly #1263 #455 + + * Pull requests: + + - Fix .Dd macro in manpage #949 + - fix M1 homebrew path #950 + - CMake Enhancements #962 + - Reduce programmer desc string length in avrdude.conf + to < 80 characters #1000 + - Dragon JTAG fix #979 + - adding support for all Linux baud rates v.2 #993 + - Replace internal knowledge in jtag3.c by a public API #996 + - JTAG3 UPDI EEPROM fix #1013 + - Treat x bits in .conf SPI commands as 0 #943 + - Fix avrftdi support for ATmega2560 et al #998 + - Fix avrdude.conf timings for ATmega328PB and other parts #1001 + - Fix PICKit2 ATmega2560 flash paged flash read #1023 + - Fix ft245r paged read for ATmega2560 et al #1018 + - Add option -A that supresses trailing 0xff optimisation + and automatically do so for -c arduino #936 + - Fix linuxspi default port #933 + - Add support for high-voltage UPDI im jtag3.c #1015 + - Fix terminal write edge cases; add one read mode; add quell + command #1025 + - Fix usbtiny read for parts with more than 64 kB flash #1029 + - CMakeLists.txt: fix build without C++ #1016 + - Provide file format I: Intel HEX with comments that ignores + checksum errors #1030 + - Enable writing fuse and lock bits for AVR-JTAGICE #1031 + - Ignore -s flag as safemode is no longer supported #1033 + - Developer options to describe parts and + extend avrdude.conf syntax #1040 + - Deprecate original STK500 v1 protocol in favour of optiboot + and Arduino as ISP #1046 + - Add jtagmkii_updi programmer option #1048 + - Enable stdin verification, display correct number of bytes + written/verified, check -U memory names against spelling + errors and exit but skip -U memory updates with known + memories that the part lacks #1053 + - Handle invalid -U file format specifiers for input #1042 + - Implement a dry run for -U updates before opening the + programmer #1056 + - Implement -c /dev_options for printing avrdude.conf + show comments with -p*/s or -c*/s; Reduce -p */r raw output; + specifying the full memory name now always works; stop + listing programmers where id starts with dot #1059 + - Fix logfile short option in man-page; fix install dir for man + page #1063 + - Use const for programmer functions where useful; add second + argument for programmer enable interface function + void (*enable)(PROGRAMMER *pgm, const AVRPART *p) #1078 + - Make avr910 programmer initialize() less verbose #1083 + - Fix flash paged write for avrftdi.c #1074 + - Fix 4 parts wrt to their interfaces in avrdude.conf; rewrite + avrdude.conf.in file from avrdude -c* -p* output; reformat + conditional programmers in avrdude.conf.in using -c*; fix + reset=dedicated|io; entries #1086 + - Add prog_modes, a bitwise or of prgramming modes, to part and + programmer definitions; add to part definition + + mcuid, a unique id in 0..2039 for 8-bit AVR + + n_interrupts, the number of interrupts + + n_page_erase, if set, the # of pages erased for NVM erase + implement a simple calculator in config_gram.y for numeric + values; set part prog_modes, mcuid, n_interrupts and + n_page_erase in avrdude.conf.in; add external intelligence + about AVRs avrintel.[ch] to the project and warn during + parsing if mcuid is incompatible with it #1091 + - Fix permission denied error in linuxgpio programmer #917 + - Add a programmer arduino_gemma for the Arduino Gemma + bootloader and another one, adafruit_gemma, for the Adafruit + Trinket Gemma bootloader in avrdude.conf; #1093 + - Add digilent-hs2 programmer in avrdude.conf #1094 + - Fix dependency chain between avrdude.conf.in and + avrdude.conf #1095 + - Build docs with CMake #1096 + - New feature so user can print all compatible parts for a + programmer using -p\? -c programmer and vice versa #1099 + - Add extended parameter disable_no_cs for linuxspi programmer + #1100 + - Fix avr109 extended address #1101 + - Add support for Flip 2 reset on exit #1102 + - Support for Power Debugger analog readings in terminal mode + #1105 + - Provide cached byte-wise read/write API #1106 + - AVR109: support for prodsig read and usersig read/write #1108 + - Add missing AVR variants the original JTAG ICE supports #1109 + - Improve help message in terminal and provide new command + pgerase #1113 + - Fix pointer truncation for Windows x64 #1119 + - Fix jtag3_page_erase for targets with UPDI #1112 + - Fix writing of last word on DWORD TPI parts #1115 + - Use byte-wise read/write when page size is 1 in terminal + cache #1121 + - Suppress Teensy USB communication error message on reboot #1122 + - Fix UPDI erase when target is locked #1125 + - Review and overhaul AVRDUDE's messaging system #1126 + - Look for ~/.config/avrdude/avrdude.rc then ~/.avrduderc #1131 + - Revamp terminal output (progress bar, callback and + stdout/stderr) #1132 + - Detect PICkit4 and SNAP in PIC mode #1138 + - Mention -B in the error message #1139 + - Support optiboot, optiboot_dx and optiboot_x bootloaders for + -c arduino #1140 + - Always use paged access for programmers that serve + bootloaders #1141 + - Add libreadline-dev for Linux github action build #1146 + - Implementation of SerialUPDI page erase operation #1151 + - Fix Type 2 HV UPDI #1164 + - Rewrite authors/copyrights #1182 + - Add fallback for EM_AVR #1181 + - Add a workaround for issue 1173 #1185 + - Add xplainedpro_pdi programmer #1147 + - Provide Urclock programmer #1171 + - Fix JTAGICE mkII (not initializing after chip erase) #1172 + - Ensure default_programmer from config files is used #1174 + - Make terminal write's automatic number width less surprising + #1175 + - Print HAVE_LIBREADLINE status when making the project #1184 + - Pad pages with input file contents before avr_write() #1188 + - Deprecate mosi/miso in favour of sdo/sdi #1189 + - Provide bootloader-hash tool #1190 + - Fix JTAGICE mkII parameters for parts with bootloaders #1191 + - Fix shell exit value when chip erase is delayed #1194 + - Support autobaud for urclock programmer #1198 + - Fix userrow size and page_size for ATtiny3216/7 #1199 + - Added TPI support for Microchip tools #1205 + - Fix reading of .elf files #1206 + - Use libedit only in interactive mode #1207 + - Add urclock support for bootloaders in low flash #1208 + - Terminal read improvements #1209 + - Print meaningful error when a too slow ISP clock is detected #1216 + - Check alternative USB PID for PICkit4/SNAP in PIC mode #1219 + - Remove extraneous avrdude> prompt at end of terminal session #1220 + - Read programmer serial number from libusb or hidusb #1223 + - Hint at -xeepromrw option in EEPROM error messages #1226 + - Add JTAG support for PICkit4 and Snap. #1233 + - Mention developer options in documentation and Usage() #1234 + - Print expected signature on signature mismatch #1237 + - To work around Issue #1107 #1240 + - Update build.sh for NetBSD #1241 + - Add FT2232H support for Windows, Tigard programmer #1242 + - Modify recv timeouts to accommodate urclock sync with ftdi + #1246 + - CMake updates #1243 + - Silence conf path detection debug output #1247 + - Make WIN32 ser_recv() fail on time-out #1248 + - Guard urclock_getsync() against initial spurious input #1251 + - Change definition of NO_PIN to 1+PIN_MAX #1231 + - Fix partial matches for locate_mem() and do_cmd() #1256 + - Add abbreviated q command in terminal + - Move static usbsn into serdev struct and remove serno #1258 + - Clean up avrdude.conf.in fixing a couple of bugs #1260 + - Add readline library replacement for MSVC #1264 + - Ensure full words are loaded for ISP programming #1265 + - Silence page erase in cache code #1266 + - Update to latest MSVC fork of hidapi to include bug fixes + #1269 + + * Internals: + + - Implement -c /dev_opts and -p /dev_opts + for printing avrdude.conf programmer and part entries + + - Added shorter alternative ISP commands for avrdude.conf + + - Reformatted avrdude.conf to canonical form + + - Reviewed API for prgrammer functions: use const for + programmer functions where useful; add second argument for + void (*enable)(PROGRAMMER *pgm, const AVRPART *p) #1078 + + - Reviewed messaging system making warnings and errors explicit + and treat them systematically + + Changes in version 7.0: * Major changes compared to the previous version: diff --git a/build.sh b/build.sh index baea4516..bcb7b6ae 100755 --- a/build.sh +++ b/build.sh @@ -29,7 +29,12 @@ ostype=$(uname | tr '[A-Z]' '[a-z]') build_type=RelWithDebInfo # build_type=Release # no debug info +# See CMakeLists.txt for all options +# +# Use this to enable (historical) parallel-port based programmers: +#extra_enable="-D HAVE_PARPORT=1" extra_enable="" + build_flags="" case "${ostype}" in @@ -37,9 +42,9 @@ case "${ostype}" in # try to find out whether this is an Embedded Linux # platform (e.g. Raspberry Pi) machine=$(uname -m) - if expr "${machine}" : 'arm' >/dev/null + if expr "${machine}" : '^\(arm\|aarch\)' >/dev/null then - extra_enable="${extra_enable} -D HAVE_LINUXGPIO=ON -D HAVE_LINUXSPI=ON" + extra_enable="${extra_enable} -D HAVE_LINUXGPIO=1 -D HAVE_LINUXSPI=1" fi ;; @@ -50,11 +55,21 @@ case "${ostype}" in then build_flags="${build_flags} -D CMAKE_C_FLAGS=-I/opt/local/include -D CMAKE_EXE_LINKER_FLAGS=-L/opt/local/lib" else - build_flags="${build_flags} -D CMAKE_C_FLAGS=-I/usr/local/include -D CMAKE_EXE_LINKER_FLAGS=-L/usr/local/Cellar" + # Apple M1 (may be new version of homebrew also) + if [ -d /opt/homebrew ] + then + build_flags="${build_flags} -D CMAKE_C_FLAGS=-I/opt/homebrew/include -D CMAKE_EXE_LINKER_FLAGS=-L/opt/homebrew/Cellar" + else + build_flags="${build_flags} -D CMAKE_C_FLAGS=-I/usr/local/include -D CMAKE_EXE_LINKER_FLAGS=-L/usr/local/Cellar" + fi fi ;; - freebsd) + netbsd) + build_flags="${build_flags} -D CMAKE_C_FLAGS=-I/usr/pkg/include -D CMAKE_EXE_LINKER_FLAGS=-R/usr/pkg/lib -D CMAKE_INSTALL_PREFIX:PATH=/usr/pkg" + ;; + + *bsd) build_flags="${build_flags} -D CMAKE_C_FLAGS=-I/usr/local/include -D CMAKE_EXE_LINKER_FLAGS=-L/usr/local/lib" ;; esac diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index fae17a1a..d75a0457 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -51,16 +51,13 @@ include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) add_compile_definitions(CONFIG_DIR=\"${CONFIG_DIR}\") if(WIN32) - set(EXTRA_WINDOWS_SOURCES "${PROJECT_BINARY_DIR}/src/windows.rc") + set(EXTRA_WINDOWS_RESOURCES "${PROJECT_BINARY_DIR}/src/windows.rc") set(EXTRA_WINDOWS_LIBRARIES setupapi ws2_32) endif() -if(NOT WIN32) - set(LIB_MATH m) - add_compile_options(-Wall) # -Wextra -endif() - if(MSVC) + enable_language(CXX) + add_compile_definitions(_CRT_SECURE_NO_WARNINGS=1) add_compile_definitions(_CRT_NONSTDC_NO_WARNINGS=1) add_compile_definitions(_WINSOCK_DEPRECATED_NO_WARNINGS=1) @@ -68,45 +65,69 @@ if(MSVC) add_compile_options(/wd4018) # warning C4018: signed/unsigned mismatch add_compile_options(/wd4244) # warning C4244: conversion from '...' to '...', possible loss of data add_compile_options(/wd4267) # warning C4267: conversion from '...' to '...', possible loss of data - add_compile_options(/wd5105) # warning C5105: macro expansion producing 'xxx' has undefined behavior - add_compile_options(/wd6255) # warning C6255: _alloca indicates failure by raising a stack overflow exception. Consider using _malloca instead set(EXTRA_WINDOWS_SOURCES ${EXTRA_WINDOWS_SOURCES} "msvc/getopt.c" "msvc/gettimeofday.c" "msvc/usleep.cpp" + "msvc/readline.cpp" "msvc/usb_com_helper.cpp" ) set(EXTRA_WINDOWS_INCLUDES ${EXTRA_WINDOWS_INCLUDES} "msvc" ) +else() + set(LIB_MATH m) + add_compile_options(-Wall) # -Wextra +endif() + +# ===================================== +# Setup default port names +# ===================================== + +if (CMAKE_SYSTEM_NAME STREQUAL "Linux") + set(DEFAULT_PAR_PORT "/dev/parport0") + set(DEFAULT_SER_PORT "/dev/ttyS0") +elseif (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") + set(DEFAULT_PAR_PORT "/dev/ppi0") + set(DEFAULT_SER_PORT "/dev/cuad0") +elseif (CMAKE_SYSTEM_NAME STREQUAL "Solaris") + set(DEFAULT_PAR_PORT "/dev/printers/0") + set(DEFAULT_SER_PORT "/dev/term/a") +elseif (CMAKE_SYSTEM_NAME STREQUAL "Windows") + set(DEFAULT_PAR_PORT "lpt1") + set(DEFAULT_SER_PORT "com1") +else() + set(DEFAULT_PAR_PORT "unknown") + set(DEFAULT_SER_PORT "unknown") endif() # ===================================== # Configure files # ===================================== -macro(configure_option option) - if(${${option}}) - string(REGEX REPLACE "(.*)@${option}_BEGIN@(.*)@${option}_END@(.*)" "\\1\\2\\3" conf_file "${conf_file}") - else() - string(REGEX REPLACE "(.*)@${option}_BEGIN@(.*)@${option}_END@(.*)" "\\1\\3" conf_file "${conf_file}") - endif() -endmacro() - -file(READ avrdude.conf.in conf_file) -configure_option(HAVE_PARPORT) -configure_option(HAVE_LINUXGPIO) -configure_option(HAVE_LINUXSPI) -file(WRITE "${PROJECT_BINARY_DIR}/avrdude.conf.in" "${conf_file}") - configure_file(cmake_config.h.in ac_cfg.h) -configure_file("${PROJECT_BINARY_DIR}/avrdude.conf.in" avrdude.conf) configure_file(avrdude.spec.in avrdude.spec) if(WIN32) configure_file(windows.rc.in windows.rc) endif() +add_custom_command( + OUTPUT avrdude.conf + COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/avrdude.conf.in" avrdude.conf.in + COMMAND ${CMAKE_COMMAND} + -D HAVE_PARPORT=${HAVE_PARPORT} + -D HAVE_LINUXSPI=${HAVE_LINUXSPI} + -D HAVE_LINUXGPIO=${HAVE_LINUXGPIO} + -D DEFAULT_PAR_PORT=${DEFAULT_PAR_PORT} + -D DEFAULT_SER_PORT=${DEFAULT_SER_PORT} + -P "${CMAKE_CURRENT_SOURCE_DIR}/configure.cmake" + DEPENDS avrdude.conf.in + VERBATIM + ) + +add_custom_target(conf ALL DEPENDS avrdude.conf) + # ===================================== # Project # ===================================== @@ -118,6 +139,7 @@ add_library(libavrdude avr.c avr910.c avr910.h + avrcache.c avrdude.h avrftdi.c avrftdi.h @@ -203,6 +225,10 @@ add_library(libavrdude updi_readwrite.h updi_state.c updi_state.h + urclock.c + urclock.h + urclock_hash.h + urclock_private.h usbasp.c usbasp.h usbdevs.h @@ -217,6 +243,7 @@ add_library(libavrdude xbee.c ${FLEX_Parser_OUTPUTS} ${BISON_Parser_OUTPUTS} + "${EXTRA_WINDOWS_SOURCES}" ) set_target_properties(libavrdude PROPERTIES @@ -252,9 +279,14 @@ add_executable(avrdude main.c term.c term.h + avrintel.c + avrintel.h + developer_opts.c + developer_opts.h + developer_opts_private.h whereami.c whereami.h - "${EXTRA_WINDOWS_SOURCES}" + "${EXTRA_WINDOWS_RESOURCES}" ) target_link_libraries(avrdude PUBLIC libavrdude) @@ -265,9 +297,11 @@ target_link_libraries(avrdude PUBLIC libavrdude) install(TARGETS avrdude DESTINATION bin) install(TARGETS libavrdude - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} PUBLIC_HEADER DESTINATION include COMPONENT dev ) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/avrdude.conf" TYPE SYSCONF) -install(FILES avrdude.1 TYPE MAN) +install(FILES "avrdude.1" + DESTINATION "${CMAKE_INSTALL_MANDIR}/man1" + ) diff --git a/src/Makefile.am b/src/Makefile.am index 15162224..10784c7c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,3 +1,4 @@ + # # avrdude - A Downloader/Uploader for AVR device programmers # Copyright (C) 2003, 2004 Theodore A. Roth @@ -92,6 +93,7 @@ libavrdude_a_SOURCES = \ avr.c \ avr910.c \ avr910.h \ + avrcache.c \ avrdude.h \ avrftdi.c \ avrftdi.h \ @@ -179,6 +181,10 @@ libavrdude_a_SOURCES = \ updi_readwrite.h \ updi_nvm.c \ updi_nvm.h \ + urclock.c \ + urclock.h \ + urclock_hash.h \ + urclock_private.h \ usbdevs.h \ usb_hidapi.c \ usb_libusb.c \ @@ -198,6 +204,11 @@ avrdude_SOURCES = \ main.c \ whereami.c \ whereami.h \ + avrintel.c \ + avrintel.h \ + developer_opts.c \ + developer_opts.h \ + developer_opts_private.h \ term.c \ term.h diff --git a/src/arduino.c b/src/arduino.c index dbaafef2..3f468294 100644 --- a/src/arduino.c +++ b/src/arduino.c @@ -38,14 +38,13 @@ #include "arduino.h" /* read signature bytes - arduino version */ -static int arduino_read_sig_bytes(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m) -{ +static int arduino_read_sig_bytes(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *m) { unsigned char buf[32]; /* Signature byte reads are always 3 bytes. */ if (m->size < 3) { - avrdude_message(MSG_INFO, "%s: memsize too small for sig byte read", progname); + pmsg_error("memsize too small for sig byte read"); return -1; } @@ -57,19 +56,16 @@ static int arduino_read_sig_bytes(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m) if (serial_recv(&pgm->fd, buf, 5) < 0) return -1; if (buf[0] == Resp_STK_NOSYNC) { - avrdude_message(MSG_INFO, "%s: stk500_cmd(): programmer is out of sync\n", - progname); + pmsg_error("programmer is out of sync\n"); return -1; } else if (buf[0] != Resp_STK_INSYNC) { - avrdude_message(MSG_INFO, "\n%s: arduino_read_sig_bytes(): (a) protocol error, " - "expect=0x%02x, resp=0x%02x\n", - progname, Resp_STK_INSYNC, buf[0]); - return -2; + msg_error("\n"); + pmsg_error("protocol expects sync byte 0x%02x but got 0x%02x\n", Resp_STK_INSYNC, buf[0]); + return -2; } if (buf[4] != Resp_STK_OK) { - avrdude_message(MSG_INFO, "\n%s: arduino_read_sig_bytes(): (a) protocol error, " - "expect=0x%02x, resp=0x%02x\n", - progname, Resp_STK_OK, buf[4]); + msg_error("\n"); + pmsg_error("protocol expects OK byte 0x%02x but got 0x%02x\n", Resp_STK_OK, buf[4]); return -3; } @@ -80,8 +76,7 @@ static int arduino_read_sig_bytes(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m) return 3; } -static int arduino_open(PROGRAMMER * pgm, char * port) -{ +static int arduino_open(PROGRAMMER *pgm, const char *port) { union pinfo pinfo; strcpy(pgm->port, port); pinfo.serialinfo.baud = pgm->baudrate? pgm->baudrate: 115200; @@ -118,8 +113,7 @@ static void arduino_close(PROGRAMMER * pgm) const char arduino_desc[] = "Arduino programmer"; -void arduino_initpgm(PROGRAMMER * pgm) -{ +void arduino_initpgm(PROGRAMMER *pgm) { /* This is mostly a STK500; just the signature is read differently than on real STK500v1 and the DTR signal is set when opening the serial port @@ -130,4 +124,6 @@ void arduino_initpgm(PROGRAMMER * pgm) pgm->read_sig_bytes = arduino_read_sig_bytes; pgm->open = arduino_open; pgm->close = arduino_close; + + disable_trailing_ff_removal(); /* so that arduino bootloader can ignore chip erase */ } diff --git a/src/arduino.h b/src/arduino.h index 024d711b..ce1ff9b8 100644 --- a/src/arduino.h +++ b/src/arduino.h @@ -22,7 +22,7 @@ #define arduino_h__ extern const char arduino_desc[]; -void arduino_initpgm (PROGRAMMER * pgm); +void arduino_initpgm(PROGRAMMER *pgm); #endif diff --git a/src/avr.c b/src/avr.c index d6e78bb5..2f40789c 100644 --- a/src/avr.c +++ b/src/avr.c @@ -38,8 +38,7 @@ FP_UpdateProgress update_progress; #define DEBUG 0 /* TPI: returns 1 if NVM controller busy, 0 if free */ -int avr_tpi_poll_nvmbsy(PROGRAMMER *pgm) -{ +int avr_tpi_poll_nvmbsy(const PROGRAMMER *pgm) { unsigned char cmd; unsigned char res; @@ -49,43 +48,41 @@ int avr_tpi_poll_nvmbsy(PROGRAMMER *pgm) } /* TPI chip erase sequence */ -int avr_tpi_chip_erase(PROGRAMMER * pgm, AVRPART * p) -{ - int err; +int avr_tpi_chip_erase(const PROGRAMMER *pgm, const AVRPART *p) { + int err; AVRMEM *mem; - if (p->flags & AVRPART_HAS_TPI) { + if (p->prog_modes & PM_TPI) { pgm->pgm_led(pgm, ON); /* Set Pointer Register */ mem = avr_locate_mem(p, "flash"); if (mem == NULL) { - avrdude_message(MSG_INFO, "No flash memory to erase for part %s\n", - p->desc); + pmsg_error("no flash memory to erase for part %s\n", p->desc); return -1; } - unsigned char cmd[] = { - /* write pointer register high byte */ - (TPI_CMD_SSTPR | 0), - ((mem->offset & 0xFF) | 1), - /* and low byte */ - (TPI_CMD_SSTPR | 1), - ((mem->offset >> 8) & 0xFF), - /* write CHIP_ERASE command to NVMCMD register */ - (TPI_CMD_SOUT | TPI_SIO_ADDR(TPI_IOREG_NVMCMD)), - TPI_NVMCMD_CHIP_ERASE, - /* write dummy value to start erase */ - TPI_CMD_SST, - 0xFF - }; + unsigned char cmd[] = { + /* write pointer register high byte */ + (TPI_CMD_SSTPR | 0), + ((mem->offset & 0xFF) | 1), + /* and low byte */ + (TPI_CMD_SSTPR | 1), + ((mem->offset >> 8) & 0xFF), + /* write CHIP_ERASE command to NVMCMD register */ + (TPI_CMD_SOUT | TPI_SIO_ADDR(TPI_IOREG_NVMCMD)), + TPI_NVMCMD_CHIP_ERASE, + /* write dummy value to start erase */ + TPI_CMD_SST, + 0xFF + }; while (avr_tpi_poll_nvmbsy(pgm)) ; err = pgm->cmd_tpi(pgm, cmd, sizeof(cmd), NULL, 0); if(err) - return err; + return err; while (avr_tpi_poll_nvmbsy(pgm)); @@ -93,65 +90,63 @@ int avr_tpi_chip_erase(PROGRAMMER * pgm, AVRPART * p) return 0; } else { - avrdude_message(MSG_INFO, "%s called for a part that has no TPI\n", __func__); - return -1; - } + pmsg_error("part has no TPI\n"); + return -1; + } } /* TPI program enable sequence */ -int avr_tpi_program_enable(PROGRAMMER * pgm, AVRPART * p, unsigned char guard_time) -{ - int err, retry; - unsigned char cmd[2]; - unsigned char response; +int avr_tpi_program_enable(const PROGRAMMER *pgm, const AVRPART *p, unsigned char guard_time) { + int err, retry; + unsigned char cmd[2]; + unsigned char response; - if(p->flags & AVRPART_HAS_TPI) { - /* set guard time */ - cmd[0] = (TPI_CMD_SSTCS | TPI_REG_TPIPCR); - cmd[1] = guard_time; + if(p->prog_modes & PM_TPI) { + /* set guard time */ + cmd[0] = (TPI_CMD_SSTCS | TPI_REG_TPIPCR); + cmd[1] = guard_time; - err = pgm->cmd_tpi(pgm, cmd, sizeof(cmd), NULL, 0); + err = pgm->cmd_tpi(pgm, cmd, sizeof(cmd), NULL, 0); if(err) - return err; + return err; - /* read TPI ident reg */ + /* read TPI ident reg */ cmd[0] = (TPI_CMD_SLDCS | TPI_REG_TPIIR); - err = pgm->cmd_tpi(pgm, cmd, 1, &response, sizeof(response)); + err = pgm->cmd_tpi(pgm, cmd, 1, &response, sizeof(response)); if (err || response != TPI_IDENT_CODE) { - avrdude_message(MSG_INFO, "TPIIR not correct\n"); + pmsg_error("TPIIR not correct\n"); return -1; } - /* send SKEY command + SKEY */ - err = pgm->cmd_tpi(pgm, tpi_skey_cmd, sizeof(tpi_skey_cmd), NULL, 0); - if(err) - return err; + /* send SKEY command + SKEY */ + err = pgm->cmd_tpi(pgm, tpi_skey_cmd, sizeof(tpi_skey_cmd), NULL, 0); + if(err) + return err; - /* check if device is ready */ - for(retry = 0; retry < 10; retry++) - { - cmd[0] = (TPI_CMD_SLDCS | TPI_REG_TPISR); - err = pgm->cmd_tpi(pgm, cmd, 1, &response, sizeof(response)); - if(err || !(response & TPI_REG_TPISR_NVMEN)) - continue; + /* check if device is ready */ + for(retry = 0; retry < 10; retry++) + { + cmd[0] = (TPI_CMD_SLDCS | TPI_REG_TPISR); + err = pgm->cmd_tpi(pgm, cmd, 1, &response, sizeof(response)); + if(err || !(response & TPI_REG_TPISR_NVMEN)) + continue; - return 0; - } + return 0; + } - avrdude_message(MSG_INFO, "Error enabling TPI external programming mode:"); - avrdude_message(MSG_INFO, "Target does not reply\n"); - return -1; + pmsg_error("target does not reply when enabling TPI external programming mode\n"); + return -1; - } else { - avrdude_message(MSG_INFO, "%s called for a part that has no TPI\n", __func__); - return -1; - } + } else { + pmsg_error("part has no TPI\n"); + return -1; + } } /* TPI: setup NVMCMD register and pointer register (PR) for read/write/erase */ -static int avr_tpi_setup_rw(PROGRAMMER * pgm, AVRMEM * mem, - unsigned long addr, unsigned char nvmcmd) -{ +static int avr_tpi_setup_rw(const PROGRAMMER *pgm, const AVRMEM *mem, + unsigned long addr, unsigned char nvmcmd) { + unsigned char cmd[4]; int rc; @@ -178,7 +173,7 @@ static int avr_tpi_setup_rw(PROGRAMMER * pgm, AVRMEM * mem, return 0; } -int avr_read_byte_default(PROGRAMMER * pgm, AVRPART * p, AVRMEM * mem, +int avr_read_byte_default(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *mem, unsigned long addr, unsigned char * value) { unsigned char cmd[4]; @@ -188,19 +183,17 @@ int avr_read_byte_default(PROGRAMMER * pgm, AVRPART * p, AVRMEM * mem, OPCODE * readop, * lext; if (pgm->cmd == NULL) { - avrdude_message(MSG_INFO, "%s: Error: %s programmer uses avr_read_byte_default() but does not\n" - "provide a cmd() method.\n", - progname, pgm->type); + pmsg_error("%s programmer uses avr_read_byte_default() but does not\n", pgm->type); + imsg_error("provide a cmd() method\n"); return -1; } pgm->pgm_led(pgm, ON); pgm->err_led(pgm, OFF); - if (p->flags & AVRPART_HAS_TPI) { + if (p->prog_modes & PM_TPI) { if (pgm->cmd_tpi == NULL) { - avrdude_message(MSG_INFO, "%s: Error: %s programmer does not support TPI\n", - progname, pgm->type); + pmsg_error("%s programmer does not support TPI\n", pgm->type); return -1; } @@ -234,8 +227,7 @@ int avr_read_byte_default(PROGRAMMER * pgm, AVRPART * p, AVRMEM * mem, if (readop == NULL) { #if DEBUG - avrdude_message(MSG_INFO, "avr_read_byte(): operation not supported on memory type \"%s\"\n", - mem->desc); + pmsg_error("operation not supported on memory type %s\n", mem->desc); #endif return -1; } @@ -278,10 +270,25 @@ int avr_read_byte_default(PROGRAMMER * pgm, AVRPART * p, AVRMEM * mem, * value. This is useful for determining where to stop when dealing * with "flash" memory, since writing 0xff to flash is typically a * no-op. Always return an even number since flash is word addressed. + * Only apply this optimisation on flash-type memory. */ -int avr_mem_hiaddr(AVRMEM * mem) +int avr_mem_hiaddr(const AVRMEM * mem) { int i, n; + static int disableffopt; + + /* calling once with NULL disables any future trailing-0xff optimisation */ + if(!mem) { + disableffopt = 1; + return 0; + } + + if(disableffopt) + return mem->size; + + /* if the memory is not a flash-type memory do not remove trailing 0xff */ + if(!avr_mem_is_flash_type(mem)) + return mem->size; /* return the highest non-0xff address regardless of how much memory was read */ @@ -300,29 +307,42 @@ int avr_mem_hiaddr(AVRMEM * mem) /* - * Read the entirety of the specified memory type into the - * corresponding buffer of the avrpart pointed to by 'p'. - * If v is non-NULL, verify against v's memory area, only - * those cells that are tagged TAG_ALLOCATED are verified. + * Read the entirety of the specified memory type into the corresponding + * buffer of the avrpart pointed to by p. If v is non-NULL, verify against + * v's memory area, only those cells that are tagged TAG_ALLOCATED are + * verified. * - * Return the number of bytes read, or < 0 if an error occurs. + * Return the number of bytes read, or < 0 if an error occurs. */ -int avr_read(PROGRAMMER * pgm, AVRPART * p, char * memtype, - AVRPART * v) -{ - unsigned long i, lastaddr; - unsigned char cmd[4]; - AVRMEM * mem, * vmem = NULL; +int avr_read(const PROGRAMMER *pgm, const AVRPART *p, const char *memtype, const AVRPART *v) { + AVRMEM *mem = avr_locate_mem(p, memtype); + if (mem == NULL) { + pmsg_error("no %s memory for part %s\n", memtype, p->desc); + return LIBAVRDUDE_GENERAL_FAILURE; + } + + return avr_read_mem(pgm, p, mem, v); +} + + +/* + * Read the entirety of the specified memory into the corresponding buffer of + * the avrpart pointed to by p. If v is non-NULL, verify against v's memory + * area, only those cells that are tagged TAG_ALLOCATED are verified. + * + * Return the number of bytes read, or < 0 if an error occurs. + */ +int avr_read_mem(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *mem, const AVRPART *v) { + unsigned long i, lastaddr; + unsigned char cmd[4]; + AVRMEM *vmem = NULL; int rc; - mem = avr_locate_mem(p, memtype); if (v != NULL) - vmem = avr_locate_mem(v, memtype); - if (mem == NULL) { - avrdude_message(MSG_INFO, "No \"%s\" memory for part %s\n", - memtype, p->desc); + vmem = avr_locate_mem(v, mem->desc); + + if(mem->size < 0) // Sanity check return -1; - } /* * start with all 0xff @@ -330,7 +350,7 @@ int avr_read(PROGRAMMER * pgm, AVRPART * p, char * memtype, memset(mem->buf, 0xff, mem->size); /* supports "paged load" thru post-increment */ - if ((p->flags & AVRPART_HAS_TPI) && mem->page_size > 1 && + if ((p->prog_modes & PM_TPI) && mem->page_size > 1 && mem->size % mem->page_size == 0 && pgm->cmd_tpi != NULL) { while (avr_tpi_poll_nvmbsy(pgm)); @@ -339,7 +359,7 @@ int avr_read(PROGRAMMER * pgm, AVRPART * p, char * memtype, avr_tpi_setup_rw(pgm, mem, 0, TPI_NVMCMD_NO_OPERATION); /* load bytes */ - for (lastaddr = i = 0; i < mem->size; i++) { + for (lastaddr = i = 0; i < (unsigned long) mem->size; i++) { if (vmem == NULL || (vmem->tags[i] & TAG_ALLOCATED) != 0) { @@ -352,7 +372,7 @@ int avr_read(PROGRAMMER * pgm, AVRPART * p, char * memtype, rc = pgm->cmd_tpi(pgm, cmd, 1, mem->buf + i, 1); lastaddr++; if (rc == -1) { - avrdude_message(MSG_INFO, "avr_read(): error reading address 0x%04lx\n", i); + pmsg_error("unable to read address 0x%04lx\n", i); return -1; } } @@ -361,8 +381,9 @@ int avr_read(PROGRAMMER * pgm, AVRPART * p, char * memtype, return avr_mem_hiaddr(mem); } - if (pgm->paged_load != NULL && mem->page_size > 1 && - mem->size % mem->page_size == 0) { + // HW programmers need a page size > 1, bootloader typ only offer paged r/w + if ((pgm->paged_load && mem->page_size > 1 && mem->size % mem->page_size == 0) || + ((pgm->prog_modes & PM_SPM) && avr_has_paged_access(pgm, mem))) { /* * the programmer supports a paged mode read */ @@ -372,7 +393,7 @@ int avr_read(PROGRAMMER * pgm, AVRPART * p, char * memtype, /* quickly scan number of pages to be written to first */ for (pageaddr = 0, npages = 0; - pageaddr < mem->size; + pageaddr < (unsigned int) mem->size; pageaddr += mem->page_size) { /* check whether this page must be read */ for (i = pageaddr; @@ -389,7 +410,7 @@ int avr_read(PROGRAMMER * pgm, AVRPART * p, char * memtype, } for (pageaddr = 0, failure = 0, nread = 0; - !failure && pageaddr < mem->size; + !failure && pageaddr < (unsigned int) mem->size; pageaddr += mem->page_size) { /* check whether this page must be read */ for (i = pageaddr, need_read = 0; @@ -410,22 +431,14 @@ int avr_read(PROGRAMMER * pgm, AVRPART * p, char * memtype, /* paged load failed, fall back to byte-at-a-time read below */ failure = 1; } else { - avrdude_message(MSG_DEBUG, "%s: avr_read(): skipping page %u: no interesting data\n", - progname, pageaddr / mem->page_size); + pmsg_debug("avr_read_mem(): skipping page %u: no interesting data\n", pageaddr / mem->page_size); } nread++; report_progress(nread, npages, NULL); } - if (!failure) { - if (strcasecmp(mem->desc, "flash") == 0 || - strcasecmp(mem->desc, "application") == 0 || - strcasecmp(mem->desc, "apptable") == 0 || - strcasecmp(mem->desc, "boot") == 0) - return avr_mem_hiaddr(mem); - else - return mem->size; - } - /* else: fall back to byte-at-a-time write, for historical reasons */ + if (!failure) + return avr_mem_hiaddr(mem); + /* else: fall back to byte-at-a-time read, for historical reasons */ } if (strcmp(mem->desc, "signature") == 0) { @@ -434,57 +447,46 @@ int avr_read(PROGRAMMER * pgm, AVRPART * p, char * memtype, } } - for (i=0; i < mem->size; i++) { - if (vmem == NULL || - (vmem->tags[i] & TAG_ALLOCATED) != 0) - { + for (i=0; i < (unsigned long) mem->size; i++) { + if (vmem == NULL || (vmem->tags[i] & TAG_ALLOCATED) != 0) { rc = pgm->read_byte(pgm, p, mem, i, mem->buf + i); - if (rc != 0) { - avrdude_message(MSG_INFO, "avr_read(): error reading address 0x%04lx\n", i); - if (rc == -1) { - avrdude_message(MSG_INFO, " read operation not supported for memory \"%s\"\n", - memtype); - return -2; + if (rc != LIBAVRDUDE_SUCCESS) { + pmsg_error("unable to read byte at address 0x%04lx\n", i); + if (rc == LIBAVRDUDE_GENERAL_FAILURE) { + pmsg_error("read operation not supported for memory %s\n", mem->desc); + return LIBAVRDUDE_NOTSUPPORTED; } - avrdude_message(MSG_INFO, " read operation failed for memory \"%s\"\n", - memtype); - return rc; + pmsg_error("read operation failed for memory %s\n", mem->desc); + return LIBAVRDUDE_SOFTFAIL; } } report_progress(i, mem->size, NULL); } - if (strcasecmp(mem->desc, "flash") == 0 || - strcasecmp(mem->desc, "application") == 0 || - strcasecmp(mem->desc, "apptable") == 0 || - strcasecmp(mem->desc, "boot") == 0) - return avr_mem_hiaddr(mem); - else - return i; + return avr_mem_hiaddr(mem); } + /* * write a page data at the specified address */ -int avr_write_page(PROGRAMMER * pgm, AVRPART * p, AVRMEM * mem, - unsigned long addr) -{ +int avr_write_page(const PROGRAMMER *pgm, const AVRPART *p_unused, const AVRMEM *mem, + unsigned long addr) { + unsigned char cmd[4]; unsigned char res[4]; OPCODE * wp, * lext; if (pgm->cmd == NULL) { - avrdude_message(MSG_INFO, "%s: Error: %s programmer uses avr_write_page() but does not\n" - "provide a cmd() method.\n", - progname, pgm->type); + pmsg_error("%s programmer uses avr_write_page() but does not\n", pgm->type); + imsg_error("provide a cmd() method\n"); return -1; } wp = mem->op[AVR_OP_WRITEPAGE]; if (wp == NULL) { - avrdude_message(MSG_INFO, "avr_write_page(): memory \"%s\" not configured for page writes\n", - mem->desc); + pmsg_error("memory %s not configured for page writes\n", mem->desc); return -1; } @@ -527,7 +529,39 @@ int avr_write_page(PROGRAMMER * pgm, AVRPART * p, AVRMEM * mem, } -int avr_write_byte_default(PROGRAMMER * pgm, AVRPART * p, AVRMEM * mem, +// Return us since program start, rolls over after ca 1h 12min +unsigned long avr_ustimestamp() { + struct timeval tv; + + memset(&tv, 0, sizeof tv); + if(gettimeofday(&tv, NULL) == 0) { + static unsigned long long epoch; + static int init; + unsigned long long now; + + now = tv.tv_sec*1000000ULL + tv.tv_usec; + if(!init) { + epoch = now; + init = 1; + } + return now - epoch; + } + + return 0; +} + +// Return ms since program start, rolls over after ca 49d 17h +unsigned long avr_mstimestamp() { + return avr_ustimestamp()/1000; +} + +// Return s since program start as double +double avr_timestamp() { + return avr_ustimestamp()/1e6; +} + + +int avr_write_byte_default(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *mem, unsigned long addr, unsigned char data) { unsigned char cmd[4]; @@ -542,27 +576,24 @@ int avr_write_byte_default(PROGRAMMER * pgm, AVRPART * p, AVRMEM * mem, OPCODE * writeop; int rc; int readok=0; - struct timeval tv; if (pgm->cmd == NULL) { - avrdude_message(MSG_INFO, "%s: Error: %s programmer uses avr_write_byte_default() but does not\n" - "provide a cmd() method.\n", - progname, pgm->type); + pmsg_error("%s programmer uses avr_write_byte_default() but does not\n", pgm->type); + imsg_error("provide a cmd() method\n"); return -1; } - if (p->flags & AVRPART_HAS_TPI) { + if (p->prog_modes & PM_TPI) { if (pgm->cmd_tpi == NULL) { - avrdude_message(MSG_INFO, "%s: Error: %s programmer does not support TPI\n", - progname, pgm->type); + pmsg_error("%s programmer does not support TPI\n", pgm->type); return -1; } if (strcmp(mem->desc, "flash") == 0) { - avrdude_message(MSG_INFO, "Writing a byte to flash is not supported for %s\n", p->desc); + pmsg_error("writing a byte to flash is not supported for %s\n", p->desc); return -1; } else if ((mem->offset + addr) & 1) { - avrdude_message(MSG_INFO, "Writing a byte to an odd location is not supported for %s\n", p->desc); + pmsg_error("writing a byte to an odd location is not supported for %s\n", p->desc); return -1; } @@ -597,8 +628,7 @@ int avr_write_byte_default(PROGRAMMER * pgm, AVRPART * p, AVRMEM * mem, return 0; } - if (!mem->paged && - (p->flags & AVRPART_IS_AT90S1200) == 0) { + if (!mem->paged && (p->flags & AVRPART_IS_AT90S1200) == 0) { /* * check to see if the write is necessary by reading the existing * value and only write if we are changing the value; we can't @@ -650,8 +680,7 @@ int avr_write_byte_default(PROGRAMMER * pgm, AVRPART * p, AVRMEM * mem, if (writeop == NULL) { #if DEBUG - avrdude_message(MSG_INFO, "avr_write_byte(): write not supported for memory type \"%s\"\n", - mem->desc); + pmsg_error("write not supported for memory type %s\n", mem->desc); #endif return -1; } @@ -708,22 +737,18 @@ int avr_write_byte_default(PROGRAMMER * pgm, AVRPART * p, AVRMEM * mem, } } else { - gettimeofday (&tv, NULL); - start_time = (tv.tv_sec * 1000000) + tv.tv_usec; + start_time = avr_ustimestamp(); do { - /* - * Do polling, but timeout after max_write_delay. - */ + // Do polling, but timeout after max_write_delay rc = pgm->read_byte(pgm, p, mem, addr, &r); if (rc != 0) { pgm->pgm_led(pgm, OFF); pgm->err_led(pgm, ON); return -4; } - gettimeofday (&tv, NULL); - prog_time = (tv.tv_sec * 1000000) + tv.tv_usec; - } while ((r != data) && - ((prog_time-start_time) < mem->max_write_delay)); + prog_time = avr_ustimestamp(); + } while (r != data && mem->max_write_delay >= 0 && + prog_time - start_time < (unsigned long) mem->max_write_delay); } /* @@ -743,25 +768,20 @@ int avr_write_byte_default(PROGRAMMER * pgm, AVRPART * p, AVRMEM * mem, * device if the data read back does not match what we wrote. */ pgm->pgm_led(pgm, OFF); - avrdude_message(MSG_INFO, "%s: this device must be powered off and back on to continue\n", - progname); - if (pgm->pinno[PPI_AVR_VCC]) { - avrdude_message(MSG_INFO, "%s: attempting to do this now ...\n", progname); + pmsg_info("this device must be powered off and back on to continue\n"); + if ((pgm->pinno[PPI_AVR_VCC] & PIN_MASK) <= PIN_MAX) { + pmsg_info("attempting to do this now ...\n"); pgm->powerdown(pgm); usleep(250000); rc = pgm->initialize(pgm, p); if (rc < 0) { - avrdude_message(MSG_INFO, "%s: initialization failed, rc=%d\n", progname, rc); - avrdude_message(MSG_INFO, "%s: can't re-initialize device after programming the " - "%s bits\n", progname, mem->desc); - avrdude_message(MSG_INFO, "%s: you must manually power-down the device and restart\n" - "%s: %s to continue.\n", - progname, progname, progname); + pmsg_error("initialization failed, rc=%d\n", rc); + imsg_error("cannot re-initialize device after programming the %s bits\n", mem->desc); + imsg_error("you must manually power-down the device and restart %s to continue\n", progname); return -3; } - avrdude_message(MSG_INFO, "%s: device was successfully re-initialized\n", - progname); + pmsg_info("device was successfully re-initialized\n"); return 0; } } @@ -788,7 +808,7 @@ int avr_write_byte_default(PROGRAMMER * pgm, AVRPART * p, AVRMEM * mem, /* * write a byte of data at the specified address */ -int avr_write_byte(PROGRAMMER * pgm, AVRPART * p, AVRMEM * mem, +int avr_write_byte(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *mem, unsigned long addr, unsigned char data) { return pgm->write_byte(pgm, p, mem, addr, data); @@ -796,32 +816,38 @@ int avr_write_byte(PROGRAMMER * pgm, AVRPART * p, AVRMEM * mem, /* - * Write the whole memory region of the specified memory from the - * corresponding buffer of the avrpart pointed to by 'p'. Write up to - * 'size' bytes from the buffer. Data is only written if the new data - * value is different from the existing data value. Data beyond - * 'size' bytes is not affected. + * Write the whole memory region of the specified memory from its buffer of + * the avrpart pointed to by p to the device. Write up to size bytes from + * the buffer. Data is only written if the corresponding tags byte is set. + * Data beyond size bytes are not affected. * - * Return the number of bytes written, or -1 if an error occurs. + * Return the number of bytes written, or LIBAVRDUDE_GENERAL_FAILURE on error. */ -int avr_write(PROGRAMMER * pgm, AVRPART * p, char * memtype, int size, - int auto_erase) -{ +int avr_write(const PROGRAMMER *pgm, const AVRPART *p, const char *memtype, int size, int auto_erase) { + AVRMEM *m = avr_locate_mem(p, memtype); + if (m == NULL) { + pmsg_error("no %s memory for part %s\n", memtype, p->desc); + return LIBAVRDUDE_GENERAL_FAILURE; + } + + return avr_write_mem(pgm, p, m, size, auto_erase); +} + +/* + * Write the whole memory region of the specified memory from its buffer of + * the avrpart pointed to by p to the device. Write up to size bytes from + * the buffer. Data is only written if the corresponding tags byte is set. + * Data beyond size bytes are not affected. + * + * Return the number of bytes written, or LIBAVRDUDE_GENERAL_FAILURE on error. + */ +int avr_write_mem(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *m, int size, int auto_erase) { int rc; - int newpage, page_tainted, flush_page, do_write; int wsize; unsigned int i, lastaddr; unsigned char data; int werror; unsigned char cmd[4]; - AVRMEM * m; - - m = avr_locate_mem(p, memtype); - if (m == NULL) { - avrdude_message(MSG_INFO, "No \"%s\" memory for part %s\n", - memtype, p->desc); - return -1; - } pgm->err_led(pgm, OFF); @@ -830,22 +856,21 @@ int avr_write(PROGRAMMER * pgm, AVRPART * p, char * memtype, int size, wsize = m->size; if (size < wsize) { wsize = size; - } - else if (size > wsize) { - avrdude_message(MSG_INFO, "%s: WARNING: %d bytes requested, but memory region is only %d" - "bytes\n" - "%sOnly %d bytes will actually be written\n", - progname, size, wsize, - progbuf, wsize); + } else if (size > wsize) { + pmsg_warning("%d bytes requested, but memory region is only %d bytes\n", size, wsize); + imsg_warning("Only %d bytes will actually be written\n", wsize); } + if(wsize <= 0) + return wsize; - if ((p->flags & AVRPART_HAS_TPI) && m->page_size > 1 && - pgm->cmd_tpi != NULL) { + if ((p->prog_modes & PM_TPI) && m->page_size > 1 && pgm->cmd_tpi) { + unsigned int chunk; /* number of words for each write command */ + unsigned int j, writeable_chunk; if (wsize == 1) { /* fuse (configuration) memory: only single byte to write */ - return avr_write_byte(pgm, p, m, 0, m->buf[0]) == 0? 1: -1; + return avr_write_byte(pgm, p, m, 0, m->buf[0]) == 0? 1: LIBAVRDUDE_GENERAL_FAILURE; } while (avr_tpi_poll_nvmbsy(pgm)); @@ -853,172 +878,231 @@ int avr_write(PROGRAMMER * pgm, AVRPART * p, char * memtype, int size, /* setup for WORD_WRITE */ avr_tpi_setup_rw(pgm, m, 0, TPI_NVMCMD_WORD_WRITE); - /* make sure it's aligned to a word boundary */ - if (wsize & 0x1) { - wsize++; + /* + * Some TPI devices can only program 2 or 4 words (4 or 8 bytes) at a time. + * This is set by the n_word_writes option of the AVRMEM config section. + * Ensure that we align our write size to this boundary. + */ + if (m->n_word_writes < 0 || m->n_word_writes > 4 || m->n_word_writes == 3) { + msg_error("\n"); + pmsg_error("unsupported n_word_writes value of %d for %s memory\n", + m->n_word_writes, m->desc); + return LIBAVRDUDE_GENERAL_FAILURE; } + chunk = m->n_word_writes > 0 ? 2*m->n_word_writes : 2; + wsize = (wsize+chunk-1) / chunk * chunk; - /* write words, low byte first */ - for (lastaddr = i = 0; i < wsize; i += 2) { - if ((m->tags[i] & TAG_ALLOCATED) != 0 || - (m->tags[i + 1] & TAG_ALLOCATED) != 0) { + /* write words in chunks, low byte first */ + for (lastaddr = i = 0; i < (unsigned int) wsize; i += chunk) { + /* check that at least one byte in this chunk is allocated */ + for (writeable_chunk = j = 0; !writeable_chunk && j < chunk; j++) { + writeable_chunk = m->tags[i+j] & TAG_ALLOCATED; + } + if (writeable_chunk) { if (lastaddr != i) { /* need to setup new address */ avr_tpi_setup_rw(pgm, m, i, TPI_NVMCMD_WORD_WRITE); lastaddr = i; } + // Write each byte of the chunk. Unallocated bytes should read + // as 0xFF, which should no-op. cmd[0] = TPI_CMD_SST_PI; - cmd[1] = m->buf[i]; - rc = pgm->cmd_tpi(pgm, cmd, 2, NULL, 0); + for (j = 0; j < chunk; j++) { + cmd[1] = m->buf[i+j]; + rc = pgm->cmd_tpi(pgm, cmd, 2, NULL, 0); + } - cmd[1] = m->buf[i + 1]; - rc = pgm->cmd_tpi(pgm, cmd, 2, NULL, 0); - - lastaddr += 2; + lastaddr += chunk; while (avr_tpi_poll_nvmbsy(pgm)); } report_progress(i, wsize, NULL); } + return i; } - if (pgm->paged_write != NULL && m->page_size > 1) { + // HW programmers need a page size > 1, bootloader typ only offer paged r/w + if ((pgm->paged_load && m->page_size > 1 && m->size % m->page_size == 0) || + ((pgm->prog_modes & PM_SPM) && avr_has_paged_access(pgm, m))) { /* * the programmer supports a paged mode write */ - int need_write, failure; + int need_write, failure, nset; unsigned int pageaddr; unsigned int npages, nwritten; - /* quickly scan number of pages to be written to first */ - for (pageaddr = 0, npages = 0; - pageaddr < wsize; - pageaddr += m->page_size) { - /* check whether this page must be written to */ - for (i = pageaddr; - i < pageaddr + m->page_size; - i++) - if ((m->tags[i] & TAG_ALLOCATED) != 0) { + /* + * Not all paged memory looks like NOR memory to AVRDUDE, particularly + * - EEPROM + * - when talking to a bootloader + * - handling write via a part-programmer combo that can do page erase + * + * Hence, read in from the chip all pages with holes to fill them in. The + * small cost of doing so is outweighed by the benefit of not potentially + * overwriting bytes with 0xff outside the input file. + * + * Also consider that the effective page size for *SPM* erasing of parts + * can be 4 times the page size for SPM writing (eg, ATtiny1634). Thus + * ensure the holes cover the effective page size for SPM programming. + * Benefits -c arduino with input files with holes on 4-page-erase parts. + */ + + AVRMEM *cm = avr_dup_mem(m); + + // Establish and sanity check effective page size + int pgsize = (pgm->prog_modes & PM_SPM) && p->n_page_erase > 0? + p->n_page_erase*cm->page_size: cm->page_size; + if((pgsize & (pgsize-1)) || pgsize < 1) { + pmsg_error("effective page size %d implausible\n", pgsize); + avr_free_mem(cm); + return -1; + } + + uint8_t *spc = cfg_malloc(__func__, cm->page_size); + + // Set cwsize as rounded-up wsize + int cwsize = (wsize + pgsize-1)/pgsize*pgsize; + + for(pageaddr = 0; pageaddr < (unsigned int) cwsize; pageaddr += pgsize) { + for(i = pageaddr, nset = 0; i < pageaddr + pgsize; i++) + if(cm->tags[i] & TAG_ALLOCATED) + nset++; + + if(nset && nset != pgsize) { // Effective page has holes + for(int np=0; np < pgsize/cm->page_size; np++) { // page by page + unsigned int beg = pageaddr + np*cm->page_size; + unsigned int end = beg + cm->page_size; + + for(i = beg; i < end; i++) + if(!(cm->tags[i] & TAG_ALLOCATED)) + break; + + if(i >= end) // Memory page has no holes + continue; + + // Read flash contents to separate memory spc and fill in holes + if(avr_read_page_default(pgm, p, cm, beg, spc) >= 0) { + pmsg_notice2("padding %s [0x%04x, 0x%04x]\n", cm->desc, beg, end-1); + for(i = beg; i < end; i++) + if(!(cm->tags[i] & TAG_ALLOCATED)) { + cm->tags[i] |= TAG_ALLOCATED; + cm->buf[i] = spc[i-beg]; + } + } else { + pmsg_notice2("cannot read %s [0x%04x, 0x%04x] to pad page\n", + cm->desc, beg, end-1); + } + } + } + } + + // Quickly scan number of pages to be written to + for(pageaddr = 0, npages = 0; pageaddr < (unsigned int) cwsize; pageaddr += cm->page_size) { + for(i = pageaddr; i < pageaddr + cm->page_size; i++) + if(cm->tags[i] & TAG_ALLOCATED) { npages++; break; } } for (pageaddr = 0, failure = 0, nwritten = 0; - !failure && pageaddr < wsize; - pageaddr += m->page_size) { - /* check whether this page must be written to */ - for (i = pageaddr, need_write = 0; - i < pageaddr + m->page_size; - i++) - if ((m->tags[i] & TAG_ALLOCATED) != 0) { + !failure && pageaddr < (unsigned int) cwsize; + pageaddr += cm->page_size) { + + // Check whether this page must be written to + for (i = pageaddr, need_write = 0; i < pageaddr + cm->page_size; i++) + if ((cm->tags[i] & TAG_ALLOCATED) != 0) { need_write = 1; break; } + if (need_write) { rc = 0; if (auto_erase) - rc = pgm->page_erase(pgm, p, m, pageaddr); + rc = pgm->page_erase(pgm, p, cm, pageaddr); if (rc >= 0) - rc = pgm->paged_write(pgm, p, m, m->page_size, pageaddr, m->page_size); + rc = pgm->paged_write(pgm, p, cm, cm->page_size, pageaddr, cm->page_size); if (rc < 0) /* paged write failed, fall back to byte-at-a-time write below */ failure = 1; } else { - avrdude_message(MSG_DEBUG, "%s: avr_write(): skipping page %u: no interesting data\n", - progname, pageaddr / m->page_size); + pmsg_debug("avr_write_mem(): skipping page %u: no interesting data\n", pageaddr / cm->page_size); } nwritten++; report_progress(nwritten, npages, NULL); } + + avr_free_mem(cm); + free(spc); + if (!failure) return wsize; /* else: fall back to byte-at-a-time write, for historical reasons */ } - if (pgm->write_setup) { - pgm->write_setup(pgm, p, m); - } + // ISP programming from now on; flash will look like NOR-memory + if (pgm->write_setup) + pgm->write_setup(pgm, p, m); - newpage = 1; - page_tainted = 0; - flush_page = 0; + int page_tainted = 0; + int flush_page = 0; + int paged = avr_mem_is_flash_type(m) && m->paged; - for (i=0; ibuf[i]; report_progress(i, wsize, NULL); /* - * Find out whether the write action must be invoked for this - * byte. + * Find out whether the write action must be invoked for this byte. * - * For non-paged memory, this only happens if TAG_ALLOCATED is - * set for the byte. + * For non-paged memory, this means the byte is set to TAG_ALLOCATED. * - * For paged memory, TAG_ALLOCATED also invokes the write - * operation, which is actually a page buffer fill only. This - * "taints" the page, and upon encountering the last byte of each - * tainted page, the write operation must also be invoked in order - * to actually write the page buffer to memory. + * For paged memory, TAG_ALLOCATED also invokes loading the associated + * full word, low-byte first, into the device page buffer as required by + * ISP page programming. This "taints" the page, and upon encountering + * the last byte of each tainted page, the write operation must also be + * invoked in order to actually write the page buffer to device memory. */ - do_write = (m->tags[i] & TAG_ALLOCATED) != 0; - if (m->paged) { - if (newpage) { - page_tainted = do_write; - } else { - page_tainted |= do_write; - } - if (i % m->page_size == m->page_size - 1 || - i == wsize - 1) { - /* last byte this page */ + int do_write = (paged? m->tags[i&~1] | m->tags[i|1]: m->tags[i]) & TAG_ALLOCATED; + if (paged) { + page_tainted |= do_write; + if ((int) i % m->page_size == m->page_size - 1 || (int) i == wsize - 1) { flush_page = page_tainted; - newpage = 1; - } else { - flush_page = newpage = 0; + page_tainted = 0; } } - if (!do_write && !flush_page) { + if (!do_write && !flush_page) continue; - } if (do_write) { rc = avr_write_byte(pgm, p, m, i, data); if (rc) { - avrdude_message(MSG_INFO, " ***failed; "); - avrdude_message(MSG_INFO, "\n"); + msg_error(" ***failed;\n"); pgm->err_led(pgm, ON); werror = 1; } } - /* - * check to see if it is time to flush the page with a page - * write - */ - if (flush_page) { + if (flush_page) { // Time to flush the page with a page write + flush_page = 0; rc = avr_write_page(pgm, p, m, i); if (rc) { - avrdude_message(MSG_INFO, " *** page %d (addresses 0x%04x - 0x%04x) failed " - "to write\n", - i % m->page_size, - i - m->page_size + 1, i); - avrdude_message(MSG_INFO, "\n"); + msg_error(" *** page %d (addresses 0x%04x - 0x%04x) failed to write\n\n", + i / m->page_size, i - m->page_size + 1, i); pgm->err_led(pgm, ON); werror = 1; } } - if (werror) { - /* - * make sure the error led stay on if there was a previous write - * error, otherwise it gets cleared in avr_write_byte() - */ + // Ensure error led stays on lest it was cleared in avr_write_byte() + if (werror) pgm->err_led(pgm, ON); - } } return i; @@ -1029,20 +1113,19 @@ int avr_write(PROGRAMMER * pgm, AVRPART * p, char * memtype, int size, /* * read the AVR device's signature bytes */ -int avr_signature(PROGRAMMER * pgm, AVRPART * p) -{ +int avr_signature(const PROGRAMMER *pgm, const AVRPART *p) { int rc; - report_progress (0,1,"Reading"); + if(verbose > 1) + report_progress(0, 1, "Reading"); rc = avr_read(pgm, p, "signature", 0); - if (rc < 0) { - avrdude_message(MSG_INFO, "%s: error reading signature data for part \"%s\", rc=%d\n", - progname, p->desc, rc); + if (rc < LIBAVRDUDE_SUCCESS) { + pmsg_error("unable to read signature data for part %s, rc=%d\n", p->desc, rc); return rc; } - report_progress (1,1,NULL); + report_progress(1, 1, NULL); - return 0; + return LIBAVRDUDE_SUCCESS; } static uint8_t get_fuse_bitmask(AVRMEM * m) { @@ -1082,8 +1165,7 @@ int compare_memory_masked(AVRMEM * m, uint8_t b1, uint8_t b2) { * * Return the number of bytes verified, or -1 if they don't match. */ -int avr_verify(AVRPART * p, AVRPART * v, char * memtype, int size) -{ +int avr_verify(const PROGRAMMER *pgm, const AVRPART *p, const AVRPART *v, const char *memtype, int size) { int i; unsigned char * buf1, * buf2; int vsize; @@ -1091,15 +1173,13 @@ int avr_verify(AVRPART * p, AVRPART * v, char * memtype, int size) a = avr_locate_mem(p, memtype); if (a == NULL) { - avrdude_message(MSG_INFO, "avr_verify(): memory type \"%s\" not defined for part %s\n", - memtype, p->desc); + pmsg_error("memory type %s not defined for part %s\n", memtype, p->desc); return -1; } b = avr_locate_mem(v, memtype); if (b == NULL) { - avrdude_message(MSG_INFO, "avr_verify(): memory type \"%s\" not defined for part %s\n", - memtype, v->desc); + pmsg_error("memory type %s not defined for part %s\n", memtype, v->desc); return -1; } @@ -1108,51 +1188,62 @@ int avr_verify(AVRPART * p, AVRPART * v, char * memtype, int size) vsize = a->size; if (vsize < size) { - avrdude_message(MSG_INFO, "%s: WARNING: requested verification for %d bytes\n" - "%s%s memory region only contains %d bytes\n" - "%sOnly %d bytes will be verified.\n", - progname, size, - progbuf, memtype, vsize, - progbuf, vsize); + pmsg_warning("requested verification for %d bytes\n", size); + imsg_warning("%s memory region only contains %d bytes\n", memtype, vsize); + imsg_warning("only %d bytes will be verified\n", vsize); size = vsize; } + int verror = 0, vroerror = 0, maxerrs = verbose >= MSG_DEBUG? size+1: 10; for (i=0; itags[i] & TAG_ALLOCATED) != 0 && - buf1[i] != buf2[i]) { + if ((b->tags[i] & TAG_ALLOCATED) != 0 && buf1[i] != buf2[i]) { uint8_t bitmask = get_fuse_bitmask(a); - if((buf1[i] & bitmask) != (buf2[i] & bitmask)) { + if(pgm->readonly && pgm->readonly(pgm, p, a, i)) { + if(quell_progress < 2) { + if(vroerror < 10) { + if(!(verror + vroerror)) + pmsg_warning("verification mismatch%s\n", + avr_mem_is_flash_type(a)? " in r/o areas, expected for vectors and/or bootloader": ""); + imsg_warning("device 0x%02x != input 0x%02x at addr 0x%04x (read only location)\n", + buf1[i], buf2[i], i); + } else if(vroerror == 10) + imsg_warning("suppressing further mismatches in read-only areas\n"); + } + vroerror++; + } else if((buf1[i] & bitmask) != (buf2[i] & bitmask)) { // Mismatch is not just in unused bits - avrdude_message(MSG_INFO, "%s: verification error, first mismatch at byte 0x%04x\n" - "%s0x%02x != 0x%02x\n", - progname, i, - progbuf, buf1[i], buf2[i]); - return -1; + if(verror < maxerrs) { + if(!(verror + vroerror)) + pmsg_warning("verification mismatch\n"); + imsg_error("device 0x%02x != input 0x%02x at addr 0x%04x (error)\n", buf1[i], buf2[i], i); + } else if(verror == maxerrs) { + imsg_warning("suppressing further verification errors\n"); + } + verror++; + if(verbose < 1) + return -1; } else { // Mismatch is only in unused bits if ((buf1[i] | bitmask) != 0xff) { // Programmer returned unused bits as 0, must be the part/programmer - avrdude_message(MSG_INFO, "%s: WARNING: ignoring mismatch in unused bits of \"%s\"\n" - "%s(0x%02x != 0x%02x). To prevent this warning fix the part\n" - "%sor programmer definition in the config file.\n", - progname, memtype, progbuf, buf1[i], buf2[i], progbuf); + pmsg_warning("ignoring mismatch in unused bits of %s\n", memtype); + imsg_warning("(device 0x%02x != input 0x%02x); to prevent this warning fix\n", buf1[i], buf2[i]); + imsg_warning("the part or programmer definition in the config file\n"); } else { // Programmer returned unused bits as 1, must be the user - avrdude_message(MSG_INFO, "%s: WARNING: ignoring mismatch in unused bits of \"%s\"\n" - "%s(0x%02x != 0x%02x). To prevent this warning set unused bits\n" - "%sto 1 when writing (double check with your datasheet first).\n", - progname, memtype, progbuf, buf1[i], buf2[i], progbuf); + pmsg_warning("ignoring mismatch in unused bits of %s\n", memtype); + imsg_warning("(device 0x%02x != input 0x%02x); to prevent this warning set\n", buf1[i], buf2[i]); + imsg_warning("unused bits to 1 when writing (double check with datasheet)\n"); } } } } - return size; + return verror? -1: size; } -int avr_get_cycle_count(PROGRAMMER * pgm, AVRPART * p, int * cycles) -{ +int avr_get_cycle_count(const PROGRAMMER *pgm, const AVRPART *p, int *cycles) { AVRMEM * a; unsigned int cycle_count = 0; unsigned char v1; @@ -1167,8 +1258,7 @@ int avr_get_cycle_count(PROGRAMMER * pgm, AVRPART * p, int * cycles) for (i=4; i>0; i--) { rc = pgm->read_byte(pgm, p, a, a->size-i, &v1); if (rc < 0) { - avrdude_message(MSG_INFO, "%s: WARNING: can't read memory for cycle count, rc=%d\n", - progname, rc); + pmsg_warning("cannot read memory for cycle count, rc=%d\n", rc); return -1; } cycle_count = (cycle_count << 8) | v1; @@ -1190,8 +1280,7 @@ int avr_get_cycle_count(PROGRAMMER * pgm, AVRPART * p, int * cycles) } -int avr_put_cycle_count(PROGRAMMER * pgm, AVRPART * p, int cycles) -{ +int avr_put_cycle_count(const PROGRAMMER *pgm, const AVRPART *p, int cycles) { AVRMEM * a; unsigned char v1; int rc; @@ -1208,26 +1297,85 @@ int avr_put_cycle_count(PROGRAMMER * pgm, AVRPART * p, int cycles) rc = avr_write_byte(pgm, p, a, a->size-i, v1); if (rc < 0) { - avrdude_message(MSG_INFO, "%s: WARNING: can't write memory for cycle count, rc=%d\n", - progname, rc); + pmsg_warning("cannot write memory for cycle count, rc=%d\n", rc); return -1; } } return 0; - } - -int avr_chip_erase(PROGRAMMER * pgm, AVRPART * p) -{ - int rc; - - rc = pgm->chip_erase(pgm, p); - - return rc; } -int avr_unlock(PROGRAMMER * pgm, AVRPART * p) -{ + +// Typical order in which memories show in avrdude.conf, runtime adds unknown ones (if any) +const char *avr_mem_order[100] = { + "eeprom", "flash", "application", "apptable", + "boot", "lfuse", "hfuse", "efuse", + "fuse", "fuse0", "wdtcfg", "fuse1", + "bodcfg", "fuse2", "osccfg", "fuse3", + "fuse4", "tcd0cfg", "fuse5", "syscfg0", + "fuse6", "syscfg1", "fuse7", "append", + "codesize", "fuse8", "fuse9", "bootend", + "bootsize", "fuses", "lock", "lockbits", + "tempsense", "signature", "prodsig", "sernum", + "calibration", "osccal16", "osccal20", "osc16err", + "osc20err", "usersig", "userrow", "data", +}; + +void avr_add_mem_order(const char *str) { + for(size_t i=0; i < sizeof avr_mem_order/sizeof *avr_mem_order; i++) { + if(avr_mem_order[i] && !strcmp(avr_mem_order[i], str)) + return; + if(!avr_mem_order[i]) { + avr_mem_order[i] = cfg_strdup("avr_mem_order()", str); + return; + } + } + pmsg_error("avr_mem_order[] under-dimensioned in avr.c; increase and recompile\n"); + exit(1); +} + +int avr_memtype_is_flash_type(const char *memtype) { + return memtype && ( + strcmp(memtype, "flash") == 0 || + strcmp(memtype, "application") == 0 || + strcmp(memtype, "apptable") == 0 || + strcmp(memtype, "boot") == 0); +} + +int avr_mem_is_flash_type(const AVRMEM *mem) { + return avr_memtype_is_flash_type(mem->desc); +} + +int avr_memtype_is_eeprom_type(const char *memtype) { + return memtype && strcmp(memtype, "eeprom") == 0; +} + +int avr_mem_is_eeprom_type(const AVRMEM *mem) { + return avr_memtype_is_eeprom_type(mem->desc); +} + +int avr_mem_is_known(const char *str) { + if(str && *str) + for(size_t i=0; i < sizeof avr_mem_order/sizeof *avr_mem_order; i++) + if(avr_mem_order[i] && !strcmp(avr_mem_order[i], str)) + return 1; + return 0; +} + +int avr_mem_might_be_known(const char *str) { + if(str && *str) + for(size_t i=0; i < sizeof avr_mem_order/sizeof *avr_mem_order; i++) + if(avr_mem_order[i] && !strncmp(avr_mem_order[i], str, strlen(str))) + return 1; + return 0; +} + + +int avr_chip_erase(const PROGRAMMER *pgm, const AVRPART *p) { + return pgm->chip_erase(pgm, p); +} + +int avr_unlock(const PROGRAMMER *pgm, const AVRPART *p) { int rc = -1; if (pgm->unlock) @@ -1237,52 +1385,49 @@ int avr_unlock(PROGRAMMER * pgm, AVRPART * p) } /* - * Report the progress of a read or write operation from/to the - * device. + * Report the progress of a read or write operation from/to the device * - * The first call of report_progress() should look like this (for a write op): + * The first call of report_progress() should look like this (for a write): * - * report_progress (0, 1, "Writing"); + * report_progress(0, 1, "Writing"); * - * Then hdr should be passed NULL on subsequent calls while the - * operation is progressing. Once the operation is complete, a final - * call should be made as such to ensure proper termination of the - * progress report: + * Then hdr should be passed NULL on subsequent calls * + * report_progress(k, n, NULL); // k/n signifies proportion of work done * - * report_progress (1, 1, NULL); + * with 0 <= k < n, while the operation is progressing. Once the operation is + * complete, a final call should be made as such to ensure proper termination + * of the progress report; choose one of the following three forms: * - * It would be nice if we could reduce the usage to one and only one - * call for each of start, during and end cases. As things stand now, - * that is not possible and makes maintenance a bit more work. + * report_progress(n, n, NULL); // finished OK, terminate with double \n + * report_progress(1, 0, NULL); // finished OK, do not print terminating \n + * report_progress(1, -1, NULL); // finished not OK, print double \n + * + * It is OK to call report_progress(1, -1, NULL) in a subroutine when + * encountering a fatal error to terminate the reporting here and there even + * though no report may have been started. */ -void report_progress (int completed, int total, char *hdr) -{ - static int last = 0; + +void report_progress(int completed, int total, const char *hdr) { + static int last; static double start_time; - int percent = (total > 0) ? ((completed * 100) / total) : 100; - struct timeval tv; + int percent; double t; if (update_progress == NULL) return; - gettimeofday(&tv, NULL); - t = tv.tv_sec + ((double)tv.tv_usec)/1000000; + percent = + completed >= total || total <= 0? 100: + completed < 0? 0: + completed < INT_MAX/100? 100*completed/total: completed/(total/100); - if (hdr) { - last = 0; + t = avr_timestamp(); + + if(hdr || !start_time) start_time = t; - update_progress (percent, t - start_time, hdr); - } - if (percent > 100) - percent = 100; - - if (percent > last) { + if(hdr || percent > last) { last = percent; - update_progress (percent, t - start_time, hdr); + update_progress(percent, t - start_time, hdr, total < 0? -1: !!total); } - - if (percent == 100) - last = 0; /* Get ready for next time. */ } diff --git a/src/avr910.c b/src/avr910.c index 3e14fdc1..d8d29332 100644 --- a/src/avr910.c +++ b/src/avr910.c @@ -57,8 +57,7 @@ struct pdata static void avr910_setup(PROGRAMMER * pgm) { if ((pgm->cookie = malloc(sizeof(struct pdata))) == 0) { - avrdude_message(MSG_INFO, "%s: avr910_setup(): Out of memory allocating private data\n", - progname); + pmsg_error("out of memory allocating private data\n"); exit(1); } memset(pgm->cookie, 0, sizeof(struct pdata)); @@ -71,40 +70,34 @@ static void avr910_teardown(PROGRAMMER * pgm) } -static int avr910_send(PROGRAMMER * pgm, char * buf, size_t len) -{ +static int avr910_send(const PROGRAMMER *pgm, char *buf, size_t len) { return serial_send(&pgm->fd, (unsigned char *)buf, len); } -static int avr910_recv(PROGRAMMER * pgm, char * buf, size_t len) -{ +static int avr910_recv(const PROGRAMMER *pgm, char *buf, size_t len) { int rv; rv = serial_recv(&pgm->fd, (unsigned char *)buf, len); if (rv < 0) { - avrdude_message(MSG_INFO, "%s: avr910_recv(): programmer is not responding\n", - progname); + pmsg_error("programmer is not responding\n"); return 1; } return 0; } -static int avr910_drain(PROGRAMMER * pgm, int display) -{ +static int avr910_drain(const PROGRAMMER *pgm, int display) { return serial_drain(&pgm->fd, display); } -static int avr910_vfy_cmd_sent(PROGRAMMER * pgm, char * errmsg) -{ +static int avr910_vfy_cmd_sent(const PROGRAMMER *pgm, char *errmsg) { char c; avr910_recv(pgm, &c, 1); if (c != '\r') { - avrdude_message(MSG_INFO, "%s: error: programmer did not respond to command: %s\n", - progname, errmsg); + pmsg_error("programmer did not respond to command: %s\n", errmsg); return 1; } return 0; @@ -114,8 +107,7 @@ static int avr910_vfy_cmd_sent(PROGRAMMER * pgm, char * errmsg) /* * issue the 'chip erase' command to the AVR device */ -static int avr910_chip_erase(PROGRAMMER * pgm, AVRPART * p) -{ +static int avr910_chip_erase(const PROGRAMMER *pgm, const AVRPART *p) { avr910_send(pgm, "e", 1); if (avr910_vfy_cmd_sent(pgm, "chip erase") < 0) return -1; @@ -129,15 +121,13 @@ static int avr910_chip_erase(PROGRAMMER * pgm, AVRPART * p) } -static int avr910_enter_prog_mode(PROGRAMMER * pgm) -{ +static int avr910_enter_prog_mode(const PROGRAMMER *pgm) { avr910_send(pgm, "P", 1); return avr910_vfy_cmd_sent(pgm, "enter prog mode"); } -static int avr910_leave_prog_mode(PROGRAMMER * pgm) -{ +static int avr910_leave_prog_mode(const PROGRAMMER *pgm) { avr910_send(pgm, "L", 1); return avr910_vfy_cmd_sent(pgm, "leave prog mode"); } @@ -146,8 +136,7 @@ static int avr910_leave_prog_mode(PROGRAMMER * pgm) /* * issue the 'program enable' command to the AVR device */ -static int avr910_program_enable(PROGRAMMER * pgm, AVRPART * p) -{ +static int avr910_program_enable(const PROGRAMMER *pgm, const AVRPART *p) { return -1; } @@ -155,8 +144,7 @@ static int avr910_program_enable(PROGRAMMER * pgm, AVRPART * p) /* * initialize the AVR device and prepare it to accept commands */ -static int avr910_initialize(PROGRAMMER * pgm, AVRPART * p) -{ +static int avr910_initialize(const PROGRAMMER *pgm, const AVRPART *p) { char id[8]; char sw[2]; char hw[2]; @@ -185,16 +173,16 @@ static int avr910_initialize(PROGRAMMER * pgm, AVRPART * p) avr910_send(pgm, "p", 1); avr910_recv(pgm, &type, 1); - avrdude_message(MSG_INFO, "Found programmer: Id = \"%s\"; type = %c\n", id, type); - avrdude_message(MSG_INFO, " Software Version = %c.%c; ", sw[0], sw[1]); - avrdude_message(MSG_INFO, "Hardware Version = %c.%c\n", hw[0], hw[1]); + msg_notice("Programmer id = %s; type = %c\n", id, type); + msg_notice("Software version = %c.%c; ", sw[0], sw[1]); + msg_notice("Hardware version = %c.%c\n", hw[0], hw[1]); /* See if programmer supports autoincrement of address. */ avr910_send(pgm, "a", 1); avr910_recv(pgm, &PDATA(pgm)->has_auto_incr_addr, 1); if (PDATA(pgm)->has_auto_incr_addr == 'Y') - avrdude_message(MSG_INFO, "Programmer supports auto addr increment.\n"); + msg_notice("programmer supports auto addr increment\n"); /* Check support for buffered memory access, ignore if not available */ @@ -206,8 +194,8 @@ static int avr910_initialize(PROGRAMMER * pgm, AVRPART * p) PDATA(pgm)->buffersize = (unsigned int)(unsigned char)c<<8; avr910_recv(pgm, &c, 1); PDATA(pgm)->buffersize += (unsigned int)(unsigned char)c; - avrdude_message(MSG_INFO, "Programmer supports buffered memory access with " - "buffersize = %u bytes.\n", + msg_notice("programmer supports buffered memory access with " + "buffersize = %u bytes\n", PDATA(pgm)->buffersize); PDATA(pgm)->use_blockmode = 1; } else { @@ -224,7 +212,7 @@ static int avr910_initialize(PROGRAMMER * pgm, AVRPART * p) /* Get list of devices that the programmer supports. */ avr910_send(pgm, "t", 1); - avrdude_message(MSG_INFO, "\nProgrammer supports the following devices:\n"); + msg_notice2("\nProgrammer supports the following devices:\n"); devtype_1st = 0; while (1) { avr910_recv(pgm, &c, 1); @@ -234,20 +222,22 @@ static int avr910_initialize(PROGRAMMER * pgm, AVRPART * p) break; part = locate_part_by_avr910_devcode(part_list, c); - avrdude_message(MSG_INFO, " Device code: 0x%02x = %s\n", c, part ? part->desc : "(unknown)"); + msg_notice2(" Device code: 0x%02x = %s\n", c & 0xff, part? part->desc: "(unknown)"); /* FIXME: Need to lookup devcode and report the device. */ if (p->avr910_devcode == c) dev_supported = 1; }; - avrdude_message(MSG_INFO, "\n"); + msg_notice2("\n"); if (!dev_supported) { - avrdude_message(MSG_INFO, "%s: %s: selected device is not supported by programmer: %s\n", - progname, ovsigck? "warning": "error", p->id); - if (!ovsigck) + if(ovsigck) + pmsg_warning("selected device is not supported by programmer %s\n", p->id); + else { + pmsg_error("selected device is not supported by programmer %s\n", p->id); return -1; + } } /* If the user forced the selection, use the first device type that is supported by the programmer. */ @@ -264,8 +254,7 @@ static int avr910_initialize(PROGRAMMER * pgm, AVRPART * p) avr910_send(pgm, buf, 2); avr910_vfy_cmd_sent(pgm, "select device"); - avrdude_message(MSG_NOTICE, "%s: avr910_devcode selected: 0x%02x\n", - progname, (unsigned)buf[1]); + pmsg_notice("avr910_devcode selected: 0x%02x\n", (unsigned) buf[1]); avr910_enter_prog_mode(pgm); @@ -273,16 +262,14 @@ static int avr910_initialize(PROGRAMMER * pgm, AVRPART * p) } -static void avr910_disable(PROGRAMMER * pgm) -{ +static void avr910_disable(const PROGRAMMER *pgm) { /* Do nothing. */ return; } -static void avr910_enable(PROGRAMMER * pgm) -{ +static void avr910_enable(PROGRAMMER *pgm, const AVRPART *p) { /* Do nothing. */ return; @@ -293,7 +280,7 @@ static void avr910_enable(PROGRAMMER * pgm) * transmit an AVR device command and return the results; 'cmd' and * 'res' must point to at least a 4 byte data buffer */ -static int avr910_cmd(PROGRAMMER * pgm, const unsigned char *cmd, +static int avr910_cmd(const PROGRAMMER *pgm, const unsigned char *cmd, unsigned char *res) { char buf[5]; @@ -318,8 +305,7 @@ static int avr910_cmd(PROGRAMMER * pgm, const unsigned char *cmd, } -static int avr910_parseextparms(PROGRAMMER * pgm, LISTID extparms) -{ +static int avr910_parseextparms(const PROGRAMMER *pgm, const LISTID extparms) { LNODEID ln; const char *extended_param; int rv = 0; @@ -331,27 +317,23 @@ static int avr910_parseextparms(PROGRAMMER * pgm, LISTID extparms) int devcode; if (sscanf(extended_param, "devcode=%i", &devcode) != 1 || devcode <= 0 || devcode > 255) { - avrdude_message(MSG_INFO, "%s: avr910_parseextparms(): invalid devcode '%s'\n", - progname, extended_param); + pmsg_error("invalid devcode '%s'\n", extended_param); rv = -1; continue; } - avrdude_message(MSG_NOTICE2, "%s: avr910_parseextparms(): devcode overwritten as 0x%02x\n", - progname, devcode); + pmsg_notice2("avr910_parseextparms(): devcode overwritten as 0x%02x\n", devcode); PDATA(pgm)->devcode = devcode; continue; } if (strncmp(extended_param, "no_blockmode", strlen("no_blockmode")) == 0) { - avrdude_message(MSG_NOTICE2, "%s: avr910_parseextparms(-x): no testing for Blockmode\n", - progname); + pmsg_notice2("avr910_parseextparms(-x): no testing for Blockmode\n"); PDATA(pgm)->test_blockmode = 0; continue; } - avrdude_message(MSG_INFO, "%s: avr910_parseextparms(): invalid extended parameter '%s'\n", - progname, extended_param); + pmsg_error("invalid extended parameter '%s'\n", extended_param); rv = -1; } @@ -359,8 +341,7 @@ static int avr910_parseextparms(PROGRAMMER * pgm, LISTID extparms) } -static int avr910_open(PROGRAMMER * pgm, char * port) -{ +static int avr910_open(PROGRAMMER *pgm, const char *port) { union pinfo pinfo; /* * If baudrate was not specified use 19.200 Baud @@ -393,14 +374,12 @@ static void avr910_close(PROGRAMMER * pgm) } -static void avr910_display(PROGRAMMER * pgm, const char * p) -{ +static void avr910_display(const PROGRAMMER *pgm, const char *p) { return; } -static void avr910_set_addr(PROGRAMMER * pgm, unsigned long addr) -{ +static void avr910_set_addr(const PROGRAMMER *pgm, unsigned long addr) { char cmd[3]; cmd[0] = 'A'; @@ -412,7 +391,7 @@ static void avr910_set_addr(PROGRAMMER * pgm, unsigned long addr) } -static int avr910_write_byte(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m, +static int avr910_write_byte(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *m, unsigned long addr, unsigned char value) { char cmd[2]; @@ -445,7 +424,7 @@ static int avr910_write_byte(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m, } -static int avr910_read_byte_flash(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m, +static int avr910_read_byte_flash(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *m, unsigned long addr, unsigned char * value) { char buf[2]; @@ -468,7 +447,7 @@ static int avr910_read_byte_flash(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m, } -static int avr910_read_byte_eeprom(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m, +static int avr910_read_byte_eeprom(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *m, unsigned long addr, unsigned char * value) { avr910_set_addr(pgm, addr); @@ -479,7 +458,7 @@ static int avr910_read_byte_eeprom(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m, } -static int avr910_read_byte(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m, +static int avr910_read_byte(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *m, unsigned long addr, unsigned char * value) { if (strcmp(m->desc, "flash") == 0) { @@ -494,7 +473,7 @@ static int avr910_read_byte(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m, } -static int avr910_paged_write_flash(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m, +static int avr910_paged_write_flash(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *m, unsigned int page_size, unsigned int addr, unsigned int n_bytes) { @@ -553,8 +532,8 @@ static int avr910_paged_write_flash(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m, } -static int avr910_paged_write_eeprom(PROGRAMMER * pgm, AVRPART * p, - AVRMEM * m, +static int avr910_paged_write_eeprom(const PROGRAMMER *pgm, const AVRPART *p, + const AVRMEM * m, unsigned int page_size, unsigned int addr, unsigned int n_bytes) { @@ -582,7 +561,7 @@ static int avr910_paged_write_eeprom(PROGRAMMER * pgm, AVRPART * p, } -static int avr910_paged_write(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m, +static int avr910_paged_write(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *m, unsigned int page_size, unsigned int addr, unsigned int n_bytes) { @@ -642,7 +621,7 @@ static int avr910_paged_write(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m, } -static int avr910_paged_load(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m, +static int avr910_paged_load(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *m, unsigned int page_size, unsigned int addr, unsigned int n_bytes) { @@ -719,12 +698,11 @@ static int avr910_paged_load(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m, /* Signature byte reads are always 3 bytes. */ -static int avr910_read_sig_bytes(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m) -{ +static int avr910_read_sig_bytes(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *m) { unsigned char tmp; if (m->size < 3) { - avrdude_message(MSG_INFO, "%s: memsize too small for sig byte read", progname); + pmsg_error("memsize too small for sig byte read"); return -1; } @@ -740,8 +718,7 @@ static int avr910_read_sig_bytes(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m) const char avr910_desc[] = "Serial programmers using protocol described in application note AVR910"; -void avr910_initpgm(PROGRAMMER * pgm) -{ +void avr910_initpgm(PROGRAMMER *pgm) { strcpy(pgm->type, "avr910"); /* diff --git a/src/avr910.h b/src/avr910.h index 808f7e68..c18e7779 100644 --- a/src/avr910.h +++ b/src/avr910.h @@ -26,7 +26,7 @@ extern "C" { #endif extern const char avr910_desc[]; -void avr910_initpgm (PROGRAMMER * pgm); +void avr910_initpgm(PROGRAMMER *pgm); #ifdef __cplusplus } diff --git a/src/avrcache.c b/src/avrcache.c new file mode 100644 index 00000000..da40c7a7 --- /dev/null +++ b/src/avrcache.c @@ -0,0 +1,774 @@ +/* + * avrdude - A Downloader/Uploader for AVR device programmers + * Copyright (C) 2022 Stefan Rueger + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/* $Id$ */ + +#include "ac_cfg.h" + +#include +#include +#include +#include +#include +#include + +#include "avrdude.h" +#include "libavrdude.h" +#include "avrintel.h" + +/* + * Provides an API for cached bytewise access + * + * int avr_read_byte_cached(const PROGRAMMER *pgm, const AVRPART *p, const + * AVRMEM *mem, unsigned long addr, unsigned char *value); + * + * int avr_write_byte_cached(const PROGRAMMER *pgm, const AVRPART *p, const + * AVRMEM *mem, unsigned long addr, unsigned char data); + * + * int avr_flush_cache(const PROGRAMMER *pgm, const AVRPART *p); + * + * int avr_chip_erase_cached(const PROGRAMMER *pgm, const AVRPART *p); + * + * int avr_page_erase_cached(const PROGRAMMER *pgm, const AVRPART *p, const + * AVRMEM *mem, unsigned int baseaddr); + * + * int avr_reset_cache(const PROGRAMMER *pgm, const AVRPART *p); + * + * avr_read_byte_cached() and avr_write_byte_cached() use a cache if paged + * routines are available and if the device memory is EEPROM or flash, + * otherwise they fall back to pgm->read_byte() and pgm->write_byte(), + * respectively. Bytewise cached read always gets its data from the cache, + * possibly after reading a page from the device memory. Bytewise cached + * write with an address in memory range only ever modifies the cache. Any + * modifications are written to the device after calling avr_flush_cache() or + * when attempting to read or write from a location outside the address range + * of the device memory. + * + * avr_flush_cache() synchronises pending writes to EEPROM and flash with the + * device. With some programmer and part combinations, flash (and sometimes + * EEPROM, too) looks like a NOR memory, ie, one can only write 0 bits, not 1 + * bits. When this is detected, either page erase is deployed (eg, with parts + * that have PDI/UPDI interfaces), or if that is not available, both EEPROM + * and flash caches are fully read in, a pgm->chip_erase() command is issued + * and both EEPROM and flash are written back to the device. Hence, it can + * take minutes to ensure that a single previously cleared bit is set and, + * therefore, this routine should be called sparingly. + * + * avr_chip_erase_cached() erases the chip and discards pending writes() to + * flash or EEPROM. It presets the flash cache to all 0xff alleviating the + * need to read from the device flash. However, if the programmer serves + * bootloaders (pgm->prog_modes & PM_SPM) then the flash cache is reset + * instead, necessitating flash memory be fetched from the device on first + * read; the reason for this is that bootloaders emulate chip erase and they + * won't overwrite themselves (some bootloaders, eg, optiboot ignore chip + * erase commands) making it truly unknowable what the flash contents on + * device is after a chip erase. + * + * For EEPROM avr_chip_erase_cached() concludes that it has been deleted if a + * previously cached EEPROM page that contained cleared bits now no longer + * has these clear bits on the device. Only with this evidence is the EEPROM + * cache preset to all 0xff otherwise the cache discards all pending writes + * to EEPROM and is left unchanged otherwise. + * + * The avr_page_erase_cached() function erases a page and synchronises it + * with the cache. + * + * Finally, avr_reset_cache() resets the cache without synchronising pending + * writes() to the device. + * + * This file also holds the following utility functions + * + * // Does the programmer/memory combo have paged memory access? + * int avr_has_paged_access(const PROGRAMMER *pgm, const AVRMEM *mem); + * + * // Read the page containing addr from the device into buf + * int avr_read_page_default(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *mem, int addr, unsigned char *buf); + * + * // Write the data page to the device into the page containing addr + * int avr_write_page_default(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *mem, int addr, unsigned char *data); + * + * // Could memory region s1 be the result of a NOR-memory copy of s3 onto s2? + * int avr_is_and(const unsigned char *s1, const unsigned char *s2, const unsigned char *s3, size_t n); + * + */ + + +/* + * Paged access? + * - Programmer must have paged routines + * - Memory has positive page size, which is a power of two + * - Memory has positive size, which is a multiple of the page size + * - Memory is flash type or eeprom type + * + * Note that in this definition the page size can be 1 + */ + +int avr_has_paged_access(const PROGRAMMER *pgm, const AVRMEM *mem) { + return pgm->paged_load && pgm->paged_write && + mem->page_size > 0 && (mem->page_size & (mem->page_size-1)) == 0 && + mem->size > 0 && mem->size % mem->page_size == 0 && + (avr_mem_is_flash_type(mem) || avr_mem_is_eeprom_type(mem)); +} + + +#define fallback_read_byte (pgm->read_byte != avr_read_byte_cached? pgm->read_byte: avr_read_byte_default) +#define fallback_write_byte (pgm->write_byte != avr_write_byte_cached? pgm->write_byte: avr_write_byte_default) + +/* + * Read the page containing addr from the device into buf + * - Caller to ensure buf has mem->page_size bytes + * - Part memory buffer mem is unaffected by this (though temporarily changed) + * - Uses read_byte() if memory page size is one, otherwise paged_load() + * - Fall back to bytewise read if paged_load() returned an error + * - On failure returns a negative value, on success a non-negative value, which is either + * + The number of bytes read by pgm->paged_load() if that succeeded + * + LIBAVRDUDE_SUCCESS (0) if the fallback of bytewise read succeeded + */ +int avr_read_page_default(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *mem, int addr, unsigned char *buf) { + if(!avr_has_paged_access(pgm, mem) || addr < 0 || addr >= mem->size) + return LIBAVRDUDE_GENERAL_FAILURE; + + int rc, pgsize = mem->page_size, base = addr & ~(pgsize-1); + unsigned char *pagecopy = cfg_malloc("avr_read_page_default()", pgsize); + + if(pgsize == 1) + return fallback_read_byte(pgm, p, mem, addr, buf); + + memcpy(pagecopy, mem->buf + base, pgsize); + if((rc = pgm->paged_load(pgm, p, mem, pgsize, base, pgsize)) >= 0) + memcpy(buf, mem->buf + base, pgsize); + memcpy(mem->buf + base, pagecopy, pgsize); + + if(rc < 0 && pgm->read_byte != avr_read_byte_cached) { + rc = LIBAVRDUDE_SUCCESS; + for(int i=0; iread_byte(pgm, p, mem, base+i, pagecopy+i) < 0) { + rc = LIBAVRDUDE_GENERAL_FAILURE; + break; + } + } + if(rc == LIBAVRDUDE_SUCCESS) + memcpy(buf, pagecopy, pgsize); + } + free(pagecopy); + + return rc; +} + + +/* + * Write the data page to the device into the page containing addr + * - Caller to provide all mem->page_size bytes incl padding if any + * - Part memory buffer mem is unaffected by this (though temporarily changed) + * - Uses write_byte() if memory page size is one, otherwise paged_write() + */ +int avr_write_page_default(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *mem, int addr, unsigned char *data) { + if(!avr_has_paged_access(pgm, mem) || addr < 0 || addr >= mem->size) + return LIBAVRDUDE_GENERAL_FAILURE; + + int rc, pgsize = mem->page_size, base = addr & ~(pgsize-1); + unsigned char *pagecopy = cfg_malloc("avr_write_page_default()", pgsize); + + if(pgsize == 1) + return fallback_write_byte(pgm, p, mem, addr, *data); + + memcpy(pagecopy, mem->buf + base, pgsize); + memcpy(mem->buf + base, data, pgsize); + rc = pgm->paged_write(pgm, p, mem, pgsize, base, pgsize); + memcpy(mem->buf + base, pagecopy, pgsize); + free(pagecopy); + + return rc; +} + + +// Could memory region s1 be the result of a NOR-memory copy of s3 onto s2? +int avr_is_and(const unsigned char *s1, const unsigned char *s2, const unsigned char *s3, size_t n) { + while(n--) + if(*s1++ != (*s2++ & *s3++)) + return 0; + + return 1; +} + + +static int cacheAddress(int addr, const AVR_Cache *cp, const AVRMEM *mem) { + int cacheaddr = addr + (int) (mem->offset - cp->offset); + + if(cacheaddr < 0 || cacheaddr >= cp->size) { // Should never happen (unless offsets wrong in avrdude.conf) + pmsg_error("%s cache address 0x%04x out of range [0, 0x%04x]\n", mem->desc, cacheaddr, cp->size-1); + return LIBAVRDUDE_GENERAL_FAILURE; + } + + if(mem->page_size != cp->page_size) { // Should never happen (unless incompatible page sizes in avrdude.conf) + pmsg_error("%s page size %d incompatible with cache page size %d\n", mem->desc, mem->page_size, cp->page_size); + return LIBAVRDUDE_GENERAL_FAILURE; + } + + return cacheaddr; +} + + +static int loadCachePage(AVR_Cache *cp, const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *mem, int addr, int cacheaddr, int nlOnErr) { + int pgno = cacheaddr/cp->page_size; + + if(!cp->iscached[pgno]) { + // Read cached section from device + int cachebase = cacheaddr & ~(cp->page_size-1); + if(avr_read_page_default(pgm, p, mem, addr & ~(cp->page_size-1), cp->cont + cachebase) < 0) { + report_progress(1, -1, NULL); + if(nlOnErr && quell_progress) + msg_info("\n"); + pmsg_error("unable to read %s page at addr 0x%04x\n", mem->desc, addr); + return LIBAVRDUDE_GENERAL_FAILURE; + } + + // Copy last read device page, so we can later check for changes + memcpy(cp->copy + cachebase, cp->cont + cachebase, cp->page_size); + cp->iscached[pgno] = 1; + } + + return LIBAVRDUDE_SUCCESS; +} + + +static int initCache(AVR_Cache *cp, const PROGRAMMER *pgm, const AVRPART *p) { + AVRMEM *basemem = avr_locate_mem(p, cp == pgm->cp_flash? "flash": "eeprom"); + + if(!basemem || !avr_has_paged_access(pgm, basemem)) + return LIBAVRDUDE_GENERAL_FAILURE; + + cp->size = basemem->size; + cp->page_size = basemem->page_size; + cp->offset = basemem->offset; + cp->cont = cfg_malloc("initCache()", cp->size); + cp->copy = cfg_malloc("initCache()", cp->size); + cp->iscached = cfg_malloc("initCache()", cp->size/cp->page_size); + + if((pgm->prog_modes & PM_SPM) && avr_mem_is_flash_type(basemem)) { // Could be vector bootloader + // Caching the vector page gives control to the progammer that then can patch the reset vector + if(loadCachePage(cp, pgm, p, basemem, 0, 0, 0) < 0) + return LIBAVRDUDE_GENERAL_FAILURE; + } + + return LIBAVRDUDE_SUCCESS; +} + + +static int writeCachePage(AVR_Cache *cp, const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *mem, int base, int nlOnErr) { + // Write modified page cont to device; if unsuccessful try bytewise access + if(avr_write_page_default(pgm, p, mem, base, cp->cont + base) < 0) { + if(pgm->read_byte != avr_read_byte_cached && pgm->write_byte != avr_write_byte_cached) { + for(int i=0; i < cp->page_size; i++) + if(cp->cont[base+i] != cp->copy[base+i]) + if(pgm->write_byte(pgm, p, mem, base+i, cp->cont[base+i]) < 0 || + pgm->read_byte(pgm, p, mem, base+i, cp->copy+base+i) < 0) { + report_progress(1, -1, NULL); + if(nlOnErr && quell_progress) + msg_info("\n"); + pmsg_error("%s access error at addr 0x%04x\n", mem->desc, base+i); + return LIBAVRDUDE_GENERAL_FAILURE; + } + + return LIBAVRDUDE_SUCCESS; // Bytewise writes & reads successful + } + report_progress(1, -1, NULL); + if(nlOnErr && quell_progress) + msg_info("\n"); + pmsg_error("write %s page error at addr 0x%04x\n", mem->desc, base); + return LIBAVRDUDE_GENERAL_FAILURE; + } + // Read page back from device and update copy to what is on device + if(avr_read_page_default(pgm, p, mem, base, cp->copy + base) < 0) { + report_progress(1, -1, NULL); + if(nlOnErr && quell_progress) + msg_info("\n"); + pmsg_error("unable to read %s page at addr 0x%04x\n", mem->desc, base); + return LIBAVRDUDE_GENERAL_FAILURE; + } + + return LIBAVRDUDE_SUCCESS; +} + + +// Does the memory region only haxe 0xff? +static int _is_all_0xff(const void *p, size_t n) { + const unsigned char *q = (const unsigned char *) p; + return n <= 0 || (*q == 0xff && memcmp(q, q+1, n-1) == 0); +} + + +// A coarse guess where any bootloader might start (prob underestimates the start) +static int guessBootStart(const PROGRAMMER *pgm, const AVRPART *p) { + int bootstart = 0; + const AVR_Cache *cp = pgm->cp_flash; + + if(p->prog_modes & PM_UPDI) // Modern AVRs put the bootloader at 0 + return 0; + + if(p->n_boot_sections > 0 && p->boot_section_size > 0) + bootstart = cp->size - (p->boot_section_size<<(p->n_boot_sections-1)); + + if(bootstart <= cp->size/2 || bootstart >= cp->size) + bootstart = cp->size > 32768? cp->size - 16384: cp->size*3/4; + + return bootstart & ~(cp->page_size-1); +} + + +// Page erase but without error messages if it does not work +static int silent_page_erase(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *m, unsigned int a) { + int bakverb = verbose; + verbose = -123; + int ret = pgm->page_erase? pgm->page_erase(pgm, p, m, a): -1; + verbose = bakverb; + + return ret; +} + + +typedef struct { + AVRMEM *mem; + AVR_Cache *cp; + int isflash, zopaddr, pgerase; +} CacheDesc_t; + + +// Write both EEPROM and flash caches to device and free them +int avr_flush_cache(const PROGRAMMER *pgm, const AVRPART *p) { + CacheDesc_t mems[2] = { + { avr_locate_mem(p, "flash"), pgm->cp_flash, 1, -1, 0 }, + { avr_locate_mem(p, "eeprom"), pgm->cp_eeprom, 0, -1, 0 }, + }; + + int chpages = 0; + bool chiperase = 0; + // Count page changes and find a page that needs a clear bit set + for(size_t i = 0; i < sizeof mems/sizeof*mems; i++) { + AVRMEM *mem = mems[i].mem; + AVR_Cache *cp = mems[i].cp; + if(!mem || !cp->cont) + continue; + + for(int pgno = 0, n = 0; n < cp->size; pgno++, n += cp->page_size) { + if(cp->iscached[pgno]) + if(memcmp(cp->copy + n, cp->cont + n, cp->page_size)) { + chpages++; + if(mems[i].zopaddr == -1 && !avr_is_and(cp->cont + n, cp->copy + n, cp->cont + n, cp->page_size)) + mems[i].zopaddr = n; + } + } + } + + if(!chpages) + return LIBAVRDUDE_SUCCESS; + + pmsg_info("synching cache to device ... "); + fflush(stderr); + + // Check whether page erase needed and working and whether chip erase needed + for(size_t i = 0; i < sizeof mems/sizeof*mems; i++) { + AVRMEM *mem = mems[i].mem; + AVR_Cache *cp = mems[i].cp; + + if(!mem) + continue; + + if(!cp->cont) // Ensure cache is initialised from now on + if(initCache(cp, pgm, p) < 0) { + if(quell_progress) + msg_info("\n"); + pmsg_error("unable to initialise the cache\n"); + return LIBAVRDUDE_GENERAL_FAILURE; + } + + if(chiperase || mems[i].zopaddr < 0) + continue; + + int n=mems[i].zopaddr; + + if(writeCachePage(cp, pgm, p, mem, n, 1) < 0) + return LIBAVRDUDE_GENERAL_FAILURE; + // Same? OK, can set cleared bit to one, "normal" memory + if(!memcmp(cp->copy + n, cp->cont + n, cp->page_size)) { + chpages--; + continue; + } + + // Probably NOR memory, check out page erase + if(silent_page_erase(pgm, p, mem, n) >= 0) { + if(writeCachePage(cp, pgm, p, mem, n, 1) < 0) + return LIBAVRDUDE_GENERAL_FAILURE; + // Worked OK? Can use page erase on this memory + if(!memcmp(cp->copy + n, cp->cont + n, cp->page_size)) { + mems[i].pgerase = 1; + chpages--; + continue; + } + } + + chiperase = 1; + } + + if(!chpages) { + msg_info("done\n"); + return LIBAVRDUDE_SUCCESS; + } + + if(chiperase) { + if(quell_progress) { + msg_info("reading/chip erase/writing cycle needed ... "); + fflush(stderr); + } + + int nrd = 0; + // Count read operations needed + for(size_t i = 0; i < sizeof mems/sizeof*mems; i++) { + AVRMEM *mem = mems[i].mem; + AVR_Cache *cp = mems[i].cp; + if(!mem) + continue; + + for(int pgno = 0, n = 0; n < cp->size; pgno++, n += cp->page_size) + if(!cp->iscached[pgno]) + nrd++; + } + + report_progress(0, 1, "Reading"); + if(nrd) { + // Read full flash and EEPROM + for(size_t i = 0; i < sizeof mems/sizeof*mems; i++) { + AVRMEM *mem = mems[i].mem; + AVR_Cache *cp = mems[i].cp; + if(!mem) + continue; + + for(int ird = 0, pgno = 0, n = 0; n < cp->size; pgno++, n += cp->page_size) { + if(!cp->iscached[pgno]) { + report_progress(ird++, nrd, NULL); + if(loadCachePage(cp, pgm, p, mem, n, n, 1) < 0) + return LIBAVRDUDE_GENERAL_FAILURE; + } + } + } + } + report_progress(1, 0, NULL); + + report_progress(0, 1, "Erasing"); + if(avr_chip_erase(pgm, p) < 0) { + report_progress(1, -1, NULL); + if(quell_progress) + msg_info("\n"); + pmsg_error("chip erase failed\n"); + return LIBAVRDUDE_GENERAL_FAILURE; + } + + // Update cache copies after chip erase so that writing back is efficient + for(size_t i = 0; i < sizeof mems/sizeof*mems; i++) { + AVRMEM *mem = mems[i].mem; + AVR_Cache *cp = mems[i].cp; + if(!mem) + continue; + + if(mems[i].isflash) { // flash + memset(cp->copy, 0xff, cp->size); // record device memory as erased + if(pgm->prog_modes & PM_SPM) { // Bootloaders will not overwrite themselves + // Read back generously estimated bootloader section to avoid verification errors + int bootstart = guessBootStart(pgm, p); + int nbo = (cp->size - bootstart)/cp->page_size; + + for(int ibo = 0, n = bootstart; n < cp->size; n += cp->page_size) { + report_progress(1+ibo++, nbo+2, NULL); + if(avr_read_page_default(pgm, p, mem, n, cp->copy + n) < 0) { + report_progress(1, -1, NULL); + if(quell_progress) + msg_info("\n"); + pmsg_error("flash read failed at addr 0x%04x\n", n); + return LIBAVRDUDE_GENERAL_FAILURE; + } + } + } + } else { // EEPROM + // Don't know whether chip erase has zapped EEPROM + for(int n = 0; n < cp->size; n += cp->page_size) { + if(!_is_all_0xff(cp->copy + n, cp->page_size)) { // First page that had EEPROM data + if(avr_read_page_default(pgm, p, mem, n, cp->copy + n) < 0) { + report_progress(1, -1, NULL); + if(quell_progress) + msg_info("\n"); + pmsg_error("EEPROM read failed at addr 0x%04x\n", n); + return LIBAVRDUDE_GENERAL_FAILURE; + } + // EEPROM zapped by chip erase? Set all copy to 0xff + if(_is_all_0xff(cp->copy + n, cp->page_size)) + memset(cp->copy, 0xff, cp->size); + break; + } + } + } + } + report_progress(1, 0, NULL); + } + + int nwr = 0; + // Count number of writes + for(size_t i = 0; i < sizeof mems/sizeof*mems; i++) { + AVRMEM *mem = mems[i].mem; + AVR_Cache *cp = mems[i].cp; + if(!mem) + continue; + + for(int pgno = 0, n = 0; n < cp->size; pgno++, n += cp->page_size) + if(cp->iscached[pgno] && memcmp(cp->copy + n, cp->cont + n, cp->page_size)) + nwr++; + } + + report_progress(0, 1, "Writing"); + if(nwr) { + // Write all modified pages to the device + for(size_t i = 0; i < sizeof mems/sizeof*mems; i++) { + AVRMEM *mem = mems[i].mem; + AVR_Cache *cp = mems[i].cp; + if(!mem || !cp->cont) + continue; + + for(int iwr = 0, pgno = 0, n = 0; n < cp->size; pgno++, n += cp->page_size) { + if(cp->iscached[pgno] && memcmp(cp->copy + n, cp->cont + n, cp->page_size)) { + if(!chiperase && mems[i].pgerase) + pgm->page_erase(pgm, p, mem, n); + if(writeCachePage(cp, pgm, p, mem, n, 1) < 0) + return LIBAVRDUDE_GENERAL_FAILURE; + if(memcmp(cp->copy + n, cp->cont + n, cp->page_size)) { + report_progress(1, -1, NULL); + if(quell_progress) + msg_info("\n"); + pmsg_error("verification mismatch at %s page addr 0x%04x\n", mem->desc, n); + return LIBAVRDUDE_GENERAL_FAILURE; + } + report_progress(iwr++, nwr, NULL); + } + } + } + } + report_progress(1, 0, NULL); + + msg_info(quell_progress? "done\n": "\n"); + return LIBAVRDUDE_SUCCESS; +} + + +/* + * Read byte via a read/write cache + * - Used if paged routines available and if memory is EEPROM or flash + * - Otherwise fall back to pgm->read_byte() + * - Out of memory addr: synchronise cache and, if successful, pretend reading a zero + * - Cache is automagically created and initialised if needed + */ +int avr_read_byte_cached(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *mem, + unsigned long addr, unsigned char *value) { + + // Use pgm->read_byte() if not EEPROM/flash or no paged access + if(!avr_has_paged_access(pgm, mem)) + return fallback_read_byte(pgm, p, mem, addr, value); + + // If address is out of range synchronise cache and, if successful, pretend reading a zero + if(addr >= (unsigned long) mem->size) { + if(avr_flush_cache(pgm, p) < 0) + return LIBAVRDUDE_GENERAL_FAILURE; + *value = 0; + return LIBAVRDUDE_SUCCESS; + } + + AVR_Cache *cp = avr_mem_is_eeprom_type(mem)? pgm->cp_eeprom: pgm->cp_flash; + + if(!cp->cont) // Init cache if needed + if(initCache(cp, pgm, p) < 0) + return LIBAVRDUDE_GENERAL_FAILURE; + + int cacheaddr = cacheAddress((int) addr, cp, mem); + if(cacheaddr < 0) + return LIBAVRDUDE_GENERAL_FAILURE; + + // Ensure cache page is there + if(loadCachePage(cp, pgm, p, mem, addr, cacheaddr, 0) < 0) + return LIBAVRDUDE_GENERAL_FAILURE; + + *value = cp->cont[cacheaddr]; + + return LIBAVRDUDE_SUCCESS; +} + + +/* + * Write byte via a read/write cache + * - Used if paged routines available and if memory is EEPROM or flash + * - Otherwise fall back to pgm->write_byte() + * - Out of memory addr: synchronise cache with device and return whether successful + * - If programmer indicates a readonly spot, return LIBAVRDUDE_SOFTFAIL + * - Cache is automagically created and initialised if needed + */ +int avr_write_byte_cached(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *mem, + unsigned long addr, unsigned char data) { + + if(pgm->readonly && pgm->readonly(pgm, p, mem, addr)) + return LIBAVRDUDE_SOFTFAIL; + + // Use pgm->write_byte() if not EEPROM/flash or no paged access + if(!avr_has_paged_access(pgm, mem)) + return fallback_write_byte(pgm, p, mem, addr, data); + + // If address is out of range synchronise caches with device and return whether successful + if(addr >= (unsigned long) mem->size) + return avr_flush_cache(pgm, p); + + AVR_Cache *cp = avr_mem_is_eeprom_type(mem)? pgm->cp_eeprom: pgm->cp_flash; + + if(!cp->cont) // Init cache if needed + if(initCache(cp, pgm, p) < 0) + return LIBAVRDUDE_GENERAL_FAILURE; + + int cacheaddr = cacheAddress((int) addr, cp, mem); + if(cacheaddr < 0) + return LIBAVRDUDE_GENERAL_FAILURE; + + // Ensure cache page is there + if(loadCachePage(cp, pgm, p, mem, addr, cacheaddr, 0) < 0) + return LIBAVRDUDE_GENERAL_FAILURE; + + cp->cont[cacheaddr] = data; + + return LIBAVRDUDE_SUCCESS; +} + + +// Erase the chip and set the cache accordingly +int avr_chip_erase_cached(const PROGRAMMER *pgm, const AVRPART *p) { + CacheDesc_t mems[2] = { + { avr_locate_mem(p, "flash"), pgm->cp_flash, 1, -1, 0 }, + { avr_locate_mem(p, "eeprom"), pgm->cp_eeprom, 0, -1, 0 }, + }; + int rc; + + if((rc = pgm->chip_erase(pgm, p)) < 0) + return rc; + + for(size_t i = 0; i < sizeof mems/sizeof*mems; i++) { + AVRMEM *mem = mems[i].mem; + AVR_Cache *cp = mems[i].cp; + + if(!mem || !avr_has_paged_access(pgm, mem)) + continue; + + if(!cp->cont) // Init cache if needed + if(initCache(cp, pgm, p) < 0) + return LIBAVRDUDE_GENERAL_FAILURE; + + if(mems[i].isflash) { // flash + if(pgm->prog_modes & PM_SPM) { // reset cache to unknown + memset(cp->iscached, 0, cp->size/cp->page_size); + } else { // preset all pages as erased + memset(cp->copy, 0xff, cp->size); + memset(cp->cont, 0xff, cp->size); + memset(cp->iscached, 1, cp->size/cp->page_size); + } + } else { // EEPROM: test whether cached pages were zapped + bool erasedee = 0; + for(int pgno = 0, n = 0; n < cp->size; pgno++, n += cp->page_size) { + if(cp->iscached[pgno]) { + if(!_is_all_0xff(cp->copy + n, cp->page_size)) { // Page has EEPROM data? + if(avr_read_page_default(pgm, p, mem, n, cp->copy + n) < 0) + return LIBAVRDUDE_GENERAL_FAILURE; + erasedee = _is_all_0xff(cp->copy + n, cp->page_size); + break; + } + } + } + if(erasedee) { // EEPROM was erased, set cache correspondingly + memset(cp->copy, 0xff, cp->size); + memset(cp->cont, 0xff, cp->size); + memset(cp->iscached, 1, cp->size/cp->page_size); + } else { // discard previous writes, but leave cache + for(int pgno = 0, n = 0; n < cp->size; pgno++, n += cp->page_size) + if(cp->iscached[pgno]) + memcpy(cp->cont + n, cp->copy + n, cp->page_size); + } + } + } + + return LIBAVRDUDE_SUCCESS; +} + + +// Erase a page and synchronise it with the cache +int avr_page_erase_cached(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *mem, + unsigned int uaddr) { + + int addr = uaddr; + + if(!avr_has_paged_access(pgm, mem) || addr < 0 || addr >= mem->size) + return LIBAVRDUDE_GENERAL_FAILURE; + + if(mem->page_size == 1) { + if(fallback_write_byte(pgm, p, mem, uaddr, 0xff) < 0) + return LIBAVRDUDE_GENERAL_FAILURE; + } else { + if(silent_page_erase(pgm, p, mem, uaddr) < 0) + return LIBAVRDUDE_GENERAL_FAILURE; + } + + AVR_Cache *cp = avr_mem_is_eeprom_type(mem)? pgm->cp_eeprom: pgm->cp_flash; + + if(!cp->cont) // Init cache if needed + if(initCache(cp, pgm, p) < 0) + return LIBAVRDUDE_GENERAL_FAILURE; + + int cacheaddr = cacheAddress(addr, cp, mem); + if(cacheaddr < 0) + return LIBAVRDUDE_GENERAL_FAILURE; + + // Invalidate this cache page and read back, ie, we don't trust the page_erase() routine + cp->iscached[cacheaddr/cp->page_size] = 0; + + // Reload cache page + if(loadCachePage(cp, pgm, p, mem, (int) addr, cacheaddr, 0) < 0) + return LIBAVRDUDE_GENERAL_FAILURE; + + if(!_is_all_0xff(cp->cont + (cacheaddr & ~(cp->page_size-1)), cp->page_size)) + return LIBAVRDUDE_GENERAL_FAILURE; + + return LIBAVRDUDE_SUCCESS; +} + + +// Free cache(s) discarding any pending writes +int avr_reset_cache(const PROGRAMMER *pgm, const AVRPART *p_unused) { + AVR_Cache *mems[2] = { pgm->cp_flash, pgm->cp_eeprom, }; + + for(size_t i = 0; i < sizeof mems/sizeof*mems; i++) { + AVR_Cache *cp = mems[i]; + if(cp->cont) + free(cp->cont); + if(cp->copy) + free(cp->copy); + if(cp->iscached) + free(cp->iscached); + memset(cp, 0, sizeof*cp); + } + + return LIBAVRDUDE_SUCCESS; +} diff --git a/src/avrdude.1 b/src/avrdude.1 index cc05cf4c..41e4a6ad 100644 --- a/src/avrdude.1 +++ b/src/avrdude.1 @@ -18,7 +18,7 @@ .\" .\" $Id$ .\" -.Dd DATE November 22, 2021 +.Dd July 12, 2022 .Os .Dt AVRDUDE 1 .Sh NAME @@ -31,6 +31,7 @@ .Op Fl B Ar bitclock .Op Fl c Ar programmer-id .Op Fl C Ar config-file +.Op Fl A .Op Fl D .Op Fl e .Oo Fl E Ar exitspec Ns @@ -38,14 +39,12 @@ .Oc .Op Fl F .Op Fl i Ar delay -.Op Fl n logfile +.Op Fl l Ar logfile .Op Fl n .Op Fl O .Op Fl P Ar port .Op Fl q -.Op Fl s .Op Fl t -.Op Fl u .Op Fl U Ar memtype:op:filename:filefmt .Op Fl v .Op Fl x Ar extended_param @@ -76,10 +75,12 @@ so, for the based programmer, the MCU signals .Ql /RESET , .Ql SCK , -.Ql MISO +.Ql SDI and -.Ql MOSI -need to be connected to the parallel port. Optionally, some otherwise +.Ql SDO +of the AVR's SPI interface need to be connected to the +parallel port; older boards might use the labels MOSI for SDO or MISO for SDI. +Optionally, some otherwise unused output pins of the parallel port can be used to supply power for the MCU part, so it is also possible to construct a passive stand-alone programming device. Some status LEDs indicating the @@ -99,10 +100,10 @@ work at all, or to work abysmally slow. .Pp If you happen to have a Linux system with at least 4 hardware GPIOs available (like almost all embedded Linux boards) you can do without -any additional hardware - just connect them to the MOSI, MISO, RESET +any additional hardware - just connect them to the SDO, SDI, RESET and SCK pins on the AVR and use the linuxgpio programmer type. It bitbangs the lines using the Linux sysfs GPIO interface. Of course, care should -be taken about voltage level compatibility. Also, although not strictrly +be taken about voltage level compatibility. Also, although not strictly required, it is strongly advisable to protect the GPIO pins from overcurrent situations in some way. The simplest would be to just put some resistors in series or better yet use a 3-state buffer driver like @@ -115,7 +116,7 @@ programmer type can be used to directly connect to and program a chip using the built in interfaces on the computer. The requirements to use this type are that an SPI interface is exposed along with one GPIO pin. The GPIO serves as the reset output since the Linux SPI drivers -do not hold slave select down when a transfer is not occurring and thus +do not hold chip select down when a transfer is not occurring and thus it cannot be used as the reset pin. A readily available level translator should be used between the SPI bus/reset GPIO and the chip to avoid potentially damaging the computer's SPI controller in the @@ -148,9 +149,23 @@ programming mode. The programmer type is ``wiring''. Note that the -D option will likely be required in this case, because the bootloader will rewrite the program memory, but no true chip erase can be performed. .Pp -The Arduino (which is very similar to the STK500 1.x) is supported via -its own programmer type specification ``arduino''. This programmer works for -the Arduino Uno Rev3 or any AVR that runs the Optiboot bootloader. +Serial bootloaders that run a skeleton of the STK500 1.x protocol are +supported via their own programmer type ``arduino''. This programmer works +for the Arduino Uno Rev3 or any AVR that runs the Optiboot bootloader. +.Pp +Urprotocol is a leaner version of the STK500 1.x protocol that is designed +to be backwards compatible with STK500 v1.x, and allows bootloaders to be +much smaller, e.g., as implemented in the urboot project +https://github.com/stefanrueger/urboot. The programmer type ``urclock'' +caters for these urboot programmers. Owing to its backward compatibility, +bootloaders that can be served by the arduino programmer can normally +also be served by the urclock programmer. This may require specifying the +size of (to avrdude) unknown bootloaders in bytes using the +.Fl x Ar bootsize= +option, which is necessary for the urclock programmer to enable it to +protect the bootloader from being overwritten. If an unknown bootloader +has EEPROM read/write capability then the option -x eepromrw informs +avrdude -c urclock of that capability. .Pp The BusPirate is a versatile tool that can also be used as an AVR programmer. A single BusPirate can be connected to up to 3 independent AVRs. See @@ -179,7 +194,7 @@ has a revision 1 hardware and firmware version of at least 5.37 (decimal). For ATxmega devices, the JTAGICE3 is supported in PDI mode. .Pp Atmel-ICE (ARM/AVR) is supported in all modes (JTAG, PDI for Xmega, debugWIRE, -ISP). +ISP, UPDI). .Pp Atmel's XplainedPro boards, using the EDBG protocol (CMSIS-DAP compatible), are supported using the "jtag3" programmer type. @@ -210,13 +225,14 @@ has been compiled in .Nm avrdude , the avrftdi device adds support for many programmers using FTDI's 2232C/D/H and 4232H parts running in MPSSE mode, which hard-codes (in the chip) -SCK to bit 1, MOSI to bit 2, and MISO to bit 3. Reset is usually bit 4. +SCK to bit 1, SDO to bit 2, and SDI to bit 3. Reset is usually bit 4. .Pp The Atmel DFU bootloader is supported in both, FLIP protocol version 1 (AT90USB* and ATmega*U* devices), as well as version 2 (Xmega devices). See below for some hints about FLIP version 1 protocol behaviour. .Pp -The MPLAB(R) PICkit 4 and MPLAB(R) SNAP, are supported in ISP, PDI and UPDI mode. +The MPLAB(R) PICkit 4 and MPLAB(R) SNAP, are supported in JTAG, TPI, ISP, +PDI and UPDI mode. The Curiosity Nano board is supported in UPDI mode. It is dubbed .Dq PICkit on Board , thus the name @@ -225,7 +241,7 @@ thus the name SerialUPDI programmer implementation is based on Microchip's .Em pymcuprog Li https://github.com/microchip-pic-avr-tools/pymcuprog utility, but it also contains some performance improvements included in -Spence Kohde's +Spence Konde's .Em DxCore Arduino core .Li https://github.com/SpenceKonde/DxCore . @@ -253,7 +269,7 @@ The Teensy bootloader is supported for all AVR boards. As the bootloader does not support reading from flash memory, use the .Fl V -option to prevent AVRDUDE from verifing the flash memory. +option to prevent AVRDUDE from verifying the flash memory. See the section on .Em extended parameters for Teensy specific options. @@ -294,7 +310,7 @@ file. Finally, a ``terminal'' mode is available that allows one to interactively communicate with the MCU, and to display or program individual memory cells. On the STK500 and STK600 programmer, several operational parameters (target supply -voltage, target Aref voltage, master clock) can be examined and changed +voltage, target Aref voltage, programming clock) can be examined and changed from within terminal mode as well. .Ss Options In order to control all the different operation modi, a number of options @@ -302,10 +318,15 @@ need to be specified to .Nm avrdude . .Bl -tag -offset indent -width indent .It Fl p Ar partno -This is the only option that is mandatory for every invocation of -.Nm avrdude . -It specifies the type of the MCU connected to the programmer. These are read from the config file. -For currently supported MCU types use ? as partno, this will print a list of partno ids and official part names on the terminal. (Both can be used with the -p option.) +This option specifies the MCU connected to the programmer. The MCU +descriptions are read from the config file. For currently supported MCUs use +? as partno, which will print a list of partno ids and official part names. +Both can be used with the -p option. If -p ? is specified with a specific +programmer, see -c below, then only those parts are output that the +programmer expects to be able to handle, together with the programming +interface(s) that can be used in that combination. In reality there can be +deviations from this list, particularly if programming is directly via a +bootloader. .Pp Following parts need special attention: .Bl -tag -width "ATmega1234" @@ -324,22 +345,29 @@ and bit-bang programmers. The ATtiny11 can only be programmed in high-voltage serial mode. .El +.It Fl p Ar wildcard/flags +Run developer options for MCUs that are matched by wildcard. Whilst +their main use is for developers some flags can be of utility for users, e.g., +avrdude -p m328p/S outputs AVRDUDE's understanding of ATmega328P MCU properties; +for more information run avrdude -p x/h. .It Fl b Ar baudrate Override the RS-232 connection baud rate specified in the respective programmer's entry of the configuration file. .It Fl B Ar bitclock -Specify the bit clock period for the JTAG interface or the ISP clock (JTAG ICE only). -The value is a floating-point number in microseconds. -Alternatively, the value might be suffixed with "Hz", "kHz", or "MHz", -in order to specify the bit clock frequency, rather than a period. -The default value of the JTAG ICE results in about 1 microsecond bit -clock period, suitable for target MCUs running at 4 MHz clock and -above. -Unlike certain parameters in the STK500, the JTAG ICE resets all its -parameters to default values when the programming software signs -off from the ICE, so for MCUs running at lower clock speeds, this -parameter must be specified on the command-line. +Specify the bit clock period for the JTAG, PDI, TPI, UPDI, or ISP +interface. The value is a floating-point number in microseconds. +Alternatively, the value might be suffixed with "Hz", "kHz" or +"MHz" in order to specify the bit clock frequency rather than a +period. Some programmers default their bit clock value to a 1 +microsecond bit clock period, suitable for target MCUs running at 4 +MHz clock and above. Slower MCUs need a correspondingly higher bit +clock period. Some programmers reset their bit clock value to the +default value when the programming software signs off, whilst others +store the last used bit clock value. It is recommended to always +specify the bit clock if read/write speed is important. You can use the 'default_bitclock' keyword in your +.Pa ${HOME}/.config/avrdude/avrdude.rc +or .Pa ${HOME}/.avrduderc file to assign a default value to keep from having to specify this option on every invocation. @@ -353,11 +381,23 @@ through the use of a config file to make work with different programmers as long as the programmer supports the Atmel AVR serial program method. You can use the 'default_programmer' keyword in your +.Pa ${HOME}/.config/avrdude/avrdude.rc +or .Pa ${HOME}/.avrduderc file to assign a default programmer to keep from having to specify this option on every invocation. A full list of all supported programmers is output to the terminal by using ? as programmer-id. +If -c ? is specified with a specific part, see +-p above, then only those programmers are output that expect +to be able to handle this part, together with the programming interface(s) that can be +used in that combination. In reality there can be deviations from this list, +particularly if programming is directly via a bootloader. +.It Fl c Ar wildcard/flags +Run developer options for programmers that are matched by wildcard. Whilst +their main use is for developers some flags can be of utility for users, e.g., +avrdude -c usbtiny/S shows AVRDUDE's understanding of usbtiny's properties; +for more information run avrdude -c x/h. .It Fl C Ar config-file Use the specified config file to load configuration data. This file contains all programmer and part definitions that @@ -376,6 +416,20 @@ files. This can be used to add entries to the configuration without patching your system wide configuration file. It can be used several times, the files are read in same order as given on the command line. +.It Fl A +Disable the automatic removal of trailing-0xFF sequences in file +input that is to be programmed to flash and in AVR reads from +flash memory. Normally, trailing 0xFFs can be discarded, as flash +programming requires the memory be erased to 0xFF beforehand. +.Fl A +should be used when the programmer hardware, or bootloader +software for that matter, does not carry out chip erase and +instead handles the memory erase on a page level. Popular +Arduino bootloaders exhibit this behaviour; for this reason +.Fl A +is engaged by default when specifying +. Fl c +arduino. .It Fl D Disable auto erase for flash. When the .Fl U @@ -389,6 +443,10 @@ use page erase before writing each page so no explicit chip erase is required. Note however that any page not affected by the current operation will retain its previous contents. +Setting +.Fl D +implies +.Fl A. .It Fl e Causes a chip erase to be executed. This will reset the contents of the flash ROM and EEPROM to the value @@ -401,7 +459,7 @@ contents would exclusively cause bits to be programmed from the value .Ql 1 to .Ql 0 . -Note that in order to reprogram EERPOM cells, no explicit prior chip +Note that in order to reprogram EEPROM cells, no explicit prior chip erase is required since the MCU provides an auto-erase cycle in that case before programming the cell. .It Xo Fl E Ar exitspec Ns @@ -434,11 +492,17 @@ MCU type, a previous invocation of .Nm with this option specified is one of the possible ways to guarantee this condition. +.Em reset +is supported by the linuxspi and flip2 programmer options, as well as all +parallel port based programmers. .It Ar noreset The .Ql /RESET line will be deactivated at program exit, thus allowing the MCU target program to run while the programming hardware remains connected. +.Em noreset +is supported by the linuxspi and flip2 programmer options, as well as all +parallel port based programmers. .It Ar vcc This option will leave those parallel port pins active .Pq \&i. \&e. Em high @@ -474,6 +538,8 @@ actual connection to a target controller), this option can be used together with .Fl t to continue in terminal mode. +Moreover, the option allows to continue despite failed initialization +of connection between a programmer and a target. .It Fl i Ar delay For bitbang-type programmers, delay for approximately .Ar delay @@ -606,7 +672,10 @@ Note: The ability to handle IPv6 hostnames and addresses is limited to Posix systems (by now). .It Fl q Disable (or quell) output of the progress bar while reading or writing -to the device. Specify it a second time for even quieter operation. +to the device. Specify it more often for even quieter operations. +.It Fl s, u +These options used to control the obsolete "safemode" feature which +is no longer present. They are silently ignored for backwards compatibility. .It Fl t Tells .Nm @@ -690,6 +759,8 @@ can be one of: .Bl -tag -width sss .It Ar i Intel Hex +.It Ar I +Intel Hex with comments on download and tolerance of checksum errors on upload .It Ar s Motorola S-record .It Ar r @@ -714,14 +785,17 @@ fuse bit settings. hexadecimal; each value will get the string .Em 0x prepended. +Only valid on output. .It Ar o octal; each value will get a .Em 0 prepended unless it is less than 8 in which case it gets no prefix. +Only valid on output. .It Ar b binary; each value will get the string .Em 0b prepended. +Only valid on output. .El .Pp The default is to use auto detection for input files, and raw binary @@ -771,30 +845,128 @@ abbreviated to the shortest unambiguous form. Terminal mode provides a command history using .Xr readline 3 , so previously entered command lines can be recalled and edited. The -following commands are currently implemented: +following commands are currently implemented for all programmers: .Bl -tag -offset indent -width indent -.It Ar dump memtype addr nbytes +.It Ar dump memory addr len Read -.Ar nbytes +.Ar len bytes from the specified memory area, and display them in the usual hexadecimal and ASCII form. -.It Ar dump +.It Ar dump memory addr ... +Read all bytes from the specified memory starting at address +.Ar addr, +and display them. +.It Ar dump memory addr +Read 256 bytes from the specified memory area, and display them. +.It Ar dump memory ... +Read all bytes from the specified memory, and display them. +.It Ar dump memory Continue dumping the memory contents for another -.Ar nbytes -where the previous +.Ar 256 +bytes where the previous .Ar dump command left off. -.It Ar write memtype addr byte1 ... byteN +.It Ar read +can be used as an alias for dump +.It Ar write memory addr data[,] {data[,]} Manually program the respective memory cells, starting at address .Ar addr , -using the values -.Ar byte1 -through -.Ar byteN . -This feature is not implemented for bank-addressed memories such as -the flash memory of ATMega devices. +using the data items provided. +The terminal implements reading from and writing to flash and EEPROM type +memories normally through a cache and paged access functions. All other +memories are directly written to without use of a cache. Some +older parts without paged access will also have flash and EEPROM directly +accessed without cache. +.Pp +.Ar data +can be hexadecimal, octal or decimal integers, floating point numbers +or C-style strings and characters. For integers, an optional case-insensitive +suffix specifies the data size: HH 8 bit, H/S 16 bit, L 32 bit, LL 64 bit. +Suffix D indicates a 64-bit double, F a 32-bit float, whilst a floating point +number without suffix defaults to 32-bit float. Hexadecimal floating point +notation is supported. An ambiguous trailing suffix, e.g., 0x1.8D, is read as +no-suffix float where D is part of the mantissa; use a zero exponent 0x1.8p0D +to clarify. +.Pp +An optional U suffix makes integers unsigned. Ordinary 0x hex integers are +always treated as unsigned. +0x or -0x hex numbers are treated as signed +unless they have a U suffix. Unsigned integers cannot be larger than 2^64-1. +If n is an unsigned integer then -n is also a valid unsigned integer as in C. +Signed integers must fall into the [-2^63, 2^63-1] range or a correspondingly +smaller range when a suffix specifies a smaller type. +.Pp +Ordinary 0x hex integers with n hex digits (counting leading zeros) use the +smallest size of one, two, four and eight bytes that can accommodate any +n-digit hex integer. If an integer suffix specifies a size explicitly the +corresponding number of least significant bytes are written, and a warning +shown if the number does not fit into the desired representation. Otherwise, +unsigned integers occupy the smallest of one, two, four or eight bytes +needed. Signed numbers are allowed to fit into the smallest signed or +smallest unsigned representation: For example, 255 is stored as one byte as +255U would fit in one byte, though as a signed number it would not fit into a +one-byte interval [-128, 127]. The number -1 is stored in one byte whilst -1U +needs eight bytes as it is the same as 0xFFFFffffFFFFffffU. +.Pp +One trailing comma at the end of +.Ar data +items is ignored to facilitate copy & paste of lists. +.It Ar write memory addr len data[,] {data[,]} ... +The ellipsis ... form writes bytes padded by repeating the last +.Ar data +item. +.It Ar flush +Synchronise with the device all pending cached writes to EEPROM or flash. +With some programmer and part combinations, flash (and sometimes EEPROM, +too) looks like a NOR memory, ie, one can only write 0 bits, not 1 bits. +When this is detected, either page erase is deployed (e.g., with parts that +have PDI/UPDI interfaces), or if that is not available, both EEPROM and +flash caches are fully read in, a chip erase command is issued and both +EEPROM and flash are written back to the device. Hence, it can take +minutes to ensure that a single previously cleared bit is set and, +therefore, this command should be used sparingly. +.It Ar abort +Normally, caches are only ever +actually written to the device when using the +.Ar flush +command, at the end of the terminal session after typing +.Ar quit , +or after EOF on input is encountered. The abort command resets +the cache discarding all previous writes to the flash and EEPROM cache. .It Ar erase -Perform a chip erase. +Perform a chip erase and discard all pending writes to EEPROM and flash. +.It Ar sig +Display the device signature bytes. +.It Ar part +Display the current part settings and parameters. Includes chip +specific information including all memory types supported by the +device, read/write timing, etc. +.It Ar verbose Op Ar level +Change (when +.Ar level +is provided), or display the verbosity level. +The initial verbosity level is controlled by the number of +.Fl v +options given on the commandline. +.It Ar quell Op Ar level +Change (when +.Ar level +is provided), or display the quell level. 1 is used to suppress progress reports. +2 or higher yields in progressively quieter operations. +The initial quell level is controlled by the number of +.Fl q +options given on the commandline. +.It Ar \&? +.It Ar help +Give a short on-line summary of the available commands. +.It Ar quit +Leave terminal mode and thus +.Nm avrdude . +.El +.Pp +The terminal commands below may only be implemented on some specific programmers, and may therefore not be available in the help menu. +.Bl -tag -offset indent -width indent +.It pgerase memory addr +Erase one page of the memory specified. .It Ar send b1 b2 b3 b4 Send raw instruction codes to the AVR device. If you need access to a feature of an AVR part that is not directly supported by @@ -803,24 +975,18 @@ this command allows you to use it, even though .Nm does not implement the command. When using direct SPI mode, up to 3 bytes can be omitted. -.It Ar sig -Display the device signature bytes. .It Ar spi Enter direct SPI mode. The .Em pgmled -pin acts as slave select. -.Em Only supported on parallel bitbang programmers, and partially by USBtiny. -.It Ar part -Display the current part settings and parameters. Includes chip -specific information including all memory types supported by the -device, read/write timing, etc. +pin acts as chip select. +.Em Supported on parallel bitbang programmers, and partially by USBtiny. .It Ar pgm Return to programming mode (from direct SPI mode). .It Ar vtarg voltage Set the target's supply voltage to .Ar voltage Volts. -.Em Only supported on the STK500 and STK600 programmer. +.Em Supported on the STK500 and STK600 programmer. .It Ar varef Oo Ar channel Oc Ar voltage Set the adjustable voltage source to .Ar voltage @@ -832,9 +998,9 @@ On the Atmel STK600, two reference voltages are available, which can be selected by the optional .Ar channel argument (either 0 or 1). -.Em Only supported on the STK500 and STK600 programmer. +.Em Supported on the STK500 and STK600 programmer. .It Ar fosc freq Ns Op M Ns \&| Ns k -Set the master oscillator to +Set the programming oscillator to .Ar freq Hz. An optional trailing letter @@ -842,17 +1008,16 @@ An optional trailing letter multiplies by 1E6, a trailing letter .Ar \&k by 1E3. -.Em Only supported on the STK500 and STK600 programmer. +.Em Supported on the STK500 and STK600 programmer. .It Ar fosc off -Turn the master oscillator off. -.Em Only supported on the STK500 and STK600 programmer. +Turn the programming oscillator off. +.Em Supported on the STK500 and STK600 programmer. .It Ar sck period -.Em STK500 and STK600 programmer only: +.Em STK500 and STK600 programmer: Set the SCK clock period to .Ar period microseconds. -.Pp -.Em JTAG ICE only: +.Em JTAG ICE: Set the JTAG ICE bit clock period to .Ar period microseconds. @@ -862,24 +1027,12 @@ software signs off from the JTAG ICE. This parameter can also be used on the JTAG ICE mkII, JTAGICE3, and Atmel-ICE to specify the ISP clock period when operating the ICE in ISP mode. .It Ar parms -.Em STK500 and STK600 programmer only: -Display the current voltage and master oscillator parameters. -.Pp -.Em JTAG ICE only: +.Em STK500 and STK600 programmer: +Display the current voltage and programming oscillator parameters. +.Em JTAG ICE: Display the current target supply voltage and JTAG bit clock rate/period. -.It Ar verbose Op Ar level -Change (when -.Ar level -is provided), or display the verbosity level. -The initial verbosity level is controlled by the number of -.Fl v -options given on the commandline. -.It Ar \&? -.It Ar help -Give a short on-line summary of the available commands. -.It Ar quit -Leave terminal mode and thus -.Nm avrdude . +.Em Other programmers: +Display the programmer specific parameters. .El .Ss Default Parallel port pin connections (these can be changed, see the @@ -891,8 +1044,8 @@ ll. 2-5 Vcc (optional power supply to MCU) 7 /RESET (to MCU) 8 SCK (to MCU) -9 MOSI (to MCU) -10 MISO (from MCU) +9 SDO (to MCU) +10 SDI (from MCU) 18-25 GND .TE .Ss debugWire limitations @@ -959,9 +1112,13 @@ versions of the bootloader. .It Ar JTAG ICE mkII .It Ar JTAGICE3 .It Ar Atmel-ICE +.It Ar Power Debugger +.It Ar PICkit 4 +.It Ar MPLAB SNAP .It Ar AVR Dragon -When using the JTAG ICE mkII, JTAGICE3, Atmel-ICE or AVR Dragon in JTAG mode, the -following extended parameter is accepted: +When using the JTAG ICE mkII, JTAGICE3, Atmel-ICE, PICkit 4, MPLAB SNAP, +Power Debugger or AVR Dragon in JTAG mode, the following extended parameter +is accepted: .Bl -tag -offset indent -width indent .It Ar jtagchain=UB,UA,BB,BA Setup the JTAG scan chain for @@ -976,6 +1133,14 @@ bits after the target AVR, respectively. Each AVR unit within the chain shifts by 4 bits. Other JTAG units might require a different bit shift count. .El +.Pp +The PICkit 4 and the Power Debugger also supports high-voltage UPDI programming. +This is used to enable a UPDI pin that has previously been set to RESET or +GPIO mode. High-voltage UPDI can be utilized by using an extended parameter: +.Bl -tag -offset indent -width indent +.It Ar hvupdi +Enable high-voltage UPDI initialization for targets that supports this. +.El .It Ar AVR910 .Bl -tag -offset indent -width indent .It Ar devcode=VALUE @@ -1007,12 +1172,119 @@ programmer creates errors during initial sequence. Specify how many connection retry attemps to perform before exiting. Defaults to 10 if not specified. .El +.It Ar Urclock +.Bl -tag -offset indent -width indent +.It Ar showall +Show all info for the connected part, then exit. The -xshow... options +below can be used to assemble a bespoke response consisting of a subset +(or only one item) of all available relevant information about the +connected part and bootloader. +.It Ar showid +Show a unique Urclock ID stored in either flash or EEPROM of the MCU, then exit. +.It Ar id=.. +Historically, the Urclock ID was a six-byte unique little-endian number +stored in Urclock boards at EEPROM address 257. The location of this +number can be set by the -xid=.. extended parameter. E +stands for EEPROM and F stands for flash. A negative address addr counts +from the end of EEPROM and flash, respectively. The length len of the +Urclock ID can be between 1 and 8 bytes. +.It Ar showdate +Show the last-modified date of the input file for the flash application, +then exit. If the input file was stdin, the date will be that of the +programming. Date and filename are part of the metadata that the urclock +programmer stores by default in high flash just under the bootloader; see also +-xnometadata. +.It Ar showfilename +Show the input filename (or title) of the last flash writing session, then exit. +.It Ar title= +When set, will be used in lieu of the input filename. The maximum +string length for the title/filename field is 254 bytes including +terminating nul. +.It Ar showapp +Show the size of the programmed application, then exit. +.It Ar showstore +Show the size of the unused flash between the application and metadata, then exit. +.It Ar showmeta +Show the size of the metadata just below the bootloader, then exit. +.It Ar showboot +Show the size of the bootloader, then exit. +.It Ar showversion +Show bootloader version and capabilities, then exit. +.It Ar showvector +Show the vector number and name of the interrupt table vector used by the +bootloader for starting the application, then exit. For hardware-supported +bootloaders this will be vector 0 (Reset), and for vector bootloaders this +will be any other vector number of the interrupt vector table or the slot +just behind the vector table with the name VBL_ADDITIONAL_VECTOR. +.It Ar showpart +Show the part for which the bootloader was compiled, then exit. +.It Ar bootsize= +Manual override for bootloader size. Urboot bootloaders put the number of +used bootloader pages into a table at the top of the bootloader section, +ie, typically top of flash, so the urclock programmer can look up the +bootloader size itself. In backward-compatibility mode, when programming +via other bootloaders, this option can be used to tell the programmer the +size, and therefore the location, of the bootloader. +.It Ar vectornum= +Manual override for vector number. Urboot bootloaders put the vector +number used by a vector bootloader into a table at the top of flash, so +this option is normally not needed for urboot bootloaders. However, it is +useful in backward-compatibility mode (or when the urboot bootloader does +not offer flash read). Specifying a vector number in these circumstances +implies a vector bootloader whilst the default assumption would be a +hardware-supported bootloader. +.It Ar eepromrw +Manual override for asserting EEPROM read/write capability. Not normally +needed for urboot bootloaders, but useful for in backward-compatibility +mode if the bootloader offers EEPROM read/write. +.It Ar emulate_ce +If an urboot bootloader does not offer a chip erase command it will tell +the urclock programmer so during handshake. In this case the urclock +programmer emulates a chip erase, if warranted by user command line +options, by filling the remainder of unused flash below the bootloader +with 0xff. If this option is specified, the urclock programmer will assume +that the bootloader cannot erase the chip itself. The option is useful +for backwards-compatible bootloaders that do not implement chip erase. +.It Ar restore +Upload unchanged flash input files and trim below the bootloader if +needed. This is most useful when one has a backup of the full flash and +wants to play that back onto the device. No metadata are written in this +case and no vector patching happens either if it is a vector bootloader. +However, for vector bootloaders, even under the option -xrestore an +input file will not be uploaded for which the reset vector does not point +to the vector bootloader. This is to avoid writing an input file to the +device that would render the vector bootloader not functional as it would +not be reached after reset. +.It Ar initstore +On writing to flash fill the store space between the flash application and +the metadata section with 0xff. +.It Ar nofilename +On writing to flash do not store the application input filename (nor a title). +.It Ar nodate +On writing to flash do not store the application input filename (nor a +title) and no date either. +.It Ar nometadata +On writing to flash do not store any metadata. The full flash below the +bootloader is available for the application. In particular, no data store +frame is programmed. +.It Ar delay= +Add a ms delay after reset. This can be useful if a board takes a +particularly long time to exit from external reset. can be negative, +in which case the default 120 ms delay after issuing reset will be +shortened accordingly. +.It Ar strict +Urclock has a faster, but slightly different strategy than -c arduino to +synchronise with the bootloader; some stk500v1 bootloaders cannot cope +with this, and they need the -xstrict option. +.It Ar help +Show this help menu and exit +.El .It Ar buspirate .Bl -tag -offset indent -width indent .It Ar reset={cs,aux,aux2} The default setup assumes the BusPirate's CS output pin connected to the RESET pin on AVR side. It is however possible to have multiple AVRs -connected to the same BP with MISO, MOSI and SCK lines common for all of them. +connected to the same BP with SDI, SDO and SCK lines common for all of them. In such a case one AVR should have its RESET connected to BusPirate's .Pa CS pin, second AVR's RESET connected to BusPirate's @@ -1125,9 +1397,9 @@ Connection to the PICkit2 programmer: RST - VPP/MCLR (1) VDD - VDD Target (2) -- possibly optional if AVR self powered GND - GND (3) -MISO - PGD (4) +SDI - PGD (4) SCLK - PDC (5) -MOSI - AUX (6) +SDO - AUX (6) .Ed Extended commandline parameters: @@ -1180,14 +1452,22 @@ specific. .Pp When not provided, driver/OS default value will be used. .El +.It Ar linuxspi +Extended parameter: +.Bl -tag -offset indent -width indent +.It Ar disable_no_cs +Ensures the programmer does not use the SPI_NO_CS bit for the SPI +driver. This parameter is useful for kernels that do not support +the CS line being managed outside the application. +.El .El .Sh FILES .Bl -tag -offset indent -width /dev/ppi0XXX .It Pa /dev/ppi0 -default device to be used for communication with the programming +Default device to be used for communication with the programming hardware .It Pa avrdude.conf -programmer and parts configuration file +Programmer and parts configuration file .Pp On Windows systems, this file is looked up in the same directory as the executable file. @@ -1196,14 +1476,22 @@ On all other systems, the file is first looked up in relative to the path of the executable, then in the same directory as the executable itself, and finally in the system default location .Pa ${PREFIX}/etc/avrdude.conf . +.It Pa ${XDG_CONFIG_HOME}/avrdude/avrdude.rc +Local programmer and parts configuration file (per-user overrides); it follows the same syntax as +.Pa avrdude.conf ; +if the +.Pa ${XDG_CONFIG_HOME} +environment variable is not set or empty, the directory +.Pa ${HOME}/.config/ +is used instead. .It Pa ${HOME}/.avrduderc -programmer and parts configuration file (per-user overrides) +Alternative location of the per-user configuration file if above file does not exist .It Pa ~/.inputrc Initialization file for the .Xr readline 3 library -.It Pa ${PREFIX}/share/doc/avrdude/avrdude.pdf -Schematic of programming hardware +.It Pa /doc/avrdude/avrdude.pdf +User manual .El .\" .Sh EXAMPLES .Sh DIAGNOSTICS @@ -1267,7 +1555,7 @@ The USBasp and USBtinyISP drivers do not offer any option to distinguish multipl devices connected simultaneously, so effectively only a single device is supported. .Pp -Slave Select must be externally held low for direct SPI when +Chip Select must be externally held low for direct SPI when using USBtinyISP, and send must be a multiple of four bytes. .Pp The avrftdi driver allows one to select specific devices using any combination of vid,pid diff --git a/src/avrdude.conf.in b/src/avrdude.conf.in index 362b6167..43dbe767 100644 --- a/src/avrdude.conf.in +++ b/src/avrdude.conf.in @@ -12,68 +12,91 @@ # # DO NOT MODIFY THIS FILE. Modifications will be overwritten the next # time a "make install" is run. For user-specific additions, use the -# "-C +filename" commandline option. +# "-C +filename" command line option. # # Possible entry formats are: # # programmer -# parent # optional parent -# id = [, [, ] ...] ; # are quoted strings -# desc = ; # quoted string -# type = ; # programmer type, quoted string -# # supported programmer types can be listed by "-c ?type" -# connection_type = parallel | serial | usb -# baudrate = ; # baudrate for avr910-programmer -# vcc = [, ... ] ; # pin number(s) -# buff = [, ... ] ; # pin number(s) -# reset = ; # pin number -# sck = ; # pin number -# mosi = ; # pin number -# miso = ; # pin number -# errled = ; # pin number -# rdyled = ; # pin number -# pgmled = ; # pin number -# vfyled = ; # pin number -# usbvid = ; # USB VID (Vendor ID) -# usbpid = [, ...] # USB PID (Product ID) (1) -# usbdev = ; # USB interface or other device info -# usbvendor = ; # USB Vendor Name -# usbproduct = ; # USB Product Name -# usbsn = ; # USB Serial Number +# parent # optional parent +# id = [, ... ] ; # are quoted strings +# desc = ; # quoted string +# type = ; # programmer type, quoted string +# # supported types can be listed by "-c ?type" +# prog_modes = PM_ {| PM_} # interfaces, eg, PM_SPM|PM_PDI (1) +# connection_type = parallel | serial | usb | spi +# baudrate = ; # baudrate for avr910-programmer +# vcc = [, ... ] ; # pin number(s) +# buff = [, ... ] ; # pin number(s) +# reset = ; # pin number +# sck = ; # pin number +# sdo = ; # pin number +# sdi = ; # pin number +# errled = ; # pin number +# rdyled = ; # pin number +# pgmled = ; # pin number +# vfyled = ; # pin number +# usbvid = ; # USB VID (Vendor ID) +# usbpid = [, ...] ; # USB PID (Product ID) (2) +# usbdev = ; # USB interface or other device info +# usbvendor = ; # USB Vendor Name +# usbproduct = ; # USB Product Name +# usbsn = ; # USB Serial Number +# hvupdi_support = [, , ... ] ; # UPDI HV Variants Support +# ; # -# To invert a bit, use = ~ , the spaces are important. -# For a pin list all pins must be inverted. -# A single pin can be specified as usual = ~ , for lists -# specify it as follows = ~ ( [, ... ] ) . -# -# (1) Not all programmer types can process a list of PIDs. -# ; +# # To invert a pin use = ~ +# # To invert a pin list (all pins get inverted) use ~ ( [, ... ] ) +# # +# # (1) The following program modes are known: +# # - PM_SPM: Bootloaders, self-programming with SPM opcodes or NVM Controllers +# # - PM_TPI: Tiny Programming Interface (t4, t5, t9, t10, t20, t40, t102, t104) +# # - PM_ISP: SPI programming for In-System Programming (almost all classic parts) +# # - PM_PDI: Program and Debug Interface (xmega parts) +# # - PM_UPDI: Unified Program and Debug Interface +# # - PM_HVSP: High Voltage Serial Programming (some classic parts) +# # - PM_HVPP: High Voltage Parallel Programming (most non-HVSP classic parts) +# # - PM_debugWIRE: Simpler alternative to JTAG (a subset of HVPP/HVSP parts) +# # - PM_JTAG: Joint Test Action Group standard (some classic parts) +# # - PM_JTAGmkI: Subset of PM_JTAG, older parts, Atmel ICE mkI +# # - PM_XMEGAJTAG: JTAG, some XMEGA parts +# # - PM_AVR32JTAG: JTAG for 32-bit AVRs +# # - PM_aWire: AVR32 parts +# # +# # (2) Not all programmer types can process a list of PIDs # # part -# id = ; # quoted string # desc = ; # quoted string -# has_jtag = ; # part has JTAG i/f -# has_debugwire = ; # part has debugWire i/f -# has_pdi = ; # part has PDI i/f -# has_updi = ; # part has UPDI i/f -# has_tpi = ; # part has TPI i/f -# devicecode = ; # deprecated, use stk500_devcode +# id = ; # quoted string +# family_id = ; # quoted string, eg, "megaAVR" or "tinyAVR" +# prog_modes = PM_ {| PM_} # interfaces, eg, PM_SPM|PM_ISP|PM_HVPP|PM_debugWIRE +# mcuid = ; # unique id in 0..2039 for 8-bit AVRs +# n_interrupts = ; # number of interrupts, used for vector bootloaders +# n_page_erase = ; # if set, number of pages erased during SPM erase +# n_boot_sections = ; # Number of boot sections +# boot_section_size = ; # Size of (smallest) boot section, if any +# hvupdi_variant = ; # numeric -1 (n/a) or 0..2 +# devicecode = ; # deprecated, use stk500_devcode # stk500_devcode = ; # numeric # avr910_devcode = ; # numeric +# has_jtag = ; # part has JTAG i/f (deprecated, use prog_modes) +# has_debugwire = ; # part has debugWire i/f (deprecated, use prog_modes) +# has_pdi = ; # part has PDI i/f (deprecated, use prog_modes) +# has_updi = ; # part has UPDI i/f (deprecated, use prog_modes) +# has_tpi = ; # part has TPI i/f (deprecated, use prog_modes) +# is_avr32 = ; # AVR32 part (deprecated, use prog_modes) +# is_at90s1200 = ; # AT90S1200 part # signature = ; # signature bytes # usbpid = ; # DFU USB PID # chip_erase_delay = ; # micro-seconds -# reset = dedicated | io; -# retry_pulse = reset | sck; -# pgm_enable = ; -# chip_erase = ; +# reset = dedicated | io ; +# retry_pulse = reset | sck ; # chip_erase_delay = ; # chip erase delay (us) # # STK500 parameters (parallel programming IO lines) # pagel = ; # pin name in hex, i.e., 0xD7 # bs2 = ; # pin name in hex, i.e., 0xA0 # serial = ; # can use serial downloading -# parallel = ; # can use par. programming -# # STK500v2 parameters, to be taken from Atmel's XML files +# parallel = ; # can use par. programming +# # STK500v2 parameters, to be taken from Atmel's ATDF files # timeout = ; # stabdelay = ; # cmdexedelay = ; @@ -84,52 +107,63 @@ # predelay = ; # postdelay = ; # pollmethod = ; -# mode = ; -# delay = ; -# blocksize = ; -# readsize = ; # hvspcmdexedelay = ; -# # STK500v2 HV programming parameters, from XML -# pp_controlstack = , , ...; # PP only -# hvsp_controlstack = , , ...; # HVSP only -# hventerstabdelay = ; -# progmodedelay = ; # PP only -# latchcycles = ; -# togglevtg = ; -# poweroffdelay = ; -# resetdelayms = ; -# resetdelayus = ; -# hvleavestabdelay = ; -# resetdelay = ; -# synchcycles = ; # HVSP only -# chiperasepulsewidth = ; # PP only -# chiperasepolltimeout = ; -# chiperasetime = ; # HVSP only -# programfusepulsewidth = ; # PP only -# programfusepolltimeout = ; -# programlockpulsewidth = ; # PP only -# programlockpolltimeout = ; -# # JTAG ICE mkII parameters, also from XML files +# # STK500v2 HV programming parameters, from ATDFs +# pp_controlstack = , , ... ; # PP only +# hvsp_controlstack = , , ... ; # HVSP only +# flash_instr = , , ; +# eeprom_instr = , , ... ; +# hventerstabdelay = ; +# progmodedelay = ; # PP only +# latchcycles = ; +# togglevtg = ; +# poweroffdelay = ; +# resetdelayms = ; +# resetdelayus = ; +# hvleavestabdelay = ; +# resetdelay = ; +# synchcycles = ; # HVSP only +# chiperasepulsewidth = ; # PP only +# chiperasepolltimeout = ; +# chiperasetime = ; # HVSP only +# programfusepulsewidth = ; # PP only +# programfusepolltimeout = ; +# programlockpulsewidth = ; # PP only +# programlockpolltimeout = ; +# # debugWIRE and/or JTAG ICE mkII parameters, also from ATDF files # allowfullpagebitstream = ; # enablepageprogramming = ; -# idr = ; # IO addr of IDR (OCD) reg. -# rampz = ; # IO addr of RAMPZ reg. -# spmcr = ; # mem addr of SPMC[S]R reg. -# eecr = ; # mem addr of EECR reg. -# # (only when != 0x3c) -# is_at90s1200 = ; # AT90S1200 part -# is_avr32 = ; # AVR32 part +# idr = ; # IO addr of IDR (OCD) reg +# rampz = ; # IO addr of RAMPZ reg +# spmcr = ; # mem addr of SPMC[S]R reg +# eecr = ; # mem addr of EECR reg only when != 0x3f +# eind = ; # mem addr of EIND reg +# mcu_base = ; +# nvm_base = ; +# ocd_base = ; +# ocdrev = ; +# pgm_enable = ; +# chip_erase = ; +# # parameters for bootloaders +# autobaud_sync = ; # autobaud detection byte, default 0x30 # # memory -# paged = ; # yes / no +# paged = ; # yes/no (flash only, do not use for EEPROM) +# offset = ; # memory offset # size = ; # bytes # page_size = ; # bytes # num_pages = ; # numeric +# n_word_writes = ; # TPI only: if set, number of words to write # min_write_delay = ; # micro-seconds # max_write_delay = ; # micro-seconds -# readback_p1 = ; # byte value -# readback_p2 = ; # byte value -# pwroff_after_write = ; # yes / no +# readback = ; # pair of byte values +# readback_p1 = ; # byte value (first component) +# readback_p2 = ; # byte value (second component) +# pwroff_after_write = ; # yes/no +# mode = ; # STK500 v2 file parameter from ATDF files +# delay = ; # " +# blocksize = ; # " +# readsize = ; # " # read = ; # write = ; # read_lo = ; @@ -139,19 +173,29 @@ # loadpage_lo = ; # loadpage_hi = ; # writepage = ; -# ; -# ; +# ; +# ; # # If any of the above parameters are not specified, the default value -# of 0 is used for numerics or the empty string ("") for string -# values. If a required parameter is left empty, AVRDUDE will -# complain. +# of 0 is used for numerics (except for mcuid, hvupdi_variant and +# ocdrev, where the default value is -1, and for autobaud_sync which +# defaults to 0x30), or the empty string "" for string values. If a +# required parameter is left empty, AVRDUDE will complain. Almost all +# occurrences of numbers (with the exception of pin numbers and where +# they are separated by space, eg, in signature and readback) can also +# be given as simple expressions involving arithemtic and bitwise +# operators. # # Parts can also inherit parameters from previously defined parts -# using the following syntax. In this case specified integer and -# string values override parameter values from the parent part. New -# memory definitions are added to the definitions inherited from the -# parent. +# using the following syntax. In this case specified integer and +# string values override parameter values from the parent part. New +# memory definitions are added to the definitions inherited from the +# parent. If, however, a new memory definition refers to an existing +# one of the same name for that part then, from v7.1, the existing +# memory definition is extended, and components overwritten with new +# values. Assigning NULL removes an inherited SPI instruction format, +# memory definition, control stack, eeprom or flash instruction, eg, +# as in memory "efuse" = NULL; # # part parent # quoted string # id = ; # quoted string @@ -159,18 +203,18 @@ # ; # # NOTES: -# * 'devicecode' is the device code used by the STK500 (see codes +# * 'devicecode' is the device code used by the STK500 (see codes # listed below) -# * Not all memory types will implement all instructions. -# * AVR Fuse bits and Lock bits are implemented as a type of memory. +# * Not all memory types will implement all instructions +# * AVR Fuse bits and Lock bits are implemented as a type of memory # * Example memory types are: # "flash", "eeprom", "fuse", "lfuse" (low fuse), "hfuse" (high # fuse), "signature", "calibration", "lock" # * The memory type specified on the avrdude command line must match -# one of the memory types defined for the specified chip. +# one of the memory types defined for the specified chip # * The pwroff_after_write flag causes avrdude to attempt to # power the device off and back on after an unsuccessful write to -# the affected memory area if VCC programmer pins are defined. If +# the affected memory area if VCC programmer pins are defined. If # VCC pins are not defined for the programmer, a message # indicating that the device needs a power-cycle is printed out. # This flag was added to work around a problem with the @@ -180,7 +224,7 @@ # # INSTRUCTION FORMATS # -# Instruction formats are specified as a comma seperated list of +# Instruction formats are specified as a comma separated list of # string values containing information (bit specifiers) about each # of the 32 bits of the instruction. Bit specifiers may be one of # the following formats: @@ -189,10 +233,11 @@ # # '0' = the bit is always clear on input as well as output # -# 'x' = the bit is ignored on input and output +# 'x' = the bit is ignored on input and output and set as 0 # -# 'a' = the bit is an address bit, the bit-number matches this bit -# specifier's position within the current instruction byte +# 'a' = the bit is an address bit; from v 7.1 the bit-number +# is set to match the right bit position for the +# instruction to "just work" # # 'aN' = the bit is the Nth address bit, bit-number = N, i.e., a12 # is address bit 12 on input, a0 is address bit 0. @@ -201,11 +246,28 @@ # # 'o' = the bit is an output data bit # -# Each instruction must be composed of 32 bit specifiers. The +# Each instruction must be composed of 32 bit specifiers. The # instruction specification closely follows the instruction data -# provided in Atmel's data sheets for their parts. +# provided in Atmel's data sheets for their parts. Note that flash +# addresses always refer to *word* addresses whilst all other +# memory types specify *byte* addresses. # -# See below for some examples. +# Example for signature read on the ATmega328P: +# 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"; +# +# As the address bit numbers in the SPI opcodes are highly +# systematic, they don't really need to be specified. A compact +# version of the format specification neither uses bit-numbers for +# address lines nor spaces. If such a string is longer than 7 +# characters, then the characters 0, 1, x, a, i and o will be +# recognised as the corresponding bit, whilst any of the characters +# ., -, _ or / can act as arbitrary visual separators, which are +# ignored. Examples: +# +# loadpage_lo = "0100.0000--000x.xxxx--xxaa.aaaa--iiii.iiii"; +# +# loadpage_lo = "0100.0000", "000x.xxxx", "xxaa.aaaa", "iiii.iiii"; # # # The following are STK500 part device codes to use for the @@ -213,7 +275,7 @@ # section avr061.zip which accompanies the application note # AVR061 available from: # -# http://www.atmel.com/dyn/resources/prod_documents/doc2525.pdf +# https://ww1.microchip.com/downloads/en/Appnotes/doc2525.pdf # #define ATTINY10 0x10 /* the _old_ one that never existed! */ @@ -269,8 +331,8 @@ #define AT86RF401 0xD0 #define AT89START 0xE0 -#define AT89S51 0xE0 -#define AT89S52 0xE1 +#define AT89S51 0xE0 +#define AT89S52 0xE1 # The following table lists the devices in the original AVR910 # appnote: @@ -322,51 +384,414 @@ # in the Internet. These add the following codes (only devices that # actually exist are listed): -# ATmega8515 0x3A -# ATmega128 0x43 -# ATmega64 0x45 -# ATtiny26 0x5E -# ATmega8535 0x69 -# ATmega32 0x72 -# ATmega16 0x74 -# ATmega8 0x76 -# ATmega169 0x78 +# ATmega8515 0x3A +# ATmega128 0x43 +# ATmega64 0x45 +# ATtiny26 0x5E +# ATmega8535 0x69 +# ATmega32 0x72 +# ATmega16 0x74 +# ATmega8 0x76 +# ATmega169 0x78 # -# Overall avrdude defaults; suitable for ~/.avrduderc +# Overall avrdude defaults; suitable for ~/.config/avrdude/avrdude.rc # default_parallel = "@DEFAULT_PAR_PORT@"; default_serial = "@DEFAULT_SER_PORT@"; +default_spi = "@DEFAULT_SPI_PORT@"; # default_bitclock = 2.5; +@HAVE_PARPORT_BEGIN@ + +# Parallel port programmers + +#------------------------------------------------------------ +# bsd +#------------------------------------------------------------ + +programmer + id = "bsd"; + desc = "Brian Dean's Programmer, http://www.bsdhome.com/avrdude/"; + type = "par"; + prog_modes = PM_TPI | PM_ISP; + vcc = 2, 3, 4, 5; + reset = 7; + sck = 8; + sdo = 9; + sdi = 10; +; + +#------------------------------------------------------------ +# stk200 +#------------------------------------------------------------ + +programmer + id = "stk200"; + desc = "STK200"; + type = "par"; + prog_modes = PM_TPI | PM_ISP; + buff = 4, 5; + reset = 9; + sck = 6; + sdo = 7; + sdi = 10; +; + +#------------------------------------------------------------ +# pony-stk200 +#------------------------------------------------------------ + +# 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 +# programming is currently in progress. + +programmer parent "stk200" + id = "pony-stk200"; + desc = "Pony Prog STK200"; + pgmled = 8; +; + +#------------------------------------------------------------ +# dt006 +#------------------------------------------------------------ + +programmer + id = "dt006"; + desc = "Dontronics DT006"; + type = "par"; + prog_modes = PM_TPI | PM_ISP; + reset = 4; + sck = 5; + sdo = 2; + sdi = 11; +; + +#------------------------------------------------------------ +# bascom +#------------------------------------------------------------ + +programmer parent "dt006" + id = "bascom"; + desc = "Bascom SAMPLE programming cable"; +; + +#------------------------------------------------------------ +# alf +#------------------------------------------------------------ + +programmer + id = "alf"; + desc = "Nightshade ALF-PgmAVR, http://nightshade.homeip.net/"; + type = "par"; + prog_modes = PM_TPI | PM_ISP; + vcc = 2, 3, 4, 5; + buff = 6; + reset = 7; + sck = 8; + sdo = 9; + sdi = 10; + errled = 1; + rdyled = 14; + pgmled = 16; + vfyled = 17; +; + +#------------------------------------------------------------ +# sp12 +#------------------------------------------------------------ + +programmer + id = "sp12"; + desc = "Steve Bolt's Programmer"; + type = "par"; + prog_modes = PM_TPI | PM_ISP; + vcc = 4, 5, 6, 7, 8; + reset = 3; + sck = 2; + sdo = 9; + sdi = 11; +; + +#------------------------------------------------------------ +# picoweb +#------------------------------------------------------------ + +programmer + id = "picoweb"; + desc = "Picoweb Programming Cable, http://www.picoweb.net/"; + type = "par"; + prog_modes = PM_TPI | PM_ISP; + reset = 2; + sck = 3; + sdo = 4; + sdi = 13; +; + +#------------------------------------------------------------ +# abcmini +#------------------------------------------------------------ + +programmer + id = "abcmini"; + desc = "ABCmini Board, aka Dick Smith HOTCHIP"; + type = "par"; + prog_modes = PM_TPI | PM_ISP; + reset = 4; + sck = 3; + sdo = 2; + sdi = 10; +; + +#------------------------------------------------------------ +# futurlec +#------------------------------------------------------------ + +programmer + id = "futurlec"; + desc = "Futurlec.com programming cable."; + type = "par"; + prog_modes = PM_TPI | PM_ISP; + reset = 3; + sck = 2; + sdo = 1; + sdi = 10; +; + +#------------------------------------------------------------ +# xil +#------------------------------------------------------------ + +# 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 +# buffer lines (trying to add it to the "buff" lines doesn't work in +# avrdude versions before 5.5j). +# With this, TMS connects to RESET, TDI to SDO, TDO to SDI and TCK +# to SCK (plus vcc/gnd of course) + +programmer + id = "xil"; + desc = "Xilinx JTAG cable"; + type = "par"; + prog_modes = PM_TPI | PM_ISP; + vcc = 6; + buff = 5; + reset = 4; + sck = 3; + sdo = 2; + sdi = 13; +; + +#------------------------------------------------------------ +# dapa +#------------------------------------------------------------ + +programmer + id = "dapa"; + desc = "Direct AVR Parallel Access cable"; + type = "par"; + prog_modes = PM_TPI | PM_ISP; + vcc = 3; + reset = 16; + sck = 1; + sdo = 2; + sdi = 11; +; + +#------------------------------------------------------------ +# atisp +#------------------------------------------------------------ + +programmer + id = "atisp"; + desc = "AT-ISP v1.1 programming cable for AVR-SDK1 from "; + type = "par"; + prog_modes = PM_TPI | PM_ISP; + reset = ~6; + sck = ~8; + sdo = ~7; + sdi = ~10; +; + +#------------------------------------------------------------ +# ere-isp-avr +#------------------------------------------------------------ + +programmer + id = "ere-isp-avr"; + desc = "ERE ISP-AVR "; + type = "par"; + prog_modes = PM_TPI | PM_ISP; + reset = ~4; + sck = 3; + sdo = 2; + sdi = 10; +; + +#------------------------------------------------------------ +# blaster +#------------------------------------------------------------ + +programmer + id = "blaster"; + desc = "Altera ByteBlaster"; + type = "par"; + prog_modes = PM_TPI | PM_ISP; + buff = 14; + reset = 3; + sck = 2; + sdo = 8; + sdi = 11; +; + +#------------------------------------------------------------ +# frank-stk200 +#------------------------------------------------------------ + +# It is almost same as pony-stk200, except vcc on pin 5 to auto +# disconnect port (download on http://electropol.free.fr/spip/spip.php?article27) + +programmer parent "pony-stk200" + id = "frank-stk200"; + desc = "Frank STK200"; + vcc = 5; + buff = ; # delete buff pin assignment +; + +#------------------------------------------------------------ +# 89isp +#------------------------------------------------------------ + +# The AT98ISP Cable is a simple parallel dongle for AT89 family. +# http://www.atmel.com/dyn/products/tools_card.asp?tool_id=2877 + +programmer + id = "89isp"; + desc = "Atmel at89isp cable"; + type = "par"; + prog_modes = PM_TPI | PM_ISP; + reset = 17; + sck = 1; + sdo = 2; + sdi = 10; +; +@HAVE_PARPORT_END@ + +@HAVE_LINUXGPIO_BEGIN@ + +# This programmer bitbangs GPIO lines using the Linux sysfs GPIO interface +# +# To enable it set the configuration below to match the GPIO lines connected +# to the relevant ISP header pins and uncomment the entry definition. In case +# you don't have the required permissions to edit this system wide config +# file put the entry in a separate .conf file and use it with +# -C+.conf on the command line. +# +# To check if your avrdude build has support for the linuxgpio programmer +# compiled in, use -c?type on the command line and look for linuxgpio in the +# list. If it's not available you need pass the --enable-linuxgpio=yes option +# to configure and recompile avrdude. +# +# +# #------------------------------------------------------------ +# # linuxgpio +# #------------------------------------------------------------ +# +# programmer +# id = "linuxgpio"; +# desc = "Use the Linux sysfs interface to bitbang GPIO lines"; +# type = "linuxgpio"; +# prog_modes = PM_ISP; +# reset = ?; +# sck = ?; +# sdo = ?; +# sdi = ?; +# ; +@HAVE_LINUXGPIO_END@ + +@HAVE_LINUXSPI_BEGIN@ +#------------------------------------------------------------ +# linuxspi +#------------------------------------------------------------ + +# This programmer uses the built in linux SPI bus devices to program an +# attached AVR. The reset pin must be attached to a GPIO pin that +# is otherwise unused (see gpioinfo(1)); the SPI bus CE pins are not +# suitable since they would release /RESET too early. +# + +programmer + id = "linuxspi"; + desc = "Use Linux SPI device in /dev/spidev*"; + type = "linuxspi"; + prog_modes = PM_TPI | PM_ISP; + connection_type = spi; + reset = 25; # Pi GPIO number - this is J8:22 +; +@HAVE_LINUXSPI_END@ + # # PROGRAMMER DEFINITIONS # +#------------------------------------------------------------ +# wiring +#------------------------------------------------------------ + # http://wiring.org.co/ -# Basically STK500v2 protocol, with some glue to trigger the -# bootloader. -programmer - id = "wiring"; - desc = "Wiring"; - type = "wiring"; - connection_type = serial; -; +# Basically STK500v2 protocol, with some glue to trigger the bootloader programmer - id = "arduino"; - desc = "Arduino"; - type = "arduino"; - connection_type = serial; + id = "wiring"; + desc = "Wiring for bootloader using STK500 v2 protocol"; + type = "wiring"; + prog_modes = PM_SPM; + connection_type = serial; ; +#------------------------------------------------------------ +# arduino +#------------------------------------------------------------ + programmer - id = "xbee"; - desc = "XBee Series 2 Over-The-Air (XBeeBoot)"; - type = "xbee"; - connection_type = serial; + id = "arduino"; + desc = "Arduino for bootloader using STK500 v1 protocol"; + type = "arduino"; + prog_modes = PM_SPM; + connection_type = serial; ; +#------------------------------------------------------------ +# urclock +#------------------------------------------------------------ + +# See https://github.com/stefanrueger/urboot +programmer + id = "urclock"; + desc = "Urclock programmer for urboot bootloaders using urprotocol"; + type = "urclock"; + prog_modes = PM_SPM; + connection_type = serial; +; + +#------------------------------------------------------------ +# xbee +#------------------------------------------------------------ + +programmer + id = "xbee"; + desc = "XBee for Series 2 Over-The-Air (XBeeBoot) bootloader using STK500 v1 protocol"; + type = "xbee"; + prog_modes = PM_SPM; + connection_type = serial; +; + +#------------------------------------------------------------ +# ft2232h +#------------------------------------------------------------ + # this will interface with the chips on these programmers: # # http://real.kiev.ua/old/avreal/en/adapters @@ -377,146 +802,181 @@ programmer # http://dangerousprototypes.com/docs/FT2232_breakout_board # http://www.ftdichip.com/Products/Modules/DLPModules.htm,DLP-2232*,DLP-USB1232H # http://flashrom.org/FT2232SPI_Programmer -# +# # The drivers will look for a specific device and use the first one found. # If you have mulitple devices, then look for unique information (like SN) # And fill that in here. # # Note that the pin numbers for the main ISP signals (reset, sck, -# mosi, miso) are fixed and cannot be changed, since they must match +# sdo, sdi) are fixed and cannot be changed, since they must match # the way the Multi-Protocol Synchronous Serial Engine (MPSSE) of # these FTDI ICs has been designed. programmer - id = "avrftdi"; - desc = "FT2232D based generic programmer"; - type = "avrftdi"; - connection_type = usb; - usbvid = 0x0403; - usbpid = 0x6010; - usbvendor = ""; - usbproduct = ""; - usbdev = "A"; - usbsn = ""; -#ISP-signals - lower ADBUS-Nibble (default) - reset = 3; - sck = 0; - mosi = 1; - miso = 2; -#LED SIGNALs - higher ADBUS-Nibble -# errled = 4; -# rdyled = 5; -# pgmled = 6; -# vfyled = 7; -#Buffer Signal - ACBUS - Nibble -# buff = 8; + id = "ft2232h"; + desc = "FT2232H based generic programmer"; + type = "avrftdi"; + prog_modes = PM_TPI | PM_ISP; + connection_type = usb; + usbvid = 0x0403; + usbpid = 0x6010; + usbdev = "A"; +# ISP-signals - lower ADBUS-Nibble (default) + reset = 3; # AD3 (TMS) + sck = 0; # AD0 (TCK) + sdo = 1; # AD1 (TDI) + sdi = 2; # AD2 (TDO) ; + +#------------------------------------------------------------ +# avrftdi +#------------------------------------------------------------ + +programmer parent "ft2232h" + id = "avrftdi"; + desc = "FT2232D based generic programmer"; +; + +#------------------------------------------------------------ +# 2232HIO +#------------------------------------------------------------ + # This is an implementation of the above with a buffer IC (74AC244) and # 4 LEDs directly attached, all active low. -programmer - id = "2232HIO"; - desc = "FT2232H based generic programmer"; - type = "avrftdi"; - connection_type = usb; - usbvid = 0x0403; -# Note: This PID is reserved for generic H devices and -# should be programmed into the EEPROM -# usbpid = 0x8A48; - usbpid = 0x6010; - usbdev = "A"; - usbvendor = ""; - usbproduct = ""; - usbsn = ""; -#ISP-signals - reset = 3; - sck = 0; - mosi = 1; - miso = 2; - buff = ~4; -#LED SIGNALs - errled = ~ 11; - rdyled = ~ 14; - pgmled = ~ 13; - vfyled = ~ 12; + +programmer parent "ft2232h" + id = "2232hio"; + desc = "2232hio based on FT2232H with buffer and LEDs"; + buff = ~4; +# LED SIGNALs + errled = ~11; + rdyled = ~14; + pgmled = ~13; + vfyled = ~12; ; +#------------------------------------------------------------ +# tigard +#------------------------------------------------------------ + +# Tigard - FT2232H based multi-protocol tool for hardware hacking +# https://github.com/tigard-tools/tigard + +programmer parent "ft2232h" + id = "tigard"; + desc = "Tigard interface board"; + usbdev = "B"; +# Reset is different to the FT2232H; sck, sdo, sdi remain at 0, 1, 2 + reset = 5; # BD5 (GPIOL1) +; + +#------------------------------------------------------------ +# ft4232h +#------------------------------------------------------------ + #The FT4232H can be treated as FT2232H, but it has a different USB #device ID of 0x6011. -programmer parent "avrftdi" - id = "4232h"; - desc = "FT4232H based generic programmer"; - usbpid = 0x6011; + +programmer parent "ft2232h" + id = "ft4232h"; + desc = "FT4232H based generic programmer"; + usbpid = 0x6011; ; -programmer - id = "jtagkey"; - desc = "Amontec JTAGKey, JTAGKey-Tiny and JTAGKey2"; - type = "avrftdi"; - connection_type = usb; - usbvid = 0x0403; -# Note: This PID is used in all JTAGKey variants - usbpid = 0xCFF8; - usbdev = "A"; - usbvendor = ""; - usbproduct = ""; - usbsn = ""; -#ISP-signals => 20 - Pin connector on JTAGKey - reset = 3; # TMS 7 violet - sck = 0; # TCK 9 white - mosi = 1; # TDI 5 green - miso = 2; # TDO 13 orange - buff = ~4; -# VTG VREF 1 brown with red tip -# GND GND 20 black -# The colors are on the 20 pin breakout cable -# from Amontec +#------------------------------------------------------------ +# 4232h +#------------------------------------------------------------ + +programmer parent "ft4232h" + id = "4232h"; ; +#------------------------------------------------------------ +# jtagkey +#------------------------------------------------------------ + programmer - id = "ft232h"; - desc = "FT232H in MPSSE mode"; - type = "avrftdi"; - connection_type = usb; - usbvid = 0x0403; - usbpid = 0x6014; - usbdev = "A"; - usbvendor = ""; - usbproduct = ""; - usbsn = ""; -#ISP-signals - sck = 0; # AD0 (TCK) - mosi = 1; # AD1 (TDI) - miso = 2; # AD2 (TDO) - reset = 3; # AD3 (TMS) + id = "jtagkey"; + desc = "Amontec JTAGKey, JTAGKey-Tiny and JTAGKey2"; + type = "avrftdi"; + prog_modes = PM_TPI | PM_ISP; + connection_type = usb; + usbvid = 0x0403; +# Note: This PID is used in all JTAGKey variants + usbpid = 0xcff8; + usbdev = "A"; + buff = ~4; +# ISP-signals => 20 - Pin connector on JTAGKey + reset = 3; # TMS 7 violet + sck = 0; # TCK 9 white + sdo = 1; # TDI 5 green + sdi = 2; # TDO 13 orange +# VTG VREF 1 brown with red tip +# GND GND 20 black +# The colors are on the 20 pin breakout cable from Amontec ; +#------------------------------------------------------------ +# ft232h +#------------------------------------------------------------ + +programmer + id = "ft232h"; + desc = "FT232H based generic programmer"; + type = "avrftdi"; + prog_modes = PM_TPI | PM_ISP; + connection_type = usb; + usbvid = 0x0403; + usbpid = 0x6014; + usbdev = "A"; +# ISP-signals + reset = 3; # AD3 (TMS) + sck = 0; # AD0 (TCK) + sdo = 1; # AD1 (TDI) + sdi = 2; # AD2 (TDO) +; + +#------------------------------------------------------------ +# um232h +#------------------------------------------------------------ + # Pin J2-7 (AD0) is SCK -# Pin J2-8 (AD1) is MOSI -# Pin J2-9 (AD2) is MISO +# Pin J2-8 (AD1) is SDO +# Pin J2-9 (AD2) is SDI # Pin J2-10 (AD3) is RESET # Pin J2-6 is GND # Use the -b flag to set the SPI clock rate eg -b 3750000 is the fastest I could get # a 16MHz Atmega1280 to program reliably. The 232H is conveniently 5V tolerant. + programmer parent "ft232h" - id = "um232h"; - desc = "UM232H module from FTDI"; + id = "um232h"; + desc = "UM232H module from FTDI"; ; +#------------------------------------------------------------ +# c232hm +#------------------------------------------------------------ + # Orange (Pin 2) is SCK -# Yellow (Pin 3) is MOSI -# Green (Pin 4) is MISO +# Yellow (Pin 3) is SDO +# Green (Pin 4) is SDI # Brown (Pin 5) is RESET # Black (Pin 10) is GND # Use the -b flag to set the SPI clock rate eg -b 3750000 is the fastest I could get # a 16MHz Atmega1280 to program reliably. The 232H is conveniently 5V tolerant. + programmer parent "ft232h" - id = "c232hm"; - desc = "C232HM cable from FTDI"; + id = "c232hm"; + desc = "C232HM cable from FTDI"; ; +#------------------------------------------------------------ +# o-link +#------------------------------------------------------------ + # On the adapter you can read "O-Link". On the PCB is printed "OpenJTAG v3.1" -# You can find it as "OpenJTAG ARM JTAG USB" in the internet. -# (But there are also several projects called Open JTAG, eg. +# You can find it as "OpenJTAG ARM JTAG USB" in the internet. +# (But there are also several projects called Open JTAG, eg. # http://www.openjtag.org, which are completely different.) # http://www.100ask.net/shop/english.html (website seems to be outdated) # http://item.taobao.com/item.htm?id=1559277013 @@ -527,72 +987,89 @@ programmer parent "ft232h" # http://armwerks.com/catalog/o-link-debugger-copy/ # or just have a look at ebay ... # It is basically the same entry as jtagkey with different usb ids. + programmer parent "jtagkey" - id = "o-link"; - desc = "O-Link, OpenJTAG from www.100ask.net"; - usbvid = 0x1457; - usbpid = 0x5118; - usbvendor = "www.100ask.net"; - usbproduct = "USB<=>JTAG&RS232"; + id = "o-link"; + desc = "O-Link, OpenJTAG from www.100ask.net"; + usbvid = 0x1457; + usbpid = 0x5118; + usbvendor = "www.100ask.net"; + usbproduct = "USB<=>JTAG&RS232"; ; +#------------------------------------------------------------ +# openmoko +#------------------------------------------------------------ + # http://wiki.openmoko.org/wiki/Debug_Board_v3 + programmer - id = "openmoko"; - desc = "Openmoko debug board (v3)"; - type = "avrftdi"; - usbvid = 0x1457; - usbpid = 0x5118; - usbdev = "A"; - usbvendor = ""; - usbproduct = ""; - usbsn = ""; - reset = 3; # TMS 7 - sck = 0; # TCK 9 - mosi = 1; # TDI 5 - miso = 2; # TDO 13 + id = "openmoko"; + desc = "Openmoko debug board (v3)"; + type = "avrftdi"; + prog_modes = PM_TPI | PM_ISP; + usbvid = 0x1457; + usbpid = 0x5118; + usbdev = "A"; + reset = 3; # TMS 7 + sck = 0; # TCK 9 + sdo = 1; # TDI 5 + sdi = 2; # TDO 13 ; +#------------------------------------------------------------ +# lm3s811 +#------------------------------------------------------------ + # Only Rev. A boards. # Schematic and user manual: http://www.cs.put.poznan.pl/wswitala/download/pdf/811EVBK.pdf + programmer - id = "lm3s811"; - desc = "Luminary Micro LM3S811 Eval Board (Rev. A)"; - type = "avrftdi"; - connection_type = usb; - usbvid = 0x0403; - usbpid = 0xbcd9; - usbvendor = "LMI"; - usbproduct = "LM3S811 Evaluation Board"; - usbdev = "A"; - usbsn = ""; -#ISP-signals - lower ACBUS-Nibble (default) - reset = 3; - sck = 0; - mosi = 1; - miso = 2; + id = "lm3s811"; + desc = "Luminary Micro LM3S811 Eval Board (Rev. A)"; + type = "avrftdi"; + prog_modes = PM_TPI | PM_ISP; + connection_type = usb; + usbvid = 0x0403; + usbpid = 0xbcd9; + usbdev = "A"; + usbvendor = "LMI"; + usbproduct = "LM3S811 Evaluation Board"; # Enable correct buffers - buff = 7; + buff = 7; +# ISP-signals - lower ACBUS-Nibble (default) + reset = 3; + sck = 0; + sdo = 1; + sdi = 2; ; +#------------------------------------------------------------ +# tumpa +#------------------------------------------------------------ + # submitted as bug #46020 + programmer - id = "tumpa"; - desc = "TIAO USB Multi-Protocol Adapter"; - type = "avrftdi"; - connection_type = usb; - usbvid = 0x0403; - usbpid = 0x8A98; - usbdev = "A"; - usbvendor = "TIAO"; - usbproduct = ""; - usbsn = ""; - sck = 0; # TCK 9 - mosi = 1; # TDI 5 - miso = 2; # TDO 13 - reset = 3; # TMS 7 + id = "tumpa"; + desc = "TIAO USB Multi-Protocol Adapter"; + type = "avrftdi"; + prog_modes = PM_TPI | PM_ISP; + connection_type = usb; + usbvid = 0x0403; + usbpid = 0x8a98; + usbdev = "A"; + usbvendor = "TIAO"; + reset = 3; # TMS 7 + sck = 0; # TCK 9 + sdo = 1; # TDI 5 + sdi = 2; # TDO 13 ; +#------------------------------------------------------------ +# ktlink +#------------------------------------------------------------ + # Kristech KT-LINK FT2232H interface with IO switching and voltage buffers. # Created on 20220410 by CeDeROM Tomasz CEDRO (www.cederom.io). # Interface DataSheet: https://kristech.pl/files/KT-LINK-UM-ENG.pdf @@ -602,1051 +1079,1438 @@ programmer # KT-LINK JTAG CONN: # 1=Vsense(->EXT13), 19=5V(EXT1->EXT3), 20=GND, 3=TPIRST, 9=TPICLK, 7=TPIDATA. # INTERNALS CONFIGURATION ("~" MEANS ACTIVE LOW): -# ~TRST_EN=10(ACBUS2), ~CLK_EN=14(ACBUS6), ~MOSI_EN=13(ACBUS5), +# ~TRST_EN=10(ACBUS2), ~CLK_EN=14(ACBUS6), ~SDO_EN=13(ACBUS5), # TMS_SEL=5(ADBUS5), ~TMS_EN=12(ACBUS4), LED=~15(ACBUS7). # CONNECTION NOTES: # * Connect EXT connector pin 1 with 3 to get 5V on JTAG connector pin 19. # * Connect JTAG connector pin 1 to 5V (i.e. EXT pin 13 or JTAG pin 19). # * For TPI connection use resistors: TDO --[470R]-- TPIDATA --[470R]-- TDI. # * Powering target from JTAG pin 19 allows KT-LINK current measurement. -programmer - id = "ktlink"; - desc = "KT-LINK FT2232H interface with IO switching and voltage buffers."; - type = "avrftdi"; - connection_type = usb; - usbvid= 0x0403; - usbpid= 0xBBE2; - usbdev= "A"; - reset = 8; - sck = 0; - mosi = 1; - miso = 2; - buff = ~10,~14,~13,5; - rdyled = ~15; -; programmer - id = "serialupdi"; - desc = "SerialUPDI"; - type = "serialupdi"; - connection_type = serial; + id = "ktlink"; + desc = "KT-LINK FT2232H interface with IO switching and voltage buffers."; + type = "avrftdi"; + prog_modes = PM_TPI | PM_ISP; + connection_type = usb; + usbvid = 0x0403; + usbpid = 0xbbe2; + usbdev = "A"; + buff = 5, ~10, ~13, ~14; + reset = 8; + sck = 0; + sdo = 1; + sdi = 2; + rdyled = ~15; ; -programmer - id = "avrisp"; - desc = "Atmel AVR ISP"; - type = "stk500"; - connection_type = serial; -; +#------------------------------------------------------------ +# digilent-hs2 +#------------------------------------------------------------ + +# Digilent JTAG HS2 programmer. FT232H-based dongle with buffers. +# https://digilent.com/reference/_media/reference/programmers/jtag-hs2/jtag-hs2_rm.pdf programmer - id = "avrispv2"; - desc = "Atmel AVR ISP V2"; - type = "stk500v2"; - connection_type = serial; + id = "digilent-hs2"; + desc = "Digilient JTAG HS2 (MPSSE)"; + type = "avrftdi"; + connection_type = usb; + usbvid = 0x0403; + usbpid = 0x6014; + usbdev = "A"; + buff = 5, 6, 7; + reset = 3; + sck = 0; + sdo = 1; + sdi = 2; ; +#------------------------------------------------------------ +# serialupdi +#------------------------------------------------------------ + programmer - id = "avrispmkII"; - desc = "Atmel AVR ISP mkII"; - type = "stk500v2"; - connection_type = usb; + id = "serialupdi"; + desc = "SerialUPDI"; + type = "serialupdi"; + prog_modes = PM_UPDI; + connection_type = serial; + hvupdi_support = 1; ; +#------------------------------------------------------------ +# avrisp +#------------------------------------------------------------ + +programmer + id = "avrisp"; + desc = "Atmel AVR ISP"; + type = "stk500"; + prog_modes = PM_ISP; + connection_type = serial; +; + +#------------------------------------------------------------ +# avrispv2 +#------------------------------------------------------------ + +programmer + id = "avrispv2"; + desc = "Atmel AVR ISP v2"; + type = "stk500v2"; + prog_modes = PM_TPI | PM_ISP | PM_PDI; + connection_type = serial; +; + +#------------------------------------------------------------ +# avrispmkII +#------------------------------------------------------------ + +programmer + id = "avrispmkII"; + desc = "Atmel AVR ISP mkII"; + type = "stk500v2"; + prog_modes = PM_TPI | PM_ISP | PM_PDI; + connection_type = usb; +; + +#------------------------------------------------------------ +# avrisp2 +#------------------------------------------------------------ + programmer parent "avrispmkII" - id = "avrisp2"; + id = "avrisp2"; ; -programmer - id = "buspirate"; - desc = "The Bus Pirate"; - type = "buspirate"; - connection_type = serial; -; +#------------------------------------------------------------ +# buspirate +#------------------------------------------------------------ programmer - id = "buspirate_bb"; - desc = "The Bus Pirate (bitbang interface, supports TPI)"; - type = "buspirate_bb"; - connection_type = serial; + id = "buspirate"; + desc = "The Bus Pirate"; + type = "buspirate"; + prog_modes = PM_ISP; + connection_type = serial; +; + +#------------------------------------------------------------ +# buspirate_bb +#------------------------------------------------------------ + +programmer + id = "buspirate_bb"; + desc = "The Bus Pirate (bitbang interface, supports TPI)"; + type = "buspirate_bb"; + prog_modes = PM_TPI | PM_ISP; + connection_type = serial; # pins are bits in bitbang byte (numbers are 87654321) - # 1|POWER|PULLUP|AUX|MOSI|CLK|MISO|CS - reset = 1; - sck = 3; - mosi = 4; - miso = 2; - #vcc = 7; This is internally set independent of this setting. + # 1|POWER|PULLUP|AUX|SDO|CLK|SDI|CS + reset = 1; + sck = 3; + sdo = 4; + sdi = 2; + # vcc = 7; # Internally set independent of this setting ; +#------------------------------------------------------------ +# stk500 +#------------------------------------------------------------ + # This is supposed to be the "default" STK500 entry. # Attempts to select the correct firmware version # by probing for it. Better use one of the entries # below instead. -programmer - id = "stk500"; - desc = "Atmel STK500"; - type = "stk500generic"; - connection_type = serial; -; programmer - id = "stk500v1"; - desc = "Atmel STK500 Version 1.x firmware"; - type = "stk500"; - connection_type = serial; + id = "stk500"; + desc = "Atmel STK500"; + type = "stk500generic"; + prog_modes = PM_ISP; + connection_type = serial; ; -programmer - id = "mib510"; - desc = "Crossbow MIB510 programming board"; - type = "stk500"; - connection_type = serial; -; +#------------------------------------------------------------ +# stk500v1 +#------------------------------------------------------------ programmer - id = "stk500v2"; - desc = "Atmel STK500 Version 2.x firmware"; - type = "stk500v2"; - connection_type = serial; + id = "stk500v1"; + desc = "Atmel STK500 version 1.x firmware"; + type = "stk500"; + prog_modes = PM_ISP; + connection_type = serial; ; -programmer - id = "stk500pp"; - desc = "Atmel STK500 V2 in parallel programming mode"; - type = "stk500pp"; - connection_type = serial; -; +#------------------------------------------------------------ +# mib510 +#------------------------------------------------------------ programmer - id = "stk500hvsp"; - desc = "Atmel STK500 V2 in high-voltage serial programming mode"; - type = "stk500hvsp"; - connection_type = serial; + id = "mib510"; + desc = "Crossbow MIB510 programming board"; + type = "stk500"; + prog_modes = PM_TPI | PM_ISP; + connection_type = serial; ; -programmer - id = "stk600"; - desc = "Atmel STK600"; - type = "stk600"; - connection_type = usb; -; +#------------------------------------------------------------ +# stk500v2 +#------------------------------------------------------------ programmer - id = "stk600pp"; - desc = "Atmel STK600 in parallel programming mode"; - type = "stk600pp"; - connection_type = usb; + id = "stk500v2"; + desc = "Atmel STK500 version 2.x firmware"; + type = "stk500v2"; + prog_modes = PM_TPI | PM_ISP; + connection_type = serial; ; -programmer - id = "stk600hvsp"; - desc = "Atmel STK600 in high-voltage serial programming mode"; - type = "stk600hvsp"; - connection_type = usb; -; +#------------------------------------------------------------ +# stk500pp +#------------------------------------------------------------ programmer - id = "avr910"; - desc = "Atmel Low Cost Serial Programmer"; - type = "avr910"; - connection_type = serial; + id = "stk500pp"; + desc = "Atmel STK500 v2 in parallel programming mode"; + type = "stk500pp"; + prog_modes = PM_HVPP; + connection_type = serial; ; -programmer - id = "ft245r"; - desc = "FT245R Synchronous BitBang"; - type = "ftdi_syncbb"; - connection_type = usb; - miso = 1; # D1 - sck = 0; # D0 - mosi = 2; # D2 - reset = 4; # D4 -; +#------------------------------------------------------------ +# stk500hvsp +#------------------------------------------------------------ programmer - id = "ft232r"; - desc = "FT232R Synchronous BitBang"; - type = "ftdi_syncbb"; - connection_type = usb; - miso = 1; # RxD - sck = 0; # TxD - mosi = 2; # RTS - reset = 4; # DTR + id = "stk500hvsp"; + desc = "Atmel STK500 v2 in high-voltage serial programming mode"; + type = "stk500hvsp"; + prog_modes = PM_HVSP; + connection_type = serial; ; +#------------------------------------------------------------ +# stk600 +#------------------------------------------------------------ + +programmer + id = "stk600"; + desc = "Atmel STK600"; + type = "stk600"; + prog_modes = PM_TPI | PM_ISP | PM_PDI; + connection_type = usb; +; + +#------------------------------------------------------------ +# stk600pp +#------------------------------------------------------------ + +programmer + id = "stk600pp"; + desc = "Atmel STK600 in parallel programming mode"; + type = "stk600pp"; + prog_modes = PM_HVPP; + connection_type = usb; +; + +#------------------------------------------------------------ +# stk600hvsp +#------------------------------------------------------------ + +programmer + id = "stk600hvsp"; + desc = "Atmel STK600 in high-voltage serial programming mode"; + type = "stk600hvsp"; + prog_modes = PM_HVSP; + connection_type = usb; +; + +#------------------------------------------------------------ +# avr910 +#------------------------------------------------------------ + +programmer + id = "avr910"; + desc = "Atmel Low Cost Serial Programmer"; + type = "avr910"; + prog_modes = PM_ISP; + connection_type = serial; +; + +#------------------------------------------------------------ +# ft245r +#------------------------------------------------------------ + +programmer + id = "ft245r"; + desc = "FT245R based generic programmer"; + type = "ftdi_syncbb"; + prog_modes = PM_TPI | PM_ISP; + connection_type = usb; + reset = 4; # D4 + sck = 0; # D0 + sdo = 2; # D2 + sdi = 1; # D1 +; + +#------------------------------------------------------------ +# ft232r +#------------------------------------------------------------ + +programmer + id = "ft232r"; + desc = "FT232R based generic programmer"; + type = "ftdi_syncbb"; + prog_modes = PM_TPI | PM_ISP; + connection_type = usb; + reset = 4; # DTR + sck = 0; # TxD + sdo = 2; # RTS + sdi = 1; # RxD +; + +#------------------------------------------------------------ +# bwmega +#------------------------------------------------------------ + # see http://www.bitwizard.nl/wiki/index.php/FTDI_ATmega + programmer - id = "bwmega"; - desc = "BitWizard ftdi_atmega builtin programmer"; - type = "ftdi_syncbb"; - connection_type = usb; - miso = 5; # DSR - sck = 6; # DCD - mosi = 3; # CTS - reset = 7; # RI + id = "bwmega"; + desc = "BitWizard ftdi_atmega builtin programmer"; + type = "ftdi_syncbb"; + prog_modes = PM_TPI | PM_ISP; + connection_type = usb; + reset = 7; # RI + sck = 6; # DCD + sdo = 3; # CTS + sdi = 5; # DSR ; +#------------------------------------------------------------ +# arduino-ft232r +#------------------------------------------------------------ + # see http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html # Note: pins are numbered from 1! -programmer - id = "arduino-ft232r"; - desc = "Arduino: FT232R connected to ISP"; - type = "ftdi_syncbb"; - connection_type = usb; - miso = 3; # CTS X3(1) - sck = 5; # DSR X3(2) - mosi = 6; # DCD X3(3) - reset = 7; # RI X3(4) -; programmer - id = "tc2030"; - desc = "Tag-Connect TC2030"; - type = "ftdi_syncbb"; - connection_type = usb; - # FOR TPI devices: - mosi = 0; # TxD = D0 (wire to TPIDATA via 1k resistor) - miso = 1; # RxD = D1 (wire to TPIDATA directly) - sck = 2; # RTS = D2 (wire to SCK) - reset = 3; # CTS = D3 (wire to ~RESET) + id = "arduino-ft232r"; + desc = "Arduino: FT232R connected to ISP"; + type = "ftdi_syncbb"; + prog_modes = PM_TPI | PM_ISP; + connection_type = usb; + reset = 7; # RI X3(4) + sck = 5; # DSR X3(2) + sdo = 6; # DCD X3(3) + sdi = 3; # CTS X3(1) ; +#------------------------------------------------------------ +# tc2030 +#------------------------------------------------------------ + +programmer + id = "tc2030"; + desc = "Tag-Connect TC2030"; + type = "ftdi_syncbb"; + prog_modes = PM_TPI | PM_ISP; + connection_type = usb; + # FOR TPI devices: + reset = 3; # CTS = D3 (wire to ~RESET) + sck = 2; # RTS = D2 (wire to SCK) + sdo = 0; # TxD = D0 (wire to TPIDATA via 1k resistor) + sdi = 1; # RxD = D1 (wire to TPIDATA directly) +; + +#------------------------------------------------------------ +# diecimila +#------------------------------------------------------------ + # website mentioned above uses this id + programmer parent "arduino-ft232r" - id = "diecimila"; - desc = "alias for arduino-ft232r"; + id = "diecimila"; + desc = "alias for arduino-ft232r"; ; +#------------------------------------------------------------ +# uncompatino +#------------------------------------------------------------ + # There is a ATmega328P kit PCB called "uncompatino". # This board allows ISP via its on-board FT232R. # This is designed like Arduino Duemilanove but has no standard ICPS header. # Its 4 pairs of pins are shorted to enable ftdi_syncbb. # http://akizukidenshi.com/catalog/g/gP-07487/ # http://akizukidenshi.com/download/ds/akizuki/k6096_manual_20130816.pdf + programmer - id = "uncompatino"; - desc = "uncompatino with all pairs of pins shorted"; - type = "ftdi_syncbb"; - connection_type = usb; - miso = 3; # cts - sck = 5; # dsr - mosi = 6; # dcd - reset = 7; # ri + id = "uncompatino"; + desc = "uncompatino with all pairs of pins shorted"; + type = "ftdi_syncbb"; + prog_modes = PM_TPI | PM_ISP; + connection_type = usb; + reset = 7; # ri + sck = 5; # dsr + sdo = 6; # dcd + sdi = 3; # cts ; +#------------------------------------------------------------ +# ttl232r +#------------------------------------------------------------ + # FTDI USB to serial cable TTL-232R-5V with a custom adapter for ICSP # http://www.ftdichip.com/Products/Cables/USBTTLSerial.htm # http://www.ftdichip.com/Support/Documents/DataSheets/Cables/DS_TTL-232R_CABLES.pdf # For ICSP pinout see for example http://www.atmel.com/images/doc2562.pdf # (Figure 1. ISP6PIN header pinout and Table 1. Connections required for ISP ...) # TTL-232R GND 1 Black -> ICPS GND (pin 6) -# TTL-232R CTS 2 Brown -> ICPS MOSI (pin 4) +# TTL-232R CTS 2 Brown -> ICPS SDO (pin 4) # TTL-232R VCC 3 Red -> ICPS VCC (pin 2) # TTL-232R TXD 4 Orange -> ICPS RESET (pin 5) # TTL-232R RXD 5 Yellow -> ICPS SCK (pin 3) -# TTL-232R RTS 6 Green -> ICPS MISO (pin 1) -# Except for VCC and GND, you can connect arbitual pairs as long as +# TTL-232R RTS 6 Green -> ICPS SDI (pin 1) +# Except for VCC and GND, you can connect arbitual pairs as long as # the following table is adjusted. + programmer - id = "ttl232r"; - desc = "FTDI TTL232R-5V with ICSP adapter"; - type = "ftdi_syncbb"; - connection_type = usb; - miso = 2; # rts - sck = 1; # rxd - mosi = 3; # cts - reset = 0; # txd + id = "ttl232r"; + desc = "FTDI TTL232R-5V with ICSP adapter"; + type = "ftdi_syncbb"; + prog_modes = PM_TPI | PM_ISP; + connection_type = usb; + reset = 0; # txd + sck = 1; # rxd + sdo = 3; # cts + sdi = 2; # rts ; -programmer - id = "usbasp"; - desc = "USBasp, http://www.fischl.de/usbasp/"; - type = "usbasp"; - connection_type = usb; - usbvid = 0x16C0; # VOTI - usbpid = 0x05DC; # Obdev's free shared PID - usbvendor = "www.fischl.de"; - usbproduct = "USBasp"; +#------------------------------------------------------------ +# usbasp +#------------------------------------------------------------ +programmer + id = "usbasp"; + desc = "USBasp, http://www.fischl.de/usbasp/"; + type = "usbasp"; + prog_modes = PM_TPI | PM_ISP; + connection_type = usb; + usbvid = 0x16c0; # VOTI + usbpid = 0x05dc; # Obdev's free shared PID + usbvendor = "www.fischl.de"; + usbproduct = "USBasp"; # following variants are autodetected for id "usbasp" # original usbasp from fischl.de # see above "usbasp" # old usbasp from fischl.de - #usbvid = 0x03EB; # ATMEL - #usbpid = 0xC7B4; # (unoffical) USBasp - #usbvendor = "www.fischl.de"; - #usbproduct = "USBasp"; + # usbvid = 0x03EB; # ATMEL + # usbpid = 0xC7B4; # (unoffical) USBasp + # usbvendor = "www.fischl.de"; + # usbproduct = "USBasp"; # NIBObee (only if -P nibobee is given on command line) # see below "nibobee" ; -programmer - id = "nibobee"; - desc = "NIBObee"; - type = "usbasp"; - connection_type = usb; - usbvid = 0x16C0; # VOTI - usbpid = 0x092F; # NIBObee PID - usbvendor = "www.nicai-systems.com"; - usbproduct = "NIBObee"; -; +#------------------------------------------------------------ +# nibobee +#------------------------------------------------------------ programmer - id = "usbasp-clone"; - desc = "Any usbasp clone with correct VID/PID"; - type = "usbasp"; - connection_type = usb; - usbvid = 0x16C0; # VOTI - usbpid = 0x05DC; # Obdev's free shared PID - #usbvendor = ""; - #usbproduct = ""; + id = "nibobee"; + desc = "NIBObee"; + type = "usbasp"; + prog_modes = PM_TPI | PM_ISP; + connection_type = usb; + usbvid = 0x16c0; # VOTI + usbpid = 0x092f; # NIBObee PID + usbvendor = "www.nicai-systems.com"; + usbproduct = "NIBObee"; ; +#------------------------------------------------------------ +# usbasp-clone +#------------------------------------------------------------ + +programmer + id = "usbasp-clone"; + desc = "Any usbasp clone with correct VID/PID"; + type = "usbasp"; + prog_modes = PM_TPI | PM_ISP; + connection_type = usb; + usbvid = 0x16c0; # VOTI + usbpid = 0x05dc; # Obdev's free shared PID +; + +#------------------------------------------------------------ +# usbtiny +#------------------------------------------------------------ + # USBtiny can also be used for TPI programming. -# In that case, a resistor of 1 kOhm is needed between MISO and MOSI -# pins of the connector, and MISO (pin 1 of the 6-pin connector) +# In that case, a resistor of 1 kOhm is needed between SDI and SDO +# pins of the connector, and SDI (pin 1 of the 6-pin connector) # connects to TPIDATA. -programmer - id = "usbtiny"; - desc = "USBtiny simple USB programmer, https://learn.adafruit.com/usbtinyisp"; - type = "usbtiny"; - connection_type = usb; - usbvid = 0x1781; - usbpid = 0x0c9f; -; programmer - id = "arduinoisp"; - desc = "Arduino ISP Programmer"; - type = "usbtiny"; - connection_type = usb; - usbvid = 0x2341; - usbpid = 0x0049; + id = "usbtiny"; + desc = "USBtiny simple USB programmer, https://learn.adafruit.com/usbtinyisp"; + type = "usbtiny"; + prog_modes = PM_TPI | PM_ISP; + connection_type = usb; + usbvid = 0x1781; + usbpid = 0x0c9f; ; +#------------------------------------------------------------ +# arduino_gemma +#------------------------------------------------------------ + +# https://github.com/arduino/ArduinoCore-avr/tree/master/bootloaders/gemma + programmer - id = "arduinoisporg"; - desc = "Arduino ISP Programmer"; - type = "usbtiny"; - connection_type = usb; - usbvid = 0x2A03; - usbpid = 0x0049; + id = "arduino_gemma"; + desc = "Arduino Gemma bootloader disguised as USBtiny"; + type = "usbtiny"; + prog_modes = PM_SPM; + connection_type = usb; + usbvid = 0x2341; + usbpid = 0x0c9f; ; +#------------------------------------------------------------ +# adafruit_gemma +#------------------------------------------------------------ + +# https://github.com/adafruit/Adafruit-Trinket-Gemma-Bootloader + +programmer + id = "adafruit_gemma"; + desc = "Adafruit Trinket Gemma bootloader disguised as USBtiny"; + type = "usbtiny"; + prog_modes = PM_SPM; + connection_type = usb; + usbvid = 0x1781; + usbpid = 0x0c9f; +; + +#------------------------------------------------------------ +# arduinoisp +#------------------------------------------------------------ + +programmer + id = "arduinoisp"; + desc = "Arduino ISP Programmer"; + type = "usbtiny"; + prog_modes = PM_TPI | PM_ISP; + connection_type = usb; + usbvid = 0x2341; + usbpid = 0x0049; +; + +#------------------------------------------------------------ +# arduinoisporg +#------------------------------------------------------------ + +programmer + id = "arduinoisporg"; + desc = "Arduino ISP Programmer"; + type = "usbtiny"; + prog_modes = PM_TPI | PM_ISP; + connection_type = usb; + usbvid = 0x2a03; + usbpid = 0x0049; +; + +#------------------------------------------------------------ +# ehajo-isp +#------------------------------------------------------------ + # commercial version of USBtiny, using a separate VID/PID + programmer - id = "ehajo-isp"; - desc = "avr-isp-programmer from eHaJo, http://www.eHaJo.de"; - type = "usbtiny"; - connection_type = usb; - usbvid = 0x16D0; - usbpid = 0x0BA5; + id = "ehajo-isp"; + desc = "avr-isp-programmer from eHaJo, http://www.eHaJo.de"; + type = "usbtiny"; + prog_modes = PM_TPI | PM_ISP; + connection_type = usb; + usbvid = 0x16d0; + usbpid = 0x0ba5; ; +#------------------------------------------------------------ +# iseavrprog +#------------------------------------------------------------ + # commercial version of USBtiny, using a separate VID/PID -programmer - id = "iseavrprog"; - desc = "USBtiny-based USB programmer, https://github.com/IowaScaledEngineering/ckt-avrprogrammer"; - type = "usbtiny"; - connection_type = usb; - usbvid = 0x1209; - usbpid = 0x6570; -; +# https://github.com/IowaScaledEngineering/ckt-avrprogrammer programmer - id = "micronucleus"; - desc = "Micronucleus Bootloader"; - type = "micronucleus"; - connection_type = usb; - usbvid = 0x16D0; - usbpid = 0x0753; + id = "iseavrprog"; + desc = "USBtiny-based programmer, https://iascaled.com"; + type = "usbtiny"; + prog_modes = PM_TPI | PM_ISP; + connection_type = usb; + usbvid = 0x1209; + usbpid = 0x6570; ; -programmer - id = "teensy"; - desc = "Teensy Bootloader"; - type = "teensy"; - connection_type = usb; - usbvid = 0x16C0; - usbpid = 0x0478; -; +#------------------------------------------------------------ +# micronucleus +#------------------------------------------------------------ programmer - id = "butterfly"; - desc = "Atmel Butterfly Development Board"; - type = "butterfly"; - connection_type = serial; + id = "micronucleus"; + desc = "Micronucleus for bootloader"; + type = "micronucleus"; + prog_modes = PM_SPM; + connection_type = usb; + usbvid = 0x16d0; + usbpid = 0x0753; ; -programmer - id = "avr109"; - desc = "Atmel AppNote AVR109 Boot Loader"; - type = "butterfly"; - connection_type = serial; -; +#------------------------------------------------------------ +# teensy +#------------------------------------------------------------ programmer - id = "avr911"; - desc = "Atmel AppNote AVR911 AVROSP"; - type = "butterfly"; - connection_type = serial; + id = "teensy"; + desc = "Teensy for bootloader"; + type = "teensy"; + prog_modes = PM_SPM; + connection_type = usb; + usbvid = 0x16c0; + usbpid = 0x0478; ; - + +#------------------------------------------------------------ +# butterfly +#------------------------------------------------------------ + +programmer + id = "butterfly"; + desc = "Atmel for bootloader (Butterfly Development Board)"; + type = "butterfly"; + prog_modes = PM_SPM; + connection_type = serial; +; + +#------------------------------------------------------------ +# avr109 +#------------------------------------------------------------ + +programmer + id = "avr109"; + desc = "Atmel for bootloader using AppNote AVR109"; + type = "butterfly"; + prog_modes = PM_SPM; + connection_type = serial; +; + +#------------------------------------------------------------ +# avr911 +#------------------------------------------------------------ + +programmer + id = "avr911"; + desc = "Atmel for bootloader using AppNote AVR911 AVROSP"; + type = "butterfly"; + prog_modes = PM_SPM; + connection_type = serial; +; + +#------------------------------------------------------------ +# mkbutterfly +#------------------------------------------------------------ + # suggested in http://forum.mikrokopter.de/topic-post48317.html + programmer - id = "mkbutterfly"; - desc = "Mikrokopter.de Butterfly"; - type = "butterfly_mk"; - connection_type = serial; + id = "mkbutterfly"; + desc = "Mikrokopter.de Butterfly for bootloader"; + type = "butterfly_mk"; + prog_modes = PM_SPM; + connection_type = serial; ; +#------------------------------------------------------------ +# butterfly_mk +#------------------------------------------------------------ + programmer parent "mkbutterfly" - id = "butterfly_mk"; + id = "butterfly_mk"; ; +#------------------------------------------------------------ +# jtagmkI +#------------------------------------------------------------ + programmer - id = "jtagmkI"; - desc = "Atmel JTAG ICE (mkI)"; - baudrate = 115200; # default is 115200 - type = "jtagmki"; - connection_type = serial; + id = "jtagmkI"; + desc = "Atmel JTAG ICE (mkI)"; + type = "jtagmki"; + prog_modes = PM_JTAGmkI; + connection_type = serial; + baudrate = 115200; # default is 115200 ; +#------------------------------------------------------------ +# jtag1 +#------------------------------------------------------------ + # easier to type + programmer parent "jtagmkI" - id = "jtag1"; + id = "jtag1"; ; +#------------------------------------------------------------ +# jtag1slow +#------------------------------------------------------------ + # easier to type + programmer parent "jtag1" - id = "jtag1slow"; - baudrate = 19200; + id = "jtag1slow"; + baudrate = 19200; ; +#------------------------------------------------------------ +# jtagmkII +#------------------------------------------------------------ + # The JTAG ICE mkII has both, serial and USB connectivity. As it is # mostly used through USB these days (AVR Studio 5 only supporting it # that way), we make connection_type = usb the default. Users are # still free to use a serial port with the -P option. programmer - id = "jtagmkII"; - desc = "Atmel JTAG ICE mkII"; - baudrate = 19200; # default is 19200 - type = "jtagmkii"; - connection_type = usb; + id = "jtagmkII"; + desc = "Atmel JTAG ICE mkII"; + type = "jtagmkii"; + prog_modes = PM_JTAG | PM_XMEGAJTAG | PM_AVR32JTAG; + connection_type = usb; + baudrate = 19200; # default is 19200 ; +#------------------------------------------------------------ +# jtag2slow +#------------------------------------------------------------ + # easier to type + programmer parent "jtagmkII" - id = "jtag2slow"; + id = "jtag2slow"; ; +#------------------------------------------------------------ +# jtag2fast +#------------------------------------------------------------ + # JTAG ICE mkII @ 115200 Bd + programmer parent "jtag2slow" - id = "jtag2fast"; - baudrate = 115200; + id = "jtag2fast"; + baudrate = 115200; ; +#------------------------------------------------------------ +# jtag2 +#------------------------------------------------------------ + # make the fast one the default, people will love that + programmer parent "jtag2fast" - id = "jtag2"; + id = "jtag2"; ; +#------------------------------------------------------------ +# jtag2isp +#------------------------------------------------------------ + # JTAG ICE mkII in ISP mode + programmer - id = "jtag2isp"; - desc = "Atmel JTAG ICE mkII in ISP mode"; - baudrate = 115200; - type = "jtagmkii_isp"; - connection_type = usb; + id = "jtag2isp"; + desc = "Atmel JTAG ICE mkII in ISP mode"; + type = "jtagmkii_isp"; + prog_modes = PM_TPI | PM_ISP; + connection_type = usb; + baudrate = 115200; ; +#------------------------------------------------------------ +# jtag2dw +#------------------------------------------------------------ + # JTAG ICE mkII in debugWire mode + programmer - id = "jtag2dw"; - desc = "Atmel JTAG ICE mkII in debugWire mode"; - baudrate = 115200; - type = "jtagmkii_dw"; - connection_type = usb; + id = "jtag2dw"; + desc = "Atmel JTAG ICE mkII in debugWire mode"; + type = "jtagmkii_dw"; + prog_modes = PM_debugWIRE; + connection_type = usb; + baudrate = 115200; ; -# JTAG ICE mkII in AVR32 mode -programmer - id = "jtagmkII_avr32"; - desc = "Atmel JTAG ICE mkII im AVR32 mode"; - baudrate = 115200; - type = "jtagmkii_avr32"; - connection_type = usb; -; +#------------------------------------------------------------ +# jtagmkII_avr32 +#------------------------------------------------------------ # JTAG ICE mkII in AVR32 mode + programmer - id = "jtag2avr32"; - desc = "Atmel JTAG ICE mkII im AVR32 mode"; - baudrate = 115200; - type = "jtagmkii_avr32"; - connection_type = usb; + id = "jtagmkII_avr32"; + desc = "Atmel JTAG ICE mkII in AVR32 mode"; + type = "jtagmkii_avr32"; + prog_modes = PM_aWire; + connection_type = usb; + baudrate = 115200; ; +#------------------------------------------------------------ +# jtag2avr32 +#------------------------------------------------------------ + +# JTAG ICE mkII in AVR32 mode + +programmer + id = "jtag2avr32"; + desc = "Atmel JTAG ICE mkII in AVR32 mode"; + type = "jtagmkii_avr32"; + prog_modes = PM_aWire; + connection_type = usb; + baudrate = 115200; +; + +#------------------------------------------------------------ +# jtag2pdi +#------------------------------------------------------------ + # JTAG ICE mkII in PDI mode + programmer - id = "jtag2pdi"; - desc = "Atmel JTAG ICE mkII PDI mode"; - baudrate = 115200; - type = "jtagmkii_pdi"; - connection_type = usb; + id = "jtag2pdi"; + desc = "Atmel JTAG ICE mkII in PDI mode"; + type = "jtagmkii_pdi"; + prog_modes = PM_PDI; + connection_type = usb; + baudrate = 115200; ; +#------------------------------------------------------------ +# dragon_jtag +#------------------------------------------------------------ + # AVR Dragon in JTAG mode + programmer - id = "dragon_jtag"; - desc = "Atmel AVR Dragon in JTAG mode"; - baudrate = 115200; - type = "dragon_jtag"; - connection_type = usb; + id = "dragon_jtag"; + desc = "Atmel AVR Dragon in JTAG mode"; + type = "dragon_jtag"; + prog_modes = PM_JTAG | PM_XMEGAJTAG | PM_AVR32JTAG; + connection_type = usb; + baudrate = 115200; ; +#------------------------------------------------------------ +# dragon_isp +#------------------------------------------------------------ + # AVR Dragon in ISP mode + programmer - id = "dragon_isp"; - desc = "Atmel AVR Dragon in ISP mode"; - baudrate = 115200; - type = "dragon_isp"; - connection_type = usb; + id = "dragon_isp"; + desc = "Atmel AVR Dragon in ISP mode"; + type = "dragon_isp"; + prog_modes = PM_TPI | PM_ISP; + connection_type = usb; + baudrate = 115200; ; +#------------------------------------------------------------ +# dragon_pp +#------------------------------------------------------------ + # AVR Dragon in PP mode + programmer - id = "dragon_pp"; - desc = "Atmel AVR Dragon in PP mode"; - baudrate = 115200; - type = "dragon_pp"; - connection_type = usb; + id = "dragon_pp"; + desc = "Atmel AVR Dragon in PP mode"; + type = "dragon_pp"; + prog_modes = PM_HVPP; + connection_type = usb; + baudrate = 115200; ; +#------------------------------------------------------------ +# dragon_hvsp +#------------------------------------------------------------ + # AVR Dragon in HVSP mode + programmer - id = "dragon_hvsp"; - desc = "Atmel AVR Dragon in HVSP mode"; - baudrate = 115200; - type = "dragon_hvsp"; - connection_type = usb; + id = "dragon_hvsp"; + desc = "Atmel AVR Dragon in HVSP mode"; + type = "dragon_hvsp"; + prog_modes = PM_HVSP; + connection_type = usb; + baudrate = 115200; ; +#------------------------------------------------------------ +# dragon_dw +#------------------------------------------------------------ + # AVR Dragon in debugWire mode + programmer - id = "dragon_dw"; - desc = "Atmel AVR Dragon in debugWire mode"; - baudrate = 115200; - type = "dragon_dw"; - connection_type = usb; + id = "dragon_dw"; + desc = "Atmel AVR Dragon in debugWire mode"; + type = "dragon_dw"; + prog_modes = PM_debugWIRE; + connection_type = usb; + baudrate = 115200; ; +#------------------------------------------------------------ +# dragon_pdi +#------------------------------------------------------------ + # AVR Dragon in PDI mode -programmer - id = "dragon_pdi"; - desc = "Atmel AVR Dragon in PDI mode"; - baudrate = 115200; - type = "dragon_pdi"; - connection_type = usb; -; programmer - id = "jtag3"; - desc = "Atmel AVR JTAGICE3 in JTAG mode"; - type = "jtagice3"; - connection_type = usb; - usbpid = 0x2110, 0x2140; + id = "dragon_pdi"; + desc = "Atmel AVR Dragon in PDI mode"; + type = "dragon_pdi"; + prog_modes = PM_PDI; + connection_type = usb; + baudrate = 115200; ; +#------------------------------------------------------------ +# jtag3 +#------------------------------------------------------------ + programmer - id = "jtag3pdi"; - desc = "Atmel AVR JTAGICE3 in PDI mode"; - type = "jtagice3_pdi"; - connection_type = usb; - usbpid = 0x2110, 0x2140; + id = "jtag3"; + desc = "Atmel AVR JTAGICE3 in JTAG mode"; + type = "jtagice3"; + prog_modes = PM_JTAG | PM_XMEGAJTAG | PM_AVR32JTAG; + connection_type = usb; + usbpid = 0x2110, 0x2140; ; +#------------------------------------------------------------ +# jtag3pdi +#------------------------------------------------------------ + programmer - id = "jtag3updi"; - desc = "Atmel AVR JTAGICE3 in UPDI mode"; - type = "jtagice3_updi"; - connection_type = usb; - usbpid = 0x2110, 0x2140; + id = "jtag3pdi"; + desc = "Atmel AVR JTAGICE3 in PDI mode"; + type = "jtagice3_pdi"; + prog_modes = PM_PDI; + connection_type = usb; + usbpid = 0x2110, 0x2140; ; +#------------------------------------------------------------ +# jtag3updi +#------------------------------------------------------------ + programmer - id = "jtag3dw"; - desc = "Atmel AVR JTAGICE3 in debugWIRE mode"; - type = "jtagice3_dw"; - connection_type = usb; - usbpid = 0x2110, 0x2140; + id = "jtag3updi"; + desc = "Atmel AVR JTAGICE3 in UPDI mode"; + type = "jtagice3_updi"; + prog_modes = PM_UPDI; + connection_type = usb; + usbpid = 0x2110, 0x2140; + hvupdi_support = 1; ; +#------------------------------------------------------------ +# jtag3dw +#------------------------------------------------------------ + programmer - id = "jtag3isp"; - desc = "Atmel AVR JTAGICE3 in ISP mode"; - type = "jtagice3_isp"; - connection_type = usb; - usbpid = 0x2110, 0x2140; + id = "jtag3dw"; + desc = "Atmel AVR JTAGICE3 in debugWIRE mode"; + type = "jtagice3_dw"; + prog_modes = PM_debugWIRE; + connection_type = usb; + usbpid = 0x2110, 0x2140; ; +#------------------------------------------------------------ +# jtag3isp +#------------------------------------------------------------ + programmer - id = "xplainedpro"; - desc = "Atmel AVR XplainedPro in JTAG mode"; - type = "jtagice3"; - connection_type = usb; - usbpid = 0x2111; + id = "jtag3isp"; + desc = "Atmel AVR JTAGICE3 in ISP mode"; + type = "jtagice3_isp"; + prog_modes = PM_ISP; + connection_type = usb; + usbpid = 0x2110, 0x2140; ; +#------------------------------------------------------------ +# xplainedpro +#------------------------------------------------------------ + programmer - id = "xplainedpro_updi"; - desc = "Atmel AVR XplainedPro in UPDI mode"; - type = "jtagice3_updi"; - connection_type = usb; - usbpid = 0x2111; + id = "xplainedpro"; + desc = "Atmel AVR XplainedPro in JTAG mode"; + type = "jtagice3"; + prog_modes = PM_JTAG | PM_XMEGAJTAG | PM_AVR32JTAG; + connection_type = usb; + usbpid = 0x2111; ; +#------------------------------------------------------------ +# xplainedpro_pdi +#------------------------------------------------------------ + programmer - id = "xplainedmini"; - desc = "Atmel AVR XplainedMini in ISP mode"; - type = "jtagice3_isp"; - connection_type = usb; - usbpid = 0x2145; + id = "xplainedpro_pdi"; + desc = "Atmel AVR XplainedPro in PDI mode"; + type = "jtagice3_pdi"; + prog_modes = PM_PDI; + connection_type = usb; + usbpid = 0x2111; + hvupdi_support = 1; ; +#------------------------------------------------------------ +# xplainedpro_updi +#------------------------------------------------------------ + programmer - id = "xplainedmini_dw"; - desc = "Atmel AVR XplainedMini in debugWIRE mode"; - type = "jtagice3_dw"; - connection_type = usb; - usbpid = 0x2145; + id = "xplainedpro_updi"; + desc = "Atmel AVR XplainedPro in UPDI mode"; + type = "jtagice3_updi"; + prog_modes = PM_UPDI; + connection_type = usb; + usbpid = 0x2111; + hvupdi_support = 1; ; +#------------------------------------------------------------ +# xplainedmini +#------------------------------------------------------------ + programmer - id = "xplainedmini_updi"; - desc = "Atmel AVR XplainedMini in UPDI mode"; - type = "jtagice3_updi"; - connection_type = usb; - usbpid = 0x2145; + id = "xplainedmini"; + desc = "Atmel AVR XplainedMini in ISP mode"; + type = "jtagice3_isp"; + prog_modes = PM_ISP; + connection_type = usb; + usbpid = 0x2145; ; +#------------------------------------------------------------ +# xplainedmini_dw +#------------------------------------------------------------ + programmer - id = "atmelice"; - desc = "Atmel-ICE (ARM/AVR) in JTAG mode"; - type = "jtagice3"; - connection_type = usb; - usbpid = 0x2141; + id = "xplainedmini_dw"; + desc = "Atmel AVR XplainedMini in debugWIRE mode"; + type = "jtagice3_dw"; + prog_modes = PM_debugWIRE; + connection_type = usb; + usbpid = 0x2145; ; +#------------------------------------------------------------ +# xplainedmini_updi +#------------------------------------------------------------ + programmer - id = "atmelice_pdi"; - desc = "Atmel-ICE (ARM/AVR) in PDI mode"; - type = "jtagice3_pdi"; - connection_type = usb; - usbpid = 0x2141; + id = "xplainedmini_updi"; + desc = "Atmel AVR XplainedMini in UPDI mode"; + type = "jtagice3_updi"; + prog_modes = PM_UPDI; + connection_type = usb; + usbpid = 0x2145; + hvupdi_support = 1; ; +#------------------------------------------------------------ +# xplainedmini_tpi +#------------------------------------------------------------ + programmer - id = "atmelice_updi"; - desc = "Atmel-ICE (ARM/AVR) in UPDI mode"; - type = "jtagice3_updi"; - connection_type = usb; - usbpid = 0x2141; + id = "xplainedmini_tpi"; + desc = "Atmel AVR XplainedMini in TPI mode"; + type = "jtagice3_tpi"; + prog_modes = PM_TPI; + connection_type = usb; + usbpid = 0x2145; ; +#------------------------------------------------------------ +# atmelice +#------------------------------------------------------------ + programmer - id = "atmelice_dw"; - desc = "Atmel-ICE (ARM/AVR) in debugWIRE mode"; - type = "jtagice3_dw"; - connection_type = usb; - usbpid = 0x2141; + id = "atmelice"; + desc = "Atmel-ICE (ARM/AVR) in JTAG mode"; + type = "jtagice3"; + prog_modes = PM_JTAG | PM_XMEGAJTAG | PM_AVR32JTAG; + connection_type = usb; + usbpid = 0x2141; ; +#------------------------------------------------------------ +# atmelice_pdi +#------------------------------------------------------------ + programmer - id = "atmelice_isp"; - desc = "Atmel-ICE (ARM/AVR) in ISP mode"; - type = "jtagice3_isp"; - connection_type = usb; - usbpid = 0x2141; + id = "atmelice_pdi"; + desc = "Atmel-ICE (ARM/AVR) in PDI mode"; + type = "jtagice3_pdi"; + prog_modes = PM_PDI; + connection_type = usb; + usbpid = 0x2141; ; +#------------------------------------------------------------ +# atmelice_updi +#------------------------------------------------------------ + programmer - id = "powerdebugger"; - desc = "Atmel PowerDebugger (ARM/AVR) in JTAG mode"; - type = "jtagice3"; - connection_type = usb; - usbpid = 0x2144; + id = "atmelice_updi"; + desc = "Atmel-ICE (ARM/AVR) in UPDI mode"; + type = "jtagice3_updi"; + prog_modes = PM_UPDI; + connection_type = usb; + usbpid = 0x2141; + hvupdi_support = 1; ; +#------------------------------------------------------------ +# atmelice_dw +#------------------------------------------------------------ + programmer - id = "powerdebugger_pdi"; - desc = "Atmel PowerDebugger (ARM/AVR) in PDI mode"; - type = "jtagice3_pdi"; - connection_type = usb; - usbpid = 0x2144; + id = "atmelice_dw"; + desc = "Atmel-ICE (ARM/AVR) in debugWIRE mode"; + type = "jtagice3_dw"; + prog_modes = PM_debugWIRE; + connection_type = usb; + usbpid = 0x2141; ; +#------------------------------------------------------------ +# atmelice_isp +#------------------------------------------------------------ + programmer - id = "powerdebugger_updi"; - desc = "Atmel PowerDebugger (ARM/AVR) in UPDI mode"; - type = "jtagice3_updi"; - connection_type = usb; - usbpid = 0x2144; + id = "atmelice_isp"; + desc = "Atmel-ICE (ARM/AVR) in ISP mode"; + type = "jtagice3_isp"; + prog_modes = PM_ISP; + connection_type = usb; + usbpid = 0x2141; ; +#------------------------------------------------------------ +# atmelice_tpi +#------------------------------------------------------------ + programmer - id = "powerdebugger_dw"; - desc = "Atmel PowerDebugger (ARM/AVR) in debugWire mode"; - type = "jtagice3_dw"; - connection_type = usb; - usbpid = 0x2144; + id = "atmelice_tpi"; + desc = "Atmel-ICE (ARM/AVR) in TPI mode"; + type = "jtagice3_tpi"; + prog_modes = PM_TPI; + connection_type = usb; + usbpid = 0x2141; ; +#------------------------------------------------------------ +# powerdebugger +#------------------------------------------------------------ + programmer - id = "powerdebugger_isp"; - desc = "Atmel PowerDebugger (ARM/AVR) in ISP mode"; - type = "jtagice3_isp"; - connection_type = usb; - usbpid = 0x2144; + id = "powerdebugger"; + desc = "Atmel PowerDebugger (ARM/AVR) in JTAG mode"; + type = "jtagice3"; + prog_modes = PM_JTAG | PM_XMEGAJTAG | PM_AVR32JTAG; + connection_type = usb; + usbpid = 0x2144; ; +#------------------------------------------------------------ +# powerdebugger_pdi +#------------------------------------------------------------ + programmer - id = "pickit4_updi"; - desc = "MPLAB(R) PICkit 4 in UPDI mode"; - type = "jtagice3_updi"; - connection_type = usb; - usbpid = 0x2177, 0x2178, 0x2179; + id = "powerdebugger_pdi"; + desc = "Atmel PowerDebugger (ARM/AVR) in PDI mode"; + type = "jtagice3_pdi"; + prog_modes = PM_PDI; + connection_type = usb; + usbpid = 0x2144; ; +#------------------------------------------------------------ +# powerdebugger_updi +#------------------------------------------------------------ + programmer - id = "pickit4_pdi"; - desc = "MPLAB(R) PICkit 4 in PDI mode"; - type = "jtagice3_pdi"; - connection_type = usb; - usbpid = 0x2177, 0x2178, 0x2179; + id = "powerdebugger_updi"; + desc = "Atmel PowerDebugger (ARM/AVR) in UPDI mode"; + type = "jtagice3_updi"; + prog_modes = PM_UPDI; + connection_type = usb; + usbpid = 0x2144; + hvupdi_support = 0, 1; ; +#------------------------------------------------------------ +# powerdebugger_dw +#------------------------------------------------------------ + programmer - id = "pickit4_isp"; - desc = "MPLAB(R) PICkit 4 in ISP mode"; - type = "jtagice3_isp"; - connection_type = usb; - usbpid = 0x2177, 0x2178, 0x2179; + id = "powerdebugger_dw"; + desc = "Atmel PowerDebugger (ARM/AVR) in debugWire mode"; + type = "jtagice3_dw"; + prog_modes = PM_debugWIRE; + connection_type = usb; + usbpid = 0x2144; ; +#------------------------------------------------------------ +# powerdebugger_isp +#------------------------------------------------------------ + programmer - id = "snap_updi"; - desc = "MPLAB(R) SNAP in UPDI mode"; - type = "jtagice3_updi"; - connection_type = usb; - usbpid = 0x217F, 0x2180, 0x2181; + id = "powerdebugger_isp"; + desc = "Atmel PowerDebugger (ARM/AVR) in ISP mode"; + type = "jtagice3_isp"; + prog_modes = PM_ISP; + connection_type = usb; + usbpid = 0x2144; ; +#------------------------------------------------------------ +# powerdebugger_tpi +#------------------------------------------------------------ + programmer - id = "snap_pdi"; - desc = "MPLAB(R) SNAP in PDI mode"; - type = "jtagice3_pdi"; - connection_type = usb; - usbpid = 0x217F, 0x2180, 0x2181; + id = "powerdebugger_tpi"; + desc = "Atmel PowerDebugger (ARM/AVR) in TPI mode"; + type = "jtagice3_tpi"; + prog_modes = PM_TPI; + connection_type = usb; + usbpid = 0x2144; ; +#------------------------------------------------------------ +# pickit4 +#------------------------------------------------------------ + programmer - id = "snap_isp"; - desc = "MPLAB(R) SNAP in ISP mode"; - type = "jtagice3_isp"; - connection_type = usb; - usbpid = 0x217F, 0x2180, 0x2181; + id = "pickit4"; + desc = "MPLAB(R) PICkit 4 in JTAG mode"; + type = "jtagice3"; + prog_modes = PM_JTAG | PM_XMEGAJTAG; + connection_type = usb; + usbpid = 0x2177, 0x2178, 0x2179; ; +#------------------------------------------------------------ +# pickit4_updi +#------------------------------------------------------------ + programmer - id = "pkobn_updi"; - desc = "Curiosity nano (nEDBG) in UPDI mode"; - type = "jtagice3_updi"; - connection_type = usb; - usbpid = 0x2175; + id = "pickit4_updi"; + desc = "MPLAB(R) PICkit 4 in UPDI mode"; + type = "jtagice3_updi"; + prog_modes = PM_UPDI; + connection_type = usb; + usbpid = 0x2177, 0x2178, 0x2179; + hvupdi_support = 0, 1, 2; ; +#------------------------------------------------------------ +# pickit4_pdi +#------------------------------------------------------------ + programmer - id = "pavr"; - desc = "Jason Kyle's pAVR Serial Programmer"; - type = "avr910"; - connection_type = serial; + id = "pickit4_pdi"; + desc = "MPLAB(R) PICkit 4 in PDI mode"; + type = "jtagice3_pdi"; + prog_modes = PM_PDI; + connection_type = usb; + usbpid = 0x2177, 0x2178, 0x2179; ; +#------------------------------------------------------------ +# pickit4_isp +#------------------------------------------------------------ + programmer - id = "pickit2"; - desc = "MicroChip's PICkit2 Programmer"; - type = "pickit2"; - connection_type = usb; + id = "pickit4_isp"; + desc = "MPLAB(R) PICkit 4 in ISP mode"; + type = "jtagice3_isp"; + prog_modes = PM_ISP; + connection_type = usb; + usbpid = 0x2177, 0x2178, 0x2179; ; +#------------------------------------------------------------ +# pickit4_tpi +#------------------------------------------------------------ + programmer - id = "flip1"; - desc = "FLIP USB DFU protocol version 1 (doc7618)"; - type = "flip1"; - connection_type = usb; + id = "pickit4_tpi"; + desc = "MPLAB(R) PICkit 4 in TPI mode"; + type = "jtagice3_tpi"; + prog_modes = PM_TPI; + connection_type = usb; + usbpid = 0x2177, 0x2178, 0x2179; ; +#------------------------------------------------------------ +# snap +#------------------------------------------------------------ + programmer - id = "flip2"; - desc = "FLIP USB DFU protocol version 2 (AVR4023)"; - type = "flip2"; - connection_type = usb; + id = "snap"; + desc = "MPLAB(R) Snap in JTAG mode"; + type = "jtagice3"; + prog_modes = PM_JTAG | PM_XMEGAJTAG; + connection_type = usb; + usbpid = 0x2180, 0x217f, 0x2181; ; -@HAVE_PARPORT_BEGIN@ -# Parallel port programmers. +#------------------------------------------------------------ +# snap_updi +#------------------------------------------------------------ programmer - id = "bsd"; - desc = "Brian Dean's Programmer, http://www.bsdhome.com/avrdude/"; - type = "par"; - connection_type = parallel; - vcc = 2, 3, 4, 5; - reset = 7; - sck = 8; - mosi = 9; - miso = 10; + id = "snap_updi"; + desc = "MPLAB(R) SNAP in UPDI mode"; + type = "jtagice3_updi"; + prog_modes = PM_UPDI; + connection_type = usb; + usbpid = 0x2180, 0x217f, 0x2181; + hvupdi_support = 1; ; +#------------------------------------------------------------ +# snap_pdi +#------------------------------------------------------------ + programmer - id = "stk200"; - desc = "STK200"; - type = "par"; - connection_type = parallel; - buff = 4, 5; - sck = 6; - mosi = 7; - reset = 9; - miso = 10; + id = "snap_pdi"; + desc = "MPLAB(R) SNAP in PDI mode"; + type = "jtagice3_pdi"; + prog_modes = PM_PDI; + connection_type = usb; + usbpid = 0x2180, 0x217f, 0x2181; ; -# 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 -# programming is currently in progress. - -programmer parent "stk200" - id = "pony-stk200"; - desc = "Pony Prog STK200"; - pgmled = 8; -; +#------------------------------------------------------------ +# snap_isp +#------------------------------------------------------------ programmer - id = "dt006"; - desc = "Dontronics DT006"; - type = "par"; - connection_type = parallel; - reset = 4; - sck = 5; - mosi = 2; - miso = 11; + id = "snap_isp"; + desc = "MPLAB(R) SNAP in ISP mode"; + type = "jtagice3_isp"; + prog_modes = PM_ISP; + connection_type = usb; + usbpid = 0x2180, 0x217f, 0x2181; ; -programmer parent "dt006" - id = "bascom"; - desc = "Bascom SAMPLE programming cable"; -; +#------------------------------------------------------------ +# snap_tpi +#------------------------------------------------------------ programmer - id = "alf"; - desc = "Nightshade ALF-PgmAVR, http://nightshade.homeip.net/"; - type = "par"; - connection_type = parallel; - vcc = 2, 3, 4, 5; - buff = 6; - reset = 7; - sck = 8; - mosi = 9; - miso = 10; - errled = 1; - rdyled = 14; - pgmled = 16; - vfyled = 17; + id = "snap_tpi"; + desc = "MPLAB(R) SNAP in TPI mode"; + type = "jtagice3_tpi"; + prog_modes = PM_TPI; + connection_type = usb; + usbpid = 0x2180, 0x217f, 0x2181; ; +#------------------------------------------------------------ +# pkobn_updi +#------------------------------------------------------------ + programmer - id = "sp12"; - desc = "Steve Bolt's Programmer"; - type = "par"; - connection_type = parallel; - vcc = 4,5,6,7,8; - reset = 3; - sck = 2; - mosi = 9; - miso = 11; + id = "pkobn_updi"; + desc = "Curiosity nano (nEDBG) in UPDI mode"; + type = "jtagice3_updi"; + prog_modes = PM_UPDI; + connection_type = usb; + usbpid = 0x2175; + hvupdi_support = 1; ; +#------------------------------------------------------------ +# pavr +#------------------------------------------------------------ + programmer - id = "picoweb"; - desc = "Picoweb Programming Cable, http://www.picoweb.net/"; - type = "par"; - connection_type = parallel; - reset = 2; - sck = 3; - mosi = 4; - miso = 13; + id = "pavr"; + desc = "Jason Kyle's pAVR Serial Programmer"; + type = "avr910"; + prog_modes = PM_ISP; + connection_type = serial; ; +#------------------------------------------------------------ +# pickit2 +#------------------------------------------------------------ + programmer - id = "abcmini"; - desc = "ABCmini Board, aka Dick Smith HOTCHIP"; - type = "par"; - connection_type = parallel; - reset = 4; - sck = 3; - mosi = 2; - miso = 10; + id = "pickit2"; + desc = "MicroChip's PICkit2 Programmer"; + type = "pickit2"; + prog_modes = PM_ISP; + connection_type = usb; ; +#------------------------------------------------------------ +# flip1 +#------------------------------------------------------------ + programmer - id = "futurlec"; - desc = "Futurlec.com programming cable."; - type = "par"; - connection_type = parallel; - reset = 3; - sck = 2; - mosi = 1; - 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 -# buffer lines (trying to add it to the "buff" lines doesn't work in -# avrdude versions before 5.5j). -# With this, TMS connects to RESET, TDI to MOSI, TDO to MISO and TCK -# to SCK (plus vcc/gnd of course) -programmer - id = "xil"; - desc = "Xilinx JTAG cable"; - type = "par"; - connection_type = parallel; - mosi = 2; - sck = 3; - reset = 4; - buff = 5; - miso = 13; - vcc = 6; + id = "flip1"; + desc = "FLIP for bootloader using USB DFU protocol version 1 (doc7618)"; + type = "flip1"; + prog_modes = PM_SPM; + connection_type = usb; ; +#------------------------------------------------------------ +# flip2 +#------------------------------------------------------------ programmer - id = "dapa"; - desc = "Direct AVR Parallel Access cable"; - type = "par"; - connection_type = parallel; - vcc = 3; - reset = 16; - sck = 1; - mosi = 2; - miso = 11; + id = "flip2"; + desc = "FLIP for bootloader using USB DFU protocol version 2 (AVR4023)"; + type = "flip2"; + prog_modes = PM_SPM; + connection_type = usb; ; -programmer - id = "atisp"; - desc = "AT-ISP V1.1 programming cable for AVR-SDK1 from micro-research.co.th"; - type = "par"; - connection_type = parallel; - reset = ~6; - sck = ~8; - mosi = ~7; - miso = ~10; -; +#------------------------------------------------------------ +# ponyser +#------------------------------------------------------------ -programmer - id = "ere-isp-avr"; - desc = "ERE ISP-AVR "; - type = "par"; - connection_type = parallel; - reset = ~4; - sck = 3; - mosi = 2; - miso = 10; -; - -programmer - id = "blaster"; - desc = "Altera ByteBlaster"; - type = "par"; - connection_type = parallel; - sck = 2; - miso = 11; - reset = 3; - mosi = 8; - buff = 14; -; - -# It is almost same as pony-stk200, except vcc on pin 5 to auto -# disconnect port (download on http://electropol.free.fr/spip/spip.php?article27) -programmer parent "pony-stk200" - id = "frank-stk200"; - desc = "Frank STK200"; - buff = ; # delete buff pin assignment - vcc = 5; -; - -# The AT98ISP Cable is a simple parallel dongle for AT89 family. -# http://www.atmel.com/dyn/products/tools_card.asp?tool_id=2877 -programmer - id = "89isp"; - desc = "Atmel at89isp cable"; - type = "par"; - connection_type = parallel; - reset = 17; - sck = 1; - mosi = 2; - miso = 10; -; - -@HAVE_PARPORT_END@ - -@HAVE_LINUXGPIO_BEGIN@ -#This programmer bitbangs GPIO lines using the Linux sysfs GPIO interface -# -#To enable it set the configuration below to match the GPIO lines connected to the -#relevant ISP header pins and uncomment the entry definition. In case you don't -#have the required permissions to edit this system wide config file put the -#entry in a separate .conf file and use it with -C+.conf -#on the command line. -# -#To check if your avrdude build has support for the linuxgpio programmer compiled in, -#use -c?type on the command line and look for linuxgpio in the list. If it's not available -#you need pass the --enable-linuxgpio=yes option to configure and recompile avrdude. -# -#programmer -# id = "linuxgpio"; -# desc = "Use the Linux sysfs interface to bitbang GPIO lines"; -# type = "linuxgpio"; -# reset = ?; -# sck = ?; -# mosi = ?; -# miso = ?; -#; -@HAVE_LINUXGPIO_END@ - - -@HAVE_LINUXSPI_BEGIN@ -# This programmer uses the built in linux SPI bus devices to program an -# attached AVR. The reset pin must be attached to a GPIO pin that -# is otherwise unused (see gpioinfo(1)); the SPI bus CE pins are not -# suitable since they would release /RESET too early. -# -programmer - id = "linuxspi"; - desc = "Use Linux SPI device in /dev/spidev*"; - type = "linuxspi"; - reset = 25; # Pi GPIO number - this is J8:22 -; -@HAVE_LINUXSPI_END@ - -# some ultra cheap programmers use bitbanging on the -# serialport. +# some ultra cheap programmers use bitbanging on the serialport # # PC - DB9 - Pins for RS232: # @@ -1664,78 +2528,104 @@ programmer # Using RI is not supported under Win32 but is supported under Posix. # serial ponyprog design (dasa2 in uisp) -# reset=!txd sck=rts mosi=dtr miso=cts +# reset=!txd sck=rts sdo=dtr sdi=cts programmer - id = "ponyser"; - desc = "design ponyprog serial, reset=!txd sck=rts mosi=dtr miso=cts"; - type = "serbb"; - connection_type = serial; - reset = ~3; - sck = 7; - mosi = 4; - miso = 8; + id = "ponyser"; + desc = "design ponyprog serial, reset=!txd sck=rts sdo=dtr sdi=cts"; + type = "serbb"; + prog_modes = PM_TPI | PM_ISP; + connection_type = serial; + reset = ~3; + sck = 7; + sdo = 4; + sdi = 8; ; +#------------------------------------------------------------ +# siprog +#------------------------------------------------------------ + # Same as above, different name -# reset=!txd sck=rts mosi=dtr miso=cts +# reset=!txd sck=rts sdo=dtr sdi=cts programmer parent "ponyser" - id = "siprog"; - desc = "Lancos SI-Prog "; + id = "siprog"; + desc = "Lancos SI-Prog "; ; +#------------------------------------------------------------ +# dasa +#------------------------------------------------------------ + # unknown (dasa in uisp) -# reset=rts sck=dtr mosi=txd miso=cts +# reset=rts sck=dtr sdo=txd sdi=cts programmer - id = "dasa"; - desc = "serial port banging, reset=rts sck=dtr mosi=txd miso=cts"; - type = "serbb"; - connection_type = serial; - reset = 7; - sck = 4; - mosi = 3; - miso = 8; + id = "dasa"; + desc = "serial port banging, reset=rts sck=dtr sdo=txd sdi=cts"; + type = "serbb"; + prog_modes = PM_TPI | PM_ISP; + connection_type = serial; + reset = 7; + sck = 4; + sdo = 3; + sdi = 8; ; +#------------------------------------------------------------ +# dasa3 +#------------------------------------------------------------ + # unknown (dasa3 in uisp) -# reset=!dtr sck=rts mosi=txd miso=cts +# reset=!dtr sck=rts sdo=txd sdi=cts programmer - id = "dasa3"; - desc = "serial port banging, reset=!dtr sck=rts mosi=txd miso=cts"; - type = "serbb"; - connection_type = serial; - reset = ~4; - sck = 7; - mosi = 3; - miso = 8; + id = "dasa3"; + desc = "serial port banging, reset=!dtr sck=rts sdo=txd sdi=cts"; + type = "serbb"; + prog_modes = PM_TPI | PM_ISP; + connection_type = serial; + reset = ~4; + sck = 7; + sdo = 3; + sdi = 8; ; +#------------------------------------------------------------ +# C2N232i +#------------------------------------------------------------ + # C2N232i (jumper configuration "auto") -# reset=dtr sck=!rts mosi=!txd miso=!cts +# reset=dtr sck=!rts sdo=!txd sdi=!cts programmer - id = "c2n232i"; - desc = "serial port banging, reset=dtr sck=!rts mosi=!txd miso=!cts"; - type = "serbb"; - connection_type = serial; - reset = 4; - sck = ~7; - mosi = ~3; - miso = ~8; + id = "c2n232i"; + desc = "serial port banging, reset=dtr sck=!rts sdo=!txd sdi=!cts"; + type = "serbb"; + prog_modes = PM_TPI | PM_ISP; + connection_type = serial; + reset = 4; + sck = ~7; + sdo = ~3; + sdi = ~8; ; +#------------------------------------------------------------ +# jtag2updi +#------------------------------------------------------------ + # JTAG2UPDI # https://github.com/ElTangas/jtag2updi programmer - id = "jtag2updi"; - desc = "JTAGv2 to UPDI bridge"; - type = "jtagmkii_pdi"; - connection_type = serial; - baudrate = 115200; + id = "jtag2updi"; + desc = "JTAGv2 to UPDI bridge"; + type = "jtagmkii_updi"; + prog_modes = PM_UPDI; + connection_type = serial; + baudrate = 115200; + hvupdi_support = 1; ; # @@ -1749,62 +2639,61 @@ programmer # This is an HVSP-only device. part - id = "t11"; - desc = "ATtiny11"; - stk500_devcode = 0x11; - signature = 0x1e 0x90 0x04; - chip_erase_delay = 20000; - - timeout = 200; - hvsp_controlstack = - 0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x00, + desc = "ATtiny11"; + id = "t11"; + prog_modes = PM_HVSP; + mcuid = 8; + n_interrupts = 5; + stk500_devcode = 0x11; + chip_erase_delay = 20000; + signature = 0x1e 0x90 0x04; + serial = no; + timeout = 200; + hvsp_controlstack = + 0x4c, 0x0c, 0x1c, 0x2c, 0x3c, 0x64, 0x74, 0x00, 0x68, 0x78, 0x68, 0x68, 0x00, 0x00, 0x68, 0x78, - 0x78, 0x00, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10, + 0x78, 0x00, 0x6d, 0x0c, 0x80, 0x40, 0x20, 0x10, 0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - hvspcmdexedelay = 0; - synchcycles = 6; - latchcycles = 1; - togglevtg = 1; - poweroffdelay = 25; - resetdelayms = 0; - resetdelayus = 50; - hvleavestabdelay = 100; - resetdelay = 25; - chiperasepolltimeout = 40; - chiperasetime = 0; + hventerstabdelay = 100; + latchcycles = 1; + togglevtg = 1; + poweroffdelay = 25; + resetdelayus = 50; + hvleavestabdelay = 100; + resetdelay = 25; + chiperasepolltimeout = 40; programfusepolltimeout = 25; programlockpolltimeout = 25; + synchcycles = 6; memory "eeprom" - size = 64; - blocksize = 64; - readsize = 256; - delay = 5; + size = 64; + delay = 5; + blocksize = 64; + readsize = 256; ; memory "flash" - size = 1024; - blocksize = 128; - readsize = 256; - delay = 3; - ; - - memory "signature" - size = 3; - ; - - memory "lock" - size = 1; - ; - - memory "calibration" - size = 1; + size = 1024; + delay = 3; + blocksize = 128; + readsize = 256; ; memory "fuse" - size = 1; + size = 1; + ; + + memory "lock" + size = 1; + ; + + memory "signature" + size = 3; + ; + + memory "calibration" + size = 1; ; ; @@ -1813,131 +2702,94 @@ part #------------------------------------------------------------ part - id = "t12"; - desc = "ATtiny12"; - stk500_devcode = 0x12; - avr910_devcode = 0x55; - signature = 0x1e 0x90 0x05; - chip_erase_delay = 20000; - 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; - - hvsp_controlstack = - 0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x00, + desc = "ATtiny12"; + id = "t12"; + prog_modes = PM_ISP | PM_HVSP; + mcuid = 9; + n_interrupts = 6; + stk500_devcode = 0x12; + avr910_devcode = 0x55; + chip_erase_delay = 20000; + signature = 0x1e 0x90 0x05; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + hvsp_controlstack = + 0x4c, 0x0c, 0x1c, 0x2c, 0x3c, 0x64, 0x74, 0x00, 0x68, 0x78, 0x68, 0x68, 0x00, 0x00, 0x68, 0x78, - 0x78, 0x00, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10, + 0x78, 0x00, 0x6d, 0x0c, 0x80, 0x40, 0x20, 0x10, 0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00; - hventerstabdelay = 100; - hvspcmdexedelay = 0; - synchcycles = 6; - latchcycles = 1; - togglevtg = 1; - poweroffdelay = 25; - resetdelayms = 0; - resetdelayus = 50; - hvleavestabdelay = 100; - resetdelay = 25; - chiperasepolltimeout = 40; - chiperasetime = 0; + hventerstabdelay = 100; + latchcycles = 1; + togglevtg = 1; + poweroffdelay = 25; + resetdelayus = 50; + hvleavestabdelay = 100; + resetdelay = 25; + chiperasepolltimeout = 40; programfusepolltimeout = 25; programlockpolltimeout = 25; + synchcycles = 6; + chip_erase = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; memory "eeprom" - size = 64; - min_write_delay = 9000; - max_write_delay = 20000; - readback_p1 = 0xff; - readback_p2 = 0xff; - read = "1 0 1 0 0 0 0 0 x x x x x x x x", - "x x 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 x a5 a4 a3 a2 a1 a0 i i i i i i i i"; - - mode = 0x04; - delay = 8; - blocksize = 64; - readsize = 256; + size = 64; + min_write_delay = 9000; + max_write_delay = 20000; + readback = 0xff 0xff; + mode = 4; + delay = 8; + blocksize = 64; + readsize = 256; + read = "1010.0000--xxxx.xxxx--xxaa.aaaa--oooo.oooo"; + write = "1100.0000--xxxx.xxxx--xxaa.aaaa--iiii.iiii"; ; memory "flash" - size = 1024; - min_write_delay = 4500; - max_write_delay = 20000; - readback_p1 = 0xff; - readback_p2 = 0xff; - read_lo = " 0 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"; - - read_hi = " 0 0 1 0 1 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_lo = " 0 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"; - - write_hi = " 0 1 0 0 1 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 "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 o o x"; - - write = "1 0 1 0 1 1 0 0 1 1 1 1 1 i i 1", - "x x x x x x x x x x x x x x x x"; - min_write_delay = 9000; - max_write_delay = 9000; - ; - - 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"; + size = 1024; + min_write_delay = 4500; + max_write_delay = 20000; + readback = 0xff 0xff; + mode = 4; + delay = 5; + blocksize = 128; + readsize = 256; + read_lo = "0010.0000--xxxx.xxxa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--xxxx.xxxa--aaaa.aaaa--oooo.oooo"; + write_lo = "0100.0000--xxxx.xxxa--aaaa.aaaa--iiii.iiii"; + write_hi = "0100.1000--xxxx.xxxa--aaaa.aaaa--iiii.iiii"; ; memory "fuse" - size = 1; - 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 o o o o o o o o"; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--xxxx.xxxx--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--101x.xxxx--xxxx.xxxx--iiii.iiii"; + ; - 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 i i i i i i i i"; - min_write_delay = 9000; - max_write_delay = 9000; + memory "lock" + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--xxxx.xxxx--xxxx.xxxx--xxxx.xoox"; + write = "1010.1100--1111.1ii1--xxxx.xxxx--xxxx.xxxx"; + ; + + memory "signature" + size = 3; + read = "0011.0000--xxxx.xxxx--0000.00aa--oooo.oooo"; + ; + + memory "calibration" + size = 1; + read = "0011.1000--xxxx.xxxx--0000.0000--oooo.oooo"; ; ; @@ -1946,172 +2798,118 @@ part #------------------------------------------------------------ part - id = "t13"; - desc = "ATtiny13"; - has_debugwire = yes; - flash_instr = 0xB4, 0x0E, 0x1E; - eeprom_instr = 0xBB, 0xFE, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D, - 0xBC, 0x0E, 0xB4, 0x0E, 0xBA, 0x0D, 0xBB, 0xBC, - 0x99, 0xE1, 0xBB, 0xAC; - stk500_devcode = 0x14; - signature = 0x1e 0x90 0x07; - chip_erase_delay = 4000; - 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; - - hvsp_controlstack = - 0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x66, - 0x68, 0x78, 0x68, 0x68, 0x7A, 0x6A, 0x68, 0x78, - 0x78, 0x7D, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10, + desc = "ATtiny13"; + id = "t13"; + prog_modes = PM_SPM | PM_ISP | PM_HVSP | PM_debugWIRE; + mcuid = 10; + n_interrupts = 10; + stk500_devcode = 0x14; + chip_erase_delay = 4000; + signature = 0x1e 0x90 0x07; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + hvsp_controlstack = + 0x4c, 0x0c, 0x1c, 0x2c, 0x3c, 0x64, 0x74, 0x66, + 0x68, 0x78, 0x68, 0x68, 0x7a, 0x6a, 0x68, 0x78, + 0x78, 0x7d, 0x6d, 0x0c, 0x80, 0x40, 0x20, 0x10, 0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - hvspcmdexedelay = 0; - synchcycles = 6; - latchcycles = 1; - togglevtg = 1; - poweroffdelay = 25; - resetdelayms = 0; - resetdelayus = 90; - hvleavestabdelay = 100; - resetdelay = 25; - chiperasepolltimeout = 40; - chiperasetime = 0; + flash_instr = 0xb4, 0x0e, 0x1e; + eeprom_instr = + 0xbb, 0xfe, 0xbb, 0xee, 0xbb, 0xcc, 0xb2, 0x0d, + 0xbc, 0x0e, 0xb4, 0x0e, 0xba, 0x0d, 0xbb, 0xbc, + 0x99, 0xe1, 0xbb, 0xac; + hventerstabdelay = 100; + latchcycles = 1; + togglevtg = 1; + poweroffdelay = 25; + resetdelayus = 90; + hvleavestabdelay = 100; + resetdelay = 25; + chiperasepolltimeout = 40; programfusepolltimeout = 25; programlockpolltimeout = 25; - - ocdrev = 0; + synchcycles = 6; + spmcr = 0x57; + eecr = 0x3c; + ocdrev = 0; + chip_erase = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; memory "eeprom" - size = 64; - page_size = 4; - min_write_delay = 4000; - max_write_delay = 4000; - 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 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 a5 a4 a3 a2 a1 a0 i i i i i i i i"; - - loadpage_lo = " 1 1 0 0 0 0 0 1", - " 0 0 0 0 0 0 0 0", - " 0 0 0 0 0 0 a1 a0", - " i i i i i i i i"; - - writepage = " 1 1 0 0 0 0 1 0", - " 0 0 x x x x x x", - " x x a5 a4 a3 a2 0 0", - " x x x x x x x x"; - - mode = 0x41; - delay = 5; - blocksize = 4; - readsize = 256; + size = 64; + page_size = 4; + min_write_delay = 4000; + max_write_delay = 4000; + readback = 0xff 0xff; + mode = 65; + delay = 5; + blocksize = 4; + readsize = 256; + read = "1010.0000--000x.xxxx--xxaa.aaaa--oooo.oooo"; + write = "1100.0000--000x.xxxx--xxaa.aaaa--iiii.iiii"; + loadpage_lo = "1100.0001--0000.0000--0000.00aa--iiii.iiii"; + writepage = "1100.0010--00xx.xxxx--xxaa.aa00--xxxx.xxxx"; ; memory "flash" - paged = yes; - size = 1024; - page_size = 32; - num_pages = 32; - 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 0 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 0 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 x 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 x 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 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" - 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; - 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 o o 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 = 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"; + paged = yes; + size = 1024; + page_size = 32; + num_pages = 32; + min_write_delay = 4500; + max_write_delay = 4500; + readback = 0xff 0xff; + mode = 65; + delay = 6; + blocksize = 32; + readsize = 256; + read_lo = "0010.0000--0000.000a--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--0000.000a--aaaa.aaaa--oooo.oooo"; + loadpage_lo = "0100.0000--000x.xxxx--xxxx.aaaa--iiii.iiii"; + loadpage_hi = "0100.1000--000x.xxxx--xxxx.aaaa--iiii.iiii"; + writepage = "0100.1100--0000.000a--aaaa.xxxx--xxxx.xxxx"; ; memory "lfuse" - size = 1; - min_write_delay = 4500; - max_write_delay = 4500; - - 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"; - ; + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii"; + ; memory "hfuse" - size = 1; - min_write_delay = 4500; - max_write_delay = 4500; + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii"; + ; - 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 = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii"; + ; - 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 "signature" + size = 3; + read = "0011.0000--000x.xxxx--xxxx.xxaa--oooo.oooo"; + ; + + memory "calibration" + size = 2; + read = "0011.1000--000x.xxxx--0000.000a--oooo.oooo"; + ; ; #------------------------------------------------------------ @@ -2119,140 +2917,105 @@ part #------------------------------------------------------------ part parent "t13" - id = "t13a"; - desc = "ATtiny13A"; - ; + desc = "ATtiny13A"; + id = "t13a"; + mcuid = 11; +; #------------------------------------------------------------ # ATtiny15 #------------------------------------------------------------ part - id = "t15"; - desc = "ATtiny15"; - stk500_devcode = 0x13; - avr910_devcode = 0x56; - signature = 0x1e 0x90 0x06; - chip_erase_delay = 8200; - 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; - - hvsp_controlstack = - 0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x00, + desc = "ATtiny15"; + id = "t15"; + prog_modes = PM_ISP | PM_HVSP; + mcuid = 12; + n_interrupts = 9; + stk500_devcode = 0x13; + avr910_devcode = 0x56; + chip_erase_delay = 8200; + signature = 0x1e 0x90 0x06; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + hvsp_controlstack = + 0x4c, 0x0c, 0x1c, 0x2c, 0x3c, 0x64, 0x74, 0x00, 0x68, 0x78, 0x68, 0x68, 0x00, 0x00, 0x68, 0x78, - 0x78, 0x00, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10, + 0x78, 0x00, 0x6d, 0x0c, 0x80, 0x40, 0x20, 0x10, 0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00; - hventerstabdelay = 100; - hvspcmdexedelay = 5; - synchcycles = 6; - latchcycles = 16; - togglevtg = 1; - poweroffdelay = 25; - resetdelayms = 0; - resetdelayus = 50; - hvleavestabdelay = 100; - resetdelay = 25; - chiperasepolltimeout = 40; - chiperasetime = 0; + hventerstabdelay = 100; + latchcycles = 16; + togglevtg = 1; + poweroffdelay = 25; + resetdelayus = 50; + hvleavestabdelay = 100; + resetdelay = 25; + chiperasepolltimeout = 40; programfusepolltimeout = 25; programlockpolltimeout = 25; + synchcycles = 6; + hvspcmdexedelay = 5; + chip_erase = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; memory "eeprom" - size = 64; - min_write_delay = 8200; - max_write_delay = 8200; - readback_p1 = 0xff; - readback_p2 = 0xff; - read = "1 0 1 0 0 0 0 0 x x x x x x x x", - "x x 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 x a5 a4 a3 a2 a1 a0 i i i i i i i i"; - - mode = 0x04; - delay = 10; - blocksize = 64; - readsize = 256; + size = 64; + min_write_delay = 8200; + max_write_delay = 8200; + readback = 0xff 0xff; + mode = 4; + delay = 10; + blocksize = 64; + readsize = 256; + read = "1010.0000--xxxx.xxxx--xxaa.aaaa--oooo.oooo"; + write = "1100.0000--xxxx.xxxx--xxaa.aaaa--iiii.iiii"; ; memory "flash" - size = 1024; - min_write_delay = 4100; - max_write_delay = 4100; - readback_p1 = 0xff; - readback_p2 = 0xff; - read_lo = " 0 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"; - - read_hi = " 0 0 1 0 1 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_lo = " 0 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"; - - write_hi = " 0 1 0 0 1 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 "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 o o x"; - - write = "1 0 1 0 1 1 0 0 1 1 1 1 1 i i 1", - "x x x x x x x x x x x x x x x x"; - min_write_delay = 9000; - max_write_delay = 9000; - ; - - 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"; + size = 1024; + min_write_delay = 4100; + max_write_delay = 4100; + readback = 0xff 0xff; + mode = 4; + delay = 5; + blocksize = 128; + readsize = 256; + read_lo = "0010.0000--xxxx.xxxa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--xxxx.xxxa--aaaa.aaaa--oooo.oooo"; + write_lo = "0100.0000--xxxx.xxxa--aaaa.aaaa--iiii.iiii"; + write_hi = "0100.1000--xxxx.xxxa--aaaa.aaaa--iiii.iiii"; ; memory "fuse" - size = 1; - 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 o o o o x x o o"; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--xxxx.xxxx--xxxx.xxxx--oooo.xxoo"; + write = "1010.1100--101x.xxxx--xxxx.xxxx--iiii.11ii"; + ; - 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 i i i i 1 1 i i"; - min_write_delay = 9000; - max_write_delay = 9000; + memory "lock" + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--xxxx.xxxx--xxxx.xxxx--xxxx.xoox"; + write = "1010.1100--1111.1ii1--xxxx.xxxx--xxxx.xxxx"; + ; + + memory "signature" + size = 3; + read = "0011.0000--xxxx.xxxx--0000.00aa--oooo.oooo"; + ; + + memory "calibration" + size = 1; + read = "0011.1000--xxxx.xxxx--0000.0000--oooo.oooo"; ; ; @@ -2261,5079 +3024,3514 @@ part #------------------------------------------------------------ part - id = "1200"; - desc = "AT90S1200"; - is_at90s1200 = yes; - stk500_devcode = 0x33; - avr910_devcode = 0x13; - signature = 0x1e 0x90 0x01; - pagel = 0xd7; - bs2 = 0xa0; - chip_erase_delay = 20000; - 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 = 1; - bytedelay = 0; - pollindex = 0; - pollvalue = 0xFF; - predelay = 1; - postdelay = 1; - pollmethod = 0; - - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 0; - togglevtg = 0; - poweroffdelay = 0; - resetdelayms = 0; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 15; - chiperasepolltimeout = 0; - programfusepulsewidth = 2; - programfusepolltimeout = 0; - programlockpulsewidth = 0; + desc = "AT90S1200"; + id = "1200"; + prog_modes = PM_SPM | PM_ISP | PM_HVPP; + mcuid = 183; + n_interrupts = 4; + stk500_devcode = 0x33; + avr910_devcode = 0x13; + chip_erase_delay = 20000; + pagel = 0xd7; + bs2 = 0xa0; + signature = 0x1e 0x90 0x01; + is_at90s1200 = yes; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 1; + pollvalue = 0xff; + predelay = 1; + postdelay = 1; + pp_controlstack = + 0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f, + 0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f, + 0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b, + 0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + hvleavestabdelay = 15; + chiperasepulsewidth = 15; + programfusepulsewidth = 2; programlockpolltimeout = 1; + chip_erase = "1010.1100--1000.0000--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; memory "eeprom" - size = 64; - min_write_delay = 4000; - max_write_delay = 9000; - readback_p1 = 0x00; - readback_p2 = 0xff; - read = "1 0 1 0 0 0 0 0 x x x x x x x x", - "x x a5 a4 a3 a2 a1 a0 o o o o o o o o"; + size = 64; + min_write_delay = 4000; + max_write_delay = 9000; + readback = 0x00 0xff; + mode = 4; + delay = 20; + blocksize = 32; + readsize = 256; + read = "1010.0000--xxxx.xxxx--xxaa.aaaa--oooo.oooo"; + write = "1100.0000--xxxx.xxxx--xxaa.aaaa--iiii.iiii"; + ; - 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; - min_write_delay = 4000; - max_write_delay = 9000; - readback_p1 = 0xff; - readback_p2 = 0xff; - read_lo = " 0 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"; + size = 1024; + min_write_delay = 4000; + max_write_delay = 9000; + readback = 0xff 0xff; + mode = 2; + delay = 15; + blocksize = 128; + readsize = 256; + read_lo = "0010.0000--xxxx.xxxa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--xxxx.xxxa--aaaa.aaaa--oooo.oooo"; + write_lo = "0100.0000--xxxx.xxxa--aaaa.aaaa--iiii.iiii"; + write_hi = "0100.1000--xxxx.xxxa--aaaa.aaaa--iiii.iiii"; + ; - read_hi = " 0 0 1 0 1 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_lo = " 0 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"; - - write_hi = " 0 1 0 0 1 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 = 0x02; - delay = 15; - blocksize = 128; - readsize = 256; - ; - 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 "fuse" - size = 1; - ; + size = 1; + ; + memory "lock" - size = 1; - min_write_delay = 9000; - max_write_delay = 20000; - write = "1 0 1 0 1 1 0 0 1 1 1 1 1 i i 1", - "x x x x x x x x x x x x x x x x"; - ; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 20000; + write = "1010.1100--1111.1ii1--xxxx.xxxx--xxxx.xxxx"; + ; + + memory "signature" + size = 3; + read = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo"; + ; +; #------------------------------------------------------------ # AT90s4414 #------------------------------------------------------------ part - id = "4414"; - desc = "AT90S4414"; - stk500_devcode = 0x50; - avr910_devcode = 0x28; - signature = 0x1e 0x92 0x01; - chip_erase_delay = 20000; - 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; - - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 0; - togglevtg = 0; - poweroffdelay = 0; - resetdelayms = 0; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 15; - chiperasepolltimeout = 0; - programfusepulsewidth = 2; - programfusepolltimeout = 0; - programlockpulsewidth = 0; + desc = "AT90S4414"; + id = "4414"; + prog_modes = PM_SPM | PM_ISP | PM_HVPP; + mcuid = 190; + n_interrupts = 13; + stk500_devcode = 0x50; + avr910_devcode = 0x28; + chip_erase_delay = 20000; + signature = 0x1e 0x92 0x01; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pp_controlstack = + 0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f, + 0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f, + 0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b, + 0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01; + hventerstabdelay = 100; + hvleavestabdelay = 15; + chiperasepulsewidth = 15; + programfusepulsewidth = 2; programlockpolltimeout = 1; + chip_erase = "1010.1100--1000.0000--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; memory "eeprom" - size = 256; - min_write_delay = 9000; - max_write_delay = 20000; - readback_p1 = 0x80; - readback_p2 = 0x7f; - 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"; + size = 256; + min_write_delay = 9000; + max_write_delay = 20000; + readback = 0x80 0x7f; + mode = 4; + delay = 12; + blocksize = 64; + readsize = 256; + read = "1010.0000--xxxx.xxxa--aaaa.aaaa--oooo.oooo"; + write = "1100.0000--xxxx.xxxa--aaaa.aaaa--iiii.iiii"; + ; - 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; - min_write_delay = 9000; - max_write_delay = 20000; - readback_p1 = 0x7f; - readback_p2 = 0x7f; - read_lo = " 0 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"; + size = 4096; + min_write_delay = 9000; + max_write_delay = 20000; + readback = 0x7f 0x7f; + mode = 4; + delay = 12; + blocksize = 64; + readsize = 256; + read_lo = "0010.0000--xxxx.aaaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--xxxx.aaaa--aaaa.aaaa--oooo.oooo"; + write_lo = "0100.0000--xxxx.aaaa--aaaa.aaaa--iiii.iiii"; + write_hi = "0100.1000--xxxx.aaaa--aaaa.aaaa--iiii.iiii"; + ; - read_hi = " 0 0 1 0 1 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_lo = " 0 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"; - - write_hi = " 0 1 0 0 1 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 "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 "fuse" - size = 1; - ; + size = 1; + ; + memory "lock" - size = 1; - write = "1 0 1 0 1 1 0 0 1 1 1 1 1 i i 1", - "x x x x x x x x x x x x x x x x"; - min_write_delay = 9000; - max_write_delay = 9000; - ; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + write = "1010.1100--1111.1ii1--xxxx.xxxx--xxxx.xxxx"; + ; + + memory "signature" + size = 3; + read = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo"; + ; +; #------------------------------------------------------------ # AT90s2313 #------------------------------------------------------------ part - id = "2313"; - desc = "AT90S2313"; - stk500_devcode = 0x40; - avr910_devcode = 0x20; - signature = 0x1e 0x91 0x01; - chip_erase_delay = 20000; - 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; - - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 0; - togglevtg = 0; - poweroffdelay = 0; - resetdelayms = 0; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 15; - chiperasepolltimeout = 0; - programfusepulsewidth = 2; - programfusepolltimeout = 0; - programlockpulsewidth = 0; + desc = "AT90S2313"; + id = "2313"; + prog_modes = PM_SPM | PM_ISP | PM_HVPP; + mcuid = 186; + n_interrupts = 11; + stk500_devcode = 0x40; + avr910_devcode = 0x20; + chip_erase_delay = 20000; + signature = 0x1e 0x91 0x01; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pp_controlstack = + 0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f, + 0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f, + 0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b, + 0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + hvleavestabdelay = 15; + chiperasepulsewidth = 15; + programfusepulsewidth = 2; programlockpolltimeout = 1; + chip_erase = "1010.1100--1000.0000--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; memory "eeprom" - size = 128; - min_write_delay = 4000; - max_write_delay = 9000; - readback_p1 = 0x80; - readback_p2 = 0x7f; - 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"; + size = 128; + min_write_delay = 4000; + max_write_delay = 9000; + readback = 0x80 0x7f; + mode = 4; + delay = 12; + blocksize = 64; + readsize = 256; + read = "1010.0000--xxxx.xxxx--xaaa.aaaa--oooo.oooo"; + write = "1100.0000--xxxx.xxxx--xaaa.aaaa--iiii.iiii"; + ; - 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; - min_write_delay = 4000; - max_write_delay = 9000; - readback_p1 = 0x7f; - readback_p2 = 0x7f; - 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"; + size = 2048; + min_write_delay = 4000; + max_write_delay = 9000; + readback = 0x7f 0x7f; + mode = 4; + delay = 12; + blocksize = 128; + readsize = 256; + read_lo = "0010.0000--xxxx.xxaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--xxxx.xxaa--aaaa.aaaa--oooo.oooo"; + write_lo = "0100.0000--xxxx.xxaa--aaaa.aaaa--iiii.iiii"; + write_hi = "0100.1000--xxxx.xxaa--aaaa.aaaa--iiii.iiii"; + ; - 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"; - - write_lo = " 0 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"; - - write_hi = " 0 1 0 0 1 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 = 0x04; - delay = 12; - blocksize = 128; - readsize = 256; - ; - 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 "fuse" - size = 1; - ; + size = 1; + ; + memory "lock" - size = 1; - write = "1 0 1 0 1 1 0 0 1 1 1 x x i i x", - "x x x x x x x x x x x x x x x x"; - min_write_delay = 9000; - max_write_delay = 9000; - ; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + write = "1010.1100--111x.xiix--xxxx.xxxx--xxxx.xxxx"; + ; + + memory "signature" + size = 3; + read = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo"; + ; +; #------------------------------------------------------------ # AT90s2333 #------------------------------------------------------------ part - id = "2333"; ##### WARNING: No XML file for device 'AT90S2333'! ##### - desc = "AT90S2333"; - stk500_devcode = 0x42; - avr910_devcode = 0x34; - signature = 0x1e 0x91 0x05; - chip_erase_delay = 20000; - 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; - - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 0; - togglevtg = 0; - poweroffdelay = 0; - resetdelayms = 0; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 15; - chiperasepolltimeout = 0; - programfusepulsewidth = 2; - programfusepolltimeout = 0; - programlockpulsewidth = 0; + desc = "AT90S2333"; + id = "2333"; + prog_modes = PM_SPM | PM_ISP | PM_HVPP; + mcuid = 188; + n_interrupts = 14; + stk500_devcode = 0x42; + avr910_devcode = 0x34; + chip_erase_delay = 20000; + signature = 0x1e 0x91 0x05; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pp_controlstack = + 0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f, + 0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f, + 0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b, + 0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + hvleavestabdelay = 15; + chiperasepulsewidth = 15; + programfusepulsewidth = 2; programlockpolltimeout = 1; + chip_erase = "1010.1100--1000.0000--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; memory "eeprom" - size = 128; - min_write_delay = 9000; - max_write_delay = 20000; - readback_p1 = 0x00; - 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 = 12; - blocksize = 128; - readsize = 256; - ; + size = 128; + min_write_delay = 9000; + max_write_delay = 20000; + readback = 0x00 0xff; + mode = 4; + delay = 12; + blocksize = 128; + readsize = 256; + read = "1010.0000--xxxx.xxxx--xaaa.aaaa--oooo.oooo"; + write = "1100.0000--xxxx.xxxx--xaaa.aaaa--iiii.iiii"; + ; memory "flash" - size = 2048; - min_write_delay = 9000; - max_write_delay = 20000; - 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"; + size = 2048; + min_write_delay = 9000; + max_write_delay = 20000; + readback = 0xff 0xff; + mode = 4; + delay = 12; + blocksize = 128; + readsize = 256; + read_lo = "0010.0000--xxxx.xxaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--xxxx.xxaa--aaaa.aaaa--oooo.oooo"; + write_lo = "0100.0000--xxxx.xxaa--aaaa.aaaa--iiii.iiii"; + write_hi = "0100.1000--xxxx.xxaa--aaaa.aaaa--iiii.iiii"; + ; - 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"; + memory "fuse" + size = 1; + min_write_delay = 9000; + max_write_delay = 20000; + pwroff_after_write = yes; + read = "0101.0000--xxxx.xxxx--xxxx.xxxx--xxoo.oooo"; + write = "1010.1100--101i.iiii--xxxx.xxxx--xxxx.xxxx"; + ; - write_lo = " 0 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"; - - write_hi = " 0 1 0 0 1 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 = 0x04; - delay = 12; - blocksize = 128; - readsize = 256; - ; + memory "lock" + size = 1; + min_write_delay = 9000; + max_write_delay = 20000; + read = "0101.1000--xxxx.xxxx--xxxx.xxxx--xxxx.xoox"; + write = "1010.1100--1111.1ii1--xxxx.xxxx--xxxx.xxxx"; + ; 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 "fuse" - size = 1; - min_write_delay = 9000; - max_write_delay = 20000; - pwroff_after_write = yes; - 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 x o o o o o o"; - - write = "1 0 1 0 1 1 0 0 1 0 1 i i i i i", - "x x x x x x x x x x x x x x x x"; - ; - memory "lock" - size = 1; - min_write_delay = 9000; - max_write_delay = 20000; - 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 o o x"; - - write = "1 0 1 0 1 1 0 0 1 1 1 1 1 i i 1", - "x x x x x x x x x x x x x x x x"; - ; - ; - + size = 3; + read = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo"; + ; +; #------------------------------------------------------------ # AT90s2343 (also AT90s2323 and ATtiny22) #------------------------------------------------------------ part - id = "2343"; - desc = "AT90S2343"; - stk500_devcode = 0x43; - avr910_devcode = 0x4c; - signature = 0x1e 0x91 0x03; - chip_erase_delay = 18000; - 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; - - hvsp_controlstack = - 0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x00, + desc = "AT90S2343"; + id = "2343"; + prog_modes = PM_SPM | PM_ISP | PM_HVSP; + mcuid = 189; + n_interrupts = 3; + stk500_devcode = 0x43; + avr910_devcode = 0x4c; + chip_erase_delay = 18000; + signature = 0x1e 0x91 0x03; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + hvsp_controlstack = + 0x4c, 0x0c, 0x1c, 0x2c, 0x3c, 0x64, 0x74, 0x00, 0x68, 0x78, 0x68, 0x68, 0x00, 0x00, 0x68, 0x78, - 0x78, 0x00, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10, + 0x78, 0x00, 0x6d, 0x0c, 0x80, 0x40, 0x20, 0x10, 0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00; - hventerstabdelay = 100; - hvspcmdexedelay = 0; - synchcycles = 6; - latchcycles = 1; - togglevtg = 0; - poweroffdelay = 25; - resetdelayms = 0; - resetdelayus = 50; - hvleavestabdelay = 100; - resetdelay = 25; - chiperasepolltimeout = 40; - chiperasetime = 0; + hventerstabdelay = 100; + latchcycles = 1; + poweroffdelay = 25; + resetdelayus = 50; + hvleavestabdelay = 100; + resetdelay = 25; + chiperasepolltimeout = 40; programfusepolltimeout = 25; programlockpolltimeout = 25; + synchcycles = 6; + chip_erase = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; memory "eeprom" - size = 128; - min_write_delay = 9000; - max_write_delay = 20000; - readback_p1 = 0x00; - readback_p2 = 0xff; - read = "1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0", - "x a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; + size = 128; + min_write_delay = 9000; + max_write_delay = 20000; + readback = 0x00 0xff; + mode = 4; + delay = 12; + blocksize = 64; + readsize = 256; + read = "1010.0000--0000.0000--xaaa.aaaa--oooo.oooo"; + write = "1100.0000--0000.0000--xaaa.aaaa--iiii.iiii"; + ; - 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; - min_write_delay = 9000; - max_write_delay = 20000; - 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"; + size = 2048; + min_write_delay = 9000; + max_write_delay = 20000; + readback = 0xff 0xff; + mode = 4; + delay = 12; + blocksize = 128; + readsize = 128; + read_lo = "0010.0000--xxxx.xxaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--xxxx.xxaa--aaaa.aaaa--oooo.oooo"; + write_lo = "0100.0000--xxxx.xxaa--aaaa.aaaa--iiii.iiii"; + write_hi = "0100.1000--xxxx.xxaa--aaaa.aaaa--iiii.iiii"; + ; - 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"; - - write_lo = " 0 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"; - - write_hi = " 0 1 0 0 1 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 = 0x04; - delay = 12; - blocksize = 128; - readsize = 128; - ; - 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 "fuse" - size = 1; - min_write_delay = 9000; - max_write_delay = 20000; - 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 o o o x x x x o"; + size = 1; + min_write_delay = 9000; + max_write_delay = 20000; + read = "0101.1000--xxxx.xxxx--xxxx.xxxx--ooox.xxxo"; + write = "1010.1100--1011.111i--xxxx.xxxx--xxxx.xxxx"; + ; - write = "1 0 1 0 1 1 0 0 1 0 1 1 1 1 1 i", - "x x x x x x x x x x x x x x x x"; - ; memory "lock" - size = 1; - min_write_delay = 9000; - max_write_delay = 20000; - 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 o o o x x x x o"; - - write = "1 0 1 0 1 1 0 0 1 1 1 1 1 i i 1", - "x x x x x x x x x x x x x x x x"; - ; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 20000; + read = "0101.1000--xxxx.xxxx--xxxx.xxxx--ooox.xxxo"; + write = "1010.1100--1111.1ii1--xxxx.xxxx--xxxx.xxxx"; + ; + memory "signature" + size = 3; + read = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo"; + ; +; #------------------------------------------------------------ # AT90s4433 #------------------------------------------------------------ part - id = "4433"; - desc = "AT90S4433"; - stk500_devcode = 0x51; - avr910_devcode = 0x30; - signature = 0x1e 0x92 0x03; - chip_erase_delay = 20000; - 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; - - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 0; - togglevtg = 0; - poweroffdelay = 0; - resetdelayms = 0; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 15; - chiperasepolltimeout = 0; - programfusepulsewidth = 2; - programfusepolltimeout = 0; - programlockpulsewidth = 0; + desc = "AT90S4433"; + id = "4433"; + prog_modes = PM_SPM | PM_ISP | PM_HVPP; + mcuid = 191; + n_interrupts = 14; + stk500_devcode = 0x51; + avr910_devcode = 0x30; + chip_erase_delay = 20000; + signature = 0x1e 0x92 0x03; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pp_controlstack = + 0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f, + 0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f, + 0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b, + 0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + hvleavestabdelay = 15; + chiperasepulsewidth = 15; + programfusepulsewidth = 2; programlockpolltimeout = 1; + chip_erase = "1010.1100--1000.0000--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; memory "eeprom" - size = 256; - min_write_delay = 9000; - max_write_delay = 20000; - readback_p1 = 0x00; - readback_p2 = 0xff; - read = " 1 0 1 0 0 0 0 0 x x x x x x x x", - "a7 a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; + size = 256; + min_write_delay = 9000; + max_write_delay = 20000; + readback = 0x00 0xff; + mode = 4; + delay = 12; + blocksize = 128; + readsize = 256; + read = "1010.0000--xxxx.xxxx--aaaa.aaaa--oooo.oooo"; + write = "1100.0000--xxxx.xxxx--aaaa.aaaa--iiii.iiii"; + ; - 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; - min_write_delay = 9000; - max_write_delay = 20000; - readback_p1 = 0xff; - readback_p2 = 0xff; - read_lo = " 0 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"; + size = 4096; + min_write_delay = 9000; + max_write_delay = 20000; + readback = 0xff 0xff; + mode = 4; + delay = 12; + blocksize = 128; + readsize = 256; + read_lo = "0010.0000--xxxx.xaaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--xxxx.xaaa--aaaa.aaaa--oooo.oooo"; + write_lo = "0100.0000--xxxx.xaaa--aaaa.aaaa--iiii.iiii"; + write_hi = "0100.1000--xxxx.xaaa--aaaa.aaaa--iiii.iiii"; + ; - read_hi = " 0 0 1 0 1 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_lo = " 0 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"; - - write_hi = " 0 1 0 0 1 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 = 0x04; - delay = 12; - blocksize = 128; - readsize = 256; - ; - 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 "fuse" - size = 1; - min_write_delay = 9000; - max_write_delay = 20000; + size = 1; + min_write_delay = 9000; + max_write_delay = 20000; pwroff_after_write = yes; - 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 x o o o o o o"; + read = "0101.0000--xxxx.xxxx--xxxx.xxxx--xxoo.oooo"; + write = "1010.1100--101i.iiii--xxxx.xxxx--xxxx.xxxx"; + ; - write = "1 0 1 0 1 1 0 0 1 0 1 i i i i i", - "x x x x x x x x x x x x x x x x"; - ; memory "lock" - size = 1; - min_write_delay = 9000; - max_write_delay = 20000; - 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 o o x"; + size = 1; + min_write_delay = 9000; + max_write_delay = 20000; + read = "0101.1000--xxxx.xxxx--xxxx.xxxx--xxxx.xoox"; + write = "1010.1100--1111.1ii1--xxxx.xxxx--xxxx.xxxx"; + ; - write = "1 0 1 0 1 1 0 0 1 1 1 1 1 i i 1", - "x x x x x x x x x x x x x x x x"; - ; - ; + memory "signature" + size = 3; + read = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo"; + ; +; #------------------------------------------------------------ # AT90s4434 #------------------------------------------------------------ part - id = "4434"; ##### WARNING: No XML file for device 'AT90S4434'! ##### - desc = "AT90S4434"; - stk500_devcode = 0x52; - avr910_devcode = 0x6c; - signature = 0x1e 0x92 0x02; - chip_erase_delay = 20000; - 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"; + desc = "AT90S4434"; + id = "4434"; + prog_modes = PM_SPM | PM_ISP; + mcuid = 192; + n_interrupts = 17; + stk500_devcode = 0x52; + avr910_devcode = 0x6c; + chip_erase_delay = 20000; + signature = 0x1e 0x92 0x02; + chip_erase = "1010.1100--1000.0000--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; memory "eeprom" - size = 256; - min_write_delay = 9000; - max_write_delay = 20000; - readback_p1 = 0x00; - readback_p2 = 0xff; - read = " 1 0 1 0 0 0 0 0 x x x x x x x x", - "a7 a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; + size = 256; + min_write_delay = 9000; + max_write_delay = 20000; + readback = 0x00 0xff; + read = "1010.0000--xxxx.xxxx--aaaa.aaaa--oooo.oooo"; + write = "1100.0000--xxxx.xxxx--aaaa.aaaa--iiii.iiii"; + ; - 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"; - ; memory "flash" - size = 4096; - min_write_delay = 9000; - max_write_delay = 20000; - readback_p1 = 0xff; - readback_p2 = 0xff; - read_lo = " 0 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"; + size = 4096; + min_write_delay = 9000; + max_write_delay = 20000; + readback = 0xff 0xff; + read_lo = "0010.0000--xxxx.xaaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--xxxx.xaaa--aaaa.aaaa--oooo.oooo"; + write_lo = "0100.0000--xxxx.xaaa--aaaa.aaaa--iiii.iiii"; + write_hi = "0100.1000--xxxx.xaaa--aaaa.aaaa--iiii.iiii"; + ; - read_hi = " 0 0 1 0 1 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_lo = " 0 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"; - - write_hi = " 0 1 0 0 1 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"; - ; - 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 "fuse" - size = 1; - min_write_delay = 9000; - max_write_delay = 20000; - 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 x o o o o o o"; + size = 1; + min_write_delay = 9000; + max_write_delay = 20000; + read = "0101.0000--xxxx.xxxx--xxxx.xxxx--xxoo.oooo"; + write = "1010.1100--101i.iiii--xxxx.xxxx--xxxx.xxxx"; + ; - write = "1 0 1 0 1 1 0 0 1 0 1 i i i i i", - "x x x x x x x x x x x x x x x x"; - ; memory "lock" - size = 1; - min_write_delay = 9000; - max_write_delay = 20000; - 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 o o x"; + size = 1; + min_write_delay = 9000; + max_write_delay = 20000; + read = "0101.1000--xxxx.xxxx--xxxx.xxxx--xxxx.xoox"; + write = "1010.1100--1111.1ii1--xxxx.xxxx--xxxx.xxxx"; + ; - write = "1 0 1 0 1 1 0 0 1 1 1 1 1 i i 1", - "x x x x x x x x x x x x x x x x"; - ; - ; + memory "signature" + size = 3; + read = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo"; + ; +; #------------------------------------------------------------ # AT90s8515 #------------------------------------------------------------ part - id = "8515"; - desc = "AT90S8515"; - stk500_devcode = 0x60; - avr910_devcode = 0x38; - signature = 0x1e 0x93 0x01; - chip_erase_delay = 20000; - 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; - - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 0; - togglevtg = 0; - poweroffdelay = 0; - resetdelayms = 0; - resetdelayus = 0; - hvleavestabdelay = 15; - resetdelay = 15; - chiperasepulsewidth = 15; - chiperasepolltimeout = 0; - programfusepulsewidth = 2; - programfusepolltimeout = 0; - programlockpulsewidth = 0; + desc = "AT90S8515"; + id = "8515"; + prog_modes = PM_SPM | PM_ISP | PM_HVPP; + mcuid = 193; + n_interrupts = 13; + stk500_devcode = 0x60; + avr910_devcode = 0x38; + chip_erase_delay = 20000; + signature = 0x1e 0x93 0x01; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pp_controlstack = + 0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f, + 0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f, + 0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b, + 0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + hvleavestabdelay = 15; + resetdelay = 15; + chiperasepulsewidth = 15; + programfusepulsewidth = 2; programlockpolltimeout = 1; + chip_erase = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; memory "eeprom" - size = 512; - min_write_delay = 4000; - max_write_delay = 9000; - readback_p1 = 0x80; - readback_p2 = 0x7f; - 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"; + size = 512; + min_write_delay = 4000; + max_write_delay = 9000; + readback = 0x80 0x7f; + mode = 4; + delay = 12; + blocksize = 128; + readsize = 256; + read = "1010.0000--xxxx.xxxa--aaaa.aaaa--oooo.oooo"; + write = "1100.0000--xxxx.xxxa--aaaa.aaaa--iiii.iiii"; + ; - 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; - min_write_delay = 4000; - max_write_delay = 9000; - readback_p1 = 0x7f; - readback_p2 = 0x7f; - read_lo = " 0 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"; + size = 8192; + min_write_delay = 4000; + max_write_delay = 9000; + readback = 0x7f 0x7f; + mode = 4; + delay = 12; + blocksize = 128; + readsize = 256; + read_lo = "0010.0000--xxxx.aaaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--xxxx.aaaa--aaaa.aaaa--oooo.oooo"; + write_lo = "0100.0000--xxxx.aaaa--aaaa.aaaa--iiii.iiii"; + write_hi = "0100.1000--xxxx.aaaa--aaaa.aaaa--iiii.iiii"; + ; - read_hi = " 0 0 1 0 1 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_lo = " 0 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"; - - write_hi = " 0 1 0 0 1 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 = 128; - readsize = 256; - ; - 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 "fuse" - size = 1; - ; + size = 1; + ; + memory "lock" - size = 1; - write = "1 0 1 0 1 1 0 0 1 1 1 1 1 i i 1", - "x x x x x x x x x x x x x x x x"; - min_write_delay = 9000; - max_write_delay = 9000; - ; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + write = "1010.1100--1111.1ii1--xxxx.xxxx--xxxx.xxxx"; + ; + + memory "signature" + size = 3; + read = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo"; + ; +; #------------------------------------------------------------ # AT90s8535 #------------------------------------------------------------ part - id = "8535"; - desc = "AT90S8535"; - stk500_devcode = 0x61; - avr910_devcode = 0x68; - signature = 0x1e 0x93 0x03; - chip_erase_delay = 20000; - 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; - - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 0; - togglevtg = 0; - poweroffdelay = 0; - resetdelayms = 0; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 15; - chiperasepolltimeout = 0; - programfusepulsewidth = 2; - programfusepolltimeout = 0; - programlockpulsewidth = 0; + desc = "AT90S8535"; + id = "8535"; + prog_modes = PM_SPM | PM_ISP | PM_HVPP; + mcuid = 195; + n_interrupts = 17; + stk500_devcode = 0x61; + avr910_devcode = 0x68; + chip_erase_delay = 20000; + signature = 0x1e 0x93 0x03; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pp_controlstack = + 0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f, + 0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f, + 0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b, + 0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + hvleavestabdelay = 15; + chiperasepulsewidth = 15; + programfusepulsewidth = 2; programlockpolltimeout = 1; + chip_erase = "1010.1100--1000.0000--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; memory "eeprom" - size = 512; - min_write_delay = 9000; - max_write_delay = 20000; - readback_p1 = 0x00; - 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"; + size = 512; + min_write_delay = 9000; + max_write_delay = 20000; + readback = 0x00 0xff; + mode = 4; + delay = 12; + blocksize = 128; + readsize = 256; + read = "1010.0000--xxxx.xxxa--aaaa.aaaa--oooo.oooo"; + write = "1100.0000--xxxx.xxxa--aaaa.aaaa--iiii.iiii"; + ; - 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; - min_write_delay = 9000; - max_write_delay = 20000; - readback_p1 = 0xff; - readback_p2 = 0xff; - read_lo = " 0 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"; + size = 8192; + min_write_delay = 9000; + max_write_delay = 20000; + readback = 0xff 0xff; + mode = 4; + delay = 12; + blocksize = 128; + readsize = 256; + read_lo = "0010.0000--xxxx.aaaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--xxxx.aaaa--aaaa.aaaa--oooo.oooo"; + write_lo = "0100.0000--xxxx.aaaa--aaaa.aaaa--iiii.iiii"; + write_hi = "0100.1000--xxxx.aaaa--aaaa.aaaa--iiii.iiii"; + ; - read_hi = " 0 0 1 0 1 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_lo = " 0 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"; - - write_hi = " 0 1 0 0 1 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 = 128; - readsize = 256; - ; - 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 "fuse" - 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 x o"; - write = "1 0 1 0 1 1 0 0 1 0 1 1 1 1 1 i", - "x x x x x x x x x x x x x x x x"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--xxxx.xxxx--xxxx.xxxx--xxxx.xxxo"; + write = "1010.1100--1011.111i--xxxx.xxxx--xxxx.xxxx"; + ; + 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 o o x x x x x x"; - write = "1 0 1 0 1 1 0 0 1 1 1 1 1 i i 1", - "x x x x x x x x x x x x x x x x"; - min_write_delay = 9000; - max_write_delay = 9000; - ; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--xxxx.xxxx--xxxx.xxxx--ooxx.xxxx"; + write = "1010.1100--1111.1ii1--xxxx.xxxx--xxxx.xxxx"; + ; + + memory "signature" + size = 3; + read = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo"; + ; +; #------------------------------------------------------------ # ATmega103 #------------------------------------------------------------ part - id = "m103"; - desc = "ATmega103"; - stk500_devcode = 0xB1; - avr910_devcode = 0x41; - signature = 0x1e 0x97 0x01; - chip_erase_delay = 112000; - 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; - - pp_controlstack = - 0x0E, 0x1E, 0x8E, 0x9E, 0x2E, 0x3E, 0xAE, 0xBE, - 0x4E, 0x5E, 0xCE, 0xDE, 0x6E, 0x7E, 0xEE, 0xDE, - 0x66, 0x76, 0xE6, 0xF6, 0x6A, 0x7A, 0xEA, 0x7A, - 0x7F, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 0; - togglevtg = 0; - poweroffdelay = 0; - resetdelayms = 0; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 15; - chiperasepolltimeout = 0; - programfusepulsewidth = 2; - programfusepolltimeout = 0; - programlockpulsewidth = 0; + desc = "ATmega103"; + id = "m103"; + prog_modes = PM_SPM | PM_ISP | PM_HVPP; + mcuid = 84; + n_interrupts = 24; + stk500_devcode = 0xb1; + avr910_devcode = 0x41; + chip_erase_delay = 112000; + signature = 0x1e 0x97 0x01; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pp_controlstack = + 0x0e, 0x1e, 0x8e, 0x9e, 0x2e, 0x3e, 0xae, 0xbe, + 0x4e, 0x5e, 0xce, 0xde, 0x6e, 0x7e, 0xee, 0xde, + 0x66, 0x76, 0xe6, 0xf6, 0x6a, 0x7a, 0xea, 0x7a, + 0x7f, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + hvleavestabdelay = 15; + chiperasepulsewidth = 15; + programfusepulsewidth = 2; programlockpolltimeout = 10; + chip_erase = "1010.1100--1000.0000--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; memory "eeprom" - size = 4096; - min_write_delay = 4000; - max_write_delay = 9000; - 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", - " o o o o o o o o"; - - 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; - ; + size = 4096; + min_write_delay = 4000; + max_write_delay = 9000; + readback = 0x80 0x7f; + mode = 4; + delay = 12; + blocksize = 64; + readsize = 256; + read = "1010.0000--xxxx.aaaa--aaaa.aaaa--oooo.oooo"; + write = "1100.0000--xxxx.aaaa--aaaa.aaaa--iiii.iiii"; + ; memory "flash" - paged = yes; - size = 131072; - page_size = 256; - num_pages = 512; - min_write_delay = 22000; - max_write_delay = 56000; - readback_p1 = 0xff; - readback_p2 = 0xff; - 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", - "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 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 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; - - writepage = " 0 1 0 0 1 1 0 0", - "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; - ; + paged = yes; + size = 0x20000; + page_size = 256; + num_pages = 512; + min_write_delay = 22000; + max_write_delay = 56000; + readback = 0xff 0xff; + mode = 17; + delay = 70; + blocksize = 256; + readsize = 256; + read_lo = "0010.0000--aaaa.aaaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--aaaa.aaaa--aaaa.aaaa--oooo.oooo"; + loadpage_lo = "0100.0000--xxxx.xxxx--xaaa.aaaa--iiii.iiii"; + loadpage_hi = "0100.1000--xxxx.xxxx--xaaa.aaaa--iiii.iiii"; + writepage = "0100.1100--aaaa.aaaa--axxx.xxxx--xxxx.xxxx"; + ; memory "fuse" - size = 1; - 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 x o x o 1 o o"; - - write = "1 0 1 0 1 1 0 0 1 0 1 1 i 1 i i", - "x x x x x x x x x x x x x x x x"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--xxxx.xxxx--xxxx.xxxx--xxox.o1oo"; + write = "1010.1100--1011.i1ii--xxxx.xxxx--xxxx.xxxx"; + ; 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 o o x"; - - write = "1 0 1 0 1 1 0 0 1 1 1 1 1 i i 1", - "x x x x x x x x x x x x x x x x"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--xxxx.xxxx--xxxx.xxxx--xxxx.xoox"; + write = "1010.1100--1111.1ii1--xxxx.xxxx--xxxx.xxxx"; + ; 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"; - ; - ; - + size = 3; + read = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo"; + ; +; #------------------------------------------------------------ # ATmega64 #------------------------------------------------------------ part - id = "m64"; - desc = "ATmega64"; - has_jtag = yes; - stk500_devcode = 0xA0; - avr910_devcode = 0x45; - signature = 0x1e 0x96 0x02; - 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; - - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 6; - togglevtg = 0; - poweroffdelay = 0; - resetdelayms = 0; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; - programfusepolltimeout = 5; - programlockpulsewidth = 0; - programlockpolltimeout = 5; - - idr = 0x22; - spmcr = 0x68; + desc = "ATmega64"; + id = "m64"; + prog_modes = PM_SPM | PM_ISP | PM_HVPP | PM_JTAG | PM_JTAGmkI; + mcuid = 72; + n_interrupts = 35; + n_boot_sections = 4; + boot_section_size = 1024; + stk500_devcode = 0xa0; + avr910_devcode = 0x45; + chip_erase_delay = 9000; + pagel = 0xd7; + bs2 = 0xa0; + signature = 0x1e 0x96 0x02; + reset = io; allowfullpagebitstream = yes; - - ocdrev = 2; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pp_controlstack = + 0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f, + 0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f, + 0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b, + 0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + latchcycles = 6; + hvleavestabdelay = 15; + chiperasepolltimeout = 10; + programfusepolltimeout = 5; + programlockpolltimeout = 5; + idr = 0x22; + spmcr = 0x68; + ocdrev = 2; + chip_erase = "1010.1100--1000.0000--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; 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 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 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; - ; + size = 2048; + page_size = 8; + min_write_delay = 9000; + max_write_delay = 9000; + readback = 0xff 0xff; + mode = 4; + delay = 20; + blocksize = 64; + readsize = 256; + read = "1010.0000--xxxx.aaaa--aaaa.aaaa--oooo.oooo"; + write = "1100.0000--xxxx.aaaa--aaaa.aaaa--iiii.iiii"; + ; memory "flash" - paged = yes; - 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 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 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 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 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 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; - ; + paged = yes; + size = 0x10000; + page_size = 256; + num_pages = 256; + min_write_delay = 4500; + max_write_delay = 4500; + readback = 0xff 0xff; + mode = 33; + delay = 6; + blocksize = 128; + readsize = 256; + read_lo = "0010.0000--xaaa.aaaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--xaaa.aaaa--aaaa.aaaa--oooo.oooo"; + loadpage_lo = "0100.0000--xxxx.xxxx--xaaa.aaaa--iiii.iiii"; + loadpage_hi = "0100.1000--xxxx.xxxx--xaaa.aaaa--iiii.iiii"; + writepage = "0100.1100--xaaa.aaaa--axxx.xxxx--xxxx.xxxx"; + ; 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii"; + ; 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii"; + ; 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 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0100--xxxx.xxxx--xxxx.xxii"; + ; 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 o o 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; - - 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"; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii"; + ; 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"; - ; - ; + size = 3; + read = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo"; + ; + + memory "calibration" + size = 4; + read = "0011.1000--xxxx.xxxx--0000.00aa--oooo.oooo"; + ; +; #------------------------------------------------------------ # ATmega64A #------------------------------------------------------------ part parent "m64" - id = "m64a"; - desc = "ATmega64A"; - ; + desc = "ATmega64A"; + id = "m64a"; + mcuid = 73; +; #------------------------------------------------------------ # ATmega128 #------------------------------------------------------------ part - id = "m128"; - desc = "ATmega128"; - has_jtag = yes; - stk500_devcode = 0xB2; - avr910_devcode = 0x43; - signature = 0x1e 0x97 0x02; - 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; - - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 6; - togglevtg = 0; - poweroffdelay = 0; - resetdelayms = 0; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; - programfusepolltimeout = 5; - programlockpulsewidth = 0; - programlockpolltimeout = 5; - - idr = 0x22; - spmcr = 0x68; - rampz = 0x3b; + desc = "ATmega128"; + id = "m128"; + prog_modes = PM_SPM | PM_ISP | PM_HVPP | PM_JTAG | PM_JTAGmkI; + mcuid = 85; + n_interrupts = 35; + n_boot_sections = 4; + boot_section_size = 1024; + stk500_devcode = 0xb2; + avr910_devcode = 0x43; + chip_erase_delay = 9000; + pagel = 0xd7; + bs2 = 0xa0; + signature = 0x1e 0x97 0x02; + reset = io; allowfullpagebitstream = yes; - - ocdrev = 1; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pp_controlstack = + 0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f, + 0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f, + 0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b, + 0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + latchcycles = 6; + hvleavestabdelay = 15; + chiperasepolltimeout = 10; + programfusepolltimeout = 5; + programlockpolltimeout = 5; + idr = 0x22; + rampz = 0x3b; + spmcr = 0x68; + ocdrev = 1; + chip_erase = "1010.1100--1000.0000--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; memory "eeprom" - paged = no; /* leave this "no" */ - page_size = 8; /* for parallel programming */ - size = 4096; - 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 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 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; - ; + size = 4096; + page_size = 8; + min_write_delay = 9000; + max_write_delay = 9000; + readback = 0xff 0xff; + mode = 4; + delay = 12; + blocksize = 64; + readsize = 256; + read = "1010.0000--xxxx.aaaa--aaaa.aaaa--oooo.oooo"; + write = "1100.0000--xxxx.aaaa--aaaa.aaaa--iiii.iiii"; + ; memory "flash" - paged = yes; - size = 131072; - page_size = 256; - num_pages = 512; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0xff; - readback_p2 = 0xff; - 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", - "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 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 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; - - writepage = " 0 1 0 0 1 1 0 0", - "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; - ; + paged = yes; + size = 0x20000; + page_size = 256; + num_pages = 512; + min_write_delay = 4500; + max_write_delay = 4500; + readback = 0xff 0xff; + mode = 33; + delay = 6; + blocksize = 128; + readsize = 256; + read_lo = "0010.0000--aaaa.aaaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--aaaa.aaaa--aaaa.aaaa--oooo.oooo"; + loadpage_lo = "0100.0000--xxxx.xxxx--xaaa.aaaa--iiii.iiii"; + loadpage_hi = "0100.1000--xxxx.xxxx--xaaa.aaaa--iiii.iiii"; + writepage = "0100.1100--aaaa.aaaa--axxx.xxxx--xxxx.xxxx"; + ; 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii"; + ; 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii"; + ; 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 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0100--xxxx.xxxx--xxxx.xxii"; + ; 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 o o 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; - - 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"; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii"; + ; 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"; - ; - ; + size = 3; + read = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo"; + ; + + memory "calibration" + size = 4; + read = "0011.1000--xxxx.xxxx--0000.00aa--oooo.oooo"; + ; +; #------------------------------------------------------------ # ATmega128A #------------------------------------------------------------ part parent "m128" - id = "m128a"; - desc = "ATmega128A"; - ; + desc = "ATmega128A"; + id = "m128a"; + mcuid = 86; +; #------------------------------------------------------------ # AT90CAN128 #------------------------------------------------------------ part - id = "c128"; - desc = "AT90CAN128"; - has_jtag = yes; - stk500_devcode = 0xB3; -# avr910_devcode = 0x43; - signature = 0x1e 0x97 0x81; - 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 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; - - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 6; - togglevtg = 0; - poweroffdelay = 0; - resetdelayms = 0; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; + desc = "AT90CAN128"; + id = "c128"; + prog_modes = PM_SPM | PM_ISP | PM_HVPP | PM_JTAG | PM_JTAGmkI; + mcuid = 176; + n_interrupts = 37; + n_boot_sections = 4; + boot_section_size = 1024; + stk500_devcode = 0xb3; + chip_erase_delay = 9000; + pagel = 0xd7; + bs2 = 0xa0; +# avr910_devcode = 0x43; + signature = 0x1e 0x97 0x81; + reset = io; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + pp_controlstack = + 0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f, + 0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f, + 0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b, + 0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01; + hventerstabdelay = 100; + latchcycles = 6; + hvleavestabdelay = 15; + chiperasepolltimeout = 10; programfusepolltimeout = 5; - programlockpulsewidth = 0; programlockpolltimeout = 5; - - idr = 0x31; - spmcr = 0x57; - rampz = 0x3b; - eecr = 0x3f; - allowfullpagebitstream = no; - - ocdrev = 3; + idr = 0x31; + rampz = 0x3b; + spmcr = 0x57; + eecr = 0x3f; + ocdrev = 3; + chip_erase = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; memory "eeprom" - paged = no; /* leave this "no" */ - page_size = 8; /* for parallel programming */ - size = 4096; - 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 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", - " 0 0 0 x a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; - - loadpage_lo = " 1 1 0 0 0 0 0 1", - " 0 0 0 0 0 0 0 0", - " 0 0 0 0 0 a2 a1 a0", - " i i i i i i i i"; - - writepage = " 1 1 0 0 0 0 1 0", - " 0 0 x x a11 a10 a9 a8", - " a7 a6 a5 a4 a3 0 0 0", - " x x x x x x x x"; - - - mode = 0x41; - delay = 20; - blocksize = 8; - readsize = 256; - ; + size = 4096; + page_size = 8; + min_write_delay = 9000; + max_write_delay = 9000; + readback = 0xff 0xff; + mode = 65; + delay = 20; + blocksize = 8; + readsize = 256; + read = "1010.0000--000x.aaaa--aaaa.aaaa--oooo.oooo"; + write = "1100.0000--000x.aaaa--aaaa.aaaa--iiii.iiii"; + loadpage_lo = "1100.0001--0000.0000--0000.0aaa--iiii.iiii"; + writepage = "1100.0010--00xx.aaaa--aaaa.a000--xxxx.xxxx"; + ; memory "flash" - paged = yes; - size = 131072; - page_size = 256; - num_pages = 512; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0xff; - readback_p2 = 0xff; - 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", - "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 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 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; - - writepage = " 0 1 0 0 1 1 0 0", - "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; - ; + paged = yes; + size = 0x20000; + page_size = 256; + num_pages = 512; + min_write_delay = 4500; + max_write_delay = 4500; + readback = 0xff 0xff; + mode = 65; + delay = 6; + blocksize = 256; + readsize = 256; + read_lo = "0010.0000--aaaa.aaaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--aaaa.aaaa--aaaa.aaaa--oooo.oooo"; + loadpage_lo = "0100.0000--000x.xxxx--xaaa.aaaa--iiii.iiii"; + loadpage_hi = "0100.1000--000x.xxxx--xaaa.aaaa--iiii.iiii"; + writepage = "0100.1100--aaaa.aaaa--axxx.xxxx--xxxx.xxxx"; + ; 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii"; + ; 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii"; + ; 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0100--xxxx.xxxx--xxxx.iiii"; + ; 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 o o 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; - - 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"; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii"; + ; 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"; - ; - ; + size = 3; + read = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo"; + ; + + memory "calibration" + size = 1; + read = "0011.1000--000x.xxxx--0000.0000--oooo.oooo"; + ; +; #------------------------------------------------------------ # AT90CAN64 #------------------------------------------------------------ part - id = "c64"; - desc = "AT90CAN64"; - has_jtag = yes; - stk500_devcode = 0xB3; -# avr910_devcode = 0x43; - signature = 0x1e 0x96 0x81; - 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 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; - - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 6; - togglevtg = 0; - poweroffdelay = 0; - resetdelayms = 0; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; + desc = "AT90CAN64"; + id = "c64"; + prog_modes = PM_SPM | PM_ISP | PM_HVPP | PM_JTAG; + mcuid = 172; + n_interrupts = 37; + n_boot_sections = 4; + boot_section_size = 1024; + stk500_devcode = 0xb3; + chip_erase_delay = 9000; + pagel = 0xd7; + bs2 = 0xa0; +# avr910_devcode = 0x43; + signature = 0x1e 0x96 0x81; + reset = io; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + pp_controlstack = + 0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f, + 0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f, + 0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b, + 0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01; + hventerstabdelay = 100; + latchcycles = 6; + hvleavestabdelay = 15; + chiperasepolltimeout = 10; programfusepolltimeout = 5; - programlockpulsewidth = 0; programlockpolltimeout = 5; - - idr = 0x31; - spmcr = 0x57; - rampz = 0x3b; - eecr = 0x3f; - allowfullpagebitstream = no; - - ocdrev = 3; + idr = 0x31; + rampz = 0x3b; + spmcr = 0x57; + eecr = 0x3f; + ocdrev = 3; + chip_erase = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; 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 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 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; - - loadpage_lo = " 1 1 0 0 0 0 0 1", - " 0 0 0 0 0 0 0 0", - " 0 0 0 0 0 a2 a1 a0", - " i i i i i i i i"; - - writepage = " 1 1 0 0 0 0 1 0", - " 0 0 x x x a10 a9 a8", - " a7 a6 a5 a4 a3 0 0 0", - " x x x x x x x x"; - - - mode = 0x41; - delay = 20; - blocksize = 8; - readsize = 256; - ; + size = 2048; + page_size = 8; + min_write_delay = 9000; + max_write_delay = 9000; + readback = 0xff 0xff; + mode = 65; + delay = 20; + blocksize = 8; + readsize = 256; + read = "1010.0000--000x.xaaa--aaaa.aaaa--oooo.oooo"; + write = "1100.0000--000x.xaaa--aaaa.aaaa--iiii.iiii"; + loadpage_lo = "1100.0001--0000.0000--0000.0aaa--iiii.iiii"; + writepage = "1100.0010--00xx.xaaa--aaaa.a000--xxxx.xxxx"; + ; memory "flash" - paged = yes; - 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", - "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", - "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 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 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; - - writepage = " 0 1 0 0 1 1 0 0", - "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; - ; + paged = yes; + size = 0x10000; + page_size = 256; + num_pages = 256; + min_write_delay = 4500; + max_write_delay = 4500; + readback = 0xff 0xff; + mode = 65; + delay = 6; + blocksize = 256; + readsize = 256; + read_lo = "0010.0000--aaaa.aaaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--aaaa.aaaa--aaaa.aaaa--oooo.oooo"; + loadpage_lo = "0100.0000--000x.xxxx--xaaa.aaaa--iiii.iiii"; + loadpage_hi = "0100.1000--000x.xxxx--xaaa.aaaa--iiii.iiii"; + writepage = "0100.1100--aaaa.aaaa--axxx.xxxx--xxxx.xxxx"; + ; 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii"; + ; 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii"; + ; 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0100--xxxx.xxxx--xxxx.iiii"; + ; 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 o o 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; - - 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"; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii"; + ; 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"; - ; - ; + size = 3; + read = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo"; + ; + + memory "calibration" + size = 1; + read = "0011.1000--000x.xxxx--0000.0000--oooo.oooo"; + ; +; #------------------------------------------------------------ # AT90CAN32 #------------------------------------------------------------ part - id = "c32"; - desc = "AT90CAN32"; - has_jtag = yes; - stk500_devcode = 0xB3; -# avr910_devcode = 0x43; - signature = 0x1e 0x95 0x81; - 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 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; - - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 6; - togglevtg = 0; - poweroffdelay = 0; - resetdelayms = 0; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; + desc = "AT90CAN32"; + id = "c32"; + prog_modes = PM_SPM | PM_ISP | PM_HVPP | PM_JTAG; + mcuid = 171; + n_interrupts = 37; + n_boot_sections = 4; + boot_section_size = 1024; + stk500_devcode = 0xb3; + chip_erase_delay = 9000; + pagel = 0xd7; + bs2 = 0xa0; +# avr910_devcode = 0x43; + signature = 0x1e 0x95 0x81; + reset = io; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + pp_controlstack = + 0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f, + 0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f, + 0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b, + 0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01; + hventerstabdelay = 100; + latchcycles = 6; + hvleavestabdelay = 15; + chiperasepolltimeout = 10; programfusepolltimeout = 5; - programlockpulsewidth = 0; programlockpolltimeout = 5; - - idr = 0x31; - spmcr = 0x57; - rampz = 0x3b; - eecr = 0x3f; - allowfullpagebitstream = no; - - ocdrev = 3; + idr = 0x31; + rampz = 0x3b; + spmcr = 0x57; + eecr = 0x3f; + ocdrev = 3; + chip_erase = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; memory "eeprom" - paged = no; /* leave this "no" */ - page_size = 8; /* 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 0 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 0 x x x a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; - - loadpage_lo = " 1 1 0 0 0 0 0 1", - " 0 0 0 0 0 0 0 0", - " 0 0 0 0 0 a2 a1 a0", - " i i i i i i i i"; - - writepage = " 1 1 0 0 0 0 1 0", - " 0 0 x x x x a9 a8", - " a7 a6 a5 a4 a3 0 0 0", - " x x x x x x x x"; - - - mode = 0x41; - delay = 20; - blocksize = 8; - readsize = 256; - ; + size = 1024; + page_size = 8; + min_write_delay = 9000; + max_write_delay = 9000; + readback = 0xff 0xff; + mode = 65; + delay = 20; + blocksize = 8; + readsize = 256; + read = "1010.0000--000x.xxaa--aaaa.aaaa--oooo.oooo"; + write = "1100.0000--000x.xxaa--aaaa.aaaa--iiii.iiii"; + loadpage_lo = "1100.0001--0000.0000--0000.0aaa--iiii.iiii"; + writepage = "1100.0010--00xx.xxaa--aaaa.a000--xxxx.xxxx"; + ; memory "flash" - paged = yes; - size = 32768; - page_size = 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", - "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", - "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 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 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; - - writepage = " 0 1 0 0 1 1 0 0", - "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; - ; + paged = yes; + size = 0x8000; + page_size = 256; + num_pages = 128; + min_write_delay = 4500; + max_write_delay = 4500; + readback = 0xff 0xff; + mode = 65; + delay = 6; + blocksize = 256; + readsize = 256; + read_lo = "0010.0000--aaaa.aaaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--aaaa.aaaa--aaaa.aaaa--oooo.oooo"; + loadpage_lo = "0100.0000--000x.xxxx--xaaa.aaaa--iiii.iiii"; + loadpage_hi = "0100.1000--000x.xxxx--xaaa.aaaa--iiii.iiii"; + writepage = "0100.1100--aaaa.aaaa--axxx.xxxx--xxxx.xxxx"; + ; 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii"; + ; 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii"; + ; 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0100--xxxx.xxxx--xxxx.iiii"; + ; 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 o o 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; - - 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"; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii"; + ; 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"; - ; - ; + size = 3; + read = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo"; + ; + memory "calibration" + size = 1; + read = "0011.1000--000x.xxxx--0000.0000--oooo.oooo"; + ; +; #------------------------------------------------------------ # ATmega16 #------------------------------------------------------------ part - id = "m16"; - desc = "ATmega16"; - has_jtag = yes; - stk500_devcode = 0x82; - avr910_devcode = 0x74; - signature = 0x1e 0x94 0x03; - 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; - - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 100; - latchcycles = 6; - togglevtg = 0; - poweroffdelay = 0; - resetdelayms = 0; - resetdelayus = 0; - hvleavestabdelay = 15; - resetdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; - programfusepolltimeout = 5; - programlockpulsewidth = 0; - programlockpolltimeout = 5; - - idr = 0x31; - spmcr = 0x57; + desc = "ATmega16"; + id = "m16"; + prog_modes = PM_SPM | PM_ISP | PM_HVPP | PM_JTAG | PM_JTAGmkI; + mcuid = 49; + n_interrupts = 21; + n_boot_sections = 4; + boot_section_size = 256; + stk500_devcode = 0x82; + avr910_devcode = 0x74; + chip_erase_delay = 9000; + pagel = 0xd7; + bs2 = 0xa0; + signature = 0x1e 0x94 0x03; + reset = io; allowfullpagebitstream = yes; - - ocdrev = 2; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pp_controlstack = + 0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f, + 0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f, + 0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b, + 0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 100; + latchcycles = 6; + hvleavestabdelay = 15; + resetdelay = 15; + chiperasepolltimeout = 10; + programfusepolltimeout = 5; + programlockpolltimeout = 5; + idr = 0x31; + spmcr = 0x57; + ocdrev = 2; + chip_erase = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; 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"; - - loadpage_lo = " 1 1 0 0 0 0 0 1", - " 0 0 0 0 0 0 0 0", - " 0 0 0 0 0 0 a1 a0", - " i i i i i i i i"; - - writepage = " 1 1 0 0 0 0 1 0", - " 0 0 x x x x a9 a8", - " a7 a6 a5 a4 a3 a2 0 0", - " x x x x x x x x"; - - mode = 0x04; - delay = 10; - blocksize = 128; - readsize = 256; - ; + size = 512; + page_size = 4; + min_write_delay = 9000; + max_write_delay = 9000; + readback = 0xff 0xff; + mode = 4; + delay = 10; + blocksize = 128; + readsize = 256; + read = "1010.0000--00xx.xxaa--aaaa.aaaa--oooo.oooo"; + write = "1100.0000--00xx.xxaa--aaaa.aaaa--iiii.iiii"; + loadpage_lo = "1100.0001--0000.0000--0000.00aa--iiii.iiii"; + writepage = "1100.0010--00xx.xxaa--aaaa.aa00--xxxx.xxxx"; + ; memory "flash" - paged = yes; - 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 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 = 128; - 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 o o 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + paged = yes; + size = 0x4000; + page_size = 128; + num_pages = 128; + min_write_delay = 4500; + max_write_delay = 4500; + readback = 0xff 0xff; + mode = 33; + delay = 6; + blocksize = 128; + readsize = 256; + read_lo = "0010.0000--00aa.aaaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--00aa.aaaa--aaaa.aaaa--oooo.oooo"; + loadpage_lo = "0100.0000--00xx.xxxx--xxaa.aaaa--iiii.iiii"; + loadpage_hi = "0100.1000--00xx.xxxx--xxaa.aaaa--iiii.iiii"; + writepage = "0100.1100--00aa.aaaa--aaxx.xxxx--xxxx.xxxx"; + ; memory "lfuse" - size = 1; - 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii"; + ; memory "hfuse" - size = 1; - 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"; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii"; + ; + + memory "lock" + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii"; + ; - 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; 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 = 4; + size = 3; + read = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo"; + ; - read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", - "0 0 0 0 0 0 a1 a0 o o o o o o o o"; - ; - ; + memory "calibration" + size = 4; + read = "0011.1000--000x.xxxx--0000.00aa--oooo.oooo"; + ; +; #------------------------------------------------------------ # ATmega16A #------------------------------------------------------------ part parent "m16" - id = "m16a"; - desc = "ATmega16A"; - ; + desc = "ATmega16A"; + id = "m16a"; + mcuid = 50; +; #------------------------------------------------------------ # ATmega324P #------------------------------------------------------------ part - id = "m324p"; - desc = "ATmega324P"; - has_jtag = yes; - stk500_devcode = 0x82; # no STK500v1 support, use the ATmega16 one - avr910_devcode = 0x74; - signature = 0x1e 0x95 0x08; - pagel = 0xd7; - bs2 = 0xa0; - chip_erase_delay = 55000; - 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; - - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; + desc = "ATmega324P"; + id = "m324p"; + prog_modes = PM_SPM | PM_ISP | PM_HVPP | PM_JTAG; + mcuid = 111; + n_interrupts = 31; + n_boot_sections = 4; + boot_section_size = 512; + stk500_devcode = 0x82; # no STK500v1 support, use the ATmega16 one + avr910_devcode = 0x74; + chip_erase_delay = 55000; + pagel = 0xd7; + bs2 = 0xa0; + signature = 0x1e 0x95 0x08; + reset = io; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pp_controlstack = + 0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f, + 0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f, + 0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b, + 0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + hvleavestabdelay = 15; + chiperasepolltimeout = 10; programfusepolltimeout = 5; - programlockpulsewidth = 0; programlockpolltimeout = 5; - - idr = 0x31; - spmcr = 0x57; - allowfullpagebitstream = no; - - ocdrev = 3; + idr = 0x31; + spmcr = 0x57; + ocdrev = 3; + chip_erase = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; 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 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 x x x a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; - - loadpage_lo = " 1 1 0 0 0 0 0 1", - " 0 0 0 0 0 0 0 0", - " 0 0 0 0 0 0 a1 a0", - " i i i i i i i i"; - - writepage = " 1 1 0 0 0 0 1 0", - " 0 0 x x x a10 a9 a8", - " a7 a6 a5 a4 a3 a2 0 0", - " x x x x x x x x"; - - mode = 0x41; - delay = 10; - blocksize = 128; - readsize = 256; - ; + size = 1024; + page_size = 4; + min_write_delay = 9000; + max_write_delay = 9000; + readback = 0xff 0xff; + mode = 65; + delay = 10; + blocksize = 128; + readsize = 256; + read = "1010.0000--00xx.xaaa--aaaa.aaaa--oooo.oooo"; + write = "1100.0000--00xx.xaaa--aaaa.aaaa--iiii.iiii"; + loadpage_lo = "1100.0001--0000.0000--0000.00aa--iiii.iiii"; + writepage = "1100.0010--00xx.xaaa--aaaa.aa00--xxxx.xxxx"; + ; 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 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 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 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 a14 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 = 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 o o 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + paged = yes; + size = 0x8000; + page_size = 128; + num_pages = 256; + min_write_delay = 4500; + max_write_delay = 4500; + readback = 0xff 0xff; + mode = 33; + delay = 6; + blocksize = 256; + readsize = 256; + read_lo = "0010.0000--0aaa.aaaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--0aaa.aaaa--aaaa.aaaa--oooo.oooo"; + loadpage_lo = "0100.0000--00xx.xxxx--xxaa.aaaa--iiii.iiii"; + loadpage_hi = "0100.1000--00xx.xxxx--xxaa.aaaa--iiii.iiii"; + writepage = "0100.1100--0aaa.aaaa--aaxx.xxxx--xxxx.xxxx"; + ; memory "lfuse" - size = 1; - 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii"; + ; memory "hfuse" - size = 1; - 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii"; + ; memory "efuse" - size = 1; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0100--xxxx.xxxx--1111.1iii"; + ; - 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + memory "lock" + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii"; + ; 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"; - ; + size = 3; + read = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo"; + ; 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"; - ; - ; + size = 1; + read = "0011.1000--000x.xxxx--0000.0000--oooo.oooo"; + ; +; #------------------------------------------------------------ # ATmega164P #------------------------------------------------------------ part parent "m324p" - id = "m164p"; - desc = "ATmega164P"; - signature = 0x1e 0x94 0x0a; + desc = "ATmega164P"; + id = "m164p"; + mcuid = 93; + boot_section_size = 256; + signature = 0x1e 0x94 0x0a; memory "eeprom" - paged = no; /* leave this "no" */ - size = 512; - page_size = 4; - 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 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 x x x a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; - - loadpage_lo = " 1 1 0 0 0 0 0 1", - " 0 0 0 0 0 0 0 0", - " 0 0 0 0 0 0 a1 a0", - " i i i i i i i i"; - - writepage = " 1 1 0 0 0 0 1 0", - " 0 0 x x x a10 a9 a8", - " a7 a6 a5 a4 a3 a2 0 0", - " x x x x x x x x"; - - mode = 0x41; - delay = 10; - blocksize = 128; - readsize = 256; - ; + size = 512; + ; memory "flash" - paged = yes; - 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 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 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 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 a14 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 = 256; - readsize = 256; - ; - - ; + size = 0x4000; + num_pages = 128; + ; +; #------------------------------------------------------------ # ATmega164PA #------------------------------------------------------------ part parent "m164p" - id = "m164pa"; - desc = "ATmega164PA"; - ; + desc = "ATmega164PA"; + id = "m164pa"; + mcuid = 94; +; #------------------------------------------------------------ # ATmega164A #------------------------------------------------------------ part parent "m164p" - id = "m164a"; - desc = "ATmega164A"; - signature = 0x1e 0x94 0x0f; - ; + desc = "ATmega164A"; + id = "m164a"; + mcuid = 92; + signature = 0x1e 0x94 0x0f; +; #------------------------------------------------------------ # ATmega324PB #------------------------------------------------------------ part parent "m324p" - id = "m324pb"; - desc = "ATmega324PB"; - signature = 0x1e 0x95 0x17; - ; + desc = "ATmega324PB"; + id = "m324pb"; + mcuid = 113; + n_interrupts = 51; + signature = 0x1e 0x95 0x17; +; #------------------------------------------------------------ # ATmega324PA #------------------------------------------------------------ part parent "m324p" - id = "m324pa"; - desc = "ATmega324PA"; - signature = 0x1e 0x95 0x11; - ; + desc = "ATmega324PA"; + id = "m324pa"; + mcuid = 112; + signature = 0x1e 0x95 0x11; +; #------------------------------------------------------------ # ATmega324A #------------------------------------------------------------ part parent "m324p" - id = "m324a"; - desc = "ATmega324A"; - signature = 0x1e 0x95 0x15; - ; + desc = "ATmega324A"; + id = "m324a"; + mcuid = 110; + signature = 0x1e 0x95 0x15; +; #------------------------------------------------------------ # ATmega644 #------------------------------------------------------------ part - id = "m644"; - desc = "ATmega644"; - has_jtag = yes; - stk500_devcode = 0x82; # no STK500v1 support, use the ATmega16 one - avr910_devcode = 0x74; - signature = 0x1e 0x96 0x09; - pagel = 0xd7; - bs2 = 0xa0; - chip_erase_delay = 55000; - 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; - - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 6; - togglevtg = 0; - poweroffdelay = 0; - resetdelayms = 0; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; + desc = "ATmega644"; + id = "m644"; + prog_modes = PM_SPM | PM_ISP | PM_HVPP | PM_JTAG; + mcuid = 127; + n_interrupts = 28; + n_boot_sections = 4; + boot_section_size = 1024; + stk500_devcode = 0x82; # no STK500v1 support, use the ATmega16 one + avr910_devcode = 0x74; + chip_erase_delay = 55000; + pagel = 0xd7; + bs2 = 0xa0; + signature = 0x1e 0x96 0x09; + reset = io; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pp_controlstack = + 0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f, + 0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f, + 0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b, + 0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02; + hventerstabdelay = 100; + latchcycles = 6; + hvleavestabdelay = 15; + chiperasepolltimeout = 10; programfusepolltimeout = 5; - programlockpulsewidth = 0; programlockpolltimeout = 5; - - idr = 0x31; - spmcr = 0x57; - allowfullpagebitstream = no; - - ocdrev = 3; + idr = 0x31; + spmcr = 0x57; + ocdrev = 3; + chip_erase = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; 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 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", - " 0 0 x x a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; - - loadpage_lo = " 1 1 0 0 0 0 0 1", - " 0 0 0 0 0 0 0 0", - " 0 0 0 0 0 a2 a1 a0", - " i i i i i i i i"; - - writepage = " 1 1 0 0 0 0 1 0", - " 0 0 x x a11 a10 a9 a8", - " a7 a6 a5 a4 a3 0 0 0", - " x x x x x x x x"; - - mode = 0x41; - delay = 10; - blocksize = 128; - readsize = 256; - ; + size = 2048; + page_size = 8; + min_write_delay = 9000; + max_write_delay = 9000; + readback = 0xff 0xff; + mode = 65; + delay = 10; + blocksize = 128; + readsize = 256; + read = "1010.0000--00xx.aaaa--aaaa.aaaa--oooo.oooo"; + write = "1100.0000--00xx.aaaa--aaaa.aaaa--iiii.iiii"; + loadpage_lo = "1100.0001--0000.0000--0000.0aaa--iiii.iiii"; + writepage = "1100.0010--00xx.aaaa--aaaa.a000--xxxx.xxxx"; + ; memory "flash" - paged = yes; - 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", - "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", - "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 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 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", - "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 o o 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + paged = yes; + size = 0x10000; + page_size = 256; + num_pages = 256; + min_write_delay = 4500; + max_write_delay = 4500; + readback = 0xff 0xff; + mode = 33; + delay = 6; + blocksize = 256; + readsize = 256; + read_lo = "0010.0000--aaaa.aaaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--aaaa.aaaa--aaaa.aaaa--oooo.oooo"; + loadpage_lo = "0100.0000--00xx.xxxx--xaaa.aaaa--iiii.iiii"; + loadpage_hi = "0100.1000--00xx.xxxx--xaaa.aaaa--iiii.iiii"; + writepage = "0100.1100--aaaa.aaaa--axxx.xxxx--xxxx.xxxx"; + ; memory "lfuse" - size = 1; - 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii"; + ; memory "hfuse" - size = 1; - 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii"; + ; memory "efuse" - size = 1; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0100--xxxx.xxxx--1111.1iii"; + ; - 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + memory "lock" + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii"; + ; 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"; - ; + size = 3; + read = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo"; + ; 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"; - ; - ; + size = 1; + read = "0011.1000--000x.xxxx--0000.0000--oooo.oooo"; + ; +; #------------------------------------------------------------ # ATmega644A #------------------------------------------------------------ part parent "m644" - id = "m644a"; - desc = "ATmega644A"; - ; + desc = "ATmega644A"; + id = "m644a"; + mcuid = 128; + n_interrupts = 31; +; #------------------------------------------------------------ # ATmega644P #------------------------------------------------------------ part parent "m644" - id = "m644p"; - desc = "ATmega644P"; - signature = 0x1e 0x96 0x0a; - ; + desc = "ATmega644P"; + id = "m644p"; + mcuid = 129; + n_interrupts = 31; + signature = 0x1e 0x96 0x0a; +; #------------------------------------------------------------ # ATmega644PA #------------------------------------------------------------ part parent "m644" - id = "m644pa"; - desc = "ATmega644PA"; - signature = 0x1e 0x96 0x0a; - ; + desc = "ATmega644PA"; + id = "m644pa"; + mcuid = 130; + n_interrupts = 31; + signature = 0x1e 0x96 0x0a; +; #------------------------------------------------------------ # ATmega1284 #------------------------------------------------------------ part - id = "m1284"; - desc = "ATmega1284"; - has_jtag = yes; - stk500_devcode = 0x82; # no STK500v1 support, use the ATmega16 one - avr910_devcode = 0x74; - signature = 0x1e 0x97 0x06; - pagel = 0xd7; - bs2 = 0xa0; - chip_erase_delay = 55000; - 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; - - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 6; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; + desc = "ATmega1284"; + id = "m1284"; + prog_modes = PM_SPM | PM_ISP | PM_HVPP | PM_JTAG; + mcuid = 140; + n_interrupts = 35; + n_boot_sections = 4; + boot_section_size = 1024; + stk500_devcode = 0x82; # no STK500v1 support, use the ATmega16 one + avr910_devcode = 0x74; + chip_erase_delay = 55000; + pagel = 0xd7; + bs2 = 0xa0; + signature = 0x1e 0x97 0x06; + reset = io; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + pp_controlstack = + 0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f, + 0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f, + 0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b, + 0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02; + hventerstabdelay = 100; + latchcycles = 6; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + hvleavestabdelay = 15; + chiperasepolltimeout = 10; programfusepolltimeout = 5; - programlockpulsewidth = 0; programlockpolltimeout = 5; - - idr = 0x31; - spmcr = 0x57; - allowfullpagebitstream = no; - - ocdrev = 3; + idr = 0x31; + spmcr = 0x57; + ocdrev = 3; + chip_erase = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; memory "eeprom" - paged = no; /* leave this "no" */ - page_size = 8; /* for parallel programming */ - size = 4096; - 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 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", - " 0 0 x x a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; - - loadpage_lo = " 1 1 0 0 0 0 0 1", - " 0 0 0 0 0 0 0 0", - " 0 0 0 0 0 a2 a1 a0", - " i i i i i i i i"; - - writepage = " 1 1 0 0 0 0 1 0", - " 0 0 x x a11 a10 a9 a8", - " a7 a6 a5 a4 a3 0 0 0", - " x x x x x x x x"; - - mode = 0x41; - delay = 10; - blocksize = 128; - readsize = 256; - ; + size = 4096; + page_size = 8; + min_write_delay = 9000; + max_write_delay = 9000; + readback = 0xff 0xff; + mode = 65; + delay = 10; + blocksize = 128; + readsize = 256; + read = "1010.0000--00xx.aaaa--aaaa.aaaa--oooo.oooo"; + write = "1100.0000--00xx.aaaa--aaaa.aaaa--iiii.iiii"; + loadpage_lo = "1100.0001--0000.0000--0000.0aaa--iiii.iiii"; + writepage = "1100.0010--00xx.aaaa--aaaa.a000--xxxx.xxxx"; + ; memory "flash" - paged = yes; - size = 131072; - page_size = 256; - num_pages = 512; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0xff; - readback_p2 = 0xff; - 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", - "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 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 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", - "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 = 10; - 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 o o 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + paged = yes; + size = 0x20000; + page_size = 256; + num_pages = 512; + min_write_delay = 4500; + max_write_delay = 4500; + readback = 0xff 0xff; + mode = 65; + delay = 10; + blocksize = 256; + readsize = 256; + read_lo = "0010.0000--aaaa.aaaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--aaaa.aaaa--aaaa.aaaa--oooo.oooo"; + loadpage_lo = "0100.0000--00xx.xxxx--xaaa.aaaa--iiii.iiii"; + loadpage_hi = "0100.1000--00xx.xxxx--xaaa.aaaa--iiii.iiii"; + writepage = "0100.1100--aaaa.aaaa--axxx.xxxx--xxxx.xxxx"; + ; memory "lfuse" - size = 1; - 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii"; + ; memory "hfuse" - size = 1; - 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii"; + ; memory "efuse" - size = 1; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0100--xxxx.xxxx--1111.1iii"; + ; - 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + memory "lock" + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii"; + ; 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"; - ; + size = 3; + read = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo"; + ; 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"; - ; - ; + size = 1; + read = "0011.1000--000x.xxxx--0000.0000--oooo.oooo"; + ; +; #------------------------------------------------------------ # ATmega1284P #------------------------------------------------------------ part parent "m1284" - id = "m1284p"; - desc = "ATmega1284P"; - signature = 0x1e 0x97 0x05; - ; + desc = "ATmega1284P"; + id = "m1284p"; + mcuid = 141; + signature = 0x1e 0x97 0x05; +; #------------------------------------------------------------ # ATmega162 #------------------------------------------------------------ part - id = "m162"; - desc = "ATmega162"; - has_jtag = yes; - stk500_devcode = 0x83; - avr910_devcode = 0x63; - signature = 0x1e 0x94 0x04; - chip_erase_delay = 9000; - pagel = 0xd7; - bs2 = 0xa0; - - idr = 0x04; - spmcr = 0x57; + desc = "ATmega162"; + id = "m162"; + prog_modes = PM_SPM | PM_ISP | PM_HVPP | PM_JTAG | PM_JTAGmkI; + mcuid = 90; + n_interrupts = 28; + n_boot_sections = 4; + boot_section_size = 256; + stk500_devcode = 0x83; + avr910_devcode = 0x63; + chip_erase_delay = 9000; + pagel = 0xd7; + bs2 = 0xa0; + signature = 0x1e 0x94 0x04; + reset = io; 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 x x x x x", - "x x x x x x x x x x x x x x x x"; - - ocdrev = 2; - - memory "flash" - paged = yes; - 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 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 = 0x41; - delay = 10; - blocksize = 128; - readsize = 256; - - ; - - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 0; - - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 6; - togglevtg = 0; - poweroffdelay = 0; - resetdelayms = 0; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pp_controlstack = + 0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f, + 0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f, + 0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b, + 0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + latchcycles = 6; + hvleavestabdelay = 15; + chiperasepolltimeout = 10; programfusepolltimeout = 5; - programlockpulsewidth = 0; programlockpolltimeout = 5; + idr = 0x04; + spmcr = 0x57; + ocdrev = 2; + chip_erase = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; 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; + size = 512; + page_size = 4; + min_write_delay = 9000; + max_write_delay = 9000; + readback = 0xff 0xff; + mode = 65; + delay = 20; + blocksize = 4; + readsize = 256; + read = "1010.0000--00xx.xxaa--aaaa.aaaa--oooo.oooo"; + write = "1100.0000--00xx.xxaa--aaaa.aaaa--iiii.iiii"; + loadpage_lo = "1100.0001--0000.0000--0000.00aa--iiii.iiii"; + writepage = "1100.0010--00xx.xxaa--aaaa.aa00--xxxx.xxxx"; + ; - 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"; - - loadpage_lo = " 1 1 0 0 0 0 0 1", - " 0 0 0 0 0 0 0 0", - " 0 0 0 0 0 0 a1 a0", - " i i i i i i i i"; - - writepage = " 1 1 0 0 0 0 1 0", - " 0 0 x x x x a9 a8", - " a7 a6 a5 a4 a3 a2 0 0", - " x x x x x x x x"; - - mode = 0x41; - delay = 20; - blocksize = 4; - readsize = 256; - ; + memory "flash" + paged = yes; + size = 0x4000; + page_size = 128; + num_pages = 128; + min_write_delay = 4500; + max_write_delay = 4500; + readback = 0xff 0xff; + mode = 65; + delay = 10; + blocksize = 128; + readsize = 256; + read_lo = "0010.0000--00aa.aaaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--00aa.aaaa--aaaa.aaaa--oooo.oooo"; + loadpage_lo = "0100.0000--00xx.xxxx--xxaa.aaaa--iiii.iiii"; + loadpage_hi = "0100.1000--00xx.xxxx--xxaa.aaaa--iiii.iiii"; + writepage = "0100.1100--00aa.aaaa--aaxx.xxxx--xxxx.xxxx"; + ; 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"; - ; + size = 1; + min_write_delay = 16000; + max_write_delay = 16000; + read = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii"; + ; 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"; - ; + size = 1; + min_write_delay = 16000; + max_write_delay = 16000; + read = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii"; + ; 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"; - ; + size = 1; + min_write_delay = 16000; + max_write_delay = 16000; + read = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0100--xxxx.xxxx--1111.1iii"; + ; 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 o o 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"; - ; + size = 1; + min_write_delay = 16000; + max_write_delay = 16000; + read = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii"; + ; 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"; - ; + size = 3; + read = "0011.0000--00xx.xxxx--xxxx.xxaa--oooo.oooo"; + ; 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"; - ; + size = 1; + read = "0011.1000--00xx.xxxx--0000.0000--oooo.oooo"; + ; ; - - #------------------------------------------------------------ # ATmega163 #------------------------------------------------------------ part - id = "m163"; - desc = "ATmega163"; - stk500_devcode = 0x81; - avr910_devcode = 0x64; - signature = 0x1e 0x94 0x02; - 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", - "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; - - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 0; - togglevtg = 0; - poweroffdelay = 0; - resetdelayms = 0; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 30; - programfusepulsewidth = 0; + desc = "ATmega163"; + id = "m163"; + prog_modes = PM_SPM | PM_ISP | PM_HVPP; + mcuid = 91; + n_interrupts = 18; + n_boot_sections = 4; + boot_section_size = 256; + stk500_devcode = 0x81; + avr910_devcode = 0x64; + chip_erase_delay = 32000; + pagel = 0xd7; + bs2 = 0xa0; + signature = 0x1e 0x94 0x02; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pp_controlstack = + 0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f, + 0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f, + 0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b, + 0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + hvleavestabdelay = 15; + chiperasepolltimeout = 30; programfusepolltimeout = 2; - programlockpulsewidth = 0; programlockpolltimeout = 2; + chip_erase = "1010.1100--1000.0000--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; - - memory "eeprom" - size = 512; - min_write_delay = 4000; - max_write_delay = 4000; - 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 = 0x41; - delay = 20; - blocksize = 4; - readsize = 256; - ; + memory "eeprom" + size = 512; + min_write_delay = 4000; + max_write_delay = 4000; + readback = 0xff 0xff; + mode = 65; + delay = 20; + blocksize = 4; + readsize = 256; + read = "1010.0000--xxxx.xxxa--aaaa.aaaa--oooo.oooo"; + write = "1100.0000--xxxx.xxxa--aaaa.aaaa--iiii.iiii"; + ; memory "flash" - paged = yes; - size = 16384; - page_size = 128; - num_pages = 128; - min_write_delay = 16000; - max_write_delay = 16000; - 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 = 0x11; - delay = 20; - blocksize = 128; - readsize = 256; - ; + paged = yes; + size = 0x4000; + page_size = 128; + num_pages = 128; + min_write_delay = 16000; + max_write_delay = 16000; + readback = 0xff 0xff; + mode = 17; + delay = 20; + blocksize = 128; + readsize = 256; + read_lo = "0010.0000--xxxa.aaaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--xxxa.aaaa--aaaa.aaaa--oooo.oooo"; + loadpage_lo = "0100.0000--xxxx.xxxx--xxaa.aaaa--iiii.iiii"; + loadpage_hi = "0100.1000--xxxx.xxxx--xxaa.aaaa--iiii.iiii"; + writepage = "0100.1100--xxxa.aaaa--aaxx.xxxx--xxxx.xxxx"; + ; 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"; - - 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"; - ; + size = 1; + min_write_delay = 2000; + max_write_delay = 2000; + read = "0101.0000--0000.0000--xxxx.xxxx--ooxx.oooo"; + write = "1010.1100--1010.0000--xxxx.xxxx--ii11.iiii"; + ; 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"; - - 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"; - ; + size = 1; + min_write_delay = 2000; + max_write_delay = 2000; + read = "0101.1000--0000.1000--xxxx.xxxx--xxxx.1ooo"; + write = "1010.1100--1010.1000--xxxx.xxxx--1111.1iii"; + ; 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 o o 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"; - ; + size = 1; + min_write_delay = 2000; + max_write_delay = 2000; + read = "0101.1000--0000.0000--xxxx.0xxx--oooo.oooo"; + write = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii"; + ; 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"; - ; + size = 3; + read = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo"; + ; 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"; - ; - ; + size = 1; + read = "0011.1000--xxxx.xxxx--0000.0000--oooo.oooo"; + ; +; #------------------------------------------------------------ # ATmega169 #------------------------------------------------------------ part - id = "m169"; - desc = "ATmega169"; - has_jtag = yes; - stk500_devcode = 0x85; - avr910_devcode = 0x78; - signature = 0x1e 0x94 0x05; - 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", - "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; - - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; + desc = "ATmega169"; + id = "m169"; + prog_modes = PM_SPM | PM_ISP | PM_HVPP | PM_JTAG | PM_JTAGmkI; + mcuid = 104; + n_interrupts = 23; + n_boot_sections = 4; + boot_section_size = 256; + stk500_devcode = 0x85; + avr910_devcode = 0x78; + chip_erase_delay = 9000; + signature = 0x1e 0x94 0x05; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + pp_controlstack = + 0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f, + 0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f, + 0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b, + 0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + hvleavestabdelay = 15; + chiperasepolltimeout = 10; programfusepolltimeout = 5; - programlockpulsewidth = 0; programlockpolltimeout = 5; + idr = 0x31; + spmcr = 0x57; + ocdrev = 2; + chip_erase = "1010.1100--1000.0000--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; - idr = 0x31; - spmcr = 0x57; - - ocdrev = 2; - - 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", - " 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"; - - loadpage_lo = " 1 1 0 0 0 0 0 1", - " 0 0 0 0 0 0 0 0", - " 0 0 0 0 0 0 a1 a0", - " i i i i i i i i"; - - writepage = " 1 1 0 0 0 0 1 0", - " 0 0 x x x x x a8", - " a7 a6 a5 a4 a3 a2 0 0", - " x x x x x x x x"; - - mode = 0x41; - delay = 20; - blocksize = 4; - readsize = 256; - ; + memory "eeprom" + size = 512; + page_size = 4; + min_write_delay = 9000; + max_write_delay = 9000; + readback = 0xff 0xff; + mode = 65; + delay = 20; + blocksize = 4; + readsize = 256; + read = "1010.0000--xxxx.xxxa--aaaa.aaaa--oooo.oooo"; + write = "1100.0000--xxxx.xxxa--aaaa.aaaa--iiii.iiii"; + loadpage_lo = "1100.0001--0000.0000--0000.00aa--iiii.iiii"; + writepage = "1100.0010--00xx.xxxa--aaaa.aa00--xxxx.xxxx"; + ; memory "flash" - paged = yes; - 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", - " 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 = 0x41; - delay = 6; - blocksize = 128; - readsize = 256; - ; + paged = yes; + size = 0x4000; + page_size = 128; + num_pages = 128; + min_write_delay = 4500; + max_write_delay = 4500; + readback = 0xff 0xff; + mode = 65; + delay = 6; + blocksize = 128; + readsize = 256; + read_lo = "0010.0000--xxxa.aaaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--xxxa.aaaa--aaaa.aaaa--oooo.oooo"; + loadpage_lo = "0100.0000--xxxx.xxxx--xxaa.aaaa--iiii.iiii"; + loadpage_hi = "0100.1000--xxxx.xxxx--xxaa.aaaa--iiii.iiii"; + writepage = "0100.1100--xxxa.aaaa--aaxx.xxxx--xxxx.xxxx"; + ; 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"; - ; + size = 1; + min_write_delay = 2000; + max_write_delay = 2000; + read = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii"; + ; 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"; - ; + size = 1; + min_write_delay = 2000; + max_write_delay = 2000; + read = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii"; + ; 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"; - ; + size = 1; + min_write_delay = 2000; + max_write_delay = 2000; + read = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0100--xxxx.xxxx--xxxx.iiii"; + ; 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 o o 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"; - ; + size = 1; + min_write_delay = 2000; + max_write_delay = 2000; + read = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii"; + ; 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"; - ; + size = 3; + read = "0011.0000--000x.xxxx--xxxx.xxaa--oooo.oooo"; + ; 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"; - ; - ; + size = 1; + read = "0011.1000--000x.xxxx--0000.0000--oooo.oooo"; + ; +; #------------------------------------------------------------ # ATmega169A #------------------------------------------------------------ part parent "m169" - id = "m169a"; - desc = "ATmega169A"; - signature = 0x1E 0x94 0x11; - ; + desc = "ATmega169A"; + id = "m169a"; + mcuid = 105; + signature = 0x1e 0x94 0x11; + reset = io; +; #------------------------------------------------------------ # ATmega169P #------------------------------------------------------------ part parent "m169" - id = "m169p"; - desc = "ATmega169P"; - signature = 0x1E 0x94 0x05; - ; + desc = "ATmega169P"; + id = "m169p"; + prog_modes = PM_SPM | PM_ISP | PM_HVPP | PM_JTAG; + mcuid = 106; + reset = io; +; #------------------------------------------------------------ # ATmega169PA #------------------------------------------------------------ part parent "m169" - id = "m169pa"; - desc = "ATmega169PA"; - signature = 0x1E 0x94 0x05; - ; + desc = "ATmega169PA"; + id = "m169pa"; + prog_modes = PM_SPM | PM_ISP | PM_HVPP | PM_JTAG; + mcuid = 107; + reset = io; +; #------------------------------------------------------------ # ATmega329 #------------------------------------------------------------ part - 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; - signature = 0x1e 0x95 0x03; - 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", - "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; - - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; + desc = "ATmega329"; + id = "m329"; + prog_modes = PM_SPM | PM_ISP | PM_HVPP | PM_JTAG; + mcuid = 121; + n_interrupts = 23; + n_boot_sections = 4; + boot_section_size = 512; +# stk500_devcode = 0x85; # no STK500 support, only STK500v2 +# avr910_devcode = 0x?; # try the ATmega169 one: + avr910_devcode = 0x75; + chip_erase_delay = 9000; + signature = 0x1e 0x95 0x03; + reset = io; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + pp_controlstack = + 0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f, + 0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f, + 0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b, + 0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + hvleavestabdelay = 15; + chiperasepolltimeout = 10; programfusepolltimeout = 5; - programlockpulsewidth = 0; programlockpolltimeout = 5; + idr = 0x31; + spmcr = 0x57; + ocdrev = 3; + chip_erase = "1010.1100--1000.0000--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; - idr = 0x31; - spmcr = 0x57; - - ocdrev = 3; - - 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 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 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; - - loadpage_lo = " 1 1 0 0 0 0 0 1", - " 0 0 0 0 0 0 0 0", - " 0 0 0 0 0 0 a1 a0", - " i i i i i i i i"; - - writepage = " 1 1 0 0 0 0 1 0", - " 0 0 x x x x a9 a8", - " a7 a6 a5 a4 a3 a2 0 0", - " x x x x x x x x"; - - mode = 0x41; - delay = 20; - blocksize = 8; - readsize = 256; - ; + memory "eeprom" + size = 1024; + page_size = 4; + min_write_delay = 9000; + max_write_delay = 9000; + readback = 0xff 0xff; + mode = 65; + delay = 20; + blocksize = 8; + readsize = 256; + read = "1010.0000--xxxx.xxaa--aaaa.aaaa--oooo.oooo"; + write = "1100.0000--xxxx.xxaa--aaaa.aaaa--iiii.iiii"; + loadpage_lo = "1100.0001--0000.0000--0000.00aa--iiii.iiii"; + writepage = "1100.0010--00xx.xxaa--aaaa.aa00--xxxx.xxxx"; + ; 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", - " 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", - " 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", - " 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 a14 a13 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; - ; + paged = yes; + size = 0x8000; + page_size = 128; + num_pages = 256; + min_write_delay = 4500; + max_write_delay = 4500; + readback = 0xff 0xff; + mode = 65; + delay = 6; + blocksize = 256; + readsize = 256; + read_lo = "0010.0000--xaaa.aaaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--xaaa.aaaa--aaaa.aaaa--oooo.oooo"; + loadpage_lo = "0100.0000--xxxx.xxxx--xxaa.aaaa--iiii.iiii"; + loadpage_hi = "0100.1000--xxxx.xxxx--xxaa.aaaa--iiii.iiii"; + writepage = "0100.1100--xaaa.aaaa--aaxx.xxxx--xxxx.xxxx"; + ; 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"; - ; + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii"; + ; 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"; - ; + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii"; + ; 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 x x x x x i i i"; - ; + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0100--xxxx.xxxx--xxxx.xiii"; + ; 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 o o 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"; - ; + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii"; + ; 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"; - ; + size = 3; + read = "0011.0000--000x.xxxx--xxxx.xxaa--oooo.oooo"; + ; 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"; - ; - ; + size = 1; + read = "0011.1000--000x.xxxx--0000.0000--oooo.oooo"; + ; +; #------------------------------------------------------------ # ATmega329A #------------------------------------------------------------ part parent "m329" - id = "m329a"; - desc = "ATmega329A"; - ; + desc = "ATmega329A"; + id = "m329a"; + mcuid = 122; +; #------------------------------------------------------------ # ATmega329P #------------------------------------------------------------ part parent "m329" - id = "m329p"; - desc = "ATmega329P"; - signature = 0x1e 0x95 0x0b; - ; + desc = "ATmega329P"; + id = "m329p"; + mcuid = 123; + signature = 0x1e 0x95 0x0b; +; #------------------------------------------------------------ # ATmega329PA #------------------------------------------------------------ part parent "m329" - id = "m329pa"; - desc = "ATmega329PA"; - signature = 0x1e 0x95 0x0b; - ; + desc = "ATmega329PA"; + id = "m329pa"; + mcuid = 124; + signature = 0x1e 0x95 0x0b; +; #------------------------------------------------------------ # ATmega3290 #------------------------------------------------------------ part parent "m329" - id = "m3290"; - desc = "ATmega3290"; - signature = 0x1e 0x95 0x04; - ; + desc = "ATmega3290"; + id = "m3290"; + mcuid = 150; + n_interrupts = 25; + signature = 0x1e 0x95 0x04; +; #------------------------------------------------------------ # ATmega3290A #------------------------------------------------------------ part parent "m329" - id = "m3290a"; - desc = "ATmega3290A"; - signature = 0x1e 0x95 0x04; - ; + desc = "ATmega3290A"; + id = "m3290a"; + mcuid = 151; + n_interrupts = 25; + signature = 0x1e 0x95 0x04; +; #------------------------------------------------------------ # ATmega3290P #------------------------------------------------------------ part parent "m329" - id = "m3290p"; - desc = "ATmega3290P"; - signature = 0x1e 0x95 0x0c; - ; + desc = "ATmega3290P"; + id = "m3290p"; + mcuid = 152; + n_interrupts = 25; + signature = 0x1e 0x95 0x0c; +; #------------------------------------------------------------ # ATmega3290PA #------------------------------------------------------------ part parent "m329" - id = "m3290pa"; - desc = "ATmega3290PA"; - signature = 0x1e 0x95 0x0c; - ; + desc = "ATmega3290PA"; + id = "m3290pa"; + mcuid = 153; + n_interrupts = 25; + signature = 0x1e 0x95 0x0c; +; #------------------------------------------------------------ # ATmega649 #------------------------------------------------------------ part - 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; - signature = 0x1e 0x96 0x03; - 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", - "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; - - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; + desc = "ATmega649"; + id = "m649"; + prog_modes = PM_SPM | PM_ISP | PM_HVPP | PM_JTAG; + mcuid = 135; + n_interrupts = 23; + n_boot_sections = 4; + boot_section_size = 1024; +# stk500_devcode = 0x85; # no STK500 support, only STK500v2 +# avr910_devcode = 0x?; # try the ATmega169 one: + avr910_devcode = 0x75; + chip_erase_delay = 9000; + signature = 0x1e 0x96 0x03; + reset = io; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + pp_controlstack = + 0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f, + 0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f, + 0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b, + 0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + hvleavestabdelay = 15; + chiperasepolltimeout = 10; programfusepolltimeout = 5; - programlockpulsewidth = 0; programlockpolltimeout = 5; + idr = 0x31; + spmcr = 0x57; + ocdrev = 3; + chip_erase = "1010.1100--1000.0000--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; - idr = 0x31; - spmcr = 0x57; - - ocdrev = 3; - - 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 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 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; - - loadpage_lo = " 1 1 0 0 0 0 0 1", - " 0 0 0 0 0 0 0 0", - " 0 0 0 0 0 a2 a1 a0", - " i i i i i i i i"; - - writepage = " 1 1 0 0 0 0 1 0", - " 0 0 x x x a10 a9 a8", - " a7 a6 a5 a4 a3 0 0 0", - " x x x x x x x x"; - - mode = 0x41; - delay = 20; - blocksize = 8; - readsize = 256; - ; + memory "eeprom" + size = 2048; + page_size = 8; + min_write_delay = 9000; + max_write_delay = 9000; + readback = 0xff 0xff; + mode = 65; + delay = 20; + blocksize = 8; + readsize = 256; + read = "1010.0000--xxxx.xaaa--aaaa.aaaa--oooo.oooo"; + write = "1100.0000--xxxx.xaaa--aaaa.aaaa--iiii.iiii"; + loadpage_lo = "1100.0001--0000.0000--0000.0aaa--iiii.iiii"; + writepage = "1100.0010--00xx.xaaa--aaaa.a000--xxxx.xxxx"; + ; memory "flash" - paged = yes; - 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", - "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", - "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 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 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; - - writepage = " 0 1 0 0 1 1 0 0", - "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; - ; + paged = yes; + size = 0x10000; + page_size = 256; + num_pages = 256; + min_write_delay = 4500; + max_write_delay = 4500; + readback = 0xff 0xff; + mode = 65; + delay = 6; + blocksize = 256; + readsize = 256; + read_lo = "0010.0000--aaaa.aaaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--aaaa.aaaa--aaaa.aaaa--oooo.oooo"; + loadpage_lo = "0100.0000--xxxx.xxxx--xaaa.aaaa--iiii.iiii"; + loadpage_hi = "0100.1000--xxxx.xxxx--xaaa.aaaa--iiii.iiii"; + writepage = "0100.1100--aaaa.aaaa--axxx.xxxx--xxxx.xxxx"; + ; 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"; - ; + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii"; + ; 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"; - ; + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii"; + ; 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 x x x x x i i i"; - ; + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0100--xxxx.xxxx--xxxx.xiii"; + ; 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 o o 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"; - ; + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii"; + ; 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"; - ; + size = 3; + read = "0011.0000--000x.xxxx--xxxx.xxaa--oooo.oooo"; + ; 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"; - ; - ; + size = 1; + read = "0011.1000--000x.xxxx--0000.0000--oooo.oooo"; + ; +; #------------------------------------------------------------ # ATmega649A #------------------------------------------------------------ part parent "m649" - id = "m649a"; - desc = "ATmega649A"; - ; + desc = "ATmega649A"; + id = "m649a"; + mcuid = 136; +; #------------------------------------------------------------ # ATmega649P #------------------------------------------------------------ part parent "m649" - id = "m649p"; - desc = "ATmega649P"; - signature = 0x1e 0x96 0x0b; - ; + desc = "ATmega649P"; + id = "m649p"; + mcuid = 137; + signature = 0x1e 0x96 0x0b; +; #------------------------------------------------------------ # ATmega6490 #------------------------------------------------------------ part parent "m649" - id = "m6490"; - desc = "ATmega6490"; - signature = 0x1e 0x96 0x04; - ; + desc = "ATmega6490"; + id = "m6490"; + mcuid = 157; + n_interrupts = 25; + signature = 0x1e 0x96 0x04; +; #------------------------------------------------------------ # ATmega6490A #------------------------------------------------------------ part parent "m649" - id = "m6490a"; - desc = "ATmega6490A"; - signature = 0x1e 0x96 0x04; - ; + desc = "ATmega6490A"; + id = "m6490a"; + mcuid = 158; + n_interrupts = 25; + signature = 0x1e 0x96 0x04; +; #------------------------------------------------------------ # ATmega6490P #------------------------------------------------------------ part parent "m649" - id = "m6490p"; - desc = "ATmega6490P"; - signature = 0x1e 0x96 0x0C; - ; + desc = "ATmega6490P"; + id = "m6490p"; + mcuid = 159; + n_interrupts = 25; + signature = 0x1e 0x96 0x0c; +; #------------------------------------------------------------ # ATmega32 #------------------------------------------------------------ part - id = "m32"; - desc = "ATmega32"; - has_jtag = yes; - stk500_devcode = 0x91; - avr910_devcode = 0x72; - signature = 0x1e 0x95 0x02; - 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; - - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 6; - togglevtg = 0; - poweroffdelay = 0; - resetdelayms = 0; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; - programfusepolltimeout = 5; - programlockpulsewidth = 0; - programlockpolltimeout = 5; - - idr = 0x31; - spmcr = 0x57; + desc = "ATmega32"; + id = "m32"; + prog_modes = PM_SPM | PM_ISP | PM_HVPP | PM_JTAG | PM_JTAGmkI; + mcuid = 58; + n_interrupts = 21; + n_boot_sections = 4; + boot_section_size = 512; + stk500_devcode = 0x91; + avr910_devcode = 0x72; + chip_erase_delay = 9000; + pagel = 0xd7; + bs2 = 0xa0; + signature = 0x1e 0x95 0x02; + reset = io; allowfullpagebitstream = yes; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pp_controlstack = + 0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f, + 0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f, + 0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b, + 0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + latchcycles = 6; + hvleavestabdelay = 15; + chiperasepolltimeout = 10; + programfusepolltimeout = 5; + programlockpolltimeout = 5; + idr = 0x31; + spmcr = 0x57; + ocdrev = 2; + chip_erase = "1010.1100--1000.0000--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; - ocdrev = 2; - - 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"; - - loadpage_lo = " 1 1 0 0 0 0 0 1", - " 0 0 0 0 0 0 0 0", - " 0 0 0 0 0 0 a1 a0", - " i i i i i i i i"; - - writepage = " 1 1 0 0 0 0 1 0", - " 0 0 x x x x a9 a8", - " a7 a6 a5 a4 a3 a2 0 0", - " x x x x x x x x"; - - mode = 0x04; - delay = 10; - blocksize = 64; - readsize = 256; - ; + memory "eeprom" + size = 1024; + page_size = 4; + min_write_delay = 9000; + max_write_delay = 9000; + readback = 0xff 0xff; + mode = 4; + delay = 10; + blocksize = 64; + readsize = 256; + read = "1010.0000--00xx.xxaa--aaaa.aaaa--oooo.oooo"; + write = "1100.0000--00xx.xxaa--aaaa.aaaa--iiii.iiii"; + loadpage_lo = "1100.0001--0000.0000--0000.00aa--iiii.iiii"; + writepage = "1100.0010--00xx.xxaa--aaaa.aa00--xxxx.xxxx"; + ; 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; - ; + paged = yes; + size = 0x8000; + page_size = 128; + num_pages = 256; + min_write_delay = 4500; + max_write_delay = 4500; + readback = 0xff 0xff; + mode = 33; + delay = 6; + blocksize = 64; + readsize = 256; + read_lo = "0010.0000--00aa.aaaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--00aa.aaaa--aaaa.aaaa--oooo.oooo"; + loadpage_lo = "0100.0000--00xx.xxxx--xxaa.aaaa--iiii.iiii"; + loadpage_hi = "0100.1000--00xx.xxxx--xxaa.aaaa--iiii.iiii"; + writepage = "0100.1100--00aa.aaaa--aaxx.xxxx--xxxx.xxxx"; + ; 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"; - ; + size = 1; + min_write_delay = 2000; + max_write_delay = 2000; + read = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii"; + ; 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"; - ; + size = 1; + min_write_delay = 2000; + max_write_delay = 2000; + read = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii"; + ; 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 o o 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"; - ; + size = 1; + min_write_delay = 2000; + max_write_delay = 2000; + read = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii"; + ; 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"; - ; + size = 3; + read = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo"; + ; 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"; - ; - ; + size = 4; + read = "0011.1000--00xx.xxxx--0000.00aa--oooo.oooo"; + ; +; #------------------------------------------------------------ # ATmega161 #------------------------------------------------------------ part - id = "m161"; - desc = "ATmega161"; - stk500_devcode = 0x80; - avr910_devcode = 0x60; - signature = 0x1e 0x94 0x01; - 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; - - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 0; - togglevtg = 0; - poweroffdelay = 0; - resetdelayms = 0; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 30; - programfusepulsewidth = 0; + desc = "ATmega161"; + id = "m161"; + prog_modes = PM_SPM | PM_ISP | PM_HVPP; + mcuid = 89; + n_interrupts = 21; + n_boot_sections = 1; + boot_section_size = 1024; + stk500_devcode = 0x80; + avr910_devcode = 0x60; + chip_erase_delay = 28000; + pagel = 0xd7; + bs2 = 0xa0; + signature = 0x1e 0x94 0x01; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pp_controlstack = + 0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f, + 0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f, + 0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b, + 0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + hvleavestabdelay = 15; + chiperasepolltimeout = 30; programfusepolltimeout = 2; - programlockpulsewidth = 0; programlockpolltimeout = 2; + chip_erase = "1010.1100--1000.0000--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; - 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 "eeprom" + size = 512; + min_write_delay = 3400; + max_write_delay = 3400; + readback = 0xff 0xff; + mode = 4; + delay = 5; + blocksize = 128; + readsize = 256; + read = "1010.0000--xxxx.xxxa--aaaa.aaaa--oooo.oooo"; + write = "1100.0000--xxxx.xxxa--aaaa.aaaa--iiii.iiii"; + ; 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; - ; + paged = yes; + size = 0x4000; + page_size = 128; + num_pages = 128; + min_write_delay = 14000; + max_write_delay = 14000; + readback = 0xff 0xff; + mode = 33; + delay = 16; + blocksize = 128; + readsize = 256; + read_lo = "0010.0000--xxxa.aaaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--xxxa.aaaa--aaaa.aaaa--oooo.oooo"; + loadpage_lo = "0100.0000--xxxx.xxxx--xxaa.aaaa--iiii.iiii"; + loadpage_hi = "0100.1000--xxxx.xxxx--xxaa.aaaa--iiii.iiii"; + writepage = "0100.1100--xxxa.aaaa--aaxx.xxxx--xxxx.xxxx"; + ; 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"; - ; + size = 1; + min_write_delay = 2000; + max_write_delay = 2000; + read = "0101.0000--xxxx.xxxx--xxxx.xxxx--xoxo.oooo"; + write = "1010.1100--101x.xxxx--xxxx.xxxx--1i1i.iiii"; + ; 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 o o o o o o o o"; + size = 1; + min_write_delay = 2000; + max_write_delay = 2000; + read = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii"; + ; - 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"; - ; - ; + size = 3; + read = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo"; + ; +; #------------------------------------------------------------ # ATmega32A #------------------------------------------------------------ part parent "m32" - id = "m32a"; - desc = "ATmega32A"; - ; + desc = "ATmega32A"; + id = "m32a"; + mcuid = 59; +; #------------------------------------------------------------ # ATmega8 #------------------------------------------------------------ part - id = "m8"; - desc = "ATmega8"; - stk500_devcode = 0x70; - avr910_devcode = 0x76; - signature = 0x1e 0x93 0x07; - 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; - - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 2; - resetdelayus = 0; - hvleavestabdelay = 15; - resetdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; + desc = "ATmega8"; + id = "m8"; + prog_modes = PM_SPM | PM_ISP | PM_HVPP; + mcuid = 45; + n_interrupts = 19; + n_boot_sections = 4; + boot_section_size = 256; + stk500_devcode = 0x70; + avr910_devcode = 0x76; + chip_erase_delay = 10000; + pagel = 0xd7; + bs2 = 0xc2; + signature = 0x1e 0x93 0x07; + reset = io; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pp_controlstack = + 0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f, + 0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f, + 0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b, + 0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 2; + hvleavestabdelay = 15; + resetdelay = 15; + chiperasepolltimeout = 10; programfusepolltimeout = 5; - programlockpulsewidth = 0; programlockpolltimeout = 5; + chip_erase = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; memory "eeprom" - size = 512; - page_size = 4; - 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"; + size = 512; + page_size = 4; + min_write_delay = 9000; + max_write_delay = 9000; + readback = 0xff 0xff; + mode = 4; + delay = 20; + blocksize = 128; + readsize = 256; + read = "1010.0000--00xx.xxxa--aaaa.aaaa--oooo.oooo"; + write = "1100.0000--00xx.xxxa--aaaa.aaaa--iiii.iiii"; + ; - 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 = 20; - 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 = 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", - " 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 = 10; - blocksize = 64; - readsize = 256; - ; + paged = yes; + size = 8192; + page_size = 64; + num_pages = 128; + min_write_delay = 4500; + max_write_delay = 4500; + readback = 0xff 0x00; + mode = 33; + delay = 10; + blocksize = 64; + readsize = 256; + read_lo = "0010.0000--0000.aaaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--0000.aaaa--aaaa.aaaa--oooo.oooo"; + loadpage_lo = "0100.0000--0000.xxxx--xxxa.aaaa--iiii.iiii"; + loadpage_hi = "0100.1000--0000.xxxx--xxxa.aaaa--iiii.iiii"; + writepage = "0100.1100--0000.aaaa--aaax.xxxx--xxxx.xxxx"; + ; 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"; - ; + size = 1; + min_write_delay = 2000; + max_write_delay = 2000; + read = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii"; + ; 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"; - ; + size = 1; + min_write_delay = 2000; + max_write_delay = 2000; + read = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii"; + ; 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 o o 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"; - ; + size = 1; + min_write_delay = 2000; + max_write_delay = 2000; + read = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii"; + ; 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"; - ; - ; - + size = 3; + read = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo"; + ; + memory "calibration" + size = 4; + read = "0011.1000--00xx.xxxx--0000.00aa--oooo.oooo"; + ; +; #------------------------------------------------------------ # ATmega8A #------------------------------------------------------------ part parent "m8" - id = "m8a"; - desc = "ATmega8A"; - ; + desc = "ATmega8A"; + id = "m8a"; + mcuid = 46; +; #------------------------------------------------------------ # ATmega8515 #------------------------------------------------------------ part - id = "m8515"; - desc = "ATmega8515"; - stk500_devcode = 0x63; - avr910_devcode = 0x3A; - signature = 0x1e 0x93 0x06; - 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; - - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 6; - togglevtg = 0; - poweroffdelay = 0; - resetdelayms = 0; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; + desc = "ATmega8515"; + id = "m8515"; + prog_modes = PM_SPM | PM_ISP | PM_HVPP; + mcuid = 160; + n_interrupts = 17; + n_boot_sections = 4; + boot_section_size = 256; + stk500_devcode = 0x63; + avr910_devcode = 0x3a; + chip_erase_delay = 9000; + signature = 0x1e 0x93 0x06; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pp_controlstack = + 0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f, + 0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f, + 0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b, + 0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + latchcycles = 6; + hvleavestabdelay = 15; + chiperasepolltimeout = 10; programfusepolltimeout = 5; - programlockpulsewidth = 0; programlockpolltimeout = 5; + chip_erase = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; 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"; + size = 512; + min_write_delay = 9000; + max_write_delay = 9000; + readback = 0xff 0xff; + mode = 4; + delay = 20; + blocksize = 128; + readsize = 256; + read = "1010.0000--00xx.xxxa--aaaa.aaaa--oooo.oooo"; + write = "1100.0000--00xx.xxxa--aaaa.aaaa--iiii.iiii"; + ; - 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 = 20; - 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; - ; + paged = yes; + size = 8192; + page_size = 64; + num_pages = 128; + min_write_delay = 4500; + max_write_delay = 4500; + readback = 0xff 0xff; + mode = 33; + delay = 6; + blocksize = 64; + readsize = 256; + read_lo = "0010.0000--0000.aaaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--0000.aaaa--aaaa.aaaa--oooo.oooo"; + loadpage_lo = "0100.0000--0000.xxxx--xxxa.aaaa--iiii.iiii"; + loadpage_hi = "0100.1000--0000.xxxx--xxxa.aaaa--iiii.iiii"; + writepage = "0100.1100--0000.aaaa--aaax.xxxx--xxxx.xxxx"; + ; 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"; - ; + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii"; + ; 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"; - ; + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii"; + ; 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 o o 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"; - ; + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii"; + ; 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"; - ; - ; - - + size = 3; + read = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo"; + ; + memory "calibration" + size = 4; + read = "0011.1000--00xx.xxxx--0000.00aa--oooo.oooo"; + ; +; #------------------------------------------------------------ # ATmega8535 #------------------------------------------------------------ part - id = "m8535"; - desc = "ATmega8535"; - stk500_devcode = 0x64; - avr910_devcode = 0x69; - signature = 0x1e 0x93 0x08; - 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; - - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 6; - togglevtg = 0; - poweroffdelay = 0; - resetdelayms = 0; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; + desc = "ATmega8535"; + id = "m8535"; + prog_modes = PM_SPM | PM_ISP | PM_HVPP; + mcuid = 161; + n_interrupts = 21; + n_boot_sections = 4; + boot_section_size = 256; + stk500_devcode = 0x64; + avr910_devcode = 0x69; + chip_erase_delay = 9000; + pagel = 0xd7; + bs2 = 0xa0; + signature = 0x1e 0x93 0x08; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pp_controlstack = + 0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f, + 0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f, + 0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b, + 0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + latchcycles = 6; + hvleavestabdelay = 15; + chiperasepolltimeout = 10; programfusepolltimeout = 5; - programlockpulsewidth = 0; programlockpolltimeout = 5; + chip_erase = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; 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"; + size = 512; + min_write_delay = 9000; + max_write_delay = 9000; + readback = 0xff 0xff; + mode = 4; + delay = 20; + blocksize = 128; + readsize = 256; + read = "1010.0000--00xx.xxxa--aaaa.aaaa--oooo.oooo"; + write = "1100.0000--00xx.xxxa--aaaa.aaaa--iiii.iiii"; + ; - 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 = 20; - 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; - ; + paged = yes; + size = 8192; + page_size = 64; + num_pages = 128; + min_write_delay = 4500; + max_write_delay = 4500; + readback = 0xff 0xff; + mode = 33; + delay = 6; + blocksize = 64; + readsize = 256; + read_lo = "0010.0000--0000.aaaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--0000.aaaa--aaaa.aaaa--oooo.oooo"; + loadpage_lo = "0100.0000--0000.xxxx--xxxa.aaaa--iiii.iiii"; + loadpage_hi = "0100.1000--0000.xxxx--xxxa.aaaa--iiii.iiii"; + writepage = "0100.1100--0000.aaaa--aaax.xxxx--xxxx.xxxx"; + ; 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"; - ; + size = 1; + min_write_delay = 2000; + max_write_delay = 2000; + read = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii"; + ; 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"; - ; + size = 1; + min_write_delay = 2000; + max_write_delay = 2000; + read = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii"; + ; 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 o o 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"; - ; + size = 1; + min_write_delay = 2000; + max_write_delay = 2000; + read = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii"; + ; 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"; - ; - ; + size = 3; + read = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo"; + ; + memory "calibration" + size = 4; + read = "0011.1000--00xx.xxxx--0000.00aa--oooo.oooo"; + ; +; #------------------------------------------------------------ # ATtiny26 #------------------------------------------------------------ part - id = "t26"; - desc = "ATtiny26"; - stk500_devcode = 0x21; - avr910_devcode = 0x5e; - signature = 0x1e 0x91 0x09; - 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; - - pp_controlstack = - 0xC4, 0xE4, 0xC4, 0xE4, 0xCC, 0xEC, 0xCC, 0xEC, - 0xD4, 0xF4, 0xD4, 0xF4, 0xDC, 0xFC, 0xDC, 0xFC, - 0xC8, 0xE8, 0xD8, 0xF8, 0x4C, 0x6C, 0x5C, 0x7C, - 0xEC, 0xBC, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 2; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; + desc = "ATtiny26"; + id = "t26"; + prog_modes = PM_ISP | PM_HVPP; + mcuid = 17; + n_interrupts = 12; + stk500_devcode = 0x21; + avr910_devcode = 0x5e; + chip_erase_delay = 9000; + pagel = 0xb3; + bs2 = 0xb2; + signature = 0x1e 0x91 0x09; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pp_controlstack = + 0xc4, 0xe4, 0xc4, 0xe4, 0xcc, 0xec, 0xcc, 0xec, + 0xd4, 0xf4, 0xd4, 0xf4, 0xdc, 0xfc, 0xdc, 0xfc, + 0xc8, 0xe8, 0xd8, 0xf8, 0x4c, 0x6c, 0x5c, 0x7c, + 0xec, 0xbc, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 2; + hvleavestabdelay = 15; + chiperasepolltimeout = 10; programfusepolltimeout = 5; - programlockpulsewidth = 0; programlockpolltimeout = 5; + chip_erase = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; 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; + size = 128; + min_write_delay = 9000; + max_write_delay = 9000; + readback = 0xff 0xff; + mode = 4; + delay = 10; + blocksize = 64; + readsize = 256; + read = "1010.0000--xxxx.xxxx--xaaa.aaaa--oooo.oooo"; + write = "1100.0000--xxxx.xxxx--xaaa.aaaa--iiii.iiii"; ; 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"; - min_write_delay = 9000; - max_write_delay = 9000; + paged = yes; + size = 2048; + page_size = 32; + num_pages = 64; + min_write_delay = 4500; + max_write_delay = 4500; + readback = 0xff 0xff; + mode = 33; + delay = 6; + blocksize = 16; + readsize = 256; + read_lo = "0010.0000--xxxx.xxaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--xxxx.xxaa--aaaa.aaaa--oooo.oooo"; + loadpage_lo = "0100.0000--xxxx.xxxx--xxxx.aaaa--iiii.iiii"; + loadpage_hi = "0100.1000--xxxx.xxxx--xxxx.aaaa--iiii.iiii"; + writepage = "0100.1100--xxxx.xxaa--aaaa.xxxx--xxxx.xxxx"; ; 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii"; + ; 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"; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.1000--xxxx.xxxx--xxxi.iiii"; + ; - 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + memory "lock" + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--xxxx.xxxx--xxxx.xxxx--xxxx.xxoo"; + write = "1010.1100--1111.11ii--xxxx.xxxx--xxxx.xxxx"; + ; + + memory "signature" + size = 3; + read = "0011.0000--xxxx.xxxx--0000.00aa--oooo.oooo"; + ; 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"; + size = 4; + read = "0011.1000--xxxx.xxxx--0000.00aa--oooo.oooo"; ; ; @@ -7342,186 +6540,126 @@ part #------------------------------------------------------------ part - id = "t261"; - desc = "ATtiny261"; - has_debugwire = yes; - flash_instr = 0xB4, 0x00, 0x10; - eeprom_instr = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D, - 0xBC, 0x00, 0xB4, 0x00, 0xBA, 0x0D, 0xBB, 0xBC, - 0x99, 0xE1, 0xBB, 0xAC; -# stk500_devcode = 0x21; -# avr910_devcode = 0x5e; - signature = 0x1e 0x91 0x0c; - pagel = 0xb3; - bs2 = 0xb2; - chip_erase_delay = 4000; - - 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; - - pp_controlstack = - 0xC4, 0xE4, 0xC4, 0xE4, 0xCC, 0xEC, 0xCC, 0xEC, - 0xD4, 0xF4, 0xD4, 0xF4, 0xDC, 0xFC, 0xDC, 0xFC, - 0xC8, 0xE8, 0xD8, 0xF8, 0x4C, 0x6C, 0x5C, 0x7C, - 0xEC, 0xBC, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 2; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; + desc = "ATtiny261"; + id = "t261"; + prog_modes = PM_SPM | PM_ISP | PM_HVPP | PM_debugWIRE; + mcuid = 30; + n_interrupts = 19; + chip_erase_delay = 4000; + pagel = 0xb3; + bs2 = 0xb2; +# stk500_devcode = 0x21; +# avr910_devcode = 0x5e; + signature = 0x1e 0x91 0x0c; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pp_controlstack = + 0xc4, 0xe4, 0xc4, 0xe4, 0xcc, 0xec, 0xcc, 0xec, + 0xd4, 0xf4, 0xd4, 0xf4, 0xdc, 0xfc, 0xdc, 0xfc, + 0xc8, 0xe8, 0xd8, 0xf8, 0x4c, 0x6c, 0x5c, 0x7c, + 0xec, 0xbc, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00; + flash_instr = 0xb4, 0x00, 0x10; + eeprom_instr = + 0xbb, 0xff, 0xbb, 0xee, 0xbb, 0xcc, 0xb2, 0x0d, + 0xbc, 0x00, 0xb4, 0x00, 0xba, 0x0d, 0xbb, 0xbc, + 0x99, 0xe1, 0xbb, 0xac; + hventerstabdelay = 100; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 2; + hvleavestabdelay = 15; + chiperasepolltimeout = 10; programfusepolltimeout = 5; - programlockpulsewidth = 0; programlockpolltimeout = 5; - - ocdrev = 1; + spmcr = 0x57; + eecr = 0x3c; + ocdrev = 1; + chip_erase = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; memory "eeprom" - paged = no; - size = 128; - page_size = 4; - num_pages = 32; - min_write_delay = 4000; - max_write_delay = 4000; - 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"; - - loadpage_lo = " 1 1 0 0 0 0 0 1", - " 0 0 0 0 0 0 0 0", - " 0 0 0 0 0 0 a1 a0", - " i i i i i i i i"; - - writepage = " 1 1 0 0 0 0 1 0", - " 0 0 x x x x x x", - " x a6 a5 a4 a3 a2 0 0", - " x x x x x x x x"; - - mode = 0x41; - delay = 10; - blocksize = 4; - readsize = 256; + size = 128; + page_size = 4; + num_pages = 32; + min_write_delay = 4000; + max_write_delay = 4000; + readback = 0xff 0xff; + mode = 65; + delay = 10; + blocksize = 4; + readsize = 256; + read = "1010.0000--xxxx.xxxx--xaaa.aaaa--oooo.oooo"; + write = "1100.0000--xxxx.xxxx--xaaa.aaaa--iiii.iiii"; + loadpage_lo = "1100.0001--0000.0000--0000.00aa--iiii.iiii"; + writepage = "1100.0010--00xx.xxxx--xaaa.aa00--xxxx.xxxx"; ; 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 = 0x41; - delay = 6; - blocksize = 32; - 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"; - min_write_delay = 4500; - max_write_delay = 4500; + paged = yes; + size = 2048; + page_size = 32; + num_pages = 64; + min_write_delay = 4500; + max_write_delay = 4500; + readback = 0xff 0xff; + mode = 65; + delay = 6; + blocksize = 32; + readsize = 256; + read_lo = "0010.0000--xxxx.xxaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--xxxx.xxaa--aaaa.aaaa--oooo.oooo"; + loadpage_lo = "0100.0000--xxxx.xxxx--xxxx.aaaa--iiii.iiii"; + loadpage_hi = "0100.1000--xxxx.xxxx--xxxx.aaaa--iiii.iiii"; + writepage = "0100.1100--xxxx.xxaa--aaaa.xxxx--xxxx.xxxx"; ; 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"; - min_write_delay = 4500; - max_write_delay = 4500; - ; + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii"; + ; 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"; - min_write_delay = 4500; - max_write_delay = 4500; - ; + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii"; + ; 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"; + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0100--xxxx.xxxx--xxxx.xxxi"; + ; - 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"; - min_write_delay = 4500; - max_write_delay = 4500; - ; + memory "lock" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.1000--xxxx.xxxx--xxxx.xxxx--xxxx.xxoo"; + write = "1010.1100--1111.11ii--xxxx.xxxx--xxxx.xxxx"; + ; + + memory "signature" + size = 3; + read = "0011.0000--xxxx.xxxx--0000.00aa--oooo.oooo"; + ; 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"; + size = 1; + read = "0011.1000--xxxx.xxxx--0000.0000--oooo.oooo"; ; ; @@ -7530,195 +6668,136 @@ part #------------------------------------------------------------ part parent "t261" - id = "t261a"; - desc = "ATtiny261A"; - ; + desc = "ATtiny261A"; + id = "t261a"; + mcuid = 31; +; #------------------------------------------------------------ # ATtiny461 #------------------------------------------------------------ part - id = "t461"; - desc = "ATtiny461"; - has_debugwire = yes; - flash_instr = 0xB4, 0x00, 0x10; - eeprom_instr = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D, - 0xBC, 0x00, 0xB4, 0x00, 0xBA, 0x0D, 0xBB, 0xBC, - 0x99, 0xE1, 0xBB, 0xAC; -# stk500_devcode = 0x21; -# avr910_devcode = 0x5e; - signature = 0x1e 0x92 0x08; - pagel = 0xb3; - bs2 = 0xb2; - chip_erase_delay = 4000; - - 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; - - pp_controlstack = - 0xC4, 0xE4, 0xC4, 0xE4, 0xCC, 0xEC, 0xCC, 0xEC, - 0xD4, 0xF4, 0xD4, 0xF4, 0xDC, 0xFC, 0xDC, 0xFC, - 0xC8, 0xE8, 0xD8, 0xF8, 0x4C, 0x6C, 0x5C, 0x7C, - 0xEC, 0xBC, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 2; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; + desc = "ATtiny461"; + id = "t461"; + prog_modes = PM_SPM | PM_ISP | PM_HVPP | PM_debugWIRE; + mcuid = 33; + n_interrupts = 19; + chip_erase_delay = 4000; + pagel = 0xb3; + bs2 = 0xb2; +# stk500_devcode = 0x21; +# avr910_devcode = 0x5e; + signature = 0x1e 0x92 0x08; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pp_controlstack = + 0xc4, 0xe4, 0xc4, 0xe4, 0xcc, 0xec, 0xcc, 0xec, + 0xd4, 0xf4, 0xd4, 0xf4, 0xdc, 0xfc, 0xdc, 0xfc, + 0xc8, 0xe8, 0xd8, 0xf8, 0x4c, 0x6c, 0x5c, 0x7c, + 0xec, 0xbc, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00; + flash_instr = 0xb4, 0x00, 0x10; + eeprom_instr = + 0xbb, 0xff, 0xbb, 0xee, 0xbb, 0xcc, 0xb2, 0x0d, + 0xbc, 0x00, 0xb4, 0x00, 0xba, 0x0d, 0xbb, 0xbc, + 0x99, 0xe1, 0xbb, 0xac; + hventerstabdelay = 100; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 2; + hvleavestabdelay = 15; + chiperasepolltimeout = 10; programfusepolltimeout = 5; - programlockpulsewidth = 0; programlockpolltimeout = 5; - - ocdrev = 1; + spmcr = 0x57; + eecr = 0x3c; + ocdrev = 1; + chip_erase = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; memory "eeprom" - paged = no; - size = 256; - page_size = 4; - num_pages = 64; - min_write_delay = 4000; - max_write_delay = 4000; - readback_p1 = 0xff; - readback_p2 = 0xff; - - read = " 1 0 1 0 0 0 0 0 x x x 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 x x x x x x x x", - "a7 a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; - - loadpage_lo = " 1 1 0 0 0 0 0 1", - " 0 0 0 0 0 0 0 0", - " 0 0 0 0 0 0 a1 a0", - " i i i i i i i i"; - - writepage = " 1 1 0 0 0 0 1 0", - " 0 0 x x x x x x", - " a7 a6 a5 a4 a3 a2 0 0", - " x x x x x x x x"; - - mode = 0x41; - delay = 10; - blocksize = 4; - readsize = 256; + size = 256; + page_size = 4; + num_pages = 64; + min_write_delay = 4000; + max_write_delay = 4000; + readback = 0xff 0xff; + mode = 65; + delay = 10; + blocksize = 4; + readsize = 256; + read = "1010.0000--xxxx.xxxx--aaaa.aaaa--oooo.oooo"; + write = "1100.0000--xxxx.xxxx--aaaa.aaaa--iiii.iiii"; + loadpage_lo = "1100.0001--0000.0000--0000.00aa--iiii.iiii"; + writepage = "1100.0010--00xx.xxxx--aaaa.aa00--xxxx.xxxx"; ; 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", - " x x x x x 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 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 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 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 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 "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"; - min_write_delay = 4500; - max_write_delay = 4500; + paged = yes; + size = 4096; + page_size = 64; + num_pages = 64; + min_write_delay = 4500; + max_write_delay = 4500; + readback = 0xff 0xff; + mode = 65; + delay = 6; + blocksize = 64; + readsize = 256; + read_lo = "0010.0000--xxxx.xaaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--xxxx.xaaa--aaaa.aaaa--oooo.oooo"; + loadpage_lo = "0100.0000--xxxx.xxxx--xxxa.aaaa--iiii.iiii"; + loadpage_hi = "0100.1000--xxxx.xxxx--xxxa.aaaa--iiii.iiii"; + writepage = "0100.1100--xxxx.xaaa--aaax.xxxx--xxxx.xxxx"; ; 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"; - min_write_delay = 4500; - max_write_delay = 4500; - ; + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii"; + ; 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"; - min_write_delay = 4500; - max_write_delay = 4500; - ; + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii"; + ; 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"; + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0100--xxxx.xxxx--xxxx.xxxi"; + ; - 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"; - min_write_delay = 4500; - max_write_delay = 4500; - ; + memory "lock" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.1000--xxxx.xxxx--xxxx.xxxx--xxxx.xxoo"; + write = "1010.1100--1111.11ii--xxxx.xxxx--xxxx.xxxx"; + ; + + memory "signature" + size = 3; + read = "0011.0000--xxxx.xxxx--0000.00aa--oooo.oooo"; + ; 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"; + size = 1; + read = "0011.1000--xxxx.xxxx--0000.0000--oooo.oooo"; ; ; @@ -7727,195 +6806,136 @@ part #------------------------------------------------------------ part parent "t461" - id = "t461a"; - desc = "ATtiny461A"; - ; + desc = "ATtiny461A"; + id = "t461a"; + mcuid = 34; +; #------------------------------------------------------------ # ATtiny861 #------------------------------------------------------------ part - id = "t861"; - desc = "ATtiny861"; - has_debugwire = yes; - flash_instr = 0xB4, 0x00, 0x10; - eeprom_instr = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D, - 0xBC, 0x00, 0xB4, 0x00, 0xBA, 0x0D, 0xBB, 0xBC, - 0x99, 0xE1, 0xBB, 0xAC; -# stk500_devcode = 0x21; -# avr910_devcode = 0x5e; - signature = 0x1e 0x93 0x0d; - pagel = 0xb3; - bs2 = 0xb2; - chip_erase_delay = 4000; - - 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; - - pp_controlstack = - 0xC4, 0xE4, 0xC4, 0xE4, 0xCC, 0xEC, 0xCC, 0xEC, - 0xD4, 0xF4, 0xD4, 0xF4, 0xDC, 0xFC, 0xDC, 0xFC, - 0xC8, 0xE8, 0xD8, 0xF8, 0x4C, 0x6C, 0x5C, 0x7C, - 0xEC, 0xBC, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 2; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; + desc = "ATtiny861"; + id = "t861"; + prog_modes = PM_SPM | PM_ISP | PM_HVPP | PM_debugWIRE; + mcuid = 38; + n_interrupts = 19; + chip_erase_delay = 4000; + pagel = 0xb3; + bs2 = 0xb2; +# stk500_devcode = 0x21; +# avr910_devcode = 0x5e; + signature = 0x1e 0x93 0x0d; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pp_controlstack = + 0xc4, 0xe4, 0xc4, 0xe4, 0xcc, 0xec, 0xcc, 0xec, + 0xd4, 0xf4, 0xd4, 0xf4, 0xdc, 0xfc, 0xdc, 0xfc, + 0xc8, 0xe8, 0xd8, 0xf8, 0x4c, 0x6c, 0x5c, 0x7c, + 0xec, 0xbc, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00; + flash_instr = 0xb4, 0x00, 0x10; + eeprom_instr = + 0xbb, 0xff, 0xbb, 0xee, 0xbb, 0xcc, 0xb2, 0x0d, + 0xbc, 0x00, 0xb4, 0x00, 0xba, 0x0d, 0xbb, 0xbc, + 0x99, 0xe1, 0xbb, 0xac; + hventerstabdelay = 100; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 2; + hvleavestabdelay = 15; + chiperasepolltimeout = 10; programfusepolltimeout = 5; - programlockpulsewidth = 0; programlockpolltimeout = 5; - - ocdrev = 1; + spmcr = 0x57; + eecr = 0x3c; + ocdrev = 1; + chip_erase = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; memory "eeprom" - paged = no; - size = 512; - num_pages = 128; - page_size = 4; - min_write_delay = 4000; - max_write_delay = 4000; - 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"; - - loadpage_lo = " 1 1 0 0 0 0 0 1", - " 0 0 0 0 0 0 0 0", - " 0 0 0 0 0 0 a1 a0", - " i i i i i i i i"; - - writepage = " 1 1 0 0 0 0 1 0", - " 0 0 x x x x x a8", - " a7 a6 a5 a4 a3 a2 0 0", - " x x x x x x x x"; - - mode = 0x41; - delay = 10; - blocksize = 4; - readsize = 256; + size = 512; + page_size = 4; + num_pages = 128; + min_write_delay = 4000; + max_write_delay = 4000; + readback = 0xff 0xff; + mode = 65; + delay = 10; + blocksize = 4; + readsize = 256; + read = "1010.0000--xxxx.xxxa--aaaa.aaaa--oooo.oooo"; + write = "1100.0000--xxxx.xxxa--aaaa.aaaa--iiii.iiii"; + loadpage_lo = "1100.0001--0000.0000--0000.00aa--iiii.iiii"; + writepage = "1100.0010--00xx.xxxa--aaaa.aa00--xxxx.xxxx"; ; 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", - " x x x x 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 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 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 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 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 "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"; - min_write_delay = 4500; - max_write_delay = 4500; + paged = yes; + size = 8192; + page_size = 64; + num_pages = 128; + min_write_delay = 4500; + max_write_delay = 4500; + readback = 0xff 0xff; + mode = 65; + delay = 6; + blocksize = 64; + readsize = 256; + read_lo = "0010.0000--xxxx.aaaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--xxxx.aaaa--aaaa.aaaa--oooo.oooo"; + loadpage_lo = "0100.0000--xxxx.xxxx--xxxa.aaaa--iiii.iiii"; + loadpage_hi = "0100.1000--xxxx.xxxx--xxxa.aaaa--iiii.iiii"; + writepage = "0100.1100--xxxx.aaaa--aaax.xxxx--xxxx.xxxx"; ; 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"; - min_write_delay = 4500; - max_write_delay = 4500; - ; + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii"; + ; 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"; - min_write_delay = 4500; - max_write_delay = 4500; - ; + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii"; + ; 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"; + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0100--xxxx.xxxx--xxxx.xxxi"; + ; - 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"; - min_write_delay = 4500; - max_write_delay = 4500; - ; + memory "lock" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.1000--xxxx.xxxx--xxxx.xxxx--xxxx.xxoo"; + write = "1010.1100--1111.11ii--xxxx.xxxx--xxxx.xxxx"; + ; + + memory "signature" + size = 3; + read = "0011.0000--xxxx.xxxx--0000.00aa--oooo.oooo"; + ; 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"; + size = 1; + read = "0011.1000--xxxx.xxxx--0000.0000--oooo.oooo"; ; ; @@ -7924,9 +6944,10 @@ part #------------------------------------------------------------ part parent "t861" - id = "t861a"; - desc = "ATtiny861A"; - ; + desc = "ATtiny861A"; + id = "t861a"; + mcuid = 39; +; #------------------------------------------------------------ # ATtiny28 @@ -7935,701 +6956,532 @@ part parent "t861" # This is an HVPP-only device. part - id = "t28"; - desc = "ATtiny28"; - stk500_devcode = 0x22; - avr910_devcode = 0x5c; - signature = 0x1e 0x91 0x07; - - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 0; - togglevtg = 0; - poweroffdelay = 0; - resetdelayms = 0; - resetdelayus = 0; - hvleavestabdelay = 15; - resetdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; + desc = "ATtiny28"; + id = "t28"; + prog_modes = PM_HVPP; + mcuid = 18; + n_interrupts = 6; + stk500_devcode = 0x22; + avr910_devcode = 0x5c; + signature = 0x1e 0x91 0x07; + serial = no; + pp_controlstack = + 0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f, + 0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f, + 0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b, + 0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + hvleavestabdelay = 15; + resetdelay = 15; + chiperasepolltimeout = 10; programfusepolltimeout = 5; - programlockpulsewidth = 0; programlockpolltimeout = 5; memory "flash" - size = 2048; - page_size = 2; - readsize = 256; - delay = 5; - ; - - memory "signature" - size = 3; - ; - - memory "lock" - size = 1; - ; - - memory "calibration" - size = 1; + size = 2048; + page_size = 2; + delay = 5; + readsize = 256; ; memory "fuse" - size = 1; + size = 1; + ; + + memory "lock" + size = 1; + ; + + memory "signature" + size = 3; + ; + + memory "calibration" + size = 1; ; ; - - #------------------------------------------------------------ # ATmega48 #------------------------------------------------------------ part - id = "m48"; - desc = "ATmega48"; - has_debugwire = yes; - flash_instr = 0xB6, 0x01, 0x11; - eeprom_instr = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00, - 0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF, - 0x99, 0xF9, 0xBB, 0xAF; - stk500_devcode = 0x59; -# avr910_devcode = 0x; - signature = 0x1e 0x92 0x05; - 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; - - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - resetdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; + desc = "ATmega48"; + id = "m48"; + prog_modes = PM_SPM | PM_ISP | PM_HVPP | PM_debugWIRE; + mcuid = 67; + n_interrupts = 26; + stk500_devcode = 0x59; + chip_erase_delay = 45000; + pagel = 0xd7; + bs2 = 0xc2; +# avr910_devcode = 0x??; + signature = 0x1e 0x92 0x05; + reset = io; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + pp_controlstack = + 0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f, + 0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f, + 0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b, + 0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + flash_instr = 0xb6, 0x01, 0x11; + eeprom_instr = + 0xbd, 0xf2, 0xbd, 0xe1, 0xbb, 0xcf, 0xb4, 0x00, + 0xbe, 0x01, 0xb6, 0x01, 0xbc, 0x00, 0xbb, 0xbf, + 0x99, 0xf9, 0xbb, 0xaf; + hventerstabdelay = 100; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + hvleavestabdelay = 15; + resetdelay = 15; + chiperasepolltimeout = 10; programfusepolltimeout = 5; - programlockpulsewidth = 0; programlockpolltimeout = 5; - - ocdrev = 1; + spmcr = 0x57; + eecr = 0x3f; + ocdrev = 1; + chip_erase = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; memory "eeprom" - paged = no; - page_size = 4; - 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"; + size = 256; + page_size = 4; + min_write_delay = 3600; + max_write_delay = 3600; + readback = 0xff 0xff; + mode = 65; + delay = 20; + blocksize = 4; + readsize = 256; + read = "1010.0000--000x.xxxx--aaaa.aaaa--oooo.oooo"; + write = "1100.0000--000x.xxxx--aaaa.aaaa--iiii.iiii"; + loadpage_lo = "1100.0001--0000.0000--0000.00aa--iiii.iiii"; + writepage = "1100.0010--00xx.xxxx--aaaa.aa00--xxxx.xxxx"; + ; - 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"; - - loadpage_lo = " 1 1 0 0 0 0 0 1", - " 0 0 0 0 0 0 0 0", - " 0 0 0 0 0 0 a1 a0", - " i i i i i i i i"; - - writepage = " 1 1 0 0 0 0 1 0", - " 0 0 x x x x x x", - " a7 a6 a5 a4 a3 a2 0 0", - " x x x x x x x x"; - - mode = 0x41; - delay = 20; - 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; - ; + paged = yes; + size = 4096; + page_size = 64; + num_pages = 64; + min_write_delay = 4500; + max_write_delay = 4500; + mode = 65; + delay = 6; + blocksize = 64; + readsize = 256; + read_lo = "0010.0000--0000.0aaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--0000.0aaa--aaaa.aaaa--oooo.oooo"; + loadpage_lo = "0100.0000--000x.xxxx--xxxa.aaaa--iiii.iiii"; + loadpage_hi = "0100.1000--000x.xxxx--xxxa.aaaa--iiii.iiii"; + writepage = "0100.1100--0000.0aaa--aaax.xxxx--xxxx.xxxx"; + ; 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"; - ; + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii"; + ; 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"; - ; + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii"; + ; 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 x x x x x x x i"; - ; + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0100--xxxx.xxxx--xxxx.xxxi"; + ; 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 o o 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"; - ; + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii"; + ; 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"; - ; - ; + size = 3; + read = "0011.0000--000x.xxxx--xxxx.xxaa--oooo.oooo"; + ; + + memory "calibration" + size = 1; + read = "0011.1000--000x.xxxx--0000.0000--oooo.oooo"; + ; +; #------------------------------------------------------------ # ATmega48A #------------------------------------------------------------ part parent "m48" - id = "m48a"; - desc = "ATmega48A"; - ; + desc = "ATmega48A"; + id = "m48a"; + mcuid = 68; +; #------------------------------------------------------------ # ATmega48P #------------------------------------------------------------ part parent "m48" - id = "m48p"; - desc = "ATmega48P"; - signature = 0x1e 0x92 0x0a; - ; + desc = "ATmega48P"; + id = "m48p"; + mcuid = 69; + signature = 0x1e 0x92 0x0a; +; #------------------------------------------------------------ # ATmega48PA #------------------------------------------------------------ part parent "m48" - id = "m48pa"; - desc = "ATmega48PA"; - signature = 0x1e 0x92 0x0a; - ; + desc = "ATmega48PA"; + id = "m48pa"; + mcuid = 70; + signature = 0x1e 0x92 0x0a; +; #------------------------------------------------------------ # ATmega48PB #------------------------------------------------------------ part parent "m48" - id = "m48pb"; - desc = "ATmega48PB"; - signature = 0x1e 0x92 0x10; - ; + desc = "ATmega48PB"; + id = "m48pb"; + mcuid = 71; + n_interrupts = 27; + chip_erase_delay = 10500; + signature = 0x1e 0x92 0x10; +; #------------------------------------------------------------ # ATmega88 #------------------------------------------------------------ part - id = "m88"; - desc = "ATmega88"; - has_debugwire = yes; - flash_instr = 0xB6, 0x01, 0x11; - eeprom_instr = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00, - 0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF, - 0x99, 0xF9, 0xBB, 0xAF; - stk500_devcode = 0x73; -# avr910_devcode = 0x; - signature = 0x1e 0x93 0x0a; - 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; - - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - resetdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; + desc = "ATmega88"; + id = "m88"; + prog_modes = PM_SPM | PM_ISP | PM_HVPP | PM_debugWIRE; + mcuid = 79; + n_interrupts = 26; + n_boot_sections = 4; + boot_section_size = 256; + stk500_devcode = 0x73; + chip_erase_delay = 9000; + pagel = 0xd7; + bs2 = 0xc2; +# avr910_devcode = 0x??; + signature = 0x1e 0x93 0x0a; + reset = io; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + pp_controlstack = + 0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f, + 0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f, + 0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b, + 0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + flash_instr = 0xb6, 0x01, 0x11; + eeprom_instr = + 0xbd, 0xf2, 0xbd, 0xe1, 0xbb, 0xcf, 0xb4, 0x00, + 0xbe, 0x01, 0xb6, 0x01, 0xbc, 0x00, 0xbb, 0xbf, + 0x99, 0xf9, 0xbb, 0xaf; + hventerstabdelay = 100; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + hvleavestabdelay = 15; + resetdelay = 15; + chiperasepolltimeout = 10; programfusepolltimeout = 5; - programlockpulsewidth = 0; programlockpolltimeout = 5; - - ocdrev = 1; + spmcr = 0x57; + eecr = 0x3f; + ocdrev = 1; + chip_erase = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; memory "eeprom" - paged = no; - page_size = 4; - 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"; + size = 512; + page_size = 4; + min_write_delay = 3600; + max_write_delay = 3600; + readback = 0xff 0xff; + mode = 65; + delay = 20; + blocksize = 4; + readsize = 256; + read = "1010.0000--000x.xxxa--aaaa.aaaa--oooo.oooo"; + write = "1100.0000--000x.xxxa--aaaa.aaaa--iiii.iiii"; + loadpage_lo = "1100.0001--0000.0000--0000.00aa--iiii.iiii"; + writepage = "1100.0010--00xx.xxxa--aaaa.aa00--xxxx.xxxx"; + ; - 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"; - - loadpage_lo = " 1 1 0 0 0 0 0 1", - " 0 0 0 0 0 0 0 0", - " 0 0 0 0 0 0 a1 a0", - " i i i i i i i i"; - - writepage = " 1 1 0 0 0 0 1 0", - " 0 0 x x x x x a8", - " a7 a6 a5 a4 a3 a2 0 0", - " x x x x x x x x"; - - mode = 0x41; - delay = 20; - 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; - ; + paged = yes; + size = 8192; + page_size = 64; + num_pages = 128; + min_write_delay = 4500; + max_write_delay = 4500; + readback = 0xff 0xff; + mode = 65; + delay = 6; + blocksize = 64; + readsize = 256; + read_lo = "0010.0000--0000.aaaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--0000.aaaa--aaaa.aaaa--oooo.oooo"; + loadpage_lo = "0100.0000--000x.xxxx--xxxa.aaaa--iiii.iiii"; + loadpage_hi = "0100.1000--000x.xxxx--xxxa.aaaa--iiii.iiii"; + writepage = "0100.1100--0000.aaaa--aaax.xxxx--xxxx.xxxx"; + ; 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"; - ; + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii"; + ; 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"; - ; + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii"; + ; 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 x x x x x i i i"; - ; + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0100--xxxx.xxxx--xxxx.xiii"; + ; 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 o o 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"; - ; + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii"; + ; 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"; - ; - ; + size = 3; + read = "0011.0000--000x.xxxx--xxxx.xxaa--oooo.oooo"; + ; + + memory "calibration" + size = 1; + read = "0011.1000--000x.xxxx--0000.0000--oooo.oooo"; + ; +; #------------------------------------------------------------ # ATmega88A #------------------------------------------------------------ part parent "m88" - id = "m88a"; - desc = "ATmega88A"; - ; + desc = "ATmega88A"; + id = "m88a"; + mcuid = 80; +; #------------------------------------------------------------ # ATmega88P #------------------------------------------------------------ part parent "m88" - id = "m88p"; - desc = "ATmega88P"; - signature = 0x1e 0x93 0x0f; - ; + desc = "ATmega88P"; + id = "m88p"; + mcuid = 81; + signature = 0x1e 0x93 0x0f; +; #------------------------------------------------------------ # ATmega88PA #------------------------------------------------------------ part parent "m88" - id = "m88pa"; - desc = "ATmega88PA"; - signature = 0x1e 0x93 0x0f; - ; + desc = "ATmega88PA"; + id = "m88pa"; + mcuid = 82; + signature = 0x1e 0x93 0x0f; +; #------------------------------------------------------------ # ATmega88PB #------------------------------------------------------------ part parent "m88" - id = "m88pb"; - desc = "ATmega88PB"; - signature = 0x1e 0x93 0x16; - ; + desc = "ATmega88PB"; + id = "m88pb"; + mcuid = 83; + n_interrupts = 27; + chip_erase_delay = 10500; + signature = 0x1e 0x93 0x16; +; #------------------------------------------------------------ # ATmega168 #------------------------------------------------------------ part - id = "m168"; - desc = "ATmega168"; - has_debugwire = yes; - flash_instr = 0xB6, 0x01, 0x11; - eeprom_instr = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00, - 0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF, - 0x99, 0xF9, 0xBB, 0xAF; - stk500_devcode = 0x86; - # avr910_devcode = 0x; - signature = 0x1e 0x94 0x06; - 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; - - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - resetdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; + desc = "ATmega168"; + id = "m168"; + prog_modes = PM_SPM | PM_ISP | PM_HVPP | PM_debugWIRE; + mcuid = 99; + n_interrupts = 26; + n_boot_sections = 4; + boot_section_size = 256; + stk500_devcode = 0x86; + chip_erase_delay = 9000; + pagel = 0xd7; + bs2 = 0xc2; +# avr910_devcode = 0x??; + signature = 0x1e 0x94 0x06; + reset = io; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + pp_controlstack = + 0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f, + 0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f, + 0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b, + 0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + flash_instr = 0xb6, 0x01, 0x11; + eeprom_instr = + 0xbd, 0xf2, 0xbd, 0xe1, 0xbb, 0xcf, 0xb4, 0x00, + 0xbe, 0x01, 0xb6, 0x01, 0xbc, 0x00, 0xbb, 0xbf, + 0x99, 0xf9, 0xbb, 0xaf; + hventerstabdelay = 100; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + hvleavestabdelay = 15; + resetdelay = 15; + chiperasepolltimeout = 10; programfusepolltimeout = 5; - programlockpulsewidth = 0; programlockpolltimeout = 5; - - ocdrev = 1; + spmcr = 0x57; + eecr = 0x3f; + ocdrev = 1; + chip_erase = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; memory "eeprom" - paged = no; - page_size = 4; - 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"; - - loadpage_lo = " 1 1 0 0 0 0 0 1", - " 0 0 0 0 0 0 0 0", - " 0 0 0 0 0 0 a1 a0", - " i i i i i i i i"; - - writepage = " 1 1 0 0 0 0 1 0", - " 0 0 x x x x x a8", - " a7 a6 a5 a4 a3 a2 0 0", - " x x x x x x x x"; - - mode = 0x41; - delay = 20; - blocksize = 4; - readsize = 256; - ; + size = 512; + page_size = 4; + min_write_delay = 3600; + max_write_delay = 3600; + readback = 0xff 0xff; + mode = 65; + delay = 20; + blocksize = 4; + readsize = 256; + read = "1010.0000--000x.xxxa--aaaa.aaaa--oooo.oooo"; + write = "1100.0000--000x.xxxa--aaaa.aaaa--iiii.iiii"; + loadpage_lo = "1100.0001--0000.0000--0000.00aa--iiii.iiii"; + writepage = "1100.0010--00xx.xxxa--aaaa.aa00--xxxx.xxxx"; + ; memory "flash" - paged = yes; - 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 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 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 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 a12 a11 a10 a9 a8", - " a7 a6 x x x x x x", - " x x x x x x x x"; + paged = yes; + size = 0x4000; + page_size = 128; + num_pages = 128; + min_write_delay = 4500; + max_write_delay = 4500; + readback = 0xff 0xff; + mode = 65; + delay = 6; + blocksize = 128; + readsize = 256; + read_lo = "0010.0000--000a.aaaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--000a.aaaa--aaaa.aaaa--oooo.oooo"; + loadpage_lo = "0100.0000--000x.xxxx--xxaa.aaaa--iiii.iiii"; + loadpage_hi = "0100.1000--000x.xxxx--xxaa.aaaa--iiii.iiii"; + writepage = "0100.1100--000a.aaaa--aaxx.xxxx--xxxx.xxxx"; + ; - mode = 0x41; - delay = 6; - blocksize = 128; - 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"; - ; - + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii"; + ; + 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"; - ; - + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii"; + ; + 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 x x x x x i i i"; - ; - + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0100--xxxx.xxxx--xxxx.xiii"; + ; + 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 o o 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"; - ; - + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii"; + ; + 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"; - ; + size = 3; + read = "0011.0000--000x.xxxx--xxxx.xxaa--oooo.oooo"; + ; + + memory "calibration" + size = 1; + read = "0011.1000--000x.xxxx--0000.0000--oooo.oooo"; + ; ; #------------------------------------------------------------ @@ -8637,226 +7489,175 @@ part #------------------------------------------------------------ part parent "m168" - id = "m168a"; - desc = "ATmega168A"; - ; + desc = "ATmega168A"; + id = "m168a"; + mcuid = 100; +; #------------------------------------------------------------ # ATmega168P #------------------------------------------------------------ part parent "m168" - id = "m168p"; - desc = "ATmega168P"; - signature = 0x1e 0x94 0x0b; - ; + desc = "ATmega168P"; + id = "m168p"; + mcuid = 101; + signature = 0x1e 0x94 0x0b; +; #------------------------------------------------------------ # ATmega168PA #------------------------------------------------------------ part parent "m168" - id = "m168pa"; - desc = "ATmega168PA"; - signature = 0x1e 0x94 0x0b; - ; + desc = "ATmega168PA"; + id = "m168pa"; + mcuid = 102; + signature = 0x1e 0x94 0x0b; +; #------------------------------------------------------------ # ATmega168PB #------------------------------------------------------------ part parent "m168" - id = "m168pb"; - desc = "ATmega168PB"; - signature = 0x1e 0x94 0x15; - ; + desc = "ATmega168PB"; + id = "m168pb"; + mcuid = 103; + n_interrupts = 27; + chip_erase_delay = 10500; + signature = 0x1e 0x94 0x15; +; #------------------------------------------------------------ # ATtiny828 #------------------------------------------------------------ part - id = "t828"; - desc = "ATtiny828"; - has_debugwire = yes; - flash_instr = 0xB6, 0x01, 0x11; - eeprom_instr = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00, - 0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF, - 0x99, 0xF9, 0xBB, 0xAF; - stk500_devcode = 0x86; - # avr910_devcode = 0x; - signature = 0x1e 0x93 0x14; - pagel = 0xd7; - bs2 = 0xc2; - chip_erase_delay = 15000; - 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; - - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - resetdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; + desc = "ATtiny828"; + id = "t828"; + prog_modes = PM_SPM | PM_ISP | PM_HVPP | PM_debugWIRE; + mcuid = 35; + n_interrupts = 26; + n_boot_sections = 4; + boot_section_size = 256; + stk500_devcode = 0x86; + chip_erase_delay = 15000; + pagel = 0xd7; + bs2 = 0xc2; +# avr910_devcode = 0x??; + signature = 0x1e 0x93 0x14; + reset = io; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + pp_controlstack = + 0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f, + 0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f, + 0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b, + 0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + flash_instr = 0xb6, 0x01, 0x11; + eeprom_instr = + 0xbd, 0xf2, 0xbd, 0xe1, 0xbb, 0xcf, 0xb4, 0x00, + 0xbe, 0x01, 0xb6, 0x01, 0xbc, 0x00, 0xbb, 0xbf, + 0x99, 0xf9, 0xbb, 0xaf; + hventerstabdelay = 100; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + hvleavestabdelay = 15; + resetdelay = 15; + chiperasepolltimeout = 10; programfusepolltimeout = 5; - programlockpulsewidth = 0; programlockpolltimeout = 5; + spmcr = 0x57; + eecr = 0x3f; + chip_erase = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; memory "eeprom" - paged = no; - page_size = 4; - 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 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"; - - loadpage_lo = " 1 1 0 0 0 0 0 1", - " 0 0 0 0 0 0 0 0", - " 0 0 0 0 0 0 a1 a0", - " i i i i i i i i"; - -writepage = " 1 1 0 0 0 0 1 0", - " 0 0 x x x x x a8", - " a7 a6 a5 a4 a3 a2 0 0", - " x x x x x x x x"; - - mode = 0x41; - delay = 5; - blocksize = 4; - readsize = 256; - ; + size = 256; + page_size = 4; + min_write_delay = 3600; + max_write_delay = 3600; + readback = 0xff 0xff; + mode = 65; + delay = 5; + blocksize = 4; + readsize = 256; + read = "1010.0000--000x.xxxa--aaaa.aaaa--oooo.oooo"; + write = "1100.0000--000x.xxxa--aaaa.aaaa--iiii.iiii"; + loadpage_lo = "1100.0001--0000.0000--0000.00aa--iiii.iiii"; + writepage = "1100.0010--00xx.xxxa--aaaa.aa00--xxxx.xxxx"; + ; 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 = 128; - readsize = 256; - - ; + paged = yes; + size = 8192; + page_size = 64; + num_pages = 128; + min_write_delay = 4500; + max_write_delay = 4500; + readback = 0xff 0xff; + mode = 65; + delay = 6; + blocksize = 128; + readsize = 256; + read_lo = "0010.0000--0000.aaaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--0000.aaaa--aaaa.aaaa--oooo.oooo"; + loadpage_lo = "0100.0000--000x.xxxx--xxxa.aaaa--iiii.iiii"; + loadpage_hi = "0100.1000--000x.xxxx--xxxa.aaaa--iiii.iiii"; + writepage = "0100.1100--0000.aaaa--aaax.xxxx--xxxx.xxxx"; + ; 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"; - ; + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii"; + ; 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"; - ; + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii"; + ; 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 1 1 1 i i i i i"; - ; + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0100--xxxx.xxxx--111i.iiii"; + ; 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 o o 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"; - ; + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii"; + ; 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"; - ; + size = 3; + read = "0011.0000--000x.xxxx--xxxx.xxaa--oooo.oooo"; + ; + + memory "calibration" + size = 1; + read = "0011.1000--000x.xxxx--0000.0000--oooo.oooo"; + ; ; #------------------------------------------------------------ @@ -8864,946 +7665,655 @@ writepage = " 1 1 0 0 0 0 1 0", #------------------------------------------------------------ part parent "t828" - id = "t828r"; - desc = "ATtiny828R"; - ; + desc = "ATtiny828R"; + id = "t828r"; + mcuid = 36; +; #------------------------------------------------------------ # ATtiny87 #------------------------------------------------------------ part - id = "t87"; - desc = "ATtiny87"; - has_debugwire = yes; - flash_instr = 0xB6, 0x01, 0x11; - eeprom_instr = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, - 0x00, 0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, - 0xBF, 0x99, 0xF9, 0xBB, 0xAF; -## no STK500 devcode in XML file, use the ATtiny45 one - stk500_devcode = 0x14; -## Try the AT90S2313 devcode: - avr910_devcode = 0x20; - signature = 0x1e 0x93 0x87; - reset = io; - chip_erase_delay = 15000; - - 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; - - pp_controlstack = - 0x0E, 0x1E, 0x0E, 0x1E, 0x2E, 0x3E, 0x2E, 0x3E, - 0x4E, 0x5E, 0x4E, 0x5E, 0x6E, 0x7E, 0x6E, 0x7E, - 0x06, 0x16, 0x46, 0x56, 0x0A, 0x1A, 0x4A, 0x5A, - 0x1E, 0x7C, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 20; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; + desc = "ATtiny87"; + id = "t87"; + prog_modes = PM_SPM | PM_ISP | PM_HVPP | PM_debugWIRE; + mcuid = 27; + n_interrupts = 20; +# no STK500 devcode in XML file, use the ATtiny45 one + stk500_devcode = 0x14; +# Try the AT90S2313 devcode: + avr910_devcode = 0x20; + chip_erase_delay = 15000; + signature = 0x1e 0x93 0x87; + reset = io; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pp_controlstack = + 0x0e, 0x1e, 0x0e, 0x1e, 0x2e, 0x3e, 0x2e, 0x3e, + 0x4e, 0x5e, 0x4e, 0x5e, 0x6e, 0x7e, 0x6e, 0x7e, + 0x06, 0x16, 0x46, 0x56, 0x0a, 0x1a, 0x4a, 0x5a, + 0x1e, 0x7c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + flash_instr = 0xb6, 0x01, 0x11; + eeprom_instr = + 0xbd, 0xf2, 0xbd, 0xe1, 0xbb, 0xcf, 0xb4, 0x00, + 0xbe, 0x01, 0xb6, 0x01, 0xbc, 0x00, 0xbb, 0xbf, + 0x99, 0xf9, 0xbb, 0xaf; + hventerstabdelay = 100; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 20; + resetdelayms = 1; + hvleavestabdelay = 15; + chiperasepolltimeout = 10; programfusepolltimeout = 5; - programlockpulsewidth = 0; programlockpolltimeout = 5; + spmcr = 0x57; + eecr = 0x3f; + chip_erase = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; - idr = 0x00; - spmcr = 0x57; - allowfullpagebitstream = no; + memory "eeprom" + size = 512; + page_size = 4; + min_write_delay = 4000; + max_write_delay = 4500; + readback = 0xff 0xff; + mode = 65; + delay = 10; + blocksize = 4; + readsize = 256; + read = "1010.0000--00xx.xxxa--aaaa.aaaa--oooo.oooo"; + write = "1100.0000--00xx.xxxa--aaaa.aaaa--iiii.iiii"; + loadpage_lo = "1100.0001--0000.0000--0000.00aa--iiii.iiii"; + writepage = "1100.0010--00xx.xxxa--aaaa.aa00--xxxx.xxxx"; + ; - memory "eeprom" - size = 512; - paged = no; - page_size = 4; - 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 x x x x x a8", - "a7 a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; + memory "flash" + paged = yes; + size = 8192; + page_size = 128; + num_pages = 64; + min_write_delay = 4500; + max_write_delay = 4500; + readback = 0xff 0xff; + mode = 65; + delay = 10; + blocksize = 64; + readsize = 256; + read_lo = "0010.0000--000a.aaaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--000a.aaaa--aaaa.aaaa--oooo.oooo"; + loadpage_lo = "0100.0000--000x.xxxx--xxaa.aaaa--iiii.iiii"; + loadpage_hi = "0100.1000--000x.xxxx--xxaa.aaaa--iiii.iiii"; + writepage = "0100.1100--0000.aaaa--aaax.xxxx--xxxx.xxxx"; + ; - 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"; + memory "lfuse" + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii"; + ; - loadpage_lo = " 1 1 0 0 0 0 0 1", - " 0 0 0 0 0 0 0 0", - " 0 0 0 0 0 0 a1 a0", - " i i i i i i i i"; + memory "hfuse" + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii"; + ; - writepage = " 1 1 0 0 0 0 1 0", - " 0 0 x x x x x a8", - " a7 a6 a5 a4 a3 a2 0 0", - " x x x x x x x x"; + memory "efuse" + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0100--xxxx.xxxx--xxxx.xxxi"; + ; - mode = 0x41; - delay = 10; - blocksize = 4; - readsize = 256; - ; - memory "flash" - paged = yes; - size = 8192; - page_size = 128; - 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 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 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 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 a5 x x x x x", - " x x x x x x x x"; - - mode = 0x41; - delay = 10; - blocksize = 64; - readsize = 256; - ; + memory "lock" + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.0000--0000.0000--oooo.oooo"; + write = "1010.1100--111x.xxxx--xxxx.xxxx--xxxx.xxii"; + ; # ATtiny87 has Signature Bytes: 0x1E 0x93 0x87. - 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 "signature" + size = 3; + read = "0011.0000--000x.xxxx--xxxx.xxaa--oooo.oooo"; + ; - 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 x x x x x x i i"; - read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", - "0 0 0 0 0 0 0 0 o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; - - 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; - - 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; - - 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; - - 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"; - ; - ; + memory "calibration" + size = 1; + read = "0011.1000--000x.xxxx--0000.000a--oooo.oooo"; + ; +; #------------------------------------------------------------ # ATtiny167 #------------------------------------------------------------ part - id = "t167"; - desc = "ATtiny167"; - has_debugwire = yes; - flash_instr = 0xB6, 0x01, 0x11; - eeprom_instr = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, - 0x00, 0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, - 0xBF, 0x99, 0xF9, 0xBB, 0xAF; -## no STK500 devcode in XML file, use the ATtiny45 one - stk500_devcode = 0x14; -## avr910_devcode = ?; -## Try the AT90S2313 devcode: - avr910_devcode = 0x20; - signature = 0x1e 0x94 0x87; - reset = io; - chip_erase_delay = 15000; - - 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; - - pp_controlstack = - 0x0E, 0x1E, 0x0E, 0x1E, 0x2E, 0x3E, 0x2E, 0x3E, - 0x4E, 0x5E, 0x4E, 0x5E, 0x6E, 0x7E, 0x6E, 0x7E, - 0x06, 0x16, 0x46, 0x56, 0x0A, 0x1A, 0x4A, 0x5A, - 0x1E, 0x7C, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 20; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; + desc = "ATtiny167"; + id = "t167"; + prog_modes = PM_SPM | PM_ISP | PM_HVPP | PM_debugWIRE; + mcuid = 29; + n_interrupts = 20; +# no STK500 devcode in XML file, use the ATtiny45 one + stk500_devcode = 0x14; +# avr910_devcode = 0x??; +# Try the AT90S2313 devcode: + avr910_devcode = 0x20; + chip_erase_delay = 15000; + signature = 0x1e 0x94 0x87; + reset = io; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pp_controlstack = + 0x0e, 0x1e, 0x0e, 0x1e, 0x2e, 0x3e, 0x2e, 0x3e, + 0x4e, 0x5e, 0x4e, 0x5e, 0x6e, 0x7e, 0x6e, 0x7e, + 0x06, 0x16, 0x46, 0x56, 0x0a, 0x1a, 0x4a, 0x5a, + 0x1e, 0x7c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + flash_instr = 0xb6, 0x01, 0x11; + eeprom_instr = + 0xbd, 0xf2, 0xbd, 0xe1, 0xbb, 0xcf, 0xb4, 0x00, + 0xbe, 0x01, 0xb6, 0x01, 0xbc, 0x00, 0xbb, 0xbf, + 0x99, 0xf9, 0xbb, 0xaf; + hventerstabdelay = 100; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 20; + resetdelayms = 1; + hvleavestabdelay = 15; + chiperasepolltimeout = 10; programfusepolltimeout = 5; - programlockpulsewidth = 0; programlockpolltimeout = 5; + spmcr = 0x57; + eecr = 0x3f; + chip_erase = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; - idr = 0x00; - spmcr = 0x57; - allowfullpagebitstream = no; + memory "eeprom" + size = 512; + page_size = 4; + min_write_delay = 4000; + max_write_delay = 4500; + readback = 0xff 0xff; + mode = 65; + delay = 10; + blocksize = 4; + readsize = 256; + read = "1010.0000--00xx.xxxa--aaaa.aaaa--oooo.oooo"; + write = "1100.0000--00xx.xxxa--aaaa.aaaa--iiii.iiii"; + loadpage_lo = "1100.0001--0000.0000--0000.00aa--iiii.iiii"; + writepage = "1100.0010--00xx.xxxa--aaaa.aa00--xxxx.xxxx"; + ; - memory "eeprom" - size = 512; - paged = no; - page_size = 4; - 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 x x x x x a8", - "a7 a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; + memory "flash" + paged = yes; + size = 0x4000; + page_size = 128; + num_pages = 128; + min_write_delay = 4500; + max_write_delay = 4500; + readback = 0xff 0xff; + mode = 65; + delay = 10; + blocksize = 64; + readsize = 256; + read_lo = "0010.0000--000a.aaaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--000a.aaaa--aaaa.aaaa--oooo.oooo"; + loadpage_lo = "0100.0000--000x.xxxx--xxaa.aaaa--iiii.iiii"; + loadpage_hi = "0100.1000--000x.xxxx--xxaa.aaaa--iiii.iiii"; + writepage = "0100.1100--000a.aaaa--aaxx.xxxx--xxxx.xxxx"; + ; - 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"; + memory "lfuse" + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii"; + ; - loadpage_lo = " 1 1 0 0 0 0 0 1", - " 0 0 0 0 0 0 0 0", - " 0 0 0 0 0 0 a1 a0", - " i i i i i i i i"; + memory "hfuse" + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii"; + ; - writepage = " 1 1 0 0 0 0 1 0", - " 0 0 x x x x x a8", - " a7 a6 a5 a4 a3 a2 0 0", - " x x x x x x x x"; + memory "efuse" + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0100--xxxx.xxxx--xxxx.xxxi"; + ; - mode = 0x41; - delay = 10; - blocksize = 4; - readsize = 256; - ; - memory "flash" - paged = yes; - 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 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 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 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 a12 a11 a10 a9 a8", - " a7 a6 x x x x x x", - " x x x x x x x x"; - - mode = 0x41; - delay = 10; - blocksize = 64; - readsize = 256; - ; + memory "lock" + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.0000--0000.0000--oooo.oooo"; + write = "1010.1100--111x.xxxx--xxxx.xxxx--xxxx.xxii"; + ; # ATtiny167 has Signature Bytes: 0x1E 0x94 0x87. - 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 "signature" + size = 3; + read = "0011.0000--000x.xxxx--xxxx.xxaa--oooo.oooo"; + ; - 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 x x x x x x i i"; - read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", - "0 0 0 0 0 0 0 0 o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; - - 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; - - 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; - - 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; - - 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"; - ; - ; + memory "calibration" + size = 1; + read = "0011.1000--000x.xxxx--0000.000a--oooo.oooo"; + ; +; #------------------------------------------------------------ # ATtiny48 #------------------------------------------------------------ part - id = "t48"; - desc = "ATtiny48"; - has_debugwire = yes; - flash_instr = 0xB6, 0x01, 0x11; - eeprom_instr = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00, - 0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF, - 0x99, 0xF9, 0xBB, 0xAF; - stk500_devcode = 0x73; -# avr910_devcode = 0x; - signature = 0x1e 0x92 0x09; - pagel = 0xd7; - bs2 = 0xc2; - chip_erase_delay = 15000; - 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; - - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - resetdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; + desc = "ATtiny48"; + id = "t48"; + prog_modes = PM_SPM | PM_ISP | PM_HVPP | PM_debugWIRE; + mcuid = 23; + n_interrupts = 20; + stk500_devcode = 0x73; + chip_erase_delay = 15000; + pagel = 0xd7; + bs2 = 0xc2; +# avr910_devcode = 0x??; + signature = 0x1e 0x92 0x09; + reset = io; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + pp_controlstack = + 0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f, + 0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f, + 0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b, + 0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + flash_instr = 0xb6, 0x01, 0x11; + eeprom_instr = + 0xbd, 0xf2, 0xbd, 0xe1, 0xbb, 0xcf, 0xb4, 0x00, + 0xbe, 0x01, 0xb6, 0x01, 0xbc, 0x00, 0xbb, 0xbf, + 0x99, 0xf9, 0xbb, 0xaf; + hventerstabdelay = 100; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + hvleavestabdelay = 15; + resetdelay = 15; + chiperasepolltimeout = 10; programfusepolltimeout = 5; - programlockpulsewidth = 0; programlockpolltimeout = 5; - - ocdrev = 1; + spmcr = 0x57; + eecr = 0x3f; + ocdrev = 1; + chip_erase = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; memory "eeprom" - paged = no; - page_size = 4; - size = 64; - 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", - " x a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + size = 64; + page_size = 4; + min_write_delay = 3600; + max_write_delay = 3600; + readback = 0xff 0xff; + mode = 65; + delay = 20; + blocksize = 4; + readsize = 64; + read = "1010.0000--000x.xxxx--xaaa.aaaa--oooo.oooo"; + write = "1100.0000--000x.xxxx--xaaa.aaaa--iiii.iiii"; + loadpage_lo = "1100.0001--0000.0000--0000.00aa--iiii.iiii"; + writepage = "1100.0010--00xx.xxxx--xaaa.aa00--xxxx.xxxx"; + ; - 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"; - - loadpage_lo = " 1 1 0 0 0 0 0 1", - " 0 0 0 0 0 0 0 0", - " 0 0 0 0 0 0 a1 a0", - " i i i i i i i i"; - - writepage = " 1 1 0 0 0 0 1 0", - " 0 0 x x x x x x", - " x a6 a5 a4 a3 a2 0 0", - " x x x x x x x x"; - - mode = 0x41; - delay = 20; - blocksize = 4; - readsize = 64; - ; 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 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; - ; + paged = yes; + size = 4096; + page_size = 64; + num_pages = 64; + min_write_delay = 4500; + max_write_delay = 4500; + readback = 0xff 0xff; + mode = 65; + delay = 6; + blocksize = 64; + readsize = 256; + read_lo = "0010.0000--0000.aaaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--0000.aaaa--aaaa.aaaa--oooo.oooo"; + loadpage_lo = "0100.0000--000x.xxxx--xxxa.aaaa--iiii.iiii"; + loadpage_hi = "0100.1000--000x.xxxx--xxxa.aaaa--iiii.iiii"; + writepage = "0100.1100--0000.aaaa--aaax.xxxx--xxxx.xxxx"; + ; 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"; - ; + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii"; + ; 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"; - ; + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii"; + ; 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 1 1 1 1 1 1 1 i"; - ; + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0100--xxxx.xxxx--1111.111i"; + ; 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 o o 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"; - ; + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii"; + ; 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"; - ; - ; + size = 3; + read = "0011.0000--000x.xxxx--xxxx.xxaa--oooo.oooo"; + ; + + memory "calibration" + size = 1; + read = "0011.1000--000x.xxxx--0000.0000--oooo.oooo"; + ; +; #------------------------------------------------------------ # ATtiny88 #------------------------------------------------------------ part - id = "t88"; - desc = "ATtiny88"; - has_debugwire = yes; - flash_instr = 0xB6, 0x01, 0x11; - eeprom_instr = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00, - 0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF, - 0x99, 0xF9, 0xBB, 0xAF; - stk500_devcode = 0x73; -# avr910_devcode = 0x; - signature = 0x1e 0x93 0x11; - 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; - - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - resetdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; + desc = "ATtiny88"; + id = "t88"; + prog_modes = PM_SPM | PM_ISP | PM_HVPP | PM_debugWIRE; + mcuid = 28; + n_interrupts = 20; + stk500_devcode = 0x73; + chip_erase_delay = 9000; + pagel = 0xd7; + bs2 = 0xc2; +# avr910_devcode = 0x??; + signature = 0x1e 0x93 0x11; + reset = io; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + pp_controlstack = + 0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f, + 0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f, + 0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b, + 0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + flash_instr = 0xb6, 0x01, 0x11; + eeprom_instr = + 0xbd, 0xf2, 0xbd, 0xe1, 0xbb, 0xcf, 0xb4, 0x00, + 0xbe, 0x01, 0xb6, 0x01, 0xbc, 0x00, 0xbb, 0xbf, + 0x99, 0xf9, 0xbb, 0xaf; + hventerstabdelay = 100; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + hvleavestabdelay = 15; + resetdelay = 15; + chiperasepolltimeout = 10; programfusepolltimeout = 5; - programlockpulsewidth = 0; programlockpolltimeout = 5; - - ocdrev = 1; + spmcr = 0x57; + eecr = 0x3f; + ocdrev = 1; + chip_erase = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; memory "eeprom" - paged = no; - page_size = 4; - size = 64; - 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", - " x a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + size = 64; + page_size = 4; + min_write_delay = 3600; + max_write_delay = 3600; + readback = 0xff 0xff; + mode = 65; + delay = 20; + blocksize = 4; + readsize = 64; + read = "1010.0000--000x.xxxx--xaaa.aaaa--oooo.oooo"; + write = "1100.0000--000x.xxxx--xaaa.aaaa--iiii.iiii"; + loadpage_lo = "1100.0001--0000.0000--0000.00aa--iiii.iiii"; + writepage = "1100.0010--00xx.xxxx--xaaa.aa00--xxxx.xxxx"; + ; - 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"; - - loadpage_lo = " 1 1 0 0 0 0 0 1", - " 0 0 0 0 0 0 0 0", - " 0 0 0 0 0 0 a1 a0", - " i i i i i i i i"; - - writepage = " 1 1 0 0 0 0 1 0", - " 0 0 x x x x x x", - " x a6 a5 a4 a3 a2 0 0", - " x x x x x x x x"; - - mode = 0x41; - delay = 20; - blocksize = 4; - readsize = 64; - ; 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; - ; + paged = yes; + size = 8192; + page_size = 64; + num_pages = 128; + min_write_delay = 4500; + max_write_delay = 4500; + readback = 0xff 0xff; + mode = 65; + delay = 6; + blocksize = 64; + readsize = 256; + read_lo = "0010.0000--0000.aaaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--0000.aaaa--aaaa.aaaa--oooo.oooo"; + loadpage_lo = "0100.0000--000x.xxxx--xxxa.aaaa--iiii.iiii"; + loadpage_hi = "0100.1000--000x.xxxx--xxxa.aaaa--iiii.iiii"; + writepage = "0100.1100--0000.aaaa--aaax.xxxx--xxxx.xxxx"; + ; 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"; - ; + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii"; + ; 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"; - ; + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii"; + ; 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 x x x x x x x i"; - ; + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0100--xxxx.xxxx--xxxx.xxxi"; + ; 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 o o 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"; - ; + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii"; + ; 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"; - ; - ; + size = 3; + read = "0011.0000--000x.xxxx--xxxx.xxaa--oooo.oooo"; + ; + + memory "calibration" + size = 1; + read = "0011.1000--000x.xxxx--0000.0000--oooo.oooo"; + ; +; #------------------------------------------------------------ # ATmega328 #------------------------------------------------------------ part - id = "m328"; - desc = "ATmega328"; - has_debugwire = yes; - flash_instr = 0xB6, 0x01, 0x11; - eeprom_instr = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00, - 0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF, - 0x99, 0xF9, 0xBB, 0xAF; - stk500_devcode = 0x86; - # avr910_devcode = 0x; - signature = 0x1e 0x95 0x14; - 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; - - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - resetdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; + desc = "ATmega328"; + id = "m328"; + prog_modes = PM_SPM | PM_ISP | PM_HVPP | PM_debugWIRE; + mcuid = 118; + n_interrupts = 26; + n_boot_sections = 4; + boot_section_size = 512; + stk500_devcode = 0x86; + chip_erase_delay = 9000; + pagel = 0xd7; + bs2 = 0xc2; +# avr910_devcode = 0x??; + signature = 0x1e 0x95 0x14; + reset = io; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + pp_controlstack = + 0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f, + 0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f, + 0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b, + 0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + flash_instr = 0xb6, 0x01, 0x11; + eeprom_instr = + 0xbd, 0xf2, 0xbd, 0xe1, 0xbb, 0xcf, 0xb4, 0x00, + 0xbe, 0x01, 0xb6, 0x01, 0xbc, 0x00, 0xbb, 0xbf, + 0x99, 0xf9, 0xbb, 0xaf; + hventerstabdelay = 100; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + hvleavestabdelay = 15; + resetdelay = 15; + chiperasepolltimeout = 10; programfusepolltimeout = 5; - programlockpulsewidth = 0; programlockpolltimeout = 5; - - ocdrev = 1; + spmcr = 0x57; + eecr = 0x3f; + ocdrev = 1; + chip_erase = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; memory "eeprom" - paged = no; - page_size = 4; - size = 1024; - 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 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 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; - - loadpage_lo = " 1 1 0 0 0 0 0 1", - " 0 0 0 0 0 0 0 0", - " 0 0 0 0 0 0 a1 a0", - " i i i i i i i i"; - - writepage = " 1 1 0 0 0 0 1 0", - " 0 0 x x x x a9 a8", - " a7 a6 a5 a4 a3 a2 0 0", - " x x x x x x x x"; - - mode = 0x41; - delay = 20; - blocksize = 4; - readsize = 256; + size = 1024; + page_size = 4; + min_write_delay = 3600; + max_write_delay = 3600; + readback = 0xff 0xff; + mode = 65; + delay = 20; + blocksize = 4; + readsize = 256; + read = "1010.0000--000x.xxaa--aaaa.aaaa--oooo.oooo"; + write = "1100.0000--000x.xxaa--aaaa.aaaa--iiii.iiii"; + loadpage_lo = "1100.0001--0000.0000--0000.00aa--iiii.iiii"; + writepage = "1100.0010--00xx.xxaa--aaaa.aa00--xxxx.xxxx"; ; 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 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 a13 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; - + paged = yes; + size = 0x8000; + page_size = 128; + num_pages = 256; + min_write_delay = 4500; + max_write_delay = 4500; + readback = 0xff 0xff; + mode = 65; + delay = 6; + blocksize = 128; + readsize = 256; + read_lo = "0010.0000--00aa.aaaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--00aa.aaaa--aaaa.aaaa--oooo.oooo"; + loadpage_lo = "0100.0000--000x.xxxx--xxaa.aaaa--iiii.iiii"; + loadpage_hi = "0100.1000--000x.xxxx--xxaa.aaaa--iiii.iiii"; + writepage = "0100.1100--00aa.aaaa--aaxx.xxxx--xxxx.xxxx"; ; 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"; + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii"; ; 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"; + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii"; ; 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 x x x x x i i i"; + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0100--xxxx.xxxx--xxxx.xiii"; ; 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 o o 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"; + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii"; ; 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"; + size = 3; + read = "0011.0000--000x.xxxx--xxxx.xxaa--oooo.oooo"; + ; + + memory "calibration" + size = 1; + read = "0011.1000--000x.xxxx--0000.0000--oooo.oooo"; ; ; @@ -9812,9 +8322,10 @@ part #------------------------------------------------------------ part parent "m328" - id = "m328p"; - desc = "ATmega328P"; - signature = 0x1e 0x95 0x0f; + desc = "ATmega328P"; + id = "m328p"; + mcuid = 119; + signature = 0x1e 0x95 0x0f; ; #------------------------------------------------------------ @@ -9822,19 +8333,15 @@ part parent "m328" #------------------------------------------------------------ part parent "m328" - id = "m328pb"; - desc = "ATmega328PB"; - signature = 0x1e 0x95 0x16; + desc = "ATmega328PB"; + id = "m328pb"; + mcuid = 120; + n_interrupts = 45; + chip_erase_delay = 10500; + signature = 0x1e 0x95 0x16; 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 x x x x i i i i"; + write = "1010.1100--1010.0100--xxxx.xxxx--xxxx.iiii"; ; ; @@ -9843,19 +8350,17 @@ part parent "m328" #------------------------------------------------------------ part parent "m328" - id = "m32m1"; - desc = "ATmega32M1"; - # stk500_devcode = 0x; - # avr910_devcode = 0x; - signature = 0x1e 0x95 0x84; - bs2 = 0xe2; + desc = "ATmega32M1"; + id = "m32m1"; + mcuid = 63; + n_interrupts = 31; + bs2 = 0xe2; +# stk500_devcode = 0x??; +# avr910_devcode = 0x??; + signature = 0x1e 0x95 0x84; 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 i i i i i i"; + write = "1010.1100--1010.0100--xxxx.xxxx--xxii.iiii"; ; ; @@ -9864,97 +8369,37 @@ part parent "m328" #------------------------------------------------------------ part parent "m328" - id = "m64m1"; - desc = "ATmega64M1"; - # stk500_devcode = 0x; - # avr910_devcode = 0x; - signature = 0x1e 0x96 0x84; - bs2 = 0xe2; + desc = "ATmega64M1"; + id = "m64m1"; + mcuid = 76; + n_interrupts = 31; + boot_section_size = 1024; + bs2 = 0xe2; +# stk500_devcode = 0x??; +# avr910_devcode = 0x??; + signature = 0x1e 0x96 0x84; memory "eeprom" - paged = no; - size = 2048; - page_size = 8; - 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 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 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; - - loadpage_lo = " 1 1 0 0 0 0 0 1", - " 0 0 0 0 0 0 0 0", - " 0 0 0 0 0 a2 a1 a0", - " i i i i i i i i"; - - writepage = " 1 1 0 0 0 0 1 0", - " 0 0 x x x a10 a9 a8", - " a7 a6 a5 a4 a3 0 0 0", - " x x x x x x x x"; - - mode = 0x41; - delay = 20; - blocksize = 4; - readsize = 256; + size = 2048; + page_size = 8; + read = "1010.0000--000x.xaaa--aaaa.aaaa--oooo.oooo"; + write = "1100.0000--000x.xaaa--aaaa.aaaa--iiii.iiii"; + loadpage_lo = "1100.0001--0000.0000--0000.0aaa--iiii.iiii"; + writepage = "1100.0010--00xx.xaaa--aaaa.a000--xxxx.xxxx"; ; memory "flash" - paged = yes; - 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", - " 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", - " 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 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 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; - - writepage = " 0 1 0 0 1 1 0 0", - " 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 = 128; - readsize = 256; - + size = 0x10000; + page_size = 256; + read_lo = "0010.0000--aaaa.aaaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--aaaa.aaaa--aaaa.aaaa--oooo.oooo"; + loadpage_lo = "0100.0000--000x.xxxx--xaaa.aaaa--iiii.iiii"; + loadpage_hi = "0100.1000--000x.xxxx--xaaa.aaaa--iiii.iiii"; + writepage = "0100.1100--aaaa.aaaa--axxx.xxxx--xxxx.xxxx"; ; 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 x x i i i i i i"; + write = "1010.1100--1010.0100--xxxx.xxxx--xxii.iiii"; ; ; @@ -9963,564 +8408,406 @@ part parent "m328" #------------------------------------------------------------ part - id = "t2313"; - desc = "ATtiny2313"; - has_debugwire = yes; - flash_instr = 0xB2, 0x0F, 0x1F; - eeprom_instr = 0xBB, 0xFE, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D, - 0xBA, 0x0F, 0xB2, 0x0F, 0xBA, 0x0D, 0xBB, 0xBC, - 0x99, 0xE1, 0xBB, 0xAC; - stk500_devcode = 0x23; -## Use the ATtiny26 devcode: - avr910_devcode = 0x5e; - signature = 0x1e 0x91 0x0a; - 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; - - pp_controlstack = - 0x0E, 0x1E, 0x0E, 0x1E, 0x2E, 0x3E, 0x2E, 0x3E, - 0x4E, 0x5E, 0x4E, 0x5E, 0x6E, 0x7E, 0x6E, 0x7E, - 0x26, 0x36, 0x66, 0x76, 0x2A, 0x3A, 0x6A, 0x7A, - 0x2E, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; + desc = "ATtiny2313"; + id = "t2313"; + prog_modes = PM_SPM | PM_ISP | PM_HVPP | PM_debugWIRE; + mcuid = 42; + n_interrupts = 19; + stk500_devcode = 0x23; +# Use the ATtiny26 devcode: + avr910_devcode = 0x5e; + chip_erase_delay = 9000; + pagel = 0xd4; + bs2 = 0xd6; + signature = 0x1e 0x91 0x0a; + reset = io; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + pp_controlstack = + 0x0e, 0x1e, 0x0e, 0x1e, 0x2e, 0x3e, 0x2e, 0x3e, + 0x4e, 0x5e, 0x4e, 0x5e, 0x6e, 0x7e, 0x6e, 0x7e, + 0x26, 0x36, 0x66, 0x76, 0x2a, 0x3a, 0x6a, 0x7a, + 0x2e, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + flash_instr = 0xb2, 0x0f, 0x1f; + eeprom_instr = + 0xbb, 0xfe, 0xbb, 0xee, 0xbb, 0xcc, 0xb2, 0x0d, + 0xba, 0x0f, 0xb2, 0x0f, 0xba, 0x0d, 0xbb, 0xbc, + 0x99, 0xe1, 0xbb, 0xac; + hventerstabdelay = 100; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + hvleavestabdelay = 15; + chiperasepolltimeout = 10; programfusepolltimeout = 5; - programlockpulsewidth = 0; programlockpolltimeout = 5; + spmcr = 0x57; + eecr = 0x3c; + ocdrev = 0; + chip_erase = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; - ocdrev = 0; - - memory "eeprom" - size = 128; - paged = no; - page_size = 4; - 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"; - - loadpage_lo = " 1 1 0 0 0 0 0 1", - " 0 0 0 0 0 0 0 0", - " 0 0 0 0 0 0 a1 a0", - " i i i i i i i i"; - - writepage = " 1 1 0 0 0 0 1 0", - " 0 0 x x x x x x", - " x a6 a5 a4 a3 a2 0 0", - " x x x x x x x x"; - - 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"; + memory "eeprom" + size = 128; + page_size = 4; + min_write_delay = 4000; + max_write_delay = 4500; + readback = 0xff 0xff; + mode = 65; + delay = 6; + blocksize = 4; + readsize = 256; + read = "1010.0000--000x.xxxx--xaaa.aaaa--oooo.oooo"; + write = "1100.0000--000x.xxxx--xaaa.aaaa--iiii.iiii"; + loadpage_lo = "1100.0001--0000.0000--0000.00aa--iiii.iiii"; + writepage = "1100.0010--00xx.xxxx--xaaa.aa00--xxxx.xxxx"; + ; + memory "flash" + paged = yes; + size = 2048; + page_size = 32; + num_pages = 64; + min_write_delay = 4500; + max_write_delay = 4500; + readback = 0xff 0xff; + mode = 65; + delay = 6; + blocksize = 32; + readsize = 256; + read_lo = "0010.0000--0000.00aa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--0000.00aa--aaaa.aaaa--oooo.oooo"; # 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"; - + loadpage_lo = "0100.0000--000x.xxxx--xxxx.aaaa--iiii.iiii"; # 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"; - + loadpage_hi = "0100.1000--000x.xxxx--xxxx.aaaa--iiii.iiii"; # 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"; + writepage = "0100.1100--0000.00aa--aaaa.xxxx--xxxx.xxxx"; + ; - mode = 0x41; - delay = 6; - blocksize = 32; - readsize = 256; - ; + memory "lfuse" + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii"; + ; + + memory "hfuse" + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii"; + ; + + memory "efuse" + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0100--xxxx.xxxx--xxxx.xxxi"; + ; + + memory "lock" + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii"; + ; # 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"; - 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 o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; - - 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; - - 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; - - 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + memory "signature" + size = 3; + read = "0011.0000--000x.xxxx--xxxx.xxaa--oooo.oooo"; + ; # 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"; - ; - ; + memory "calibration" + size = 2; + read = "0011.1000--000x.xxxx--0000.000a--oooo.oooo"; + ; +; #------------------------------------------------------------ # ATtiny2313A #------------------------------------------------------------ part parent "t2313" - id = "t2313a"; - desc = "ATtiny2313A"; - ; + desc = "ATtiny2313A"; + id = "t2313a"; + mcuid = 43; + n_interrupts = 21; +; #------------------------------------------------------------ # ATtiny4313 #------------------------------------------------------------ part - id = "t4313"; - desc = "ATtiny4313"; - has_debugwire = yes; - flash_instr = 0xB2, 0x0F, 0x1F; - eeprom_instr = 0xBB, 0xFE, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D, - 0xBA, 0x0F, 0xB2, 0x0F, 0xBA, 0x0D, 0xBB, 0xBC, - 0x99, 0xE1, 0xBB, 0xAC; - stk500_devcode = 0x23; -## Use the ATtiny26 devcode: - avr910_devcode = 0x5e; - signature = 0x1e 0x92 0x0d; - 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; - - pp_controlstack = - 0x0E, 0x1E, 0x0E, 0x1E, 0x2E, 0x3E, 0x2E, 0x3E, - 0x4E, 0x5E, 0x4E, 0x5E, 0x6E, 0x7E, 0x6E, 0x7E, - 0x26, 0x36, 0x66, 0x76, 0x2A, 0x3A, 0x6A, 0x7A, - 0x2E, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; + desc = "ATtiny4313"; + id = "t4313"; + prog_modes = PM_SPM | PM_ISP | PM_HVPP | PM_debugWIRE; + mcuid = 44; + n_interrupts = 21; + stk500_devcode = 0x23; +# Use the ATtiny26 devcode: + avr910_devcode = 0x5e; + chip_erase_delay = 9000; + pagel = 0xd4; + bs2 = 0xd6; + signature = 0x1e 0x92 0x0d; + reset = io; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + pp_controlstack = + 0x0e, 0x1e, 0x0e, 0x1e, 0x2e, 0x3e, 0x2e, 0x3e, + 0x4e, 0x5e, 0x4e, 0x5e, 0x6e, 0x7e, 0x6e, 0x7e, + 0x26, 0x36, 0x66, 0x76, 0x2a, 0x3a, 0x6a, 0x7a, + 0x2e, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + flash_instr = 0xb2, 0x0f, 0x1f; + eeprom_instr = + 0xbb, 0xfe, 0xbb, 0xee, 0xbb, 0xcc, 0xb2, 0x0d, + 0xba, 0x0f, 0xb2, 0x0f, 0xba, 0x0d, 0xbb, 0xbc, + 0x99, 0xe1, 0xbb, 0xac; + hventerstabdelay = 100; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + hvleavestabdelay = 15; + chiperasepolltimeout = 10; programfusepolltimeout = 5; - programlockpulsewidth = 0; programlockpolltimeout = 5; + spmcr = 0x57; + eecr = 0x3c; + ocdrev = 0; + chip_erase = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; - ocdrev = 0; + memory "eeprom" + size = 256; + page_size = 4; + min_write_delay = 4000; + max_write_delay = 4500; + readback = 0xff 0xff; + mode = 65; + delay = 6; + blocksize = 4; + readsize = 256; + read = "1010.0000--000x.xxxx--aaaa.aaaa--oooo.oooo"; + write = "1100.0000--000x.xxxx--aaaa.aaaa--iiii.iiii"; + loadpage_lo = "1100.0001--0000.0000--0000.00aa--iiii.iiii"; + writepage = "1100.0010--00xx.xxxx--aaaa.aa00--xxxx.xxxx"; + ; - memory "eeprom" - size = 256; - paged = no; - page_size = 4; - 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"; + memory "flash" + paged = yes; + size = 4096; + page_size = 64; + num_pages = 64; + min_write_delay = 4500; + max_write_delay = 4500; + readback = 0xff 0xff; + mode = 65; + delay = 6; + blocksize = 32; + readsize = 256; + read_lo = "0010.0000--0000.0aaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--0000.0aaa--aaaa.aaaa--oooo.oooo"; + loadpage_lo = "0100.0000--000x.xxxx--xxxa.aaaa--iiii.iiii"; + loadpage_hi = "0100.1000--000x.xxxx--xxxa.aaaa--iiii.iiii"; + writepage = "0100.1100--0000.0aaa--aaax.xxxx--xxxx.xxxx"; + ; - 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"; + memory "lfuse" + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii"; + ; - loadpage_lo = " 1 1 0 0 0 0 0 1", - " 0 0 0 0 0 0 0 0", - " 0 0 0 0 0 0 a1 a0", - " i i i i i i i i"; + memory "hfuse" + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii"; + ; - writepage = " 1 1 0 0 0 0 1 0", - " 0 0 x x x x x x", - " a7 a6 a5 a4 a3 a2 0 0", - " x x x x x x x x"; + memory "efuse" + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0100--xxxx.xxxx--xxxx.xxxi"; + ; - 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; - ; + memory "lock" + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii"; + ; # ATtiny4313 has Signature Bytes: 0x1E 0x92 0x0D. - 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"; - 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 o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + memory "signature" + size = 3; + read = "0011.0000--000x.xxxx--xxxx.xxaa--oooo.oooo"; + ; - 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; - - 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; - - 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; - - 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"; - ; - ; + memory "calibration" + size = 2; + read = "0011.1000--000x.xxxx--0000.000a--oooo.oooo"; + ; +; #------------------------------------------------------------ # AT90PWM2 #------------------------------------------------------------ part - id = "pwm2"; - desc = "AT90PWM2"; - has_debugwire = yes; - flash_instr = 0xB6, 0x01, 0x11; - eeprom_instr = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00, - 0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF, - 0x99, 0xF9, 0xBB, 0xAF; - stk500_devcode = 0x65; -## avr910_devcode = ?; - signature = 0x1e 0x93 0x81; - 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; - - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; + desc = "AT90PWM2"; + id = "pwm2"; + prog_modes = PM_SPM | PM_ISP | PM_HVPP | PM_debugWIRE; + mcuid = 167; + n_interrupts = 32; + n_boot_sections = 4; + boot_section_size = 256; + stk500_devcode = 0x65; + chip_erase_delay = 9000; + pagel = 0xd8; + bs2 = 0xe2; +# avr910_devcode = ?; + signature = 0x1e 0x93 0x81; + reset = io; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + pp_controlstack = + 0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f, + 0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f, + 0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b, + 0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + flash_instr = 0xb6, 0x01, 0x11; + eeprom_instr = + 0xbd, 0xf2, 0xbd, 0xe1, 0xbb, 0xcf, 0xb4, 0x00, + 0xbe, 0x01, 0xb6, 0x01, 0xbc, 0x00, 0xbb, 0xbf, + 0x99, 0xf9, 0xbb, 0xaf; + hventerstabdelay = 100; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + hvleavestabdelay = 15; + chiperasepolltimeout = 10; programfusepolltimeout = 5; - programlockpulsewidth = 0; programlockpolltimeout = 5; + spmcr = 0x57; + eecr = 0x3f; + chip_erase = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; - memory "eeprom" - size = 512; - paged = no; - page_size = 4; - 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"; + memory "eeprom" + size = 512; + page_size = 4; + min_write_delay = 4000; + max_write_delay = 4500; + readback = 0xff 0xff; + mode = 65; + delay = 6; + blocksize = 4; + readsize = 256; + read = "1010.0000--000x.xxxa--aaaa.aaaa--oooo.oooo"; + write = "1100.0000--000x.xxxa--aaaa.aaaa--iiii.iiii"; + loadpage_lo = "1100.0001--0000.0000--0000.00aa--iiii.iiii"; + writepage = "1100.0010--00xx.xxxa--aaaa.aa00--xxxx.xxxx"; + ; - 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"; + memory "flash" + paged = yes; + size = 8192; + page_size = 64; + num_pages = 128; + min_write_delay = 4500; + max_write_delay = 4500; + readback = 0xff 0xff; + mode = 65; + delay = 6; + blocksize = 64; + readsize = 256; + read_lo = "0010.0000--0000.aaaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--0000.aaaa--aaaa.aaaa--oooo.oooo"; + loadpage_lo = "0100.0000--000x.xxxx--xxxa.aaaa--iiii.iiii"; + loadpage_hi = "0100.1000--000x.xxxx--xxxa.aaaa--iiii.iiii"; + writepage = "0100.1100--0000.aaaa--aaax.xxxx--xxxx.xxxx"; + ; - loadpage_lo = " 1 1 0 0 0 0 0 1", - " 0 0 0 0 0 0 0 0", - " 0 0 0 0 0 0 a1 a0", - " i i i i i i i i"; + memory "lfuse" + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii"; + ; - writepage = " 1 1 0 0 0 0 1 0", - " 0 0 x x x x x a8", - " a7 a6 a5 a4 a3 a2 0 0", - " x x x x x x x x"; + memory "hfuse" + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii"; + ; - 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"; + memory "efuse" + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0100--xxxx.xxxx--iiii.iiii"; + ; - 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 "lock" + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii"; + ; # 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"; + memory "signature" + size = 3; + read = "0011.0000--00xx.xxxx--xxxx.xxaa--oooo.oooo"; + ; - 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 o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; - - 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; - - 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; - - 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 i i 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; - - 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 "calibration" + size = 1; + read = "0011.1000--000x.xxxx--0000.0000--oooo.oooo"; + ; +; #------------------------------------------------------------ # AT90PWM3 @@ -10529,9 +8816,10 @@ part # Completely identical to AT90PWM2 (including the signature!) part parent "pwm2" - id = "pwm3"; - desc = "AT90PWM3"; - ; + desc = "AT90PWM3"; + id = "pwm3"; + mcuid = 169; +; #------------------------------------------------------------ # AT90PWM2B @@ -10539,12 +8827,12 @@ part parent "pwm2" # Same as AT90PWM2 but different signature. part parent "pwm2" - id = "pwm2b"; - desc = "AT90PWM2B"; - signature = 0x1e 0x93 0x83; - - ocdrev = 1; - ; + desc = "AT90PWM2B"; + id = "pwm2b"; + mcuid = 168; + signature = 0x1e 0x93 0x83; + ocdrev = 1; +; #------------------------------------------------------------ # AT90PWM3B @@ -10553,11 +8841,10 @@ part parent "pwm2" # Completely identical to AT90PWM2B (including the signature!) part parent "pwm2b" - id = "pwm3b"; - desc = "AT90PWM3B"; - - ocdrev = 1; - ; + desc = "AT90PWM3B"; + id = "pwm3b"; + mcuid = 170; +; #------------------------------------------------------------ # AT90PWM316 @@ -10566,52 +8853,24 @@ part parent "pwm2b" # Similar to AT90PWM3B, but with 16 kiB flash, 512 B EEPROM, and 1024 B SRAM. part parent "pwm3b" - id = "pwm316"; - desc = "AT90PWM316"; - signature = 0x1e 0x94 0x83; - - ocdrev = 1; + desc = "AT90PWM316"; + id = "pwm316"; + mcuid = 180; + boot_section_size = 512; + signature = 0x1e 0x94 0x83; memory "flash" - paged = yes; - 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 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 = 128; - readsize = 256; - ; - ; + size = 0x4000; + page_size = 128; + mode = 33; + blocksize = 128; + read_lo = "0010.0000--00aa.aaaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--00aa.aaaa--aaaa.aaaa--oooo.oooo"; + loadpage_lo = "0100.0000--00xx.xxxx--xxaa.aaaa--iiii.iiii"; + loadpage_hi = "0100.1000--00xx.xxxx--xxaa.aaaa--iiii.iiii"; + writepage = "0100.1100--00aa.aaaa--aaxx.xxxx--xxxx.xxxx"; + ; +; #------------------------------------------------------------ # AT90PWM216 @@ -10619,560 +8878,405 @@ part parent "pwm3b" # Completely identical to AT90PWM316 (including the signature!) part parent "pwm316" - id = "pwm216"; - desc = "AT90PWM216"; - ; + desc = "AT90PWM216"; + id = "pwm216"; + mcuid = 179; +; #------------------------------------------------------------ # ATtiny25 #------------------------------------------------------------ part - id = "t25"; - desc = "ATtiny25"; - has_debugwire = yes; - flash_instr = 0xB4, 0x02, 0x12; - eeprom_instr = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D, - 0xBC, 0x02, 0xB4, 0x02, 0xBA, 0x0D, 0xBB, 0xBC, - 0x99, 0xE1, 0xBB, 0xAC; -## no STK500 devcode in XML file, use the ATtiny45 one - stk500_devcode = 0x14; -## avr910_devcode = ?; -## Try the AT90S2313 devcode: - avr910_devcode = 0x20; - signature = 0x1e 0x91 0x08; - 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; - - hvsp_controlstack = - 0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x66, - 0x68, 0x78, 0x68, 0x68, 0x7A, 0x6A, 0x68, 0x78, - 0x78, 0x7D, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10, + desc = "ATtiny25"; + id = "t25"; + prog_modes = PM_SPM | PM_ISP | PM_HVSP | PM_debugWIRE; + mcuid = 16; + n_interrupts = 15; +# no STK500 devcode in XML file, use the ATtiny45 one + stk500_devcode = 0x14; +# avr910_devcode = ?; +# Try the AT90S2313 devcode: + avr910_devcode = 0x20; + chip_erase_delay = 4500; + signature = 0x1e 0x91 0x08; + reset = io; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + hvsp_controlstack = + 0x4c, 0x0c, 0x1c, 0x2c, 0x3c, 0x64, 0x74, 0x66, + 0x68, 0x78, 0x68, 0x68, 0x7a, 0x6a, 0x68, 0x78, + 0x78, 0x7d, 0x6d, 0x0c, 0x80, 0x40, 0x20, 0x10, 0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00; - hventerstabdelay = 100; - hvspcmdexedelay = 0; - synchcycles = 6; - latchcycles = 1; - togglevtg = 1; - poweroffdelay = 25; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 100; - resetdelay = 25; - chiperasepolltimeout = 40; - chiperasetime = 0; + flash_instr = 0xb4, 0x02, 0x12; + eeprom_instr = + 0xbb, 0xff, 0xbb, 0xee, 0xbb, 0xcc, 0xb2, 0x0d, + 0xbc, 0x02, 0xb4, 0x02, 0xba, 0x0d, 0xbb, 0xbc, + 0x99, 0xe1, 0xbb, 0xac; + hventerstabdelay = 100; + latchcycles = 1; + togglevtg = 1; + poweroffdelay = 25; + resetdelayms = 1; + hvleavestabdelay = 100; + resetdelay = 25; + chiperasepolltimeout = 40; programfusepolltimeout = 25; programlockpolltimeout = 25; + synchcycles = 6; + spmcr = 0x57; + eecr = 0x3c; + ocdrev = 1; + chip_erase = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; - ocdrev = 1; + memory "eeprom" + size = 128; + page_size = 4; + min_write_delay = 4000; + max_write_delay = 4500; + readback = 0xff 0xff; + mode = 65; + delay = 6; + blocksize = 4; + readsize = 256; + read = "1010.0000--000x.xxxx--xaaa.aaaa--oooo.oooo"; + write = "1100.0000--000x.xxxx--xaaa.aaaa--iiii.iiii"; + loadpage_lo = "1100.0001--0000.0000--0000.00aa--iiii.iiii"; + writepage = "1100.0010--00xx.xxxx--xaaa.aa00--xxxx.xxxx"; + ; - memory "eeprom" - size = 128; - paged = no; - page_size = 4; - 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"; + memory "flash" + paged = yes; + size = 2048; + page_size = 32; + num_pages = 64; + min_write_delay = 4500; + max_write_delay = 4500; + readback = 0xff 0xff; + mode = 65; + delay = 6; + blocksize = 32; + readsize = 256; + read_lo = "0010.0000--0000.00aa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--0000.00aa--aaaa.aaaa--oooo.oooo"; + loadpage_lo = "0100.0000--000x.xxxx--xxxx.aaaa--iiii.iiii"; + loadpage_hi = "0100.1000--000x.xxxx--xxxx.aaaa--iiii.iiii"; + writepage = "0100.1100--0000.00aa--aaaa.xxxx--xxxx.xxxx"; + ; - 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"; + memory "lfuse" + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii"; + ; - loadpage_lo = " 1 1 0 0 0 0 0 1", - " 0 0 0 0 0 0 0 0", - " 0 0 0 0 0 0 a1 a0", - " i i i i i i i i"; + memory "hfuse" + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii"; + ; - writepage = " 1 1 0 0 0 0 1 0", - " 0 0 x x x x x x", - " x a6 a5 a4 a3 a2 0 0", - " x x x x x x x x"; + memory "efuse" + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0100--xxxx.xxxx--xxxx.xxxi"; + ; - 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"; - - 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"; - - 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"; - - 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; - ; + memory "lock" + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.0000--0000.0000--oooo.oooo"; + write = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii"; + ; # 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", - "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", - "0 0 0 0 0 0 0 0 o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + memory "signature" + size = 3; + read = "0011.0000--000x.xxxx--xxxx.xxaa--oooo.oooo"; + ; - 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; - - 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; - - 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; - - 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"; - ; - ; + memory "calibration" + size = 1; + read = "0011.1000--000x.xxxx--0000.000a--oooo.oooo"; + ; +; #------------------------------------------------------------ # ATtiny45 #------------------------------------------------------------ part - id = "t45"; - desc = "ATtiny45"; - has_debugwire = yes; - flash_instr = 0xB4, 0x02, 0x12; - eeprom_instr = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D, - 0xBC, 0x02, 0xB4, 0x02, 0xBA, 0x0D, 0xBB, 0xBC, - 0x99, 0xE1, 0xBB, 0xAC; - stk500_devcode = 0x14; -## avr910_devcode = ?; -## Try the AT90S2313 devcode: - avr910_devcode = 0x20; - signature = 0x1e 0x92 0x06; - 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; - - hvsp_controlstack = - 0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x66, - 0x68, 0x78, 0x68, 0x68, 0x7A, 0x6A, 0x68, 0x78, - 0x78, 0x7D, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10, + desc = "ATtiny45"; + id = "t45"; + prog_modes = PM_SPM | PM_ISP | PM_HVSP | PM_debugWIRE; + mcuid = 22; + n_interrupts = 15; + stk500_devcode = 0x14; +# avr910_devcode = ?; +# Try the AT90S2313 devcode: + avr910_devcode = 0x20; + chip_erase_delay = 4500; + signature = 0x1e 0x92 0x06; + reset = io; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + hvsp_controlstack = + 0x4c, 0x0c, 0x1c, 0x2c, 0x3c, 0x64, 0x74, 0x66, + 0x68, 0x78, 0x68, 0x68, 0x7a, 0x6a, 0x68, 0x78, + 0x78, 0x7d, 0x6d, 0x0c, 0x80, 0x40, 0x20, 0x10, 0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - hvspcmdexedelay = 0; - synchcycles = 6; - latchcycles = 1; - togglevtg = 1; - poweroffdelay = 25; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 100; - resetdelay = 25; - chiperasepolltimeout = 40; - chiperasetime = 0; + flash_instr = 0xb4, 0x02, 0x12; + eeprom_instr = + 0xbb, 0xff, 0xbb, 0xee, 0xbb, 0xcc, 0xb2, 0x0d, + 0xbc, 0x02, 0xb4, 0x02, 0xba, 0x0d, 0xbb, 0xbc, + 0x99, 0xe1, 0xbb, 0xac; + hventerstabdelay = 100; + latchcycles = 1; + togglevtg = 1; + poweroffdelay = 25; + resetdelayms = 1; + hvleavestabdelay = 100; + resetdelay = 25; + chiperasepolltimeout = 40; programfusepolltimeout = 25; programlockpolltimeout = 25; + synchcycles = 6; + spmcr = 0x57; + eecr = 0x3c; + ocdrev = 1; + chip_erase = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; - ocdrev = 1; + memory "eeprom" + size = 256; + page_size = 4; + min_write_delay = 4000; + max_write_delay = 4500; + readback = 0xff 0xff; + mode = 65; + delay = 6; + blocksize = 4; + readsize = 256; + read = "1010.0000--000x.xxxx--aaaa.aaaa--oooo.oooo"; + write = "1100.0000--000x.xxxx--aaaa.aaaa--iiii.iiii"; + loadpage_lo = "1100.0001--0000.0000--0000.00aa--iiii.iiii"; + writepage = "1100.0010--00xx.xxxx--aaaa.aa00--xxxx.xxxx"; + ; - memory "eeprom" - size = 256; - page_size = 4; - 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"; + memory "flash" + paged = yes; + size = 4096; + page_size = 64; + num_pages = 64; + min_write_delay = 4500; + max_write_delay = 4500; + readback = 0xff 0xff; + mode = 65; + delay = 6; + blocksize = 32; + readsize = 256; + read_lo = "0010.0000--0000.0aaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--0000.0aaa--aaaa.aaaa--oooo.oooo"; + loadpage_lo = "0100.0000--000x.xxxx--xxxa.aaaa--iiii.iiii"; + loadpage_hi = "0100.1000--000x.xxxx--xxxa.aaaa--iiii.iiii"; + writepage = "0100.1100--0000.0aaa--aaax.xxxx--xxxx.xxxx"; + ; - 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"; + memory "lfuse" + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii"; + ; - loadpage_lo = " 1 1 0 0 0 0 0 1", - " 0 0 0 0 0 0 0 0", - " 0 0 0 0 0 0 a1 a0", - " i i i i i i i i"; + memory "hfuse" + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii"; + ; - writepage = " 1 1 0 0 0 0 1 0", - " 0 0 x x x x x x", - " a7 a6 a5 a4 a3 a2 0 0", - " x x x x x x x x"; + memory "efuse" + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0100--xxxx.xxxx--xxxx.xxxi"; + ; - 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; - ; + memory "lock" + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.0000--0000.0000--oooo.oooo"; + write = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii"; + ; # ATtiny45 has Signature Bytes: 0x1E 0x92 0x08. (Data sheet 2586C-AVR-06/05 (doc2586.pdf) indicates otherwise!) - 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"; - read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", - "0 0 0 0 0 0 0 0 o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + memory "signature" + size = 3; + read = "0011.0000--000x.xxxx--xxxx.xxaa--oooo.oooo"; + ; - 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; - - 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; - - 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; - - 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"; - ; - ; + memory "calibration" + size = 1; + read = "0011.1000--000x.xxxx--0000.000a--oooo.oooo"; + ; +; #------------------------------------------------------------ # ATtiny85 #------------------------------------------------------------ part - id = "t85"; - desc = "ATtiny85"; - has_debugwire = yes; - flash_instr = 0xB4, 0x02, 0x12; - eeprom_instr = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D, - 0xBC, 0x02, 0xB4, 0x02, 0xBA, 0x0D, 0xBB, 0xBC, - 0x99, 0xE1, 0xBB, 0xAC; -## no STK500 devcode in XML file, use the ATtiny45 one - stk500_devcode = 0x14; -## avr910_devcode = ?; -## Try the AT90S2313 devcode: - avr910_devcode = 0x20; - signature = 0x1e 0x93 0x0b; - 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; - - hvsp_controlstack = - 0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x66, - 0x68, 0x78, 0x68, 0x68, 0x7A, 0x6A, 0x68, 0x78, - 0x78, 0x7D, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10, + desc = "ATtiny85"; + id = "t85"; + prog_modes = PM_SPM | PM_ISP | PM_HVSP | PM_debugWIRE; + mcuid = 26; + n_interrupts = 15; +# no STK500 devcode in XML file, use the ATtiny45 one + stk500_devcode = 0x14; +# avr910_devcode = ?; +# Try the AT90S2313 devcode: + avr910_devcode = 0x20; + chip_erase_delay = 4500; + signature = 0x1e 0x93 0x0b; + reset = io; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + hvsp_controlstack = + 0x4c, 0x0c, 0x1c, 0x2c, 0x3c, 0x64, 0x74, 0x66, + 0x68, 0x78, 0x68, 0x68, 0x7a, 0x6a, 0x68, 0x78, + 0x78, 0x7d, 0x6d, 0x0c, 0x80, 0x40, 0x20, 0x10, 0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00; - hventerstabdelay = 100; - hvspcmdexedelay = 0; - synchcycles = 6; - latchcycles = 1; - togglevtg = 1; - poweroffdelay = 25; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 100; - resetdelay = 25; - chiperasepolltimeout = 40; - chiperasetime = 0; + flash_instr = 0xb4, 0x02, 0x12; + eeprom_instr = + 0xbb, 0xff, 0xbb, 0xee, 0xbb, 0xcc, 0xb2, 0x0d, + 0xbc, 0x02, 0xb4, 0x02, 0xba, 0x0d, 0xbb, 0xbc, + 0x99, 0xe1, 0xbb, 0xac; + hventerstabdelay = 100; + latchcycles = 1; + togglevtg = 1; + poweroffdelay = 25; + resetdelayms = 1; + hvleavestabdelay = 100; + resetdelay = 25; + chiperasepolltimeout = 40; programfusepolltimeout = 25; programlockpolltimeout = 25; + synchcycles = 6; + spmcr = 0x57; + eecr = 0x3c; + ocdrev = 1; + chip_erase = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; - ocdrev = 1; + memory "eeprom" + size = 512; + page_size = 4; + min_write_delay = 4000; + max_write_delay = 4500; + readback = 0xff 0xff; + mode = 65; + delay = 6; + blocksize = 4; + readsize = 256; + read = "1010.0000--000x.xxxa--aaaa.aaaa--oooo.oooo"; + write = "1100.0000--000x.xxxa--aaaa.aaaa--iiii.iiii"; + loadpage_lo = "1100.0001--0000.0000--0000.00aa--iiii.iiii"; + writepage = "1100.0010--00xx.xxxa--aaaa.aa00--xxxx.xxxx"; + ; - memory "eeprom" - size = 512; - paged = no; - page_size = 4; - 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"; + memory "flash" + paged = yes; + size = 8192; + page_size = 64; + num_pages = 128; + min_write_delay = 4500; + max_write_delay = 4500; + readback = 0xff 0xff; + mode = 65; + delay = 6; + blocksize = 32; + readsize = 256; + read_lo = "0010.0000--0000.aaaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--0000.aaaa--aaaa.aaaa--oooo.oooo"; + loadpage_lo = "0100.0000--000x.xxxx--xxxa.aaaa--iiii.iiii"; + loadpage_hi = "0100.1000--000x.xxxx--xxxa.aaaa--iiii.iiii"; + writepage = "0100.1100--0000.aaaa--aaax.xxxx--xxxx.xxxx"; + ; - 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"; + memory "lfuse" + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii"; + ; - loadpage_lo = " 1 1 0 0 0 0 0 1", - " 0 0 0 0 0 0 0 0", - " 0 0 0 0 0 0 a1 a0", - " i i i i i i i i"; + memory "hfuse" + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii"; + ; - writepage = " 1 1 0 0 0 0 1 0", - " 0 0 x x x x x a8", - " a7 a6 a5 a4 a3 a2 0 0", - " x x x x x x x x"; + memory "efuse" + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0100--xxxx.xxxx--xxxx.xxxi"; + ; - 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; - ; + memory "lock" + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.0000--0000.0000--oooo.oooo"; + write = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii"; + ; # 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"; - read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", - "0 0 0 0 0 0 0 0 o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + memory "signature" + size = 3; + read = "0011.0000--000x.xxxx--xxxx.xxaa--oooo.oooo"; + ; - 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; - - 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; - - 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; - - 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"; - ; - ; + memory "calibration" + size = 1; + read = "0011.1000--000x.xxxx--0000.000a--oooo.oooo"; + ; +; #------------------------------------------------------------ # ATmega640 @@ -11180,380 +9284,250 @@ part # Almost same as ATmega1280, except for different memory sizes part - id = "m640"; - desc = "ATmega640"; - signature = 0x1e 0x96 0x08; - has_jtag = yes; -# stk500_devcode = 0xB2; -# avr910_devcode = 0x43; - 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 = 1; - - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; + desc = "ATmega640"; + id = "m640"; + prog_modes = PM_SPM | PM_ISP | PM_HVPP | PM_JTAG; + mcuid = 126; + n_interrupts = 57; + n_boot_sections = 4; + boot_section_size = 1024; +# stk500_devcode = 0xB2; +# avr910_devcode = 0x43; + chip_erase_delay = 9000; + pagel = 0xd7; + bs2 = 0xa0; + signature = 0x1e 0x96 0x08; + reset = io; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + pp_controlstack = + 0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f, + 0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f, + 0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b, + 0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + hvleavestabdelay = 15; + chiperasepolltimeout = 10; programfusepolltimeout = 5; - programlockpulsewidth = 0; programlockpolltimeout = 5; - - idr = 0x31; - spmcr = 0x57; - rampz = 0x3b; - allowfullpagebitstream = no; - - ocdrev = 3; + idr = 0x31; + rampz = 0x3b; + spmcr = 0x57; + ocdrev = 3; + chip_erase = "1010.1100--1000.0000--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; memory "eeprom" - paged = no; /* leave this "no" */ - page_size = 8; /* for parallel programming */ - size = 4096; - min_write_delay = 9000; - max_write_delay = 9000; - readback_p1 = 0x00; - readback_p2 = 0x00; - 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", - " x x x x a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; - - loadpage_lo = " 1 1 0 0 0 0 0 1", - " 0 0 0 0 0 0 0 0", - " 0 0 0 0 0 a2 a1 a0", - " i i i i i i i i"; - - writepage = " 1 1 0 0 0 0 1 0", - " 0 0 x x a11 a10 a9 a8", - " a7 a6 a5 a4 a3 0 0 0", - " x x x x x x x x"; - - mode = 0x41; - delay = 10; - blocksize = 8; - readsize = 256; - ; + size = 4096; + page_size = 8; + min_write_delay = 9000; + max_write_delay = 9000; + mode = 65; + delay = 10; + blocksize = 8; + readsize = 256; + read = "1010.0000--xxxx.aaaa--aaaa.aaaa--oooo.oooo"; + write = "1100.0000--xxxx.aaaa--aaaa.aaaa--iiii.iiii"; + loadpage_lo = "1100.0001--0000.0000--0000.0aaa--iiii.iiii"; + writepage = "1100.0010--00xx.aaaa--aaaa.a000--xxxx.xxxx"; + ; memory "flash" - paged = yes; - size = 65536; - page_size = 256; - num_pages = 256; - 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 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 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 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 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 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 = 10; - blocksize = 256; - readsize = 256; - ; + paged = yes; + size = 0x10000; + page_size = 256; + num_pages = 256; + min_write_delay = 4500; + max_write_delay = 4500; + mode = 65; + delay = 10; + blocksize = 256; + readsize = 256; + read_lo = "0010.0000--0aaa.aaaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--0aaa.aaaa--aaaa.aaaa--oooo.oooo"; + loadpage_lo = "0100.0000--xxxx.xxxx--xaaa.aaaa--iiii.iiii"; + loadpage_hi = "0100.1000--xxxx.xxxx--xaaa.aaaa--iiii.iiii"; + writepage = "0100.1100--0aaa.aaaa--axxx.xxxx--xxxx.xxxx"; + ; 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii"; + ; 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii"; + ; 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 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0100--xxxx.xxxx--xxxx.xiii"; + ; 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 o o 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; - - 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"; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii"; + ; 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"; - ; - ; + size = 3; + read = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo"; + ; + + memory "calibration" + size = 1; + read = "0011.1000--xxxx.xxxx--0000.0000--oooo.oooo"; + ; +; #------------------------------------------------------------ # ATmega1280 #------------------------------------------------------------ part - id = "m1280"; - desc = "ATmega1280"; - signature = 0x1e 0x97 0x03; - has_jtag = yes; -# stk500_devcode = 0xB2; -# avr910_devcode = 0x43; - 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 = 1; - - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; + desc = "ATmega1280"; + id = "m1280"; + prog_modes = PM_SPM | PM_ISP | PM_HVPP | PM_JTAG; + mcuid = 138; + n_interrupts = 57; + n_boot_sections = 4; + boot_section_size = 1024; +# stk500_devcode = 0xB2; +# avr910_devcode = 0x43; + chip_erase_delay = 9000; + pagel = 0xd7; + bs2 = 0xa0; + signature = 0x1e 0x97 0x03; + reset = io; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + pp_controlstack = + 0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f, + 0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f, + 0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b, + 0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + hvleavestabdelay = 15; + chiperasepolltimeout = 10; programfusepolltimeout = 5; - programlockpulsewidth = 0; programlockpolltimeout = 5; - - idr = 0x31; - spmcr = 0x57; - rampz = 0x3b; - allowfullpagebitstream = no; - - ocdrev = 3; + idr = 0x31; + rampz = 0x3b; + spmcr = 0x57; + ocdrev = 3; + chip_erase = "1010.1100--1000.0000--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; memory "eeprom" - paged = no; /* leave this "no" */ - page_size = 8; /* for parallel programming */ - size = 4096; - min_write_delay = 9000; - max_write_delay = 9000; - readback_p1 = 0x00; - readback_p2 = 0x00; - 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", - " x x x x a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; - - loadpage_lo = " 1 1 0 0 0 0 0 1", - " 0 0 0 0 0 0 0 0", - " 0 0 0 0 0 a2 a1 a0", - " i i i i i i i i"; - - writepage = " 1 1 0 0 0 0 1 0", - " 0 0 x x a11 a10 a9 a8", - " a7 a6 a5 a4 a3 0 0 0", - " x x x x x x x x"; - - mode = 0x41; - delay = 10; - blocksize = 8; - readsize = 256; - ; + size = 4096; + page_size = 8; + min_write_delay = 9000; + max_write_delay = 9000; + mode = 65; + delay = 10; + blocksize = 8; + readsize = 256; + read = "1010.0000--xxxx.aaaa--aaaa.aaaa--oooo.oooo"; + write = "1100.0000--xxxx.aaaa--aaaa.aaaa--iiii.iiii"; + loadpage_lo = "1100.0001--0000.0000--0000.0aaa--iiii.iiii"; + writepage = "1100.0010--00xx.aaaa--aaaa.a000--xxxx.xxxx"; + ; memory "flash" - paged = yes; - size = 131072; - page_size = 256; - num_pages = 512; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0x00; - readback_p2 = 0x00; - 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", - "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 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 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; - - writepage = " 0 1 0 0 1 1 0 0", - "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 = 10; - blocksize = 256; - readsize = 256; - ; + paged = yes; + size = 0x20000; + page_size = 256; + num_pages = 512; + min_write_delay = 4500; + max_write_delay = 4500; + mode = 65; + delay = 10; + blocksize = 256; + readsize = 256; + read_lo = "0010.0000--aaaa.aaaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--aaaa.aaaa--aaaa.aaaa--oooo.oooo"; + loadpage_lo = "0100.0000--xxxx.xxxx--xaaa.aaaa--iiii.iiii"; + loadpage_hi = "0100.1000--xxxx.xxxx--xaaa.aaaa--iiii.iiii"; + writepage = "0100.1100--aaaa.aaaa--axxx.xxxx--xxxx.xxxx"; + ; 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii"; + ; 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii"; + ; 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 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0100--xxxx.xxxx--xxxx.xiii"; + ; 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 o o 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; - - 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"; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii"; + ; 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"; - ; - ; + size = 3; + read = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo"; + ; + + memory "calibration" + size = 1; + read = "0011.1000--xxxx.xxxx--0000.0000--oooo.oooo"; + ; +; #------------------------------------------------------------ # ATmega1281 @@ -11561,219 +9535,148 @@ part # Identical to ATmega1280 part parent "m1280" - id = "m1281"; - desc = "ATmega1281"; - signature = 0x1e 0x97 0x04; - - ocdrev = 3; - ; + desc = "ATmega1281"; + id = "m1281"; + mcuid = 139; + signature = 0x1e 0x97 0x04; +; #------------------------------------------------------------ # ATmega2560 #------------------------------------------------------------ part - id = "m2560"; - desc = "ATmega2560"; - signature = 0x1e 0x98 0x01; - has_jtag = yes; - stk500_devcode = 0xB2; -# avr910_devcode = 0x43; - 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 = 1; - - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; + desc = "ATmega2560"; + id = "m2560"; + prog_modes = PM_SPM | PM_ISP | PM_HVPP | PM_JTAG; + mcuid = 143; + n_interrupts = 57; + n_boot_sections = 4; + boot_section_size = 1024; + stk500_devcode = 0xb2; +# avr910_devcode = 0x43; + chip_erase_delay = 9000; + pagel = 0xd7; + bs2 = 0xa0; + signature = 0x1e 0x98 0x01; + reset = io; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + pp_controlstack = + 0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f, + 0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f, + 0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b, + 0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02; + hventerstabdelay = 100; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + hvleavestabdelay = 15; + chiperasepolltimeout = 10; programfusepolltimeout = 5; - programlockpulsewidth = 0; programlockpolltimeout = 5; - - idr = 0x31; - spmcr = 0x57; - rampz = 0x3b; - allowfullpagebitstream = no; - - ocdrev = 4; + idr = 0x31; + rampz = 0x3b; + spmcr = 0x57; + ocdrev = 4; + chip_erase = "1010.1100--1000.0000--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; memory "eeprom" - paged = no; /* leave this "no" */ - page_size = 8; /* for parallel programming */ - size = 4096; - min_write_delay = 9000; - max_write_delay = 9000; - readback_p1 = 0x00; - readback_p2 = 0x00; - 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", - " x x x x a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; - - loadpage_lo = " 1 1 0 0 0 0 0 1", - " 0 0 0 0 0 0 0 0", - " 0 0 0 0 0 a2 a1 a0", - " i i i i i i i i"; - - writepage = " 1 1 0 0 0 0 1 0", - " 0 0 x x a11 a10 a9 a8", - " a7 a6 a5 a4 a3 0 0 0", - " x x x x x x x x"; - - mode = 0x41; - delay = 10; - blocksize = 8; - readsize = 256; - ; + size = 4096; + page_size = 8; + min_write_delay = 9000; + max_write_delay = 9000; + mode = 65; + delay = 10; + blocksize = 8; + readsize = 256; + read = "1010.0000--xxxx.aaaa--aaaa.aaaa--oooo.oooo"; + write = "1100.0000--xxxx.aaaa--aaaa.aaaa--iiii.iiii"; + loadpage_lo = "1100.0001--0000.0000--0000.0aaa--iiii.iiii"; + writepage = "1100.0010--00xx.aaaa--aaaa.a000--xxxx.xxxx"; + ; memory "flash" - paged = yes; - size = 262144; - page_size = 256; - num_pages = 1024; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0x00; - readback_p2 = 0x00; - 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", - "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 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 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; - - writepage = " 0 1 0 0 1 1 0 0", - "a15 a14 a13 a12 a11 a10 a9 a8", - " a7 x x x x x x x", - " x x x x x x x x"; - - load_ext_addr = " 0 1 0 0 1 1 0 1", - " 0 0 0 0 0 0 0 0", - " 0 0 0 0 0 0 0 a16", - " 0 0 0 0 0 0 0 0"; - - mode = 0x41; - delay = 10; - blocksize = 256; - readsize = 256; - ; + paged = yes; + size = 0x40000; + page_size = 256; + num_pages = 1024; + min_write_delay = 4500; + max_write_delay = 4500; + mode = 65; + delay = 10; + blocksize = 256; + readsize = 256; + read_lo = "0010.0000--aaaa.aaaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--aaaa.aaaa--aaaa.aaaa--oooo.oooo"; + loadpage_lo = "0100.0000--xxxx.xxxx--xaaa.aaaa--iiii.iiii"; + loadpage_hi = "0100.1000--xxxx.xxxx--xaaa.aaaa--iiii.iiii"; + load_ext_addr = "0100.1101--0000.0000--0000.000a--0000.0000"; + writepage = "0100.1100--aaaa.aaaa--axxx.xxxx--xxxx.xxxx"; + ; 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii"; + ; 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii"; + ; 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 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0100--xxxx.xxxx--xxxx.xiii"; + ; 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 o o 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; - - 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"; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii"; + ; 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"; - ; - ; + size = 3; + read = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo"; + ; + + memory "calibration" + size = 1; + read = "0011.1000--xxxx.xxxx--0000.0000--oooo.oooo"; + ; +; #------------------------------------------------------------ # ATmega2561 #------------------------------------------------------------ part parent "m2560" - id = "m2561"; - desc = "ATmega2561"; - signature = 0x1e 0x98 0x02; - - ocdrev = 4; - ; + desc = "ATmega2561"; + id = "m2561"; + mcuid = 144; + signature = 0x1e 0x98 0x02; +; #------------------------------------------------------------ # ATmega128RFA1 @@ -11781,875 +9684,572 @@ part parent "m2560" # Identical to ATmega2561 but half the ROM part parent "m2561" - id = "m128rfa1"; - desc = "ATmega128RFA1"; - signature = 0x1e 0xa7 0x01; - chip_erase_delay = 55000; - bs2 = 0xE2; - - ocdrev = 3; + desc = "ATmega128RFA1"; + id = "m128rfa1"; + mcuid = 87; + n_interrupts = 72; + chip_erase_delay = 55000; + bs2 = 0xe2; + signature = 0x1e 0xa7 0x01; + ocdrev = 3; memory "flash" - paged = yes; - size = 131072; - page_size = 256; - num_pages = 512; - min_write_delay = 50000; - max_write_delay = 50000; - readback_p1 = 0x00; - readback_p2 = 0x00; - 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", - "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 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 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; - - writepage = " 0 1 0 0 1 1 0 0", - "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 = 20; - blocksize = 256; - readsize = 256; - ; - ; + size = 0x20000; + num_pages = 512; + min_write_delay = 50000; + max_write_delay = 50000; + delay = 20; + load_ext_addr = NULL; + ; +; #------------------------------------------------------------ # ATmega256RFR2 #------------------------------------------------------------ part parent "m2561" - id = "m256rfr2"; - desc = "ATmega256RFR2"; - signature = 0x1e 0xa8 0x02; - chip_erase_delay = 18500; - bs2 = 0xE2; + desc = "ATmega256RFR2"; + id = "m256rfr2"; + mcuid = 108; + n_interrupts = 77; + chip_erase_delay = 18500; + bs2 = 0xe2; + signature = 0x1e 0xa8 0x02; memory "eeprom" - paged = no; /* leave this "no" */ - page_size = 8; /* for parallel programming */ - size = 8192; - min_write_delay = 13000; - max_write_delay = 13000; - readback_p1 = 0x00; - readback_p2 = 0x00; - read = " 1 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"; - - write = " 1 1 0 0 0 0 0 0", - " x x x a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; - - loadpage_lo = " 1 1 0 0 0 0 0 1", - " 0 0 0 0 0 0 0 0", - " 0 0 0 0 0 a2 a1 a0", - " i i i i i i i i"; - - writepage = " 1 1 0 0 0 0 1 0", - " 0 0 x a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 0 0 0", - " x x x x x x x x"; - - mode = 0x41; - delay = 10; - blocksize = 8; - readsize = 256; - ; - - - ocdrev = 4; - ; + size = 8192; + min_write_delay = 13000; + max_write_delay = 13000; + read = "1010.0000--xxxa.aaaa--aaaa.aaaa--oooo.oooo"; + write = "1100.0000--xxxa.aaaa--aaaa.aaaa--iiii.iiii"; + writepage = "1100.0010--00xa.aaaa--aaaa.a000--xxxx.xxxx"; + ; +; #------------------------------------------------------------ # ATmega128RFR2 #------------------------------------------------------------ part parent "m128rfa1" - id = "m128rfr2"; - desc = "ATmega128RFR2"; - signature = 0x1e 0xa7 0x02; - - - ocdrev = 3; - ; + desc = "ATmega128RFR2"; + id = "m128rfr2"; + mcuid = 88; + n_interrupts = 77; + signature = 0x1e 0xa7 0x02; +; #------------------------------------------------------------ # ATmega64RFR2 #------------------------------------------------------------ part parent "m128rfa1" - id = "m64rfr2"; - desc = "ATmega64RFR2"; - signature = 0x1e 0xa6 0x02; - - - ocdrev = 3; - - memory "flash" - paged = yes; - size = 65536; - page_size = 256; - num_pages = 256; - min_write_delay = 50000; - max_write_delay = 50000; - readback_p1 = 0x00; - readback_p2 = 0x00; - read_lo = " 0 0 1 0 0 0 0 0", - " 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", - " 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 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 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 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 = 20; - blocksize = 256; - readsize = 256; - ; + desc = "ATmega64RFR2"; + id = "m64rfr2"; + mcuid = 78; + n_interrupts = 77; + signature = 0x1e 0xa6 0x02; memory "eeprom" - paged = no; /* leave this "no" */ - page_size = 8; /* for parallel programming */ - size = 2048; - min_write_delay = 13000; - max_write_delay = 13000; - readback_p1 = 0x00; - readback_p2 = 0x00; - 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"; + size = 2048; + min_write_delay = 13000; + max_write_delay = 13000; + read = "1010.0000--xxxx.xaaa--aaaa.aaaa--oooo.oooo"; + write = "1100.0000--xxxx.xaaa--aaaa.aaaa--iiii.iiii"; + writepage = "1100.0010--00xx.xaaa--aaaa.a000--xxxx.xxxx"; + ; - 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"; - - loadpage_lo = " 1 1 0 0 0 0 0 1", - " 0 0 0 0 0 0 0 0", - " 0 0 0 0 0 a2 a1 a0", - " i i i i i i i i"; - - writepage = " 1 1 0 0 0 0 1 0", - " 0 0 x x x a10 a9 a8", - " a7 a6 a5 a4 a3 0 0 0", - " x x x x x x x x"; - - mode = 0x41; - delay = 10; - blocksize = 8; - readsize = 256; - ; - - - ; + memory "flash" + size = 0x10000; + num_pages = 256; + read_lo = "0010.0000--0aaa.aaaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--0aaa.aaaa--aaaa.aaaa--oooo.oooo"; + writepage = "0100.1100--0aaa.aaaa--axxx.xxxx--xxxx.xxxx"; + ; +; #------------------------------------------------------------ # ATmega2564RFR2 #------------------------------------------------------------ part parent "m256rfr2" - id = "m2564rfr2"; - desc = "ATmega2564RFR2"; - signature = 0x1e 0xa8 0x03; - ; + desc = "ATmega2564RFR2"; + id = "m2564rfr2"; + mcuid = 145; + signature = 0x1e 0xa8 0x03; +; #------------------------------------------------------------ # ATmega1284RFR2 #------------------------------------------------------------ part parent "m128rfr2" - id = "m1284rfr2"; - desc = "ATmega1284RFR2"; - signature = 0x1e 0xa7 0x03; - ; + desc = "ATmega1284RFR2"; + id = "m1284rfr2"; + mcuid = 142; + signature = 0x1e 0xa7 0x03; +; #------------------------------------------------------------ # ATmega644RFR2 #------------------------------------------------------------ part parent "m64rfr2" - id = "m644rfr2"; - desc = "ATmega644RFR2"; - signature = 0x1e 0xa6 0x03; - ; + desc = "ATmega644RFR2"; + id = "m644rfr2"; + mcuid = 131; + signature = 0x1e 0xa6 0x03; +; #------------------------------------------------------------ # ATtiny24 #------------------------------------------------------------ part - id = "t24"; - desc = "ATtiny24"; - has_debugwire = yes; - flash_instr = 0xB4, 0x07, 0x17; - eeprom_instr = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D, - 0xBC, 0x07, 0xB4, 0x07, 0xBA, 0x0D, 0xBB, 0xBC, - 0x99, 0xE1, 0xBB, 0xAC; -## no STK500 devcode in XML file, use the ATtiny45 one - stk500_devcode = 0x14; -## avr910_devcode = ?; -## Try the AT90S2313 devcode: - avr910_devcode = 0x20; - signature = 0x1e 0x91 0x0b; - 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; - - hvsp_controlstack = - 0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x66, - 0x68, 0x78, 0x68, 0x68, 0x7A, 0x6A, 0x68, 0x78, - 0x78, 0x7D, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10, - 0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x0F; - hventerstabdelay = 100; - hvspcmdexedelay = 0; - synchcycles = 6; - latchcycles = 1; - togglevtg = 1; - poweroffdelay = 25; - resetdelayms = 0; - resetdelayus = 70; - hvleavestabdelay = 100; - resetdelay = 25; - chiperasepolltimeout = 40; - chiperasetime = 0; + desc = "ATtiny24"; + id = "t24"; + prog_modes = PM_SPM | PM_ISP | PM_HVSP | PM_debugWIRE; + mcuid = 14; + n_interrupts = 17; +# no STK500 devcode in XML file, use the ATtiny45 one + stk500_devcode = 0x14; +# avr910_devcode = ?; +# Try the AT90S2313 devcode: + avr910_devcode = 0x20; + chip_erase_delay = 4500; + signature = 0x1e 0x91 0x0b; + reset = io; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + hvsp_controlstack = + 0x4c, 0x0c, 0x1c, 0x2c, 0x3c, 0x64, 0x74, 0x66, + 0x68, 0x78, 0x68, 0x68, 0x7a, 0x6a, 0x68, 0x78, + 0x78, 0x7d, 0x6d, 0x0c, 0x80, 0x40, 0x20, 0x10, + 0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x0f; + flash_instr = 0xb4, 0x07, 0x17; + eeprom_instr = + 0xbb, 0xff, 0xbb, 0xee, 0xbb, 0xcc, 0xb2, 0x0d, + 0xbc, 0x07, 0xb4, 0x07, 0xba, 0x0d, 0xbb, 0xbc, + 0x99, 0xe1, 0xbb, 0xac; + hventerstabdelay = 100; + latchcycles = 1; + togglevtg = 1; + poweroffdelay = 25; + resetdelayus = 70; + hvleavestabdelay = 100; + resetdelay = 25; + chiperasepolltimeout = 40; programfusepolltimeout = 25; programlockpolltimeout = 25; + synchcycles = 6; + spmcr = 0x57; + eecr = 0x3c; + ocdrev = 1; + chip_erase = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; - ocdrev = 1; + memory "eeprom" + size = 128; + page_size = 4; + min_write_delay = 4000; + max_write_delay = 4500; + readback = 0xff 0xff; + mode = 65; + delay = 6; + blocksize = 4; + readsize = 256; + read = "1010.0000--000x.xxxx--xaaa.aaaa--oooo.oooo"; + write = "1100.0000--000x.xxxx--xaaa.aaaa--iiii.iiii"; + loadpage_lo = "1100.0001--0000.0000--0000.00aa--iiii.iiii"; + writepage = "1100.0010--00xx.xxxx--xaaa.aa00--xxxx.xxxx"; + ; - memory "eeprom" - size = 128; - paged = no; - page_size = 4; - 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"; + memory "flash" + paged = yes; + size = 2048; + page_size = 32; + num_pages = 64; + min_write_delay = 4500; + max_write_delay = 4500; + readback = 0xff 0xff; + mode = 65; + delay = 6; + blocksize = 32; + readsize = 256; + read_lo = "0010.0000--0000.00aa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--0000.00aa--aaaa.aaaa--oooo.oooo"; + loadpage_lo = "0100.0000--000x.xxxx--xxxx.aaaa--iiii.iiii"; + loadpage_hi = "0100.1000--000x.xxxx--xxxx.aaaa--iiii.iiii"; + writepage = "0100.1100--0000.00aa--aaaa.xxxx--xxxx.xxxx"; + ; - 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"; + memory "lfuse" + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii"; + ; - loadpage_lo = " 1 1 0 0 0 0 0 1", - " 0 0 0 0 0 0 0 0", - " 0 0 0 0 0 0 a1 a0", - " i i i i i i i i"; + memory "hfuse" + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii"; + ; - writepage = " 1 1 0 0 0 0 1 0", - " 0 0 x x x x x x", - " x a6 a5 a4 a3 a2 0 0", - " x x x x x x x x"; + memory "efuse" + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0100--xxxx.xxxx--xxxx.xxxi"; + ; - 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"; - - 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"; - - 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"; - - 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; - ; + memory "lock" + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.0000--0000.0000--oooo.oooo"; + write = "1010.1100--111x.xxxx--xxxx.xxxx--xxxx.xxii"; + ; # ATtiny24 has Signature Bytes: 0x1E 0x91 0x0B. - 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 x x x x x x i i"; - read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", - "0 0 0 0 0 0 0 0 o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + memory "signature" + size = 3; + read = "0011.0000--000x.xxxx--xxxx.xxaa--oooo.oooo"; + ; - 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; - - 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; - - 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; - - 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"; - ; - ; + memory "calibration" + size = 1; + read = "0011.1000--000x.xxxx--0000.000a--oooo.oooo"; + ; +; #------------------------------------------------------------ # ATtiny24A #------------------------------------------------------------ part parent "t24" - id = "t24a"; - desc = "ATtiny24A"; - ; + desc = "ATtiny24A"; + id = "t24a"; + mcuid = 15; +; #------------------------------------------------------------ # ATtiny44 #------------------------------------------------------------ part - id = "t44"; - desc = "ATtiny44"; - has_debugwire = yes; - flash_instr = 0xB4, 0x07, 0x17; - eeprom_instr = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D, - 0xBC, 0x07, 0xB4, 0x07, 0xBA, 0x0D, 0xBB, 0xBC, - 0x99, 0xE1, 0xBB, 0xAC; -## no STK500 devcode in XML file, use the ATtiny45 one - stk500_devcode = 0x14; -## avr910_devcode = ?; -## Try the AT90S2313 devcode: - avr910_devcode = 0x20; - signature = 0x1e 0x92 0x07; - 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; - - hvsp_controlstack = - 0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x66, - 0x68, 0x78, 0x68, 0x68, 0x7A, 0x6A, 0x68, 0x78, - 0x78, 0x7D, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10, - 0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x0F; - hventerstabdelay = 100; - hvspcmdexedelay = 0; - synchcycles = 6; - latchcycles = 1; - togglevtg = 1; - poweroffdelay = 25; - resetdelayms = 0; - resetdelayus = 70; - hvleavestabdelay = 100; - resetdelay = 25; - chiperasepolltimeout = 40; - chiperasetime = 0; + desc = "ATtiny44"; + id = "t44"; + prog_modes = PM_SPM | PM_ISP | PM_HVSP | PM_debugWIRE; + mcuid = 20; + n_interrupts = 17; +# no STK500 devcode in XML file, use the ATtiny45 one + stk500_devcode = 0x14; +# avr910_devcode = ?; +# Try the AT90S2313 devcode: + avr910_devcode = 0x20; + chip_erase_delay = 4500; + signature = 0x1e 0x92 0x07; + reset = io; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + hvsp_controlstack = + 0x4c, 0x0c, 0x1c, 0x2c, 0x3c, 0x64, 0x74, 0x66, + 0x68, 0x78, 0x68, 0x68, 0x7a, 0x6a, 0x68, 0x78, + 0x78, 0x7d, 0x6d, 0x0c, 0x80, 0x40, 0x20, 0x10, + 0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x0f; + flash_instr = 0xb4, 0x07, 0x17; + eeprom_instr = + 0xbb, 0xff, 0xbb, 0xee, 0xbb, 0xcc, 0xb2, 0x0d, + 0xbc, 0x07, 0xb4, 0x07, 0xba, 0x0d, 0xbb, 0xbc, + 0x99, 0xe1, 0xbb, 0xac; + hventerstabdelay = 100; + latchcycles = 1; + togglevtg = 1; + poweroffdelay = 25; + resetdelayus = 70; + hvleavestabdelay = 100; + resetdelay = 25; + chiperasepolltimeout = 40; programfusepolltimeout = 25; programlockpolltimeout = 25; + synchcycles = 6; + spmcr = 0x57; + eecr = 0x3c; + ocdrev = 1; + chip_erase = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; - ocdrev = 1; + memory "eeprom" + size = 256; + page_size = 4; + min_write_delay = 4000; + max_write_delay = 4500; + readback = 0xff 0xff; + mode = 65; + delay = 6; + blocksize = 4; + readsize = 256; + read = "1010.0000--000x.xxxx--aaaa.aaaa--oooo.oooo"; + write = "1100.0000--000x.xxxx--aaaa.aaaa--iiii.iiii"; + loadpage_lo = "1100.0001--0000.0000--0000.00aa--iiii.iiii"; + writepage = "1100.0010--00xx.xxxx--aaaa.aa00--xxxx.xxxx"; + ; - memory "eeprom" - size = 256; - paged = no; - page_size = 4; - 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"; + memory "flash" + paged = yes; + size = 4096; + page_size = 64; + num_pages = 64; + min_write_delay = 4500; + max_write_delay = 4500; + readback = 0xff 0xff; + mode = 65; + delay = 6; + blocksize = 32; + readsize = 256; + read_lo = "0010.0000--0000.0aaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--0000.0aaa--aaaa.aaaa--oooo.oooo"; + loadpage_lo = "0100.0000--000x.xxxx--xxxa.aaaa--iiii.iiii"; + loadpage_hi = "0100.1000--000x.xxxx--xxxa.aaaa--iiii.iiii"; + writepage = "0100.1100--0000.0aaa--aaax.xxxx--xxxx.xxxx"; + ; - 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"; + memory "lfuse" + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii"; + ; - loadpage_lo = " 1 1 0 0 0 0 0 1", - " 0 0 0 0 0 0 0 0", - " 0 0 0 0 0 0 a1 a0", - " i i i i i i i i"; + memory "hfuse" + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii"; + ; - writepage = " 1 1 0 0 0 0 1 0", - " 0 0 x x x x x x", - " a7 a6 a5 a4 a3 a2 0 0", - " x x x x x x x x"; + memory "efuse" + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0100--xxxx.xxxx--xxxx.xxxi"; + ; - 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; - ; + memory "lock" + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.0000--0000.0000--oooo.oooo"; + write = "1010.1100--111x.xxxx--xxxx.xxxx--xxxx.xxii"; + ; # ATtiny44 has Signature Bytes: 0x1E 0x92 0x07. - 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 x x x x x x i i"; - read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", - "0 0 0 0 0 0 0 0 o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + memory "signature" + size = 3; + read = "0011.0000--000x.xxxx--xxxx.xxaa--oooo.oooo"; + ; - 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; - - 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; - - 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; - - 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"; - ; - ; + memory "calibration" + size = 1; + read = "0011.1000--000x.xxxx--0000.000a--oooo.oooo"; + ; +; #------------------------------------------------------------ # ATtiny44A #------------------------------------------------------------ part parent "t44" - id = "t44a"; - desc = "ATtiny44A"; - ; + desc = "ATtiny44A"; + id = "t44a"; + mcuid = 21; +; #------------------------------------------------------------ # ATtiny84 #------------------------------------------------------------ part - id = "t84"; - desc = "ATtiny84"; - has_debugwire = yes; - flash_instr = 0xB4, 0x07, 0x17; - eeprom_instr = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D, - 0xBC, 0x07, 0xB4, 0x07, 0xBA, 0x0D, 0xBB, 0xBC, - 0x99, 0xE1, 0xBB, 0xAC; -## no STK500 devcode in XML file, use the ATtiny45 one - stk500_devcode = 0x14; -## avr910_devcode = ?; -## Try the AT90S2313 devcode: - avr910_devcode = 0x20; - signature = 0x1e 0x93 0x0c; - 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; - - hvsp_controlstack = - 0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x66, - 0x68, 0x78, 0x68, 0x68, 0x7A, 0x6A, 0x68, 0x78, - 0x78, 0x7D, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10, - 0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x0F; - hventerstabdelay = 100; - hvspcmdexedelay = 0; - synchcycles = 6; - latchcycles = 1; - togglevtg = 1; - poweroffdelay = 25; - resetdelayms = 0; - resetdelayus = 70; - hvleavestabdelay = 100; - resetdelay = 25; - chiperasepolltimeout = 40; - chiperasetime = 0; + desc = "ATtiny84"; + id = "t84"; + prog_modes = PM_SPM | PM_ISP | PM_HVSP | PM_debugWIRE; + mcuid = 24; + n_interrupts = 17; +# no STK500 devcode in XML file, use the ATtiny45 one + stk500_devcode = 0x14; +# avr910_devcode = ?; +# Try the AT90S2313 devcode: + avr910_devcode = 0x20; + chip_erase_delay = 4500; + signature = 0x1e 0x93 0x0c; + reset = io; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + hvsp_controlstack = + 0x4c, 0x0c, 0x1c, 0x2c, 0x3c, 0x64, 0x74, 0x66, + 0x68, 0x78, 0x68, 0x68, 0x7a, 0x6a, 0x68, 0x78, + 0x78, 0x7d, 0x6d, 0x0c, 0x80, 0x40, 0x20, 0x10, + 0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x0f; + flash_instr = 0xb4, 0x07, 0x17; + eeprom_instr = + 0xbb, 0xff, 0xbb, 0xee, 0xbb, 0xcc, 0xb2, 0x0d, + 0xbc, 0x07, 0xb4, 0x07, 0xba, 0x0d, 0xbb, 0xbc, + 0x99, 0xe1, 0xbb, 0xac; + hventerstabdelay = 100; + latchcycles = 1; + togglevtg = 1; + poweroffdelay = 25; + resetdelayus = 70; + hvleavestabdelay = 100; + resetdelay = 25; + chiperasepolltimeout = 40; programfusepolltimeout = 25; programlockpolltimeout = 25; + synchcycles = 6; + spmcr = 0x57; + eecr = 0x3c; + ocdrev = 1; + chip_erase = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; - ocdrev = 1; + memory "eeprom" + size = 512; + page_size = 4; + min_write_delay = 4000; + max_write_delay = 4500; + readback = 0xff 0xff; + mode = 65; + delay = 6; + blocksize = 4; + readsize = 256; + read = "1010.0000--000x.xxxa--aaaa.aaaa--oooo.oooo"; + write = "1100.0000--000x.xxxa--aaaa.aaaa--iiii.iiii"; + loadpage_lo = "1100.0001--0000.0000--0000.00aa--iiii.iiii"; + writepage = "1100.0010--00xx.xxxa--aaaa.aa00--xxxx.xxxx"; + ; - memory "eeprom" - size = 512; - paged = no; - page_size = 4; - 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"; + memory "flash" + paged = yes; + size = 8192; + page_size = 64; + num_pages = 128; + min_write_delay = 4500; + max_write_delay = 4500; + readback = 0xff 0xff; + mode = 65; + delay = 6; + blocksize = 32; + readsize = 256; + read_lo = "0010.0000--0000.aaaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--0000.aaaa--aaaa.aaaa--oooo.oooo"; + loadpage_lo = "0100.0000--000x.xxxx--xxxa.aaaa--iiii.iiii"; + loadpage_hi = "0100.1000--000x.xxxx--xxxa.aaaa--iiii.iiii"; + writepage = "0100.1100--0000.aaaa--aaax.xxxx--xxxx.xxxx"; + ; - 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"; + memory "lfuse" + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii"; + ; - loadpage_lo = " 1 1 0 0 0 0 0 1", - " 0 0 0 0 0 0 0 0", - " 0 0 0 0 0 0 a1 a0", - " i i i i i i i i"; + memory "hfuse" + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii"; + ; - writepage = " 1 1 0 0 0 0 1 0", - " 0 0 x x x x x a8", - " a7 a6 a5 a4 a3 a2 0 0", - " x x x x x x x x"; + memory "efuse" + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0100--xxxx.xxxx--xxxx.xxxi"; + ; - 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; - ; + memory "lock" + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.0000--0000.0000--oooo.oooo"; + write = "1010.1100--111x.xxxx--xxxx.xxxx--xxxx.xxii"; + ; # ATtiny84 has Signature Bytes: 0x1E 0x93 0x0C. - 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 "signature" + size = 3; + read = "0011.0000--000x.xxxx--xxxx.xxaa--oooo.oooo"; + ; - 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 x x x x x x i i"; - read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", - "0 0 0 0 0 0 0 0 o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; - - 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; - - 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; - - 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; - - 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"; - ; - ; + memory "calibration" + size = 1; + read = "0011.1000--000x.xxxx--0000.000a--oooo.oooo"; + ; +; #------------------------------------------------------------ # ATtiny84A #------------------------------------------------------------ part parent "t84" - id = "t84a"; - desc = "ATtiny84A"; - ; + desc = "ATtiny84A"; + id = "t84a"; + mcuid = 25; +; #------------------------------------------------------------ # ATtiny441 #------------------------------------------------------------ part parent "t44" - id = "t441"; - desc = "ATtiny441"; - signature = 0x1e 0x92 0x15; + desc = "ATtiny441"; + id = "t441"; + mcuid = 32; + n_interrupts = 30; + n_page_erase = 4; + signature = 0x1e 0x92 0x15; - memory "flash" - paged = yes; - size = 4096; - page_size = 16; - 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"; + memory "flash" + page_size = 16; + num_pages = 256; + blocksize = 16; + loadpage_lo = "0100.0000--000x.xxxx--xxxx.xaaa--iiii.iiii"; + loadpage_hi = "0100.1000--000x.xxxx--xxxx.xaaa--iiii.iiii"; + writepage = "0100.1100--0000.0aaa--aaaa.axxx--xxxx.xxxx"; + ; - 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 x x 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 x x 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 a4 a3 x x x", - " x x x x x x x x"; - - mode = 0x41; - delay = 6; - blocksize = 16; - readsize = 256; - ; - - 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 i i 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + memory "efuse" + write = "1010.1100--1010.0100--xxxx.xxxx--iiii.iiii"; + ; ; #------------------------------------------------------------ @@ -12657,60 +10257,25 @@ part parent "t44" #------------------------------------------------------------ part parent "t84" - id = "t841"; - desc = "ATtiny841"; - signature = 0x1e 0x93 0x15; + desc = "ATtiny841"; + id = "t841"; + mcuid = 37; + n_interrupts = 30; + n_page_erase = 4; + signature = 0x1e 0x93 0x15; - memory "flash" - paged = yes; - size = 8192; - page_size = 16; - num_pages = 512; - 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"; + memory "flash" + page_size = 16; + num_pages = 512; + blocksize = 16; + loadpage_lo = "0100.0000--000x.xxxx--xxxx.xaaa--iiii.iiii"; + loadpage_hi = "0100.1000--000x.xxxx--xxxx.xaaa--iiii.iiii"; + writepage = "0100.1100--0000.aaaa--aaaa.axxx--xxxx.xxxx"; + ; - 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 x x 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 x x 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 a4 a3 x x x", - " x x x x x x x x"; - - mode = 0x41; - delay = 6; - blocksize = 16; - readsize = 256; - ; - - 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 i i 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + memory "efuse" + write = "1010.1100--1010.0100--xxxx.xxxx--iiii.iiii"; + ; ; #------------------------------------------------------------ @@ -12718,179 +10283,129 @@ part parent "t84" #------------------------------------------------------------ part - id = "t43u"; - desc = "ATtiny43U"; - has_debugwire = yes; - flash_instr = 0xB4, 0x07, 0x17; - eeprom_instr = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D, - 0xBC, 0x07, 0xB4, 0x07, 0xBA, 0x0D, 0xBB, 0xBC, - 0x99, 0xE1, 0xBB, 0xAC; - stk500_devcode = 0x14; -## avr910_devcode = ?; -## Try the AT90S2313 devcode: - avr910_devcode = 0x20; - signature = 0x1e 0x92 0x0C; - reset = io; - chip_erase_delay = 1000; - - 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; - pp_controlstack = 0x0E, 0x1E, 0x0E, 0x1E, 0x2E, 0x3E, 0x2E, 0x3E, 0x4E, 0x5E, - 0x4E, 0x5E, 0x6E, 0x7E, 0x6E, 0x7E, 0x06, 0x16, 0x46, 0x56, - 0x0A, 0x1A, 0x4A, 0x5A, 0x1E, 0x7C, 0x00, 0x01, 0x00, 0x00, - 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - hvspcmdexedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 20; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - resetdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; + desc = "ATtiny43U"; + id = "t43u"; + prog_modes = PM_SPM | PM_ISP | PM_HVPP | PM_debugWIRE; + mcuid = 19; + n_interrupts = 16; + stk500_devcode = 0x14; +# avr910_devcode = ?; +# Try the AT90S2313 devcode: + avr910_devcode = 0x20; + chip_erase_delay = 1000; + signature = 0x1e 0x92 0x0c; + reset = io; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + pp_controlstack = + 0x0e, 0x1e, 0x0e, 0x1e, 0x2e, 0x3e, 0x2e, 0x3e, + 0x4e, 0x5e, 0x4e, 0x5e, 0x6e, 0x7e, 0x6e, 0x7e, + 0x06, 0x16, 0x46, 0x56, 0x0a, 0x1a, 0x4a, 0x5a, + 0x1e, 0x7c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + flash_instr = 0xb4, 0x07, 0x17; + eeprom_instr = + 0xbb, 0xff, 0xbb, 0xee, 0xbb, 0xcc, 0xb2, 0x0d, + 0xbc, 0x07, 0xb4, 0x07, 0xba, 0x0d, 0xbb, 0xbc, + 0x99, 0xe1, 0xbb, 0xac; + hventerstabdelay = 100; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 20; + resetdelayms = 1; + hvleavestabdelay = 15; + resetdelay = 15; + chiperasepolltimeout = 10; programfusepolltimeout = 5; - programlockpulsewidth = 0; programlockpolltimeout = 5; + spmcr = 0x57; + eecr = 0x3c; + chip_erase = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; + memory "eeprom" - size = 64; - paged = yes; - page_size = 4; - num_pages = 16; - 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", - "0 0 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", - "0 0 a5 a4 a3 a2 a1 a0 i i i i i i i i"; - - loadpage_lo = " 1 1 0 0 0 0 0 1", - " 0 0 0 0 0 0 0 0", - " 0 0 0 0 0 0 a1 a0", - " i i i i i i i i"; - - writepage = " 1 1 0 0 0 0 1 0", - " 0 0 x x x x x x", - " 0 0 a5 a4 a3 a2 0 0", - " x x x x x x x x"; - - 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 = 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 = 10; - blocksize = 64; - readsize = 256; - ; - 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"; + paged = yes; + size = 64; + page_size = 4; + num_pages = 16; + min_write_delay = 4000; + max_write_delay = 4500; + readback = 0xff 0xff; + mode = 65; + delay = 5; + blocksize = 4; + readsize = 256; + read = "1010.0000--000x.xxxx--00aa.aaaa--oooo.oooo"; + write = "1100.0000--000x.xxxx--00aa.aaaa--iiii.iiii"; + loadpage_lo = "1100.0001--0000.0000--0000.00aa--iiii.iiii"; + writepage = "1100.0010--00xx.xxxx--00aa.aa00--xxxx.xxxx"; ; - 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 o o o o o o o o"; - min_write_delay = 4500; - max_write_delay = 4500; + + memory "flash" + paged = yes; + size = 4096; + page_size = 64; + num_pages = 64; + min_write_delay = 4500; + max_write_delay = 4500; + readback = 0xff 0xff; + mode = 65; + delay = 10; + blocksize = 64; + readsize = 256; + read_lo = "0010.0000--0000.0aaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--0000.0aaa--aaaa.aaaa--oooo.oooo"; + loadpage_lo = "0100.0000--000x.xxxx--xxxa.aaaa--iiii.iiii"; + loadpage_hi = "0100.1000--000x.xxxx--xxxa.aaaa--iiii.iiii"; + writepage = "0100.1100--0000.0aaa--aaax.xxxx--xxxx.xxxx"; ; 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"; - min_write_delay = 4500; - max_write_delay = 4500; - ; + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii"; + ; 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"; - min_write_delay = 4500; - max_write_delay = 4500; - ; + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii"; + ; 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"; + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0100--xxxx.xxxx--xxxx.xxxi"; + ; - 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"; - min_write_delay = 4500; - max_write_delay = 4500; + memory "lock" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii"; + ; + + memory "signature" + size = 3; + read = "0011.0000--000x.xxxx--xxxx.xxaa--oooo.oooo"; ; 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"; + size = 1; + read = "0011.1000--000x.xxxx--0000.000a--oooo.oooo"; ; ; @@ -12899,573 +10414,378 @@ part #------------------------------------------------------------ part - id = "m16u4"; - desc = "ATmega16U4"; - signature = 0x1e 0x94 0x88; - usbpid = 0x2ff4; - has_jtag = yes; -# stk500_devcode = 0xB2; -# avr910_devcode = 0x43; - 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 = 1; - - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; + desc = "ATmega16U4"; + id = "m16u4"; + prog_modes = PM_SPM | PM_ISP | PM_HVPP | PM_JTAG; + mcuid = 57; + n_interrupts = 43; + n_boot_sections = 4; + boot_section_size = 512; +# stk500_devcode = 0xB2; +# avr910_devcode = 0x43; + chip_erase_delay = 9000; + pagel = 0xd7; + bs2 = 0xa0; + signature = 0x1e 0x94 0x88; + usbpid = 0x2ff4; + reset = io; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + pp_controlstack = + 0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f, + 0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f, + 0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b, + 0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + hvleavestabdelay = 15; + chiperasepolltimeout = 10; programfusepolltimeout = 5; - programlockpulsewidth = 0; programlockpolltimeout = 5; - - idr = 0x31; - spmcr = 0x57; - rampz = 0x3b; - allowfullpagebitstream = no; - - ocdrev = 3; + idr = 0x31; + rampz = 0x3b; + spmcr = 0x57; + ocdrev = 3; + chip_erase = "1010.1100--1000.0000--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; 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 = 0x00; - readback_p2 = 0x00; - 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"; - - loadpage_lo = " 1 1 0 0 0 0 0 1", - " 0 0 0 0 0 0 0 0", - " 0 0 0 0 0 0 a1 a0", - " i i i i i i i i"; - - writepage = " 1 1 0 0 0 0 1 0", - " 0 0 x x x x x a8", - " a7 a6 a5 a4 a3 a2 0 0", - " x x x x x x x x"; - - mode = 0x41; - delay = 20; - blocksize = 4; - readsize = 256; - ; + size = 512; + page_size = 4; + min_write_delay = 9000; + max_write_delay = 9000; + mode = 65; + delay = 20; + blocksize = 4; + readsize = 256; + read = "1010.0000--xxxx.xxxa--aaaa.aaaa--oooo.oooo"; + write = "1100.0000--xxxx.xxxa--aaaa.aaaa--iiii.iiii"; + loadpage_lo = "1100.0001--0000.0000--0000.00aa--iiii.iiii"; + writepage = "1100.0010--00xx.xxxa--aaaa.aa00--xxxx.xxxx"; + ; memory "flash" - paged = yes; - size = 16384; - page_size = 128; - num_pages = 128; - 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 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 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", - " 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", - " a15 a14 a13 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; - ; + paged = yes; + size = 0x4000; + page_size = 128; + num_pages = 128; + min_write_delay = 4500; + max_write_delay = 4500; + mode = 65; + delay = 6; + blocksize = 128; + readsize = 256; + read_lo = "0010.0000--0aaa.aaaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--0aaa.aaaa--aaaa.aaaa--oooo.oooo"; + loadpage_lo = "0100.0000--xxxx.xxxx--xxaa.aaaa--iiii.iiii"; + loadpage_hi = "0100.1000--xxxx.xxxx--xxaa.aaaa--iiii.iiii"; + writepage = "0100.1100--aaaa.aaaa--aaxx.xxxx--xxxx.xxxx"; + ; 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii"; + ; 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii"; + ; 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 1 1 1 1 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0100--xxxx.xxxx--1111.iiii"; + ; 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 0 0 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; - - 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"; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.0000--xxxx.xxxx--00oo.oooo"; + write = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii"; + ; 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"; - ; - ; + size = 3; + read = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo"; + ; + + memory "calibration" + size = 1; + read = "0011.1000--xxxx.xxxx--0000.0000--oooo.oooo"; + ; +; #------------------------------------------------------------ # ATmega32u4 #------------------------------------------------------------ part - id = "m32u4"; - desc = "ATmega32U4"; - signature = 0x1e 0x95 0x87; - usbpid = 0x2ff4; - has_jtag = yes; -# stk500_devcode = 0xB2; -# avr910_devcode = 0x43; - 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 = 1; - - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; + desc = "ATmega32U4"; + id = "m32u4"; + prog_modes = PM_SPM | PM_ISP | PM_HVPP | PM_JTAG; + mcuid = 65; + n_interrupts = 43; + n_boot_sections = 4; + boot_section_size = 512; +# stk500_devcode = 0xB2; +# avr910_devcode = 0x43; + chip_erase_delay = 9000; + pagel = 0xd7; + bs2 = 0xa0; + signature = 0x1e 0x95 0x87; + usbpid = 0x2ff4; + reset = io; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + pp_controlstack = + 0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f, + 0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f, + 0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b, + 0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + hvleavestabdelay = 15; + chiperasepolltimeout = 10; programfusepolltimeout = 5; - programlockpulsewidth = 0; programlockpolltimeout = 5; - - idr = 0x31; - spmcr = 0x57; - rampz = 0x3b; - allowfullpagebitstream = no; - - ocdrev = 3; + idr = 0x31; + rampz = 0x3b; + spmcr = 0x57; + ocdrev = 3; + chip_erase = "1010.1100--1000.0000--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; 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 = 0x00; - readback_p2 = 0x00; - 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 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; - - loadpage_lo = " 1 1 0 0 0 0 0 1", - " 0 0 0 0 0 0 0 0", - " 0 0 0 0 0 0 a1 a0", - " i i i i i i i i"; - - writepage = " 1 1 0 0 0 0 1 0", - " 0 0 x x x a10 a9 a8", - " a7 a6 a5 a4 a3 a2 0 0", - " x x x x x x x x"; - - mode = 0x41; - delay = 20; - blocksize = 4; - readsize = 256; - ; + size = 1024; + page_size = 4; + min_write_delay = 9000; + max_write_delay = 9000; + mode = 65; + delay = 20; + blocksize = 4; + readsize = 256; + read = "1010.0000--xxxx.xaaa--aaaa.aaaa--oooo.oooo"; + write = "1100.0000--xxxx.xaaa--aaaa.aaaa--iiii.iiii"; + loadpage_lo = "1100.0001--0000.0000--0000.00aa--iiii.iiii"; + writepage = "1100.0010--00xx.xaaa--aaaa.aa00--xxxx.xxxx"; + ; memory "flash" - paged = yes; - size = 32768; - page_size = 128; - num_pages = 256; - 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 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 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", - " 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", - " a15 a14 a13 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; - ; + paged = yes; + size = 0x8000; + page_size = 128; + num_pages = 256; + min_write_delay = 4500; + max_write_delay = 4500; + mode = 65; + delay = 6; + blocksize = 128; + readsize = 256; + read_lo = "0010.0000--0aaa.aaaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--0aaa.aaaa--aaaa.aaaa--oooo.oooo"; + loadpage_lo = "0100.0000--xxxx.xxxx--xxaa.aaaa--iiii.iiii"; + loadpage_hi = "0100.1000--xxxx.xxxx--xxaa.aaaa--iiii.iiii"; + writepage = "0100.1100--aaaa.aaaa--aaxx.xxxx--xxxx.xxxx"; + ; 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii"; + ; 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii"; + ; 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 1 1 1 1 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0100--xxxx.xxxx--1111.iiii"; + ; 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 o o 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; - - 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"; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii"; + ; 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"; - ; - ; + size = 3; + read = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo"; + ; + + memory "calibration" + size = 1; + read = "0011.1000--xxxx.xxxx--0000.0000--oooo.oooo"; + ; +; #------------------------------------------------------------ # AT90USB646 #------------------------------------------------------------ part - id = "usb646"; - desc = "AT90USB646"; - signature = 0x1e 0x96 0x82; - usbpid = 0x2ff9; - has_jtag = yes; -# stk500_devcode = 0xB2; -# avr910_devcode = 0x43; - 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 = 1; - - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; + desc = "AT90USB646"; + id = "usb646"; + prog_modes = PM_SPM | PM_ISP | PM_HVPP | PM_JTAG; + mcuid = 181; + n_interrupts = 38; + n_boot_sections = 4; + boot_section_size = 1024; +# stk500_devcode = 0xB2; +# avr910_devcode = 0x43; + chip_erase_delay = 9000; + pagel = 0xd7; + bs2 = 0xa0; + signature = 0x1e 0x96 0x82; + usbpid = 0x2ff9; + reset = io; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + pp_controlstack = + 0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f, + 0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f, + 0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b, + 0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + hvleavestabdelay = 15; + chiperasepolltimeout = 10; programfusepolltimeout = 5; - programlockpulsewidth = 0; programlockpolltimeout = 5; - - idr = 0x31; - spmcr = 0x57; - rampz = 0x3b; - allowfullpagebitstream = no; - - ocdrev = 3; + idr = 0x31; + rampz = 0x3b; + spmcr = 0x57; + ocdrev = 3; + chip_erase = "1010.1100--1000.0000--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; 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 = 0x00; - readback_p2 = 0x00; - 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 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; - - loadpage_lo = " 1 1 0 0 0 0 0 1", - " 0 0 0 0 0 0 0 0", - " 0 0 0 0 0 a2 a1 a0", - " i i i i i i i i"; - - writepage = " 1 1 0 0 0 0 1 0", - " 0 0 x x x a10 a9 a8", - " a7 a6 a5 a4 a3 0 0 0", - " x x x x x x x x"; - - mode = 0x41; - delay = 10; - blocksize = 8; - readsize = 256; - ; + size = 2048; + page_size = 8; + min_write_delay = 9000; + max_write_delay = 9000; + mode = 65; + delay = 10; + blocksize = 8; + readsize = 256; + read = "1010.0000--xxxx.xaaa--aaaa.aaaa--oooo.oooo"; + write = "1100.0000--xxxx.xaaa--aaaa.aaaa--iiii.iiii"; + loadpage_lo = "1100.0001--0000.0000--0000.0aaa--iiii.iiii"; + writepage = "1100.0010--00xx.xaaa--aaaa.a000--xxxx.xxxx"; + ; memory "flash" - paged = yes; - size = 65536; - page_size = 256; - num_pages = 256; - 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 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 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 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 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 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; - ; + paged = yes; + size = 0x10000; + page_size = 256; + num_pages = 256; + min_write_delay = 4500; + max_write_delay = 4500; + mode = 65; + delay = 6; + blocksize = 256; + readsize = 256; + read_lo = "0010.0000--0aaa.aaaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--0aaa.aaaa--aaaa.aaaa--oooo.oooo"; + loadpage_lo = "0100.0000--xxxx.xxxx--xaaa.aaaa--iiii.iiii"; + loadpage_hi = "0100.1000--xxxx.xxxx--xaaa.aaaa--iiii.iiii"; + writepage = "0100.1100--0aaa.aaaa--axxx.xxxx--xxxx.xxxx"; + ; 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii"; + ; 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii"; + ; 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0100--xxxx.xxxx--xxxx.iiii"; + ; 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 o o 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; - - 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"; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii"; + ; 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"; - ; - ; + size = 3; + read = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo"; + ; + + memory "calibration" + size = 1; + read = "0011.1000--xxxx.xxxx--0000.0000--oooo.oooo"; + ; +; #------------------------------------------------------------ # AT90USB647 @@ -13473,203 +10793,136 @@ part # identical to AT90USB646 part parent "usb646" - id = "usb647"; - desc = "AT90USB647"; - signature = 0x1e 0x96 0x82; - - ocdrev = 3; - ; + desc = "AT90USB647"; + id = "usb647"; + mcuid = 182; +; #------------------------------------------------------------ # AT90USB1286 #------------------------------------------------------------ part - id = "usb1286"; - desc = "AT90USB1286"; - signature = 0x1e 0x97 0x82; - usbpid = 0x2ffb; - has_jtag = yes; -# stk500_devcode = 0xB2; -# avr910_devcode = 0x43; - 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 = 1; - - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; + desc = "AT90USB1286"; + id = "usb1286"; + prog_modes = PM_SPM | PM_ISP | PM_HVPP | PM_JTAG; + mcuid = 184; + n_interrupts = 38; + n_boot_sections = 4; + boot_section_size = 1024; +# stk500_devcode = 0xB2; +# avr910_devcode = 0x43; + chip_erase_delay = 9000; + pagel = 0xd7; + bs2 = 0xa0; + signature = 0x1e 0x97 0x82; + usbpid = 0x2ffb; + reset = io; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + pp_controlstack = + 0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f, + 0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f, + 0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b, + 0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + hvleavestabdelay = 15; + chiperasepolltimeout = 10; programfusepolltimeout = 5; - programlockpulsewidth = 0; programlockpolltimeout = 5; - - idr = 0x31; - spmcr = 0x57; - rampz = 0x3b; - allowfullpagebitstream = no; - - ocdrev = 3; + idr = 0x31; + rampz = 0x3b; + spmcr = 0x57; + ocdrev = 3; + chip_erase = "1010.1100--1000.0000--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; memory "eeprom" - paged = no; /* leave this "no" */ - page_size = 8; /* for parallel programming */ - size = 4096; - min_write_delay = 9000; - max_write_delay = 9000; - readback_p1 = 0x00; - readback_p2 = 0x00; - 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", - " x x x x a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; - - loadpage_lo = " 1 1 0 0 0 0 0 1", - " 0 0 0 0 0 0 0 0", - " 0 0 0 0 0 a2 a1 a0", - " i i i i i i i i"; - - writepage = " 1 1 0 0 0 0 1 0", - " 0 0 x x a11 a10 a9 a8", - " a7 a6 a5 a4 a3 0 0 0", - " x x x x x x x x"; - - mode = 0x41; - delay = 10; - blocksize = 8; - readsize = 256; - ; + size = 4096; + page_size = 8; + min_write_delay = 9000; + max_write_delay = 9000; + mode = 65; + delay = 10; + blocksize = 8; + readsize = 256; + read = "1010.0000--xxxx.aaaa--aaaa.aaaa--oooo.oooo"; + write = "1100.0000--xxxx.aaaa--aaaa.aaaa--iiii.iiii"; + loadpage_lo = "1100.0001--0000.0000--0000.0aaa--iiii.iiii"; + writepage = "1100.0010--00xx.aaaa--aaaa.a000--xxxx.xxxx"; + ; memory "flash" - paged = yes; - size = 131072; - page_size = 256; - num_pages = 512; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0x00; - readback_p2 = 0x00; - 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", - "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 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 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; - - writepage = " 0 1 0 0 1 1 0 0", - "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; - ; + paged = yes; + size = 0x20000; + page_size = 256; + num_pages = 512; + min_write_delay = 4500; + max_write_delay = 4500; + mode = 65; + delay = 6; + blocksize = 256; + readsize = 256; + read_lo = "0010.0000--aaaa.aaaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--aaaa.aaaa--aaaa.aaaa--oooo.oooo"; + loadpage_lo = "0100.0000--xxxx.xxxx--xaaa.aaaa--iiii.iiii"; + loadpage_hi = "0100.1000--xxxx.xxxx--xaaa.aaaa--iiii.iiii"; + writepage = "0100.1100--aaaa.aaaa--axxx.xxxx--xxxx.xxxx"; + ; 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii"; + ; 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii"; + ; 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0100--xxxx.xxxx--xxxx.iiii"; + ; 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 o o 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; - - 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"; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii"; + ; 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"; - ; - ; + size = 3; + read = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo"; + ; + + memory "calibration" + size = 1; + read = "0011.1000--xxxx.xxxx--0000.0000--oooo.oooo"; + ; +; #------------------------------------------------------------ # AT90USB1287 @@ -13677,1721 +10930,1236 @@ part # identical to AT90USB1286 part parent "usb1286" - id = "usb1287"; - desc = "AT90USB1287"; - signature = 0x1e 0x97 0x82; - - ocdrev = 3; - ; + desc = "AT90USB1287"; + id = "usb1287"; + mcuid = 185; +; #------------------------------------------------------------ # AT90USB162 #------------------------------------------------------------ part - id = "usb162"; - desc = "AT90USB162"; - has_jtag = no; - has_debugwire = yes; - signature = 0x1e 0x94 0x82; - usbpid = 0x2ffa; - chip_erase_delay = 9000; - reset = io; - 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"; - pagel = 0xD7; - bs2 = 0xC6; - - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 1; - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; + desc = "AT90USB162"; + id = "usb162"; + prog_modes = PM_SPM | PM_ISP | PM_HVPP | PM_debugWIRE; + mcuid = 178; + n_interrupts = 29; + n_boot_sections = 4; + boot_section_size = 512; + chip_erase_delay = 9000; + pagel = 0xd7; + bs2 = 0xc6; + signature = 0x1e 0x94 0x82; + usbpid = 0x2ffa; + reset = io; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + pp_controlstack = + 0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f, + 0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f, + 0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b, + 0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + hvleavestabdelay = 15; + chiperasepolltimeout = 10; programfusepolltimeout = 5; - programlockpulsewidth = 0; programlockpolltimeout = 5; - - ocdrev = 1; + spmcr = 0x57; + eecr = 0x3f; + eind = 0x5c; + ocdrev = 1; + chip_erase = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; memory "eeprom" - paged = no; /* leave this "no" */ - page_size = 4; /* for parallel programming */ - size = 512; - num_pages = 128; - min_write_delay = 9000; - max_write_delay = 9000; - readback_p1 = 0x00; - readback_p2 = 0x00; - read = " 1 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"; - - write = " 1 1 0 0 0 0 0 0", - " 0 0 0 0 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; - - loadpage_lo = " 1 1 0 0 0 0 0 1", - " 0 0 0 0 0 0 0 0", - " 0 0 0 0 0 0 a1 a0", - " i i i i i i i i"; - - writepage = " 1 1 0 0 0 0 1 0", - " 0 0 0 0 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 0 0", - " x x x x x x x x"; - - mode = 0x41; - delay = 20; - blocksize = 4; - readsize = 256; - ; + size = 512; + page_size = 4; + num_pages = 128; + min_write_delay = 9000; + max_write_delay = 9000; + mode = 65; + delay = 20; + blocksize = 4; + readsize = 256; + read = "1010.0000--0000.aaaa--aaaa.aaaa--oooo.oooo"; + write = "1100.0000--0000.aaaa--aaaa.aaaa--iiii.iiii"; + loadpage_lo = "1100.0001--0000.0000--0000.00aa--iiii.iiii"; + writepage = "1100.0010--0000.aaaa--aaaa.aa00--xxxx.xxxx"; + ; memory "flash" - paged = yes; - size = 16384; - page_size = 128; - num_pages = 128; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0x00; - readback_p2 = 0x00; - 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", - "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", - " 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", - "a15 a14 a13 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; - ; + paged = yes; + size = 0x4000; + page_size = 128; + num_pages = 128; + min_write_delay = 4500; + max_write_delay = 4500; + mode = 65; + delay = 6; + blocksize = 128; + readsize = 256; + read_lo = "0010.0000--aaaa.aaaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--aaaa.aaaa--aaaa.aaaa--oooo.oooo"; + loadpage_lo = "0100.0000--xxxx.xxxx--xxaa.aaaa--iiii.iiii"; + loadpage_hi = "0100.1000--xxxx.xxxx--xxaa.aaaa--iiii.iiii"; + writepage = "0100.1100--aaaa.aaaa--aaxx.xxxx--xxxx.xxxx"; + ; 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii"; + ; 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii"; + ; 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 i i 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0100--xxxx.xxxx--iiii.iiii"; + ; 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 o o o o o o o o"; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii"; + ; - 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + memory "signature" + size = 3; + read = "0011.0000--000x.xxxx--xxxx.xxaa--oooo.oooo"; + ; 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"; - ; - ; + size = 1; + read = "0011.1000--000x.xxxx--0000.0000--oooo.oooo"; + ; +; #------------------------------------------------------------ # AT90USB82 #------------------------------------------------------------ -# Changes against AT90USB162 (beside IDs) -# memory "flash" -# size = 8192; -# num_pages = 64; part - id = "usb82"; - desc = "AT90USB82"; - has_jtag = no; - has_debugwire = yes; - signature = 0x1e 0x93 0x82; - usbpid = 0x2ff7; - chip_erase_delay = 9000; - reset = io; - 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"; - pagel = 0xD7; - bs2 = 0xC6; - - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 1; - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; + desc = "AT90USB82"; + id = "usb82"; + prog_modes = PM_SPM | PM_ISP | PM_HVPP | PM_debugWIRE; + mcuid = 174; + n_interrupts = 29; + n_boot_sections = 4; + boot_section_size = 512; + chip_erase_delay = 9000; + pagel = 0xd7; + bs2 = 0xc6; + signature = 0x1e 0x93 0x82; + usbpid = 0x2ff7; + reset = io; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + pp_controlstack = + 0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f, + 0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f, + 0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b, + 0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + hvleavestabdelay = 15; + chiperasepolltimeout = 10; programfusepolltimeout = 5; - programlockpulsewidth = 0; programlockpolltimeout = 5; - - ocdrev = 1; + spmcr = 0x57; + eecr = 0x3f; + eind = 0x5c; + ocdrev = 1; + chip_erase = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; memory "eeprom" - paged = no; /* leave this "no" */ - page_size = 4; /* for parallel programming */ - size = 512; - num_pages = 128; - min_write_delay = 9000; - max_write_delay = 9000; - readback_p1 = 0x00; - readback_p2 = 0x00; - read = " 1 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"; - - write = " 1 1 0 0 0 0 0 0", - " 0 0 0 0 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; - - loadpage_lo = " 1 1 0 0 0 0 0 1", - " 0 0 0 0 0 0 0 0", - " 0 0 0 0 0 0 a1 a0", - " i i i i i i i i"; - - writepage = " 1 1 0 0 0 0 1 0", - " 0 0 0 0 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 0 0", - " x x x x x x x x"; - - mode = 0x41; - delay = 20; - blocksize = 4; - readsize = 256; - ; + size = 512; + page_size = 4; + num_pages = 128; + min_write_delay = 9000; + max_write_delay = 9000; + mode = 65; + delay = 20; + blocksize = 4; + readsize = 256; + read = "1010.0000--0000.aaaa--aaaa.aaaa--oooo.oooo"; + write = "1100.0000--0000.aaaa--aaaa.aaaa--iiii.iiii"; + loadpage_lo = "1100.0001--0000.0000--0000.00aa--iiii.iiii"; + writepage = "1100.0010--0000.aaaa--aaaa.aa00--xxxx.xxxx"; + ; memory "flash" - paged = yes; - size = 8192; - page_size = 128; - 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", - "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", - "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", - " 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", - "a15 a14 a13 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; - ; + paged = yes; + size = 8192; + page_size = 128; + num_pages = 64; + min_write_delay = 4500; + max_write_delay = 4500; + mode = 65; + delay = 6; + blocksize = 128; + readsize = 256; + read_lo = "0010.0000--aaaa.aaaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--aaaa.aaaa--aaaa.aaaa--oooo.oooo"; + loadpage_lo = "0100.0000--xxxx.xxxx--xxaa.aaaa--iiii.iiii"; + loadpage_hi = "0100.1000--xxxx.xxxx--xxaa.aaaa--iiii.iiii"; + writepage = "0100.1100--aaaa.aaaa--aaxx.xxxx--xxxx.xxxx"; + ; 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii"; + ; 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii"; + ; 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 i i 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0100--xxxx.xxxx--iiii.iiii"; + ; 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 o o o o o o o o"; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii"; + ; - 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + memory "signature" + size = 3; + read = "0011.0000--000x.xxxx--xxxx.xxaa--oooo.oooo"; + ; 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"; - ; - ; + size = 1; + read = "0011.1000--000x.xxxx--0000.0000--oooo.oooo"; + ; +; #------------------------------------------------------------ # ATmega32U2 #------------------------------------------------------------ -# Changes against AT90USB162 (beside IDs) -# memory "flash" -# size = 32768; -# num_pages = 256; -# memory "eeprom" -# size = 1024; -# num_pages = 256; + part - id = "m32u2"; - desc = "ATmega32U2"; - has_jtag = no; - has_debugwire = yes; - signature = 0x1e 0x95 0x8a; - usbpid = 0x2ff0; - chip_erase_delay = 9000; - reset = io; - 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"; - pagel = 0xD7; - bs2 = 0xC6; - - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 1; - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; + desc = "ATmega32U2"; + id = "m32u2"; + prog_modes = PM_SPM | PM_ISP | PM_HVPP | PM_debugWIRE; + mcuid = 64; + n_interrupts = 29; + n_boot_sections = 4; + boot_section_size = 512; + chip_erase_delay = 9000; + pagel = 0xd7; + bs2 = 0xc6; + signature = 0x1e 0x95 0x8a; + usbpid = 0x2ff0; + reset = io; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + pp_controlstack = + 0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f, + 0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f, + 0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b, + 0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + hvleavestabdelay = 15; + chiperasepolltimeout = 10; programfusepolltimeout = 5; - programlockpulsewidth = 0; programlockpolltimeout = 5; - - ocdrev = 1; + spmcr = 0x57; + eecr = 0x3f; + eind = 0x5c; + ocdrev = 1; + chip_erase = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; memory "eeprom" - paged = no; /* leave this "no" */ - page_size = 4; /* for parallel programming */ - size = 1024; - num_pages = 256; - min_write_delay = 9000; - max_write_delay = 9000; - readback_p1 = 0x00; - readback_p2 = 0x00; - read = " 1 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"; - - write = " 1 1 0 0 0 0 0 0", - " 0 0 0 0 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; - - loadpage_lo = " 1 1 0 0 0 0 0 1", - " 0 0 0 0 0 0 0 0", - " 0 0 0 0 0 0 a1 a0", - " i i i i i i i i"; - - writepage = " 1 1 0 0 0 0 1 0", - " 0 0 0 0 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 0 0", - " x x x x x x x x"; - - mode = 0x41; - delay = 20; - blocksize = 4; - readsize = 256; - ; + size = 1024; + page_size = 4; + num_pages = 256; + min_write_delay = 9000; + max_write_delay = 9000; + mode = 65; + delay = 20; + blocksize = 4; + readsize = 256; + read = "1010.0000--0000.aaaa--aaaa.aaaa--oooo.oooo"; + write = "1100.0000--0000.aaaa--aaaa.aaaa--iiii.iiii"; + loadpage_lo = "1100.0001--0000.0000--0000.00aa--iiii.iiii"; + writepage = "1100.0010--0000.aaaa--aaaa.aa00--xxxx.xxxx"; + ; memory "flash" - paged = yes; - size = 32768; - page_size = 128; - num_pages = 256; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0x00; - readback_p2 = 0x00; - 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", - "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", - " 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", - "a15 a14 a13 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; - ; + paged = yes; + size = 0x8000; + page_size = 128; + num_pages = 256; + min_write_delay = 4500; + max_write_delay = 4500; + mode = 65; + delay = 6; + blocksize = 128; + readsize = 256; + read_lo = "0010.0000--aaaa.aaaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--aaaa.aaaa--aaaa.aaaa--oooo.oooo"; + loadpage_lo = "0100.0000--xxxx.xxxx--xxaa.aaaa--iiii.iiii"; + loadpage_hi = "0100.1000--xxxx.xxxx--xxaa.aaaa--iiii.iiii"; + writepage = "0100.1100--aaaa.aaaa--aaxx.xxxx--xxxx.xxxx"; + ; 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii"; + ; 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii"; + ; 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 i i 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0100--xxxx.xxxx--iiii.iiii"; + ; 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 o o o o o o o o"; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii"; + ; - 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + memory "signature" + size = 3; + read = "0011.0000--000x.xxxx--xxxx.xxaa--oooo.oooo"; + ; 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"; - ; - ; + size = 1; + read = "0011.1000--000x.xxxx--0000.0000--oooo.oooo"; + ; +; + #------------------------------------------------------------ # ATmega16U2 #------------------------------------------------------------ -# Changes against ATmega32U2 (beside IDs) -# memory "flash" -# size = 16384; -# num_pages = 128; -# memory "eeprom" -# size = 512; -# num_pages = 128; + part - id = "m16u2"; - desc = "ATmega16U2"; - has_jtag = no; - has_debugwire = yes; - signature = 0x1e 0x94 0x89; - usbpid = 0x2fef; - chip_erase_delay = 9000; - reset = io; - 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"; - pagel = 0xD7; - bs2 = 0xC6; - - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 1; - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; + desc = "ATmega16U2"; + id = "m16u2"; + prog_modes = PM_SPM | PM_ISP | PM_HVPP | PM_debugWIRE; + mcuid = 56; + n_interrupts = 29; + n_boot_sections = 4; + boot_section_size = 512; + chip_erase_delay = 9000; + pagel = 0xd7; + bs2 = 0xc6; + signature = 0x1e 0x94 0x89; + usbpid = 0x2fef; + reset = io; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + pp_controlstack = + 0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f, + 0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f, + 0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b, + 0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + hvleavestabdelay = 15; + chiperasepolltimeout = 10; programfusepolltimeout = 5; - programlockpulsewidth = 0; programlockpolltimeout = 5; - - ocdrev = 1; + spmcr = 0x57; + eecr = 0x3f; + eind = 0x5c; + ocdrev = 1; + chip_erase = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; memory "eeprom" - paged = no; /* leave this "no" */ - page_size = 4; /* for parallel programming */ - size = 512; - num_pages = 128; - min_write_delay = 9000; - max_write_delay = 9000; - readback_p1 = 0x00; - readback_p2 = 0x00; - read = " 1 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"; - - write = " 1 1 0 0 0 0 0 0", - " 0 0 0 0 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; - - loadpage_lo = " 1 1 0 0 0 0 0 1", - " 0 0 0 0 0 0 0 0", - " 0 0 0 0 0 0 a1 a0", - " i i i i i i i i"; - - writepage = " 1 1 0 0 0 0 1 0", - " 0 0 0 0 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 0 0", - " x x x x x x x x"; - - mode = 0x41; - delay = 20; - blocksize = 4; - readsize = 256; - ; + size = 512; + page_size = 4; + num_pages = 128; + min_write_delay = 9000; + max_write_delay = 9000; + mode = 65; + delay = 20; + blocksize = 4; + readsize = 256; + read = "1010.0000--0000.aaaa--aaaa.aaaa--oooo.oooo"; + write = "1100.0000--0000.aaaa--aaaa.aaaa--iiii.iiii"; + loadpage_lo = "1100.0001--0000.0000--0000.00aa--iiii.iiii"; + writepage = "1100.0010--0000.aaaa--aaaa.aa00--xxxx.xxxx"; + ; memory "flash" - paged = yes; - size = 16384; - page_size = 128; - num_pages = 128; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0x00; - readback_p2 = 0x00; - 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", - "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", - " 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", - "a15 a14 a13 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; - ; + paged = yes; + size = 0x4000; + page_size = 128; + num_pages = 128; + min_write_delay = 4500; + max_write_delay = 4500; + mode = 65; + delay = 6; + blocksize = 128; + readsize = 256; + read_lo = "0010.0000--aaaa.aaaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--aaaa.aaaa--aaaa.aaaa--oooo.oooo"; + loadpage_lo = "0100.0000--xxxx.xxxx--xxaa.aaaa--iiii.iiii"; + loadpage_hi = "0100.1000--xxxx.xxxx--xxaa.aaaa--iiii.iiii"; + writepage = "0100.1100--aaaa.aaaa--aaxx.xxxx--xxxx.xxxx"; + ; 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii"; + ; 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii"; + ; 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 i i 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0100--xxxx.xxxx--iiii.iiii"; + ; 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 o o o o o o o o"; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii"; + ; - 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + memory "signature" + size = 3; + read = "0011.0000--000x.xxxx--xxxx.xxaa--oooo.oooo"; + ; 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"; - ; - ; + size = 1; + read = "0011.1000--000x.xxxx--0000.0000--oooo.oooo"; + ; +; #------------------------------------------------------------ # ATmega8U2 #------------------------------------------------------------ -# Changes against ATmega16U2 (beside IDs) -# memory "flash" -# size = 8192; -# page_size = 64; -# blocksize = 64; part - id = "m8u2"; - desc = "ATmega8U2"; - has_jtag = no; - has_debugwire = yes; - signature = 0x1e 0x93 0x89; - usbpid = 0x2fee; - chip_erase_delay = 9000; - reset = io; - 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"; - pagel = 0xD7; - bs2 = 0xC6; - - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 1; - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; + desc = "ATmega8U2"; + id = "m8u2"; + prog_modes = PM_SPM | PM_ISP | PM_HVPP | PM_debugWIRE; + mcuid = 48; + n_interrupts = 29; + n_boot_sections = 4; + boot_section_size = 512; + chip_erase_delay = 9000; + pagel = 0xd7; + bs2 = 0xc6; + signature = 0x1e 0x93 0x89; + usbpid = 0x2fee; + reset = io; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + pp_controlstack = + 0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f, + 0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f, + 0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b, + 0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + hvleavestabdelay = 15; + chiperasepolltimeout = 10; programfusepolltimeout = 5; - programlockpulsewidth = 0; programlockpolltimeout = 5; - - ocdrev = 1; + spmcr = 0x57; + eecr = 0x3f; + eind = 0x5c; + ocdrev = 1; + chip_erase = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; memory "eeprom" - paged = no; /* leave this "no" */ - page_size = 4; /* for parallel programming */ - size = 512; - num_pages = 128; - min_write_delay = 9000; - max_write_delay = 9000; - readback_p1 = 0x00; - readback_p2 = 0x00; - read = " 1 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"; - - write = " 1 1 0 0 0 0 0 0", - " 0 0 0 0 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; - - loadpage_lo = " 1 1 0 0 0 0 0 1", - " 0 0 0 0 0 0 0 0", - " 0 0 0 0 0 0 a1 a0", - " i i i i i i i i"; - - writepage = " 1 1 0 0 0 0 1 0", - " 0 0 0 0 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 0 0", - " x x x x x x x x"; - - mode = 0x41; - delay = 20; - blocksize = 4; - readsize = 256; - ; + size = 512; + page_size = 4; + num_pages = 128; + min_write_delay = 9000; + max_write_delay = 9000; + mode = 65; + delay = 20; + blocksize = 4; + readsize = 256; + read = "1010.0000--0000.aaaa--aaaa.aaaa--oooo.oooo"; + write = "1100.0000--0000.aaaa--aaaa.aaaa--iiii.iiii"; + loadpage_lo = "1100.0001--0000.0000--0000.00aa--iiii.iiii"; + writepage = "1100.0010--0000.aaaa--aaaa.aa00--xxxx.xxxx"; + ; memory "flash" - paged = yes; - size = 8192; - page_size = 128; - 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", - "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", - "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", - " 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", - "a15 a14 a13 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; - ; + paged = yes; + size = 8192; + page_size = 128; + num_pages = 64; + min_write_delay = 4500; + max_write_delay = 4500; + mode = 65; + delay = 6; + blocksize = 128; + readsize = 256; + read_lo = "0010.0000--aaaa.aaaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--aaaa.aaaa--aaaa.aaaa--oooo.oooo"; + loadpage_lo = "0100.0000--xxxx.xxxx--xxaa.aaaa--iiii.iiii"; + loadpage_hi = "0100.1000--xxxx.xxxx--xxaa.aaaa--iiii.iiii"; + writepage = "0100.1100--aaaa.aaaa--aaxx.xxxx--xxxx.xxxx"; + ; 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii"; + ; 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii"; + ; 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 i i 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0100--xxxx.xxxx--iiii.iiii"; + ; 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 o o o o o o o o"; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii"; + ; - 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"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + memory "signature" + size = 3; + read = "0011.0000--000x.xxxx--xxxx.xxaa--oooo.oooo"; + ; 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"; - ; - ; + size = 1; + read = "0011.1000--000x.xxxx--0000.0000--oooo.oooo"; + ; +; #------------------------------------------------------------ # ATmega165 #------------------------------------------------------------ part - id = "m165"; - desc = "ATmega165"; - signature = 0x1e 0x94 0x10; - has_jtag = yes; -# stk500_devcode = 0x??; -# avr910_devcode = 0x??; - chip_erase_delay = 9000; - reset = io; - 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 x x x x x", - "x x x x x x x x x x x x x x x x"; - + desc = "ATmega165"; + id = "m165"; + prog_modes = PM_SPM | PM_ISP | PM_HVPP | PM_JTAG; + mcuid = 95; + n_interrupts = 22; + n_boot_sections = 4; + boot_section_size = 256; +# stk500_devcode = 0x??; +# avr910_devcode = 0x??; + chip_erase_delay = 9000; + pagel = 0xd7; + bs2 = 0xa0; + signature = 0x1e 0x94 0x10; + reset = io; timeout = 200; stabdelay = 100; cmdexedelay = 25; synchloops = 32; - bytedelay = 0; pollindex = 3; pollvalue = 0x53; predelay = 1; postdelay = 1; pollmethod = 1; - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + 0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f, + 0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f, + 0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b, + 0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; hventerstabdelay = 100; - progmodedelay = 0; latchcycles = 6; - togglevtg = 0; - poweroffdelay = 0; - resetdelayms = 0; - resetdelayus = 0; hvleavestabdelay = 15; - chiperasepulsewidth = 0; resetdelay = 15; chiperasepolltimeout = 10; - programfusepulsewidth = 0; programfusepolltimeout = 5; - programlockpulsewidth = 0; programlockpolltimeout = 5; - idr = 0x31; spmcr = 0x57; eecr = 0x3f; - allowfullpagebitstream = no; - ocdrev = 3; + chip_erase = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; memory "eeprom" - paged = no; - page_size = 4; - size = 512; - num_pages = 128; - min_write_delay = 3600; - max_write_delay = 3600; - readback_p1 = 0x00; - readback_p2 = 0x00; - read = " 1 0 1 0 0 0 0 0", - " 0 0 0 0 0 0 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 0 0 0 x a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; - - loadpage_lo = " 1 1 0 0 0 0 0 1", - " 0 0 0 0 0 0 0 0", - " 0 0 0 0 0 0 a1 a0", - " i i i i i i i i"; - - writepage = " 1 1 0 0 0 0 1 0", - " 0 0 0 0 0 0 x a8", - " a7 a6 a5 a4 a3 a2 0 0", - " x x x x x x x x"; - - mode = 0x41; - delay = 20; - blocksize = 4; - readsize = 256; - ; + size = 512; + page_size = 4; + num_pages = 128; + min_write_delay = 3600; + max_write_delay = 3600; + mode = 65; + delay = 20; + blocksize = 4; + readsize = 256; + read = "1010.0000--0000.00xa--aaaa.aaaa--oooo.oooo"; + write = "1100.0000--0000.00xa--aaaa.aaaa--iiii.iiii"; + loadpage_lo = "1100.0001--0000.0000--0000.00aa--iiii.iiii"; + writepage = "1100.0010--0000.00xa--aaaa.aa00--xxxx.xxxx"; + ; memory "flash" - paged = yes; - size = 16384; - page_size = 128; - num_pages = 128; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0x00; - readback_p2 = 0x00; - 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", - " 0 0 0 0 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 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 = 0x41; - delay = 10; - blocksize = 128; - readsize = 256; - ; + paged = yes; + size = 0x4000; + page_size = 128; + num_pages = 128; + min_write_delay = 4500; + max_write_delay = 4500; + mode = 65; + delay = 10; + blocksize = 128; + readsize = 256; + read_lo = "0010.0000--xxxa.aaaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--xxxa.aaaa--aaaa.aaaa--oooo.oooo"; + loadpage_lo = "0100.0000--0000.xxxx--xxaa.aaaa--iiii.iiii"; + loadpage_hi = "0100.1000--0000.xxxx--xxaa.aaaa--iiii.iiii"; + writepage = "0100.1100--xxxa.aaaa--aaxx.xxxx--xxxx.xxxx"; + ; 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"; - ; + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii"; + ; 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"; - ; + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii"; + ; 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 x x x x i i i i"; - ; + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0100--xxxx.xxxx--xxxx.iiii"; + ; 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 o o 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"; - ; + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii"; + ; memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x a1 a0 o o o o o o o o"; - ; + size = 3; + read = "0011.0000--0000.0000--xxxx.xxaa--oooo.oooo"; + ; memory "calibration" - size = 1; - read = "0 0 1 1 1 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"; - ; - ; + size = 1; + read = "0011.1000--0000.0000--xxxx.xxxx--oooo.oooo"; + ; +; #------------------------------------------------------------ # ATmega165A #------------------------------------------------------------ part parent "m165" - id = "m165a"; - desc = "ATmega165A"; - signature = 0x1e 0x94 0x10; - ; + desc = "ATmega165A"; + id = "m165a"; + mcuid = 96; +; #------------------------------------------------------------ # ATmega165P #------------------------------------------------------------ part parent "m165" - id = "m165p"; - desc = "ATmega165P"; - signature = 0x1e 0x94 0x07; - ; + desc = "ATmega165P"; + id = "m165p"; + mcuid = 97; + signature = 0x1e 0x94 0x07; +; #------------------------------------------------------------ # ATmega165PA #------------------------------------------------------------ part parent "m165" - id = "m165pa"; - desc = "ATmega165PA"; - signature = 0x1e 0x94 0x07; - ; + desc = "ATmega165PA"; + id = "m165pa"; + mcuid = 98; + signature = 0x1e 0x94 0x07; +; #------------------------------------------------------------ # ATmega325 #------------------------------------------------------------ part - id = "m325"; - desc = "ATmega325"; - signature = 0x1e 0x95 0x05; - has_jtag = yes; -# stk500_devcode = 0x??; # 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", - "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0"; - - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", - "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0"; - - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 1; - - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; + desc = "ATmega325"; + id = "m325"; + prog_modes = PM_SPM | PM_ISP | PM_HVPP | PM_JTAG; + mcuid = 114; + n_interrupts = 22; + n_boot_sections = 4; + boot_section_size = 512; +# stk500_devcode = 0x??; # No STK500v1 support? +# avr910_devcode = 0x??; # Try the ATmega16 one + avr910_devcode = 0x74; + chip_erase_delay = 9000; + pagel = 0xd7; + bs2 = 0xa0; + signature = 0x1e 0x95 0x05; + reset = io; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + pp_controlstack = + 0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f, + 0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f, + 0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b, + 0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + hvleavestabdelay = 15; + chiperasepolltimeout = 10; programfusepolltimeout = 5; - programlockpulsewidth = 0; programlockpolltimeout = 5; - - idr = 0x31; - spmcr = 0x57; - allowfullpagebitstream = no; - - ocdrev = 3; + idr = 0x31; + spmcr = 0x57; + ocdrev = 3; + chip_erase = "1010.1100--1000.0000--0000.0000--0000.0000"; + pgm_enable = "1010.1100--0101.0011--0000.0000--0000.0000"; 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 0 0 0 0 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 0 0 0 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; - - loadpage_lo = " 1 1 0 0 0 0 0 1", - " 0 0 0 0 0 0 0 0", - " 0 0 0 0 0 0 a1 a0", - " i i i i i i i i"; - - writepage = " 1 1 0 0 0 0 1 0", - " 0 0 0 0 0 0 a9 a8", - " a7 a6 a5 a4 a3 a2 0 0", - " x x x x x x x x"; - - mode = 0x41; - delay = 10; - blocksize = 4; - readsize = 256; - ; + size = 1024; + page_size = 4; + min_write_delay = 9000; + max_write_delay = 9000; + readback = 0xff 0xff; + mode = 65; + delay = 10; + blocksize = 4; + readsize = 256; + read = "1010.0000--0000.00aa--aaaa.aaaa--oooo.oooo"; + write = "1100.0000--0000.00aa--aaaa.aaaa--iiii.iiii"; + loadpage_lo = "1100.0001--0000.0000--0000.00aa--iiii.iiii"; + writepage = "1100.0010--0000.00aa--aaaa.aa00--xxxx.xxxx"; + ; 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 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 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 0 0 0 0", - " a7 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 0 0 0 0 0", - " a7 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 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " x x x x x x x x"; - - mode = 0x41; - delay = 10; - blocksize = 128; - 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 o o o o o o o o"; - - write = "1 0 1 0 1 1 0 0 1 1 1 0 0 0 0 0", - "0 0 0 0 0 0 0 0 1 1 i i i i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + paged = yes; + size = 0x8000; + page_size = 128; + num_pages = 256; + min_write_delay = 4500; + max_write_delay = 4500; + readback = 0xff 0xff; + mode = 65; + delay = 10; + blocksize = 128; + readsize = 256; + read_lo = "0010.0000--0aaa.aaaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--0aaa.aaaa--aaaa.aaaa--oooo.oooo"; + loadpage_lo = "0100.0000--0000.0000--aaaa.aaaa--iiii.iiii"; + loadpage_hi = "0100.1000--0000.0000--aaaa.aaaa--iiii.iiii"; + writepage = "0100.1100--0aaa.aaaa--aaaa.aaaa--xxxx.xxxx"; + ; memory "lfuse" - size = 1; - read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "0 0 0 0 0 0 0 0 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", - "0 0 0 0 0 0 0 0 i i i i i i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.0000--0000.0000--oooo.oooo"; + write = "1010.1100--1010.0000--0000.0000--iiii.iiii"; + ; memory "hfuse" - size = 1; - read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "0 0 0 0 0 0 0 0 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", - "0 0 0 0 0 0 0 0 i i i i i i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.1000--0000.0000--oooo.oooo"; + write = "1010.1100--1010.1000--0000.0000--iiii.iiii"; + ; memory "efuse" - size = 1; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.1000--0000.0000--oooo.oooo"; + write = "1010.1100--1010.0100--0000.0000--1111.1iii"; + ; - read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "0 0 0 0 0 0 0 0 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", - "0 0 0 0 0 0 0 0 1 1 1 1 1 i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + memory "lock" + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1110.0000--0000.0000--11ii.iiii"; + ; memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0", - "0 0 0 0 0 0 a1 a0 o o o o o o o o"; - ; + size = 3; + read = "0011.0000--0000.0000--0000.00aa--oooo.oooo"; + ; memory "calibration" - size = 1; - - read = "0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0", - "0 0 0 0 0 0 0 0 o o o o o o o o"; - ; - ; + size = 1; + read = "0011.1000--0000.0000--0000.0000--oooo.oooo"; + ; +; #------------------------------------------------------------ # ATmega325A #------------------------------------------------------------ part parent "m325" - id = "m325a"; - desc = "ATmega325A"; - ; + desc = "ATmega325A"; + id = "m325a"; + mcuid = 115; +; #------------------------------------------------------------ # ATmega325P #------------------------------------------------------------ part parent "m325" - id = "m325p"; - desc = "ATmega325P"; - signature = 0x1e 0x95 0x0d; - ; + desc = "ATmega325P"; + id = "m325p"; + mcuid = 116; + signature = 0x1e 0x95 0x0d; +; #------------------------------------------------------------ # ATmega325PA #------------------------------------------------------------ part parent "m325" - id = "m325pa"; - desc = "ATmega325PA"; - signature = 0x1e 0x95 0x0d; - ; + desc = "ATmega325PA"; + id = "m325pa"; + mcuid = 117; + signature = 0x1e 0x95 0x0d; +; #------------------------------------------------------------ # ATmega645 #------------------------------------------------------------ part - id = "m645"; - desc = "ATmega645"; - signature = 0x1E 0x96 0x05; - has_jtag = yes; -# stk500_devcode = 0x??; # 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", - "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0"; - - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", - "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0"; - - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 1; - - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; + desc = "ATmega645"; + id = "m645"; + prog_modes = PM_SPM | PM_ISP | PM_HVPP | PM_JTAG; + mcuid = 132; + n_interrupts = 22; + n_boot_sections = 4; + boot_section_size = 1024; +# stk500_devcode = 0x??; # No STK500v1 support? +# avr910_devcode = 0x??; # Try the ATmega16 one + avr910_devcode = 0x74; + chip_erase_delay = 9000; + pagel = 0xd7; + bs2 = 0xa0; + signature = 0x1e 0x96 0x05; + reset = io; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + pp_controlstack = + 0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f, + 0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f, + 0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b, + 0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + hvleavestabdelay = 15; + chiperasepolltimeout = 10; programfusepolltimeout = 5; - programlockpulsewidth = 0; programlockpolltimeout = 5; - - idr = 0x31; - spmcr = 0x57; - allowfullpagebitstream = no; - - ocdrev = 3; + idr = 0x31; + spmcr = 0x57; + ocdrev = 3; + chip_erase = "1010.1100--1000.0000--0000.0000--0000.0000"; + pgm_enable = "1010.1100--0101.0011--0000.0000--0000.0000"; 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 0 0 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 0 0 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; - - loadpage_lo = " 1 1 0 0 0 0 0 1", - " 0 0 0 0 0 0 0 0", - " 0 0 0 0 0 a2 a1 a0", - " i i i i i i i i"; - - writepage = " 1 1 0 0 0 0 1 0", - " 0 0 0 0 0 a10 a9 a8", - " a7 a6 a5 a4 a3 0 0 0", - " x x x x x x x x"; - - mode = 0x41; - delay = 10; - blocksize = 8; - readsize = 256; - ; + size = 2048; + page_size = 8; + min_write_delay = 9000; + max_write_delay = 9000; + readback = 0xff 0xff; + mode = 65; + delay = 10; + blocksize = 8; + readsize = 256; + read = "1010.0000--0000.0aaa--aaaa.aaaa--oooo.oooo"; + write = "1100.0000--0000.0aaa--aaaa.aaaa--iiii.iiii"; + loadpage_lo = "1100.0001--0000.0000--0000.0aaa--iiii.iiii"; + writepage = "1100.0010--0000.0aaa--aaaa.a000--xxxx.xxxx"; + ; memory "flash" - paged = yes; - 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", - " 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", - " 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 0 0 0 0 0", - " a7 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 0 0 0 0 0", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; - - writepage = " 0 1 0 0 1 1 0 0", - " a15 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " 0 0 0 0 0 0 0 0"; - - mode = 0x41; - delay = 10; - blocksize = 128; - 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 o o o o o o o o"; - - write = "1 0 1 0 1 1 0 0 1 1 1 0 0 0 0 0", - "0 0 0 0 0 0 0 0 1 1 i i i i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + paged = yes; + size = 0x10000; + page_size = 256; + num_pages = 256; + min_write_delay = 4500; + max_write_delay = 4500; + readback = 0xff 0xff; + mode = 65; + delay = 10; + blocksize = 128; + readsize = 256; + read_lo = "0010.0000--aaaa.aaaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--aaaa.aaaa--aaaa.aaaa--oooo.oooo"; + loadpage_lo = "0100.0000--0000.0000--aaaa.aaaa--iiii.iiii"; + loadpage_hi = "0100.1000--0000.0000--aaaa.aaaa--iiii.iiii"; + writepage = "0100.1100--aaaa.aaaa--aaaa.aaaa--0000.0000"; + ; memory "lfuse" - size = 1; - read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "0 0 0 0 0 0 0 0 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", - "0 0 0 0 0 0 0 0 i i i i i i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.0000--0000.0000--oooo.oooo"; + write = "1010.1100--1010.0000--0000.0000--iiii.iiii"; + ; memory "hfuse" - size = 1; - read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "0 0 0 0 0 0 0 0 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", - "0 0 0 0 0 0 0 0 i i i i i i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.1000--0000.0000--oooo.oooo"; + write = "1010.1100--1010.1000--0000.0000--iiii.iiii"; + ; memory "efuse" - size = 1; + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.0000--0000.1000--0000.0000--oooo.oooo"; + write = "1010.1100--1010.0100--0000.0000--1111.1iii"; + ; - read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "0 0 0 0 0 0 0 0 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", - "0 0 0 0 0 0 0 0 1 1 1 1 1 i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + memory "lock" + size = 1; + min_write_delay = 9000; + max_write_delay = 9000; + read = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1110.0000--0000.0000--11ii.iiii"; + ; memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0", - "0 0 0 0 0 0 a1 a0 o o o o o o o o"; - ; + size = 3; + read = "0011.0000--0000.0000--0000.00aa--oooo.oooo"; + ; memory "calibration" - size = 1; - - read = "0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0", - "0 0 0 0 0 0 0 0 o o o o o o o o"; - ; - ; + size = 1; + read = "0011.1000--0000.0000--0000.0000--oooo.oooo"; + ; +; #------------------------------------------------------------ # ATmega645A #------------------------------------------------------------ part parent "m645" - id = "m645a"; - desc = "ATmega645A"; - ; + desc = "ATmega645A"; + id = "m645a"; + mcuid = 133; +; #------------------------------------------------------------ # ATmega645P #------------------------------------------------------------ part parent "m645" - id = "m645p"; - desc = "ATmega645P"; - signature = 0x1e 0x96 0x0d; - ; + desc = "ATmega645P"; + id = "m645p"; + mcuid = 134; + signature = 0x1e 0x96 0x0d; +; #------------------------------------------------------------ # ATmega3250 #------------------------------------------------------------ part parent "m325" - id = "m3250"; - desc = "ATmega3250"; - signature = 0x1E 0x95 0x06; - ; + desc = "ATmega3250"; + id = "m3250"; + mcuid = 146; + n_interrupts = 25; + signature = 0x1e 0x95 0x06; +; #------------------------------------------------------------ # ATmega3250A #------------------------------------------------------------ part parent "m325" - id = "m3250a"; - desc = "ATmega3250A"; - signature = 0x1E 0x95 0x06; - ; + desc = "ATmega3250A"; + id = "m3250a"; + mcuid = 147; + n_interrupts = 25; + signature = 0x1e 0x95 0x06; +; #------------------------------------------------------------ # ATmega3250P #------------------------------------------------------------ part parent "m325" - id = "m3250p"; - desc = "ATmega3250P"; - signature = 0x1E 0x95 0x0e; - ; + desc = "ATmega3250P"; + id = "m3250p"; + mcuid = 148; + n_interrupts = 25; + signature = 0x1e 0x95 0x0e; +; #------------------------------------------------------------ # ATmega3250PA #------------------------------------------------------------ part parent "m325" - id = "m3250pa"; - desc = "ATmega3250PA"; - signature = 0x1E 0x95 0x0e; - ; + desc = "ATmega3250PA"; + id = "m3250pa"; + mcuid = 149; + n_interrupts = 25; + signature = 0x1e 0x95 0x0e; +; #------------------------------------------------------------ # ATmega6450 #------------------------------------------------------------ part parent "m645" - id = "m6450"; - desc = "ATmega6450"; - signature = 0x1E 0x96 0x06; - ; + desc = "ATmega6450"; + id = "m6450"; + mcuid = 154; + n_interrupts = 25; + signature = 0x1e 0x96 0x06; +; #------------------------------------------------------------ # ATmega6450A #------------------------------------------------------------ part parent "m645" - id = "m6450a"; - desc = "ATmega6450A"; - signature = 0x1E 0x96 0x06; - ; + desc = "ATmega6450A"; + id = "m6450a"; + mcuid = 155; + n_interrupts = 25; + signature = 0x1e 0x96 0x06; +; #------------------------------------------------------------ # ATmega6450P #------------------------------------------------------------ part parent "m645" - id = "m6450p"; - desc = "ATmega6450P"; - signature = 0x1E 0x96 0x0e; - ; + desc = "ATmega6450P"; + id = "m6450p"; + mcuid = 156; + n_interrupts = 25; + signature = 0x1e 0x96 0x0e; +; #------------------------------------------------------------ # AVR XMEGA family common values #------------------------------------------------------------ part - id = ".xmega"; - desc = "AVR XMEGA family common values"; - has_pdi = yes; - nvm_base = 0x01c0; - mcu_base = 0x0090; - - memory "signature" - size = 3; - offset = 0x1000090; - ; - - memory "prodsig" - size = 0x32; - offset = 0x8e0200; - page_size = 0x32; - readsize = 0x32; - ; + desc = "AVR XMEGA family common values"; + id = ".xmega"; + prog_modes = PM_SPM | PM_PDI; + n_boot_sections = 1; + mcu_base = 0x0090; + nvm_base = 0x01c0; + autobaud_sync = 0x20; memory "fuse1" - size = 1; - offset = 0x8f0021; + size = 1; + offset = 0x8f0021; ; memory "fuse2" - size = 1; - offset = 0x8f0022; + size = 1; + offset = 0x8f0022; ; memory "fuse4" - size = 1; - offset = 0x8f0024; + size = 1; + offset = 0x8f0024; ; memory "fuse5" - size = 1; - offset = 0x8f0025; + size = 1; + offset = 0x8f0025; ; memory "lock" - size = 1; - offset = 0x8f0027; + size = 1; + offset = 0x8f0027; + ; + + memory "signature" + size = 3; + offset = 0x1000090; + ; + + memory "prodsig" + size = 50; + page_size = 50; + offset = 0x8e0200; + readsize = 50; ; memory "data" # SRAM, only used to supply the offset - offset = 0x1000000; + offset = 0x1000000; ; ; @@ -15400,51 +12168,54 @@ part #------------------------------------------------------------ part parent ".xmega" - id = "x16a4u"; - desc = "ATxmega16A4U"; - signature = 0x1e 0x94 0x41; - usbpid = 0x2fe3; + desc = "ATxmega16A4U"; + id = "x16a4u"; + mcuid = 232; + n_interrupts = 127; + boot_section_size = 4096; + signature = 0x1e 0x94 0x41; + usbpid = 0x2fe3; memory "eeprom" - size = 0x400; - offset = 0x8c0000; - page_size = 0x20; - readsize = 0x100; - ; - - memory "application" - size = 0x4000; - offset = 0x800000; - page_size = 0x100; - readsize = 0x100; - ; - - memory "apptable" - size = 0x1000; - offset = 0x803000; - page_size = 0x100; - readsize = 0x100; - ; - - memory "boot" - size = 0x1000; - offset = 0x804000; - page_size = 0x100; - readsize = 0x100; + size = 1024; + page_size = 32; + offset = 0x8c0000; + readsize = 256; ; memory "flash" - size = 0x5000; - offset = 0x800000; - page_size = 0x100; - readsize = 0x100; + size = 0x5000; + page_size = 256; + offset = 0x800000; + readsize = 256; + ; + + memory "application" + size = 0x4000; + page_size = 256; + offset = 0x800000; + readsize = 256; + ; + + memory "apptable" + size = 4096; + page_size = 256; + offset = 0x803000; + readsize = 256; + ; + + memory "boot" + size = 4096; + page_size = 256; + offset = 0x804000; + readsize = 256; ; memory "usersig" - size = 0x100; - offset = 0x8e0400; - page_size = 0x100; - readsize = 0x100; + size = 256; + page_size = 256; + offset = 0x8e0400; + readsize = 256; ; ; @@ -15453,9 +12224,10 @@ part parent ".xmega" #------------------------------------------------------------ part parent "x16a4u" - id = "x16c4"; - desc = "ATxmega16C4"; - signature = 0x1e 0x94 0x43; + desc = "ATxmega16C4"; + id = "x16c4"; + mcuid = 233; + signature = 0x1e 0x94 0x43; ; #------------------------------------------------------------ @@ -15463,9 +12235,11 @@ part parent "x16a4u" #------------------------------------------------------------ part parent "x16a4u" - id = "x16d4"; - desc = "ATxmega16D4"; - signature = 0x1e 0x94 0x42; + desc = "ATxmega16D4"; + id = "x16d4"; + mcuid = 234; + n_interrupts = 91; + signature = 0x1e 0x94 0x42; ; #------------------------------------------------------------ @@ -15473,14 +12247,14 @@ part parent "x16a4u" #------------------------------------------------------------ part parent "x16a4u" - id = "x16a4"; - desc = "ATxmega16A4"; - signature = 0x1e 0x94 0x41; - has_jtag = yes; + desc = "ATxmega16A4"; + id = "x16a4"; + mcuid = 231; + n_interrupts = 94; memory "fuse0" - size = 1; - offset = 0x8f0020; + size = 1; + offset = 0x8f0020; ; ; @@ -15489,51 +12263,54 @@ part parent "x16a4u" #------------------------------------------------------------ part parent ".xmega" - id = "x32a4u"; - desc = "ATxmega32A4U"; - signature = 0x1e 0x95 0x41; - usbpid = 0x2fe4; + desc = "ATxmega32A4U"; + id = "x32a4u"; + mcuid = 239; + n_interrupts = 127; + boot_section_size = 4096; + signature = 0x1e 0x95 0x41; + usbpid = 0x2fe4; memory "eeprom" - size = 0x400; - offset = 0x8c0000; - page_size = 0x20; - readsize = 0x100; - ; - - memory "application" - size = 0x8000; - offset = 0x800000; - page_size = 0x100; - readsize = 0x100; - ; - - memory "apptable" - size = 0x1000; - offset = 0x807000; - page_size = 0x100; - readsize = 0x100; - ; - - memory "boot" - size = 0x1000; - offset = 0x808000; - page_size = 0x100; - readsize = 0x100; + size = 1024; + page_size = 32; + offset = 0x8c0000; + readsize = 256; ; memory "flash" - size = 0x9000; - offset = 0x800000; - page_size = 0x100; - readsize = 0x100; + size = 0x9000; + page_size = 256; + offset = 0x800000; + readsize = 256; + ; + + memory "application" + size = 0x8000; + page_size = 256; + offset = 0x800000; + readsize = 256; + ; + + memory "apptable" + size = 4096; + page_size = 256; + offset = 0x807000; + readsize = 256; + ; + + memory "boot" + size = 4096; + page_size = 256; + offset = 0x808000; + readsize = 256; ; memory "usersig" - size = 0x100; - offset = 0x8e0400; - page_size = 0x100; - readsize = 0x100; + size = 256; + page_size = 256; + offset = 0x8e0400; + readsize = 256; ; ; @@ -15542,9 +12319,10 @@ part parent ".xmega" #------------------------------------------------------------ part parent "x32a4u" - id = "x32c4"; - desc = "ATxmega32C4"; - signature = 0x1e 0x95 0x44; + desc = "ATxmega32C4"; + id = "x32c4"; + mcuid = 240; + signature = 0x1e 0x95 0x44; ; #------------------------------------------------------------ @@ -15552,9 +12330,11 @@ part parent "x32a4u" #------------------------------------------------------------ part parent "x32a4u" - id = "x32d4"; - desc = "ATxmega32D4"; - signature = 0x1e 0x95 0x42; + desc = "ATxmega32D4"; + id = "x32d4"; + mcuid = 241; + n_interrupts = 91; + signature = 0x1e 0x95 0x42; ; #------------------------------------------------------------ @@ -15562,14 +12342,14 @@ part parent "x32a4u" #------------------------------------------------------------ part parent "x32a4u" - id = "x32a4"; - desc = "ATxmega32A4"; - signature = 0x1e 0x95 0x41; - has_jtag = yes; + desc = "ATxmega32A4"; + id = "x32a4"; + mcuid = 238; + n_interrupts = 94; memory "fuse0" - size = 1; - offset = 0x8f0020; + size = 1; + offset = 0x8f0020; ; ; @@ -15578,51 +12358,54 @@ part parent "x32a4u" #------------------------------------------------------------ part parent ".xmega" - id = "x64a4u"; - desc = "ATxmega64A4U"; - signature = 0x1e 0x96 0x46; - usbpid = 0x2fe5; + desc = "ATxmega64A4U"; + id = "x64a4u"; + mcuid = 252; + n_interrupts = 127; + boot_section_size = 4096; + signature = 0x1e 0x96 0x46; + usbpid = 0x2fe5; memory "eeprom" - size = 0x800; - offset = 0x8c0000; - page_size = 0x20; - readsize = 0x100; - ; - - memory "application" - size = 0x10000; - offset = 0x800000; - page_size = 0x100; - readsize = 0x100; - ; - - memory "apptable" - size = 0x1000; - offset = 0x80f000; - page_size = 0x100; - readsize = 0x100; - ; - - memory "boot" - size = 0x1000; - offset = 0x810000; - page_size = 0x100; - readsize = 0x100; + size = 2048; + page_size = 32; + offset = 0x8c0000; + readsize = 256; ; memory "flash" - size = 0x11000; - offset = 0x800000; - page_size = 0x100; - readsize = 0x100; + size = 0x11000; + page_size = 256; + offset = 0x800000; + readsize = 256; + ; + + memory "application" + size = 0x10000; + page_size = 256; + offset = 0x800000; + readsize = 256; + ; + + memory "apptable" + size = 4096; + page_size = 256; + offset = 0x80f000; + readsize = 256; + ; + + memory "boot" + size = 4096; + page_size = 256; + offset = 0x810000; + readsize = 256; ; memory "usersig" - size = 0x100; - offset = 0x8e0400; - page_size = 0x100; - readsize = 0x100; + size = 256; + page_size = 256; + offset = 0x8e0400; + readsize = 256; ; ; @@ -15631,10 +12414,11 @@ part parent ".xmega" #------------------------------------------------------------ part parent "x64a4u" - id = "x64c3"; - desc = "ATxmega64C3"; - signature = 0x1e 0x96 0x49; - usbpid = 0x2fd6; + desc = "ATxmega64C3"; + id = "x64c3"; + mcuid = 249; + signature = 0x1e 0x96 0x49; + usbpid = 0x2fd6; ; #------------------------------------------------------------ @@ -15642,9 +12426,11 @@ part parent "x64a4u" #------------------------------------------------------------ part parent "x64a4u" - id = "x64d3"; - desc = "ATxmega64D3"; - signature = 0x1e 0x96 0x4a; + desc = "ATxmega64D3"; + id = "x64d3"; + mcuid = 250; + n_interrupts = 114; + signature = 0x1e 0x96 0x4a; ; #------------------------------------------------------------ @@ -15652,9 +12438,11 @@ part parent "x64a4u" #------------------------------------------------------------ part parent "x64a4u" - id = "x64d4"; - desc = "ATxmega64D4"; - signature = 0x1e 0x96 0x47; + desc = "ATxmega64D4"; + id = "x64d4"; + mcuid = 253; + n_interrupts = 91; + signature = 0x1e 0x96 0x47; ; #------------------------------------------------------------ @@ -15662,14 +12450,16 @@ part parent "x64a4u" #------------------------------------------------------------ part parent "x64a4u" - id = "x64a1"; - desc = "ATxmega64A1"; - signature = 0x1e 0x96 0x4e; - has_jtag = yes; + desc = "ATxmega64A1"; + id = "x64a1"; + prog_modes = PM_SPM | PM_PDI | PM_XMEGAJTAG; + mcuid = 243; + n_interrupts = 125; + signature = 0x1e 0x96 0x4e; memory "fuse0" - size = 1; - offset = 0x8f0020; + size = 1; + offset = 0x8f0020; ; ; @@ -15678,10 +12468,11 @@ part parent "x64a4u" #------------------------------------------------------------ part parent "x64a1" - id = "x64a1u"; - desc = "ATxmega64A1U"; - signature = 0x1e 0x96 0x4e; - usbpid = 0x2fe8; + desc = "ATxmega64A1U"; + id = "x64a1u"; + mcuid = 244; + n_interrupts = 127; + usbpid = 0x2fe8; ; #------------------------------------------------------------ @@ -15689,9 +12480,11 @@ part parent "x64a1" #------------------------------------------------------------ part parent "x64a1" - id = "x64a3"; - desc = "ATxmega64A3"; - signature = 0x1e 0x96 0x42; + desc = "ATxmega64A3"; + id = "x64a3"; + mcuid = 246; + n_interrupts = 122; + signature = 0x1e 0x96 0x42; ; #------------------------------------------------------------ @@ -15699,10 +12492,11 @@ part parent "x64a1" #------------------------------------------------------------ part parent "x64a1" - id = "x64a3u"; - desc = "ATxmega64A3U"; - signature = 0x1e 0x96 0x42; - usbpid = 0x2fe5; + desc = "ATxmega64A3U"; + id = "x64a3u"; + mcuid = 247; + n_interrupts = 127; + signature = 0x1e 0x96 0x42; ; #------------------------------------------------------------ @@ -15710,9 +12504,10 @@ part parent "x64a1" #------------------------------------------------------------ part parent "x64a1" - id = "x64a4"; - desc = "ATxmega64A4"; - signature = 0x1e 0x96 0x46; + desc = "ATxmega64A4"; + id = "x64a4"; + mcuid = 251; + signature = 0x1e 0x96 0x46; ; #------------------------------------------------------------ @@ -15720,10 +12515,12 @@ part parent "x64a1" #------------------------------------------------------------ part parent "x64a1" - id = "x64b1"; - desc = "ATxmega64B1"; - signature = 0x1e 0x96 0x52; - usbpid = 0x2fe1; + desc = "ATxmega64B1"; + id = "x64b1"; + mcuid = 245; + n_interrupts = 81; + signature = 0x1e 0x96 0x52; + usbpid = 0x2fe1; ; #------------------------------------------------------------ @@ -15731,10 +12528,12 @@ part parent "x64a1" #------------------------------------------------------------ part parent "x64a1" - id = "x64b3"; - desc = "ATxmega64B3"; - signature = 0x1e 0x96 0x51; - usbpid = 0x2fdf; + desc = "ATxmega64B3"; + id = "x64b3"; + mcuid = 248; + n_interrupts = 54; + signature = 0x1e 0x96 0x51; + usbpid = 0x2fdf; ; #------------------------------------------------------------ @@ -15742,51 +12541,54 @@ part parent "x64a1" #------------------------------------------------------------ part parent ".xmega" - id = "x128c3"; - desc = "ATxmega128C3"; - signature = 0x1e 0x97 0x52; - usbpid = 0x2fd7; + desc = "ATxmega128C3"; + id = "x128c3"; + mcuid = 261; + n_interrupts = 127; + boot_section_size = 8192; + signature = 0x1e 0x97 0x52; + usbpid = 0x2fd7; memory "eeprom" - size = 0x800; - offset = 0x8c0000; - page_size = 0x20; - readsize = 0x100; - ; - - memory "application" - size = 0x20000; - offset = 0x800000; - page_size = 0x200; - readsize = 0x100; - ; - - memory "apptable" - size = 0x2000; - offset = 0x81e000; - page_size = 0x200; - readsize = 0x100; - ; - - memory "boot" - size = 0x2000; - offset = 0x820000; - page_size = 0x200; - readsize = 0x100; + size = 2048; + page_size = 32; + offset = 0x8c0000; + readsize = 256; ; memory "flash" - size = 0x22000; - offset = 0x800000; - page_size = 0x200; - readsize = 0x100; + size = 0x22000; + page_size = 512; + offset = 0x800000; + readsize = 256; + ; + + memory "application" + size = 0x20000; + page_size = 512; + offset = 0x800000; + readsize = 256; + ; + + memory "apptable" + size = 8192; + page_size = 512; + offset = 0x81e000; + readsize = 256; + ; + + memory "boot" + size = 8192; + page_size = 512; + offset = 0x820000; + readsize = 256; ; memory "usersig" - size = 0x200; - offset = 0x8e0400; - page_size = 0x200; - readsize = 0x100; + size = 512; + page_size = 512; + offset = 0x8e0400; + readsize = 256; ; ; @@ -15795,9 +12597,11 @@ part parent ".xmega" #------------------------------------------------------------ part parent "x128c3" - id = "x128d3"; - desc = "ATxmega128D3"; - signature = 0x1e 0x97 0x48; + desc = "ATxmega128D3"; + id = "x128d3"; + mcuid = 262; + n_interrupts = 114; + signature = 0x1e 0x97 0x48; ; #------------------------------------------------------------ @@ -15805,15 +12609,14 @@ part parent "x128c3" #------------------------------------------------------------ part parent "x128c3" - id = "x128d4"; - desc = "ATxmega128D4"; - signature = 0x1e 0x97 0x47; + desc = "ATxmega128D4"; + id = "x128d4"; + mcuid = 265; + n_interrupts = 91; + signature = 0x1e 0x97 0x47; memory "flash" - size = 0x22000; - offset = 0x800000; - page_size = 0x100; - readsize = 0x100; + page_size = 256; ; ; @@ -15822,14 +12625,16 @@ part parent "x128c3" #------------------------------------------------------------ part parent "x128c3" - id = "x128a1"; - desc = "ATxmega128A1"; - signature = 0x1e 0x97 0x4c; - has_jtag = yes; + desc = "ATxmega128A1"; + id = "x128a1"; + prog_modes = PM_SPM | PM_PDI | PM_XMEGAJTAG; + mcuid = 254; + n_interrupts = 125; + signature = 0x1e 0x97 0x4c; memory "fuse0" - size = 1; - offset = 0x8f0020; + size = 1; + offset = 0x8f0020; ; ; @@ -15838,9 +12643,10 @@ part parent "x128c3" #------------------------------------------------------------ part parent "x128a1" - id = "x128a1d"; - desc = "ATxmega128A1revD"; - signature = 0x1e 0x97 0x41; + desc = "ATxmega128A1revD"; + id = "x128a1d"; + mcuid = 255; + signature = 0x1e 0x97 0x41; ; #------------------------------------------------------------ @@ -15848,10 +12654,11 @@ part parent "x128a1" #------------------------------------------------------------ part parent "x128a1" - id = "x128a1u"; - desc = "ATxmega128A1U"; - signature = 0x1e 0x97 0x4c; - usbpid = 0x2fed; + desc = "ATxmega128A1U"; + id = "x128a1u"; + mcuid = 256; + n_interrupts = 127; + usbpid = 0x2fed; ; #------------------------------------------------------------ @@ -15859,9 +12666,11 @@ part parent "x128a1" #------------------------------------------------------------ part parent "x128a1" - id = "x128a3"; - desc = "ATxmega128A3"; - signature = 0x1e 0x97 0x42; + desc = "ATxmega128A3"; + id = "x128a3"; + mcuid = 258; + n_interrupts = 122; + signature = 0x1e 0x97 0x42; ; #------------------------------------------------------------ @@ -15869,10 +12678,12 @@ part parent "x128a1" #------------------------------------------------------------ part parent "x128a1" - id = "x128a3u"; - desc = "ATxmega128A3U"; - signature = 0x1e 0x97 0x42; - usbpid = 0x2fe6; + desc = "ATxmega128A3U"; + id = "x128a3u"; + mcuid = 259; + n_interrupts = 127; + signature = 0x1e 0x97 0x42; + usbpid = 0x2fe6; ; #------------------------------------------------------------ @@ -15880,56 +12691,57 @@ part parent "x128a1" #------------------------------------------------------------ part parent ".xmega" - id = "x128a4"; - desc = "ATxmega128A4"; - signature = 0x1e 0x97 0x46; - has_jtag = yes; + desc = "ATxmega128A4"; + id = "x128a4"; + prog_modes = PM_SPM | PM_PDI | PM_XMEGAJTAG; + mcuid = 263; + signature = 0x1e 0x97 0x46; memory "eeprom" - size = 0x800; - offset = 0x8c0000; - page_size = 0x20; - readsize = 0x100; - ; - - memory "application" - size = 0x20000; - offset = 0x800000; - page_size = 0x200; - readsize = 0x100; - ; - - memory "apptable" - size = 0x1000; - offset = 0x81f000; - page_size = 0x200; - readsize = 0x100; - ; - - memory "boot" - size = 0x2000; - offset = 0x820000; - page_size = 0x200; - readsize = 0x100; + size = 2048; + page_size = 32; + offset = 0x8c0000; + readsize = 256; ; memory "flash" - size = 0x22000; - offset = 0x800000; - page_size = 0x200; - readsize = 0x100; + size = 0x22000; + page_size = 512; + offset = 0x800000; + readsize = 256; ; - memory "usersig" - size = 0x200; - offset = 0x8e0400; - page_size = 0x200; - readsize = 0x100; + memory "application" + size = 0x20000; + page_size = 512; + offset = 0x800000; + readsize = 256; + ; + + memory "apptable" + size = 4096; + page_size = 512; + offset = 0x81f000; + readsize = 256; + ; + + memory "boot" + size = 8192; + page_size = 512; + offset = 0x820000; + readsize = 256; ; memory "fuse0" - size = 1; - offset = 0x8f0020; + size = 1; + offset = 0x8f0020; + ; + + memory "usersig" + size = 512; + page_size = 512; + offset = 0x8e0400; + readsize = 256; ; ; @@ -15938,51 +12750,54 @@ part parent ".xmega" #------------------------------------------------------------ part parent ".xmega" - id = "x128a4u"; - desc = "ATxmega128A4U"; - signature = 0x1e 0x97 0x46; - usbpid = 0x2fde; + desc = "ATxmega128A4U"; + id = "x128a4u"; + mcuid = 264; + n_interrupts = 127; + boot_section_size = 8192; + signature = 0x1e 0x97 0x46; + usbpid = 0x2fde; memory "eeprom" - size = 0x800; - offset = 0x8c0000; - page_size = 0x20; - readsize = 0x100; - ; - - memory "application" - size = 0x20000; - offset = 0x800000; - page_size = 0x100; - readsize = 0x100; - ; - - memory "apptable" - size = 0x1000; - offset = 0x81f000; - page_size = 0x100; - readsize = 0x100; - ; - - memory "boot" - size = 0x2000; - offset = 0x820000; - page_size = 0x100; - readsize = 0x100; + size = 2048; + page_size = 32; + offset = 0x8c0000; + readsize = 256; ; memory "flash" - size = 0x22000; - offset = 0x800000; - page_size = 0x100; - readsize = 0x100; + size = 0x22000; + page_size = 256; + offset = 0x800000; + readsize = 256; + ; + + memory "application" + size = 0x20000; + page_size = 256; + offset = 0x800000; + readsize = 256; + ; + + memory "apptable" + size = 4096; + page_size = 256; + offset = 0x81f000; + readsize = 256; + ; + + memory "boot" + size = 8192; + page_size = 256; + offset = 0x820000; + readsize = 256; ; memory "usersig" - size = 0x100; - offset = 0x8e0400; - page_size = 0x100; - readsize = 0x100; + size = 256; + page_size = 256; + offset = 0x8e0400; + readsize = 256; ; ; @@ -15991,57 +12806,60 @@ part parent ".xmega" #------------------------------------------------------------ part parent ".xmega" - id = "x128b1"; - desc = "ATxmega128B1"; - signature = 0x1e 0x97 0x4d; - usbpid = 0x2fea; - has_jtag = yes; + desc = "ATxmega128B1"; + id = "x128b1"; + prog_modes = PM_SPM | PM_PDI | PM_XMEGAJTAG; + mcuid = 257; + n_interrupts = 81; + boot_section_size = 8192; + signature = 0x1e 0x97 0x4d; + usbpid = 0x2fea; memory "eeprom" - size = 0x800; - offset = 0x8c0000; - page_size = 0x20; - readsize = 0x100; - ; - - memory "application" - size = 0x20000; - offset = 0x800000; - page_size = 0x100; - readsize = 0x100; - ; - - memory "apptable" - size = 0x2000; - offset = 0x81e000; - page_size = 0x100; - readsize = 0x100; - ; - - memory "boot" - size = 0x2000; - offset = 0x820000; - page_size = 0x100; - readsize = 0x100; + size = 2048; + page_size = 32; + offset = 0x8c0000; + readsize = 256; ; memory "flash" - size = 0x22000; - offset = 0x800000; - page_size = 0x100; - readsize = 0x100; + size = 0x22000; + page_size = 256; + offset = 0x800000; + readsize = 256; ; - memory "usersig" - size = 0x100; - offset = 0x8e0400; - page_size = 0x100; - readsize = 0x100; + memory "application" + size = 0x20000; + page_size = 256; + offset = 0x800000; + readsize = 256; + ; + + memory "apptable" + size = 8192; + page_size = 256; + offset = 0x81e000; + readsize = 256; + ; + + memory "boot" + size = 8192; + page_size = 256; + offset = 0x820000; + readsize = 256; ; memory "fuse0" - size = 1; - offset = 0x8f0020; + size = 1; + offset = 0x8f0020; + ; + + memory "usersig" + size = 256; + page_size = 256; + offset = 0x8e0400; + readsize = 256; ; ; @@ -16050,10 +12868,12 @@ part parent ".xmega" #------------------------------------------------------------ part parent "x128b1" - id = "x128b3"; - desc = "ATxmega128B3"; - signature = 0x1e 0x97 0x4b; - usbpid = 0x2fe0; + desc = "ATxmega128B3"; + id = "x128b3"; + mcuid = 260; + n_interrupts = 54; + signature = 0x1e 0x97 0x4b; + usbpid = 0x2fe0; ; #------------------------------------------------------------ @@ -16061,51 +12881,54 @@ part parent "x128b1" #------------------------------------------------------------ part parent ".xmega" - id = "x192c3"; - desc = "ATxmega192C3"; - signature = 0x1e 0x97 0x51; - # usbpid = 0x2f??; + desc = "ATxmega192C3"; + id = "x192c3"; + mcuid = 269; + n_interrupts = 127; + boot_section_size = 8192; + signature = 0x1e 0x97 0x51; +# usbpid = 0x2f??; memory "eeprom" - size = 0x800; - offset = 0x8c0000; - page_size = 0x20; - readsize = 0x100; - ; - - memory "application" - size = 0x30000; - offset = 0x800000; - page_size = 0x200; - readsize = 0x100; - ; - - memory "apptable" - size = 0x2000; - offset = 0x82e000; - page_size = 0x200; - readsize = 0x100; - ; - - memory "boot" - size = 0x2000; - offset = 0x830000; - page_size = 0x200; - readsize = 0x100; + size = 2048; + page_size = 32; + offset = 0x8c0000; + readsize = 256; ; memory "flash" - size = 0x32000; - offset = 0x800000; - page_size = 0x200; - readsize = 0x100; + size = 0x32000; + page_size = 512; + offset = 0x800000; + readsize = 256; + ; + + memory "application" + size = 0x30000; + page_size = 512; + offset = 0x800000; + readsize = 256; + ; + + memory "apptable" + size = 8192; + page_size = 512; + offset = 0x82e000; + readsize = 256; + ; + + memory "boot" + size = 8192; + page_size = 512; + offset = 0x830000; + readsize = 256; ; memory "usersig" - size = 0x200; - offset = 0x8e0400; - page_size = 0x200; - readsize = 0x100; + size = 512; + page_size = 512; + offset = 0x8e0400; + readsize = 256; ; ; @@ -16114,9 +12937,11 @@ part parent ".xmega" #------------------------------------------------------------ part parent "x192c3" - id = "x192d3"; - desc = "ATxmega192D3"; - signature = 0x1e 0x97 0x49; + desc = "ATxmega192D3"; + id = "x192d3"; + mcuid = 270; + n_interrupts = 114; + signature = 0x1e 0x97 0x49; ; #------------------------------------------------------------ @@ -16124,14 +12949,15 @@ part parent "x192c3" #------------------------------------------------------------ part parent "x192c3" - id = "x192a1"; - desc = "ATxmega192A1"; - signature = 0x1e 0x97 0x4e; - has_jtag = yes; + desc = "ATxmega192A1"; + id = "x192a1"; + prog_modes = PM_SPM | PM_PDI | PM_XMEGAJTAG; + mcuid = 266; + signature = 0x1e 0x97 0x4e; memory "fuse0" - size = 1; - offset = 0x8f0020; + size = 1; + offset = 0x8f0020; ; ; @@ -16140,9 +12966,11 @@ part parent "x192c3" #------------------------------------------------------------ part parent "x192a1" - id = "x192a3"; - desc = "ATxmega192A3"; - signature = 0x1e 0x97 0x44; + desc = "ATxmega192A3"; + id = "x192a3"; + mcuid = 267; + n_interrupts = 122; + signature = 0x1e 0x97 0x44; ; #------------------------------------------------------------ @@ -16150,10 +12978,11 @@ part parent "x192a1" #------------------------------------------------------------ part parent "x192a1" - id = "x192a3u"; - desc = "ATxmega192A3U"; - signature = 0x1e 0x97 0x44; - usbpid = 0x2fe7; + desc = "ATxmega192A3U"; + id = "x192a3u"; + mcuid = 268; + signature = 0x1e 0x97 0x44; + usbpid = 0x2fe7; ; #------------------------------------------------------------ @@ -16161,51 +12990,54 @@ part parent "x192a1" #------------------------------------------------------------ part parent ".xmega" - id = "x256c3"; - desc = "ATxmega256C3"; - signature = 0x1e 0x98 0x46; - usbpid = 0x2fda; + desc = "ATxmega256C3"; + id = "x256c3"; + mcuid = 276; + n_interrupts = 127; + boot_section_size = 8192; + signature = 0x1e 0x98 0x46; + usbpid = 0x2fda; memory "eeprom" - size = 0x1000; - offset = 0x8c0000; - page_size = 0x20; - readsize = 0x100; - ; - - memory "application" - size = 0x40000; - offset = 0x800000; - page_size = 0x200; - readsize = 0x100; - ; - - memory "apptable" - size = 0x2000; - offset = 0x83e000; - page_size = 0x200; - readsize = 0x100; - ; - - memory "boot" - size = 0x2000; - offset = 0x840000; - page_size = 0x200; - readsize = 0x100; + size = 4096; + page_size = 32; + offset = 0x8c0000; + readsize = 256; ; memory "flash" - size = 0x42000; - offset = 0x800000; - page_size = 0x200; - readsize = 0x100; + size = 0x42000; + page_size = 512; + offset = 0x800000; + readsize = 256; + ; + + memory "application" + size = 0x40000; + page_size = 512; + offset = 0x800000; + readsize = 256; + ; + + memory "apptable" + size = 8192; + page_size = 512; + offset = 0x83e000; + readsize = 256; + ; + + memory "boot" + size = 8192; + page_size = 512; + offset = 0x840000; + readsize = 256; ; memory "usersig" - size = 0x200; - offset = 0x8e0400; - page_size = 0x200; - readsize = 0x100; + size = 512; + page_size = 512; + offset = 0x8e0400; + readsize = 256; ; ; @@ -16214,9 +13046,11 @@ part parent ".xmega" #------------------------------------------------------------ part parent "x256c3" - id = "x256d3"; - desc = "ATxmega256D3"; - signature = 0x1e 0x98 0x44; + desc = "ATxmega256D3"; + id = "x256d3"; + mcuid = 277; + n_interrupts = 114; + signature = 0x1e 0x98 0x44; ; #------------------------------------------------------------ @@ -16224,14 +13058,14 @@ part parent "x256c3" #------------------------------------------------------------ part parent "x256c3" - id = "x256a1"; - desc = "ATxmega256A1"; - signature = 0x1e 0x98 0x46; - has_jtag = yes; + desc = "ATxmega256A1"; + id = "x256a1"; + prog_modes = PM_SPM | PM_PDI | PM_XMEGAJTAG; + mcuid = 271; memory "fuse0" - size = 1; - offset = 0x8f0020; + size = 1; + offset = 0x8f0020; ; ; @@ -16240,9 +13074,11 @@ part parent "x256c3" #------------------------------------------------------------ part parent "x256a1" - id = "x256a3"; - desc = "ATxmega256A3"; - signature = 0x1e 0x98 0x42; + desc = "ATxmega256A3"; + id = "x256a3"; + mcuid = 272; + n_interrupts = 122; + signature = 0x1e 0x98 0x42; ; #------------------------------------------------------------ @@ -16250,10 +13086,11 @@ part parent "x256a1" #------------------------------------------------------------ part parent "x256a1" - id = "x256a3u"; - desc = "ATxmega256A3U"; - signature = 0x1e 0x98 0x42; - usbpid = 0x2fec; + desc = "ATxmega256A3U"; + id = "x256a3u"; + mcuid = 275; + signature = 0x1e 0x98 0x42; + usbpid = 0x2fec; ; #------------------------------------------------------------ @@ -16261,9 +13098,11 @@ part parent "x256a1" #------------------------------------------------------------ part parent "x256a1" - id = "x256a3b"; - desc = "ATxmega256A3B"; - signature = 0x1e 0x98 0x43; + desc = "ATxmega256A3B"; + id = "x256a3b"; + mcuid = 273; + n_interrupts = 122; + signature = 0x1e 0x98 0x43; ; #------------------------------------------------------------ @@ -16271,10 +13110,11 @@ part parent "x256a1" #------------------------------------------------------------ part parent "x256a1" - id = "x256a3bu"; - desc = "ATxmega256A3BU"; - signature = 0x1e 0x98 0x43; - usbpid = 0x2fe2; + desc = "ATxmega256A3BU"; + id = "x256a3bu"; + mcuid = 274; + signature = 0x1e 0x98 0x43; + usbpid = 0x2fe2; ; #------------------------------------------------------------ @@ -16282,51 +13122,54 @@ part parent "x256a1" #------------------------------------------------------------ part parent ".xmega" - id = "x384c3"; - desc = "ATxmega384C3"; - signature = 0x1e 0x98 0x45; - usbpid = 0x2fdb; + desc = "ATxmega384C3"; + id = "x384c3"; + mcuid = 278; + n_interrupts = 127; + boot_section_size = 8192; + signature = 0x1e 0x98 0x45; + usbpid = 0x2fdb; memory "eeprom" - size = 0x1000; - offset = 0x8c0000; - page_size = 0x20; - readsize = 0x100; - ; - - memory "application" - size = 0x60000; - offset = 0x800000; - page_size = 0x200; - readsize = 0x100; - ; - - memory "apptable" - size = 0x2000; - offset = 0x85e000; - page_size = 0x200; - readsize = 0x100; - ; - - memory "boot" - size = 0x2000; - offset = 0x860000; - page_size = 0x200; - readsize = 0x100; + size = 4096; + page_size = 32; + offset = 0x8c0000; + readsize = 256; ; memory "flash" - size = 0x62000; - offset = 0x800000; - page_size = 0x200; - readsize = 0x100; + size = 0x62000; + page_size = 512; + offset = 0x800000; + readsize = 256; + ; + + memory "application" + size = 0x60000; + page_size = 512; + offset = 0x800000; + readsize = 256; + ; + + memory "apptable" + size = 8192; + page_size = 512; + offset = 0x85e000; + readsize = 256; + ; + + memory "boot" + size = 8192; + page_size = 512; + offset = 0x860000; + readsize = 256; ; memory "usersig" - size = 0x200; - offset = 0x8e0400; - page_size = 0x200; - readsize = 0x100; + size = 512; + page_size = 512; + offset = 0x8e0400; + readsize = 256; ; ; @@ -16335,9 +13178,11 @@ part parent ".xmega" #------------------------------------------------------------ part parent "x384c3" - id = "x384d3"; - desc = "ATxmega384D3"; - signature = 0x1e 0x98 0x47; + desc = "ATxmega384D3"; + id = "x384d3"; + mcuid = 279; + n_interrupts = 114; + signature = 0x1e 0x98 0x47; ; #------------------------------------------------------------ @@ -16345,50 +13190,53 @@ part parent "x384c3" #------------------------------------------------------------ part parent ".xmega" - id = "x8e5"; - desc = "ATxmega8E5"; - signature = 0x1e 0x93 0x41; + desc = "ATxmega8E5"; + id = "x8e5"; + mcuid = 230; + n_interrupts = 43; + boot_section_size = 2048; + signature = 0x1e 0x93 0x41; memory "eeprom" - size = 0x0200; - offset = 0x08c0000; - page_size = 0x20; - readsize = 0x100; - ; - - memory "application" - size = 0x2000; - offset = 0x0800000; - page_size = 0x80; - readsize = 0x100; - ; - - memory "apptable" - size = 0x800; - offset = 0x00801800; - page_size = 0x80; - readsize = 0x100; - ; - - memory "boot" - size = 0x800; - offset = 0x00802000; - page_size = 0x80; - readsize = 0x100; + size = 512; + page_size = 32; + offset = 0x8c0000; + readsize = 256; ; memory "flash" - size = 0x2800; - offset = 0x0800000; - page_size = 0x80; - readsize = 0x100; + size = 0x2800; + page_size = 128; + offset = 0x800000; + readsize = 256; + ; + + memory "application" + size = 8192; + page_size = 128; + offset = 0x800000; + readsize = 256; + ; + + memory "apptable" + size = 2048; + page_size = 128; + offset = 0x801800; + readsize = 256; + ; + + memory "boot" + size = 2048; + page_size = 128; + offset = 0x802000; + readsize = 256; ; memory "usersig" - size = 0x80; - offset = 0x8e0400; - page_size = 0x80; - readsize = 0x100; + size = 128; + page_size = 128; + offset = 0x8e0400; + readsize = 256; ; ; @@ -16397,50 +13245,53 @@ part parent ".xmega" #------------------------------------------------------------ part parent ".xmega" - id = "x16e5"; - desc = "ATxmega16E5"; - signature = 0x1e 0x94 0x45; + desc = "ATxmega16E5"; + id = "x16e5"; + mcuid = 235; + n_interrupts = 43; + boot_section_size = 4096; + signature = 0x1e 0x94 0x45; memory "eeprom" - size = 0x0200; - offset = 0x08c0000; - page_size = 0x20; - readsize = 0x100; - ; - - memory "application" - size = 0x4000; - offset = 0x0800000; - page_size = 0x80; - readsize = 0x100; - ; - - memory "apptable" - size = 0x1000; - offset = 0x00803000; - page_size = 0x80; - readsize = 0x100; - ; - - memory "boot" - size = 0x1000; - offset = 0x00804000; - page_size = 0x80; - readsize = 0x100; + size = 512; + page_size = 32; + offset = 0x8c0000; + readsize = 256; ; memory "flash" - size = 0x5000; - offset = 0x0800000; - page_size = 0x80; - readsize = 0x100; + size = 0x5000; + page_size = 128; + offset = 0x800000; + readsize = 256; + ; + + memory "application" + size = 0x4000; + page_size = 128; + offset = 0x800000; + readsize = 256; + ; + + memory "apptable" + size = 4096; + page_size = 128; + offset = 0x803000; + readsize = 256; + ; + + memory "boot" + size = 4096; + page_size = 128; + offset = 0x804000; + readsize = 256; ; memory "usersig" - size = 0x80; - offset = 0x8e0400; - page_size = 0x80; - readsize = 0x100; + size = 128; + page_size = 128; + offset = 0x8e0400; + readsize = 256; ; ; @@ -16449,50 +13300,53 @@ part parent ".xmega" #------------------------------------------------------------ part parent ".xmega" - id = "x32e5"; - desc = "ATxmega32E5"; - signature = 0x1e 0x95 0x4c; + desc = "ATxmega32E5"; + id = "x32e5"; + mcuid = 242; + n_interrupts = 43; + boot_section_size = 4096; + signature = 0x1e 0x95 0x4c; memory "eeprom" - size = 0x0400; - offset = 0x08c0000; - page_size = 0x20; - readsize = 0x100; - ; - - memory "application" - size = 0x8000; - offset = 0x0800000; - page_size = 0x80; - readsize = 0x100; - ; - - memory "apptable" - size = 0x1000; - offset = 0x00807000; - page_size = 0x80; - readsize = 0x100; - ; - - memory "boot" - size = 0x1000; - offset = 0x00808000; - page_size = 0x80; - readsize = 0x100; + size = 1024; + page_size = 32; + offset = 0x8c0000; + readsize = 256; ; memory "flash" - size = 0x9000; - offset = 0x0800000; - page_size = 0x80; - readsize = 0x100; + size = 0x9000; + page_size = 128; + offset = 0x800000; + readsize = 256; + ; + + memory "application" + size = 0x8000; + page_size = 128; + offset = 0x800000; + readsize = 256; + ; + + memory "apptable" + size = 4096; + page_size = 128; + offset = 0x807000; + readsize = 256; + ; + + memory "boot" + size = 4096; + page_size = 128; + offset = 0x808000; + readsize = 256; ; memory "usersig" - size = 0x80; - offset = 0x8e0400; - page_size = 0x80; - readsize = 0x100; + size = 128; + page_size = 128; + offset = 0x8e0400; + readsize = 256; ; ; @@ -16501,25 +13355,28 @@ part parent ".xmega" #------------------------------------------------------------ part - id = "uc3a0512"; - desc = "AT32UC3A0512"; - signature = 0xED 0xC0 0x3F; - has_jtag = yes; - is_avr32 = yes; + desc = "AT32UC3A0512"; + id = "uc3a0512"; + prog_modes = PM_AVR32JTAG | PM_aWire; + signature = 0xed 0xc0 0x3f; memory "flash" - paged = yes; - page_size = 512; # bytes - readsize = 512; # bytes - num_pages = 1024; # could be set dynamicly - size = 0x00080000; # could be set dynamicly - offset = 0x80000000; + paged = yes; + size = 0x80000; # could be set dynamicly + page_size = 512; # bytes + num_pages = 1024; # could be set dynamicly + offset = 0x80000000; + readsize = 512; # bytes ; ; +#------------------------------------------------------------ +# deprecated, use 'uc3a0512' +#------------------------------------------------------------ + part parent "uc3a0512" - id = "ucr2"; - desc = "deprecated, use 'uc3a0512'"; + desc = "deprecated, use 'uc3a0512'"; + id = "ucr2"; ; #------------------------------------------------------------ @@ -16527,188 +13384,128 @@ part parent "uc3a0512" #------------------------------------------------------------ part - id = "t1634"; - desc = "ATtiny1634"; - has_debugwire = yes; - flash_instr = 0xB6, 0x01, 0x11; - eeprom_instr = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00, - 0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF, - 0x99, 0xF9, 0xBB, 0xAF; - stk500_devcode = 0x86; - # avr910_devcode = 0x; - signature = 0x1e 0x94 0x12; - pagel = 0xB3; - bs2 = 0xB1; - 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; - - pp_controlstack = - 0x0E, 0x1E, 0x0E, 0x1E, 0x2E, 0x3E, 0x2E, 0x3E, - 0x4E, 0x5E, 0x4E, 0x5E, 0x6E, 0x7E, 0x6E, 0x7E, - 0x26, 0x36, 0x66, 0x76, 0x2A, 0x3A, 0x6A, 0x7A, - 0x2E, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 0; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - resetdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; + desc = "ATtiny1634"; + id = "t1634"; + prog_modes = PM_SPM | PM_ISP | PM_HVPP | PM_debugWIRE; + mcuid = 40; + n_interrupts = 28; + n_page_erase = 4; + stk500_devcode = 0x86; + chip_erase_delay = 9000; + pagel = 0xb3; + bs2 = 0xb1; +# avr910_devcode = 0x??; + signature = 0x1e 0x94 0x12; + reset = io; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + pp_controlstack = + 0x0e, 0x1e, 0x0e, 0x1e, 0x2e, 0x3e, 0x2e, 0x3e, + 0x4e, 0x5e, 0x4e, 0x5e, 0x6e, 0x7e, 0x6e, 0x7e, + 0x26, 0x36, 0x66, 0x76, 0x2a, 0x3a, 0x6a, 0x7a, + 0x2e, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + flash_instr = 0xb6, 0x01, 0x11; + eeprom_instr = + 0xbd, 0xf2, 0xbd, 0xe1, 0xbb, 0xcf, 0xb4, 0x00, + 0xbe, 0x01, 0xb6, 0x01, 0xbc, 0x00, 0xbb, 0xbf, + 0x99, 0xf9, 0xbb, 0xaf; + hventerstabdelay = 100; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + hvleavestabdelay = 15; + resetdelay = 15; + chiperasepolltimeout = 10; programfusepolltimeout = 5; - programlockpulsewidth = 0; programlockpolltimeout = 5; + spmcr = 0x57; + eecr = 0x3c; + chip_erase = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx"; + pgm_enable = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx"; memory "eeprom" - paged = no; - page_size = 4; - 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 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"; - - loadpage_lo = " 1 1 0 0 0 0 0 1", - " 0 0 0 0 0 0 0 0", - " 0 0 0 0 0 0 a1 a0", - " i i i i i i i i"; - - writepage = " 1 1 0 0 0 0 1 0", - " 0 0 x x x x x a8", - " a7 a6 a5 a4 a3 a2 0 0", - " x x x x x x x x"; - - mode = 0x41; - delay = 5; - blocksize = 4; - readsize = 256; - ; + size = 256; + page_size = 4; + min_write_delay = 3600; + max_write_delay = 3600; + readback = 0xff 0xff; + mode = 65; + delay = 5; + blocksize = 4; + readsize = 256; + read = "1010.0000--000x.xxxa--aaaa.aaaa--oooo.oooo"; + write = "1100.0000--000x.xxxa--aaaa.aaaa--iiii.iiii"; + loadpage_lo = "1100.0001--0000.0000--0000.00aa--iiii.iiii"; + writepage = "1100.0010--00xx.xxxa--aaaa.aa00--xxxx.xxxx"; + ; memory "flash" - paged = yes; - size = 16384; - page_size = 32; - num_pages = 512; - 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 0 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", - " 0 0 0 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", - " 0 0 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 x x x x", - " x x x x x x x x"; - - mode = 0x41; - delay = 6; - blocksize = 128; - readsize = 256; - - ; + paged = yes; + size = 0x4000; + page_size = 32; + num_pages = 512; + min_write_delay = 4500; + max_write_delay = 4500; + readback = 0xff 0xff; + mode = 65; + delay = 6; + blocksize = 128; + readsize = 256; + read_lo = "0010.0000--00aa.aaaa--aaaa.aaaa--oooo.oooo"; + read_hi = "0010.1000--00aa.aaaa--aaaa.aaaa--oooo.oooo"; + loadpage_lo = "0100.0000--000x.xxxx--xxxx.aaaa--iiii.iiii"; + loadpage_hi = "0100.1000--000x.xxxx--xxxx.aaaa--iiii.iiii"; + writepage = "0100.1100--00aa.aaaa--aaaa.xxxx--xxxx.xxxx"; + ; 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"; - ; + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii"; + ; 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"; - ; + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii"; + ; 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 x x x i i i i i"; - ; + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--1010.0100--xxxx.xxxx--xxxi.iiii"; + ; 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 o o 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 1 1 1 1 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"; - ; + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo"; + write = "1010.1100--111x.xxxx--xxxx.xxxx--1111.11ii"; + ; 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"; - ; + size = 3; + read = "0011.0000--000x.xxxx--xxxx.xxaa--oooo.oooo"; + ; + + memory "calibration" + size = 1; + read = "0011.1000--000x.xxxx--0000.0000--oooo.oooo"; + ; ; #------------------------------------------------------------ @@ -16716,42 +13513,43 @@ part #------------------------------------------------------------ part parent "t1634" - id = "t1634r"; - desc = "ATtiny1634R"; - ; + desc = "ATtiny1634R"; + id = "t1634r"; + mcuid = 41; +; #------------------------------------------------------------ # Common values for reduced core tinys (4/5/9/10/20/40) #------------------------------------------------------------ part - id = ".reduced_core_tiny"; - desc = "Common values for reduced core tinys"; - has_tpi = yes; - - memory "signature" - size = 3; - offset = 0x3fc0; - page_size = 16; - ; + desc = "Common values for reduced core tinys"; + id = ".reduced_core_tiny"; + prog_modes = PM_TPI; memory "fuse" - size = 1; - offset = 0x3f40; - page_size = 16; - blocksize = 4; - ; - - memory "calibration" - size = 1; - offset = 0x3f80; - page_size = 16; + size = 1; + page_size = 16; + offset = 0x3f40; + blocksize = 4; ; memory "lockbits" - size = 1; - offset = 0x3f00; - page_size = 16; + size = 1; + page_size = 16; + offset = 0x3f00; + ; + + memory "signature" + size = 3; + page_size = 16; + offset = 0x3fc0; + ; + + memory "calibration" + size = 1; + page_size = 16; + offset = 0x3f80; ; ; @@ -16760,15 +13558,17 @@ part #------------------------------------------------------------ part parent ".reduced_core_tiny" - id = "t4"; - desc = "ATtiny4"; - signature = 0x1e 0x8f 0x0a; + desc = "ATtiny4"; + id = "t4"; + mcuid = 0; + n_interrupts = 10; + signature = 0x1e 0x8f 0x0a; memory "flash" - size = 512; - offset = 0x4000; - page_size = 16; - blocksize = 128; + size = 512; + page_size = 16; + offset = 0x4000; + blocksize = 128; ; ; @@ -16777,9 +13577,11 @@ part parent ".reduced_core_tiny" #------------------------------------------------------------ part parent "t4" - id = "t5"; - desc = "ATtiny5"; - signature = 0x1e 0x8f 0x09; + desc = "ATtiny5"; + id = "t5"; + mcuid = 1; + n_interrupts = 11; + signature = 0x1e 0x8f 0x09; ; #------------------------------------------------------------ @@ -16787,15 +13589,17 @@ part parent "t4" #------------------------------------------------------------ part parent ".reduced_core_tiny" - id = "t9"; - desc = "ATtiny9"; - signature = 0x1e 0x90 0x08; + desc = "ATtiny9"; + id = "t9"; + mcuid = 2; + n_interrupts = 10; + signature = 0x1e 0x90 0x08; memory "flash" - size = 1024; - offset = 0x4000; - page_size = 16; - blocksize = 128; + size = 1024; + page_size = 16; + offset = 0x4000; + blocksize = 128; ; ; @@ -16804,9 +13608,11 @@ part parent ".reduced_core_tiny" #------------------------------------------------------------ part parent "t9" - id = "t10"; - desc = "ATtiny10"; - signature = 0x1e 0x90 0x03; + desc = "ATtiny10"; + id = "t10"; + mcuid = 3; + n_interrupts = 11; + signature = 0x1e 0x90 0x03; ; #------------------------------------------------------------ @@ -16814,15 +13620,22 @@ part parent "t9" #------------------------------------------------------------ part parent ".reduced_core_tiny" - id = "t20"; - desc = "ATtiny20"; - signature = 0x1e 0x91 0x0F; + desc = "ATtiny20"; + id = "t20"; + mcuid = 4; + n_interrupts = 17; + signature = 0x1e 0x91 0x0f; memory "flash" - size = 2048; - offset = 0x4000; - page_size = 16; - blocksize = 128; + size = 2048; + page_size = 16; + n_word_writes = 2; + offset = 0x4000; + blocksize = 128; + ; + + memory "fuse" + n_word_writes = 2; ; ; @@ -16831,15 +13644,22 @@ part parent ".reduced_core_tiny" #------------------------------------------------------------ part parent ".reduced_core_tiny" - id = "t40"; - desc = "ATtiny40"; - signature = 0x1e 0x92 0x0E; + desc = "ATtiny40"; + id = "t40"; + mcuid = 5; + n_interrupts = 18; + signature = 0x1e 0x92 0x0e; memory "flash" - size = 4096; - offset = 0x4000; - page_size = 64; - blocksize = 128; + size = 4096; + page_size = 64; + n_word_writes = 4; + offset = 0x4000; + blocksize = 128; + ; + + memory "fuse" + n_word_writes = 4; ; ; @@ -16848,15 +13668,23 @@ part parent ".reduced_core_tiny" #------------------------------------------------------------ part parent ".reduced_core_tiny" - id = "t102"; - desc = "ATtiny102"; - signature = 0x1e 0x90 0x0C; + desc = "ATtiny102"; + id = "t102"; + mcuid = 6; + n_interrupts = 16; + signature = 0x1e 0x90 0x0c; memory "flash" - size = 1024; - offset = 0x4000; - page_size = 16; - blocksize = 128; + size = 1024; + page_size = 16; + offset = 0x4000; + blocksize = 128; + ; + + memory "sigrow" + size = 16; + page_size = 16; + offset = 0x3fc6; ; ; @@ -16865,15 +13693,23 @@ part parent ".reduced_core_tiny" #------------------------------------------------------------ part parent ".reduced_core_tiny" - id = "t104"; - desc = "ATtiny104"; - signature = 0x1e 0x90 0x0B; + desc = "ATtiny104"; + id = "t104"; + mcuid = 7; + n_interrupts = 16; + signature = 0x1e 0x90 0x0b; memory "flash" - size = 1024; - offset = 0x4000; - page_size = 16; - blocksize = 128; + size = 1024; + page_size = 16; + offset = 0x4000; + blocksize = 128; + ; + + memory "sigrow" + size = 16; + page_size = 16; + offset = 0x3fc6; ; ; @@ -16882,63 +13718,60 @@ part parent ".reduced_core_tiny" #------------------------------------------------------------ part - id = "m406"; - desc = "ATmega406"; - has_jtag = yes; - signature = 0x1e 0x95 0x07; - + desc = "ATmega406"; + id = "m406"; + prog_modes = PM_SPM | PM_HVPP | PM_JTAG; + mcuid = 125; + n_interrupts = 23; + n_boot_sections = 4; + boot_section_size = 512; # STK500 parameters (parallel programming IO lines) - pagel = 0xa7; - bs2 = 0xa0; - serial = no; - parallel = yes; - + pagel = 0xa7; + bs2 = 0xa0; + signature = 0x1e 0x95 0x07; + reset = io; + serial = no; # STK500v2 HV programming parameters, from XML - pp_controlstack = 0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f, - 0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f, - 0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b, - 0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - - # JTAG ICE mkII parameters, also from XML files - allowfullpagebitstream = no; - enablepageprogramming = yes; - idr = 0x51; - rampz = 0x00; - spmcr = 0x57; - eecr = 0x3f; + pp_controlstack = + 0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f, + 0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f, + 0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b, + 0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + idr = 0x51; + spmcr = 0x57; + eecr = 0x3f; memory "eeprom" - paged = no; - size = 512; - page_size = 4; - blocksize = 4; - readsize = 4; - num_pages = 128; + size = 512; + page_size = 4; + num_pages = 128; + blocksize = 4; + readsize = 4; ; memory "flash" - paged = yes; - size = 40960; - page_size = 128; - blocksize = 128; - readsize = 128; - num_pages = 320; - ; - - memory "hfuse" - size = 1; + paged = yes; + size = 0xa000; + page_size = 128; + num_pages = 320; + blocksize = 128; + readsize = 128; ; memory "lfuse" - size = 1; + size = 1; + ; + + memory "hfuse" + size = 1; ; memory "lockbits" - size = 1; + size = 1; ; memory "signature" - size = 3; + size = 3; ; ; @@ -16947,72 +13780,17 @@ part #------------------------------------------------------------ part - id = ".avr8x"; - desc = "AVR8X family common values"; - has_updi = yes; - nvm_base = 0x1000; - ocd_base = 0x0F80; - - memory "signature" - size = 3; - offset = 0x1100; - readsize = 0x3; - ; - - memory "prodsig" - size = 0x3D; - offset = 0x1103; - page_size = 0x3D; - readsize = 0x3D; - ; - - memory "sernum" - size = 10; - offset = 0x1104; - readsize = 1; - ; - - memory "osccal16" - size = 2; - offset = 0x1118; - readsize = 1; - ; - - memory "osccal20" - size = 2; - offset = 0x111A; - readsize = 1; - ; - - memory "tempsense" - size = 2; - offset = 0x1120; - readsize = 1; - ; - - memory "osc16err" - size = 2; - offset = 0x1122; - readsize = 1; - ; - - memory "osc20err" - size = 2; - offset = 0x1124; - readsize = 1; - ; - - memory "fuses" - size = 9; - offset = 0x1280; - page_size = 0x0A; - readsize = 0x0A; - ; + desc = "AVR8X family common values"; + id = ".avr8x"; + prog_modes = PM_SPM | PM_UPDI; + n_boot_sections = 1; + nvm_base = 0x1000; + ocd_base = 0x0f80; memory "fuse0" - size = 1; - offset = 0x1280; - readsize = 1; + size = 1; + offset = 0x1280; + readsize = 1; ; memory "wdtcfg" @@ -17020,9 +13798,9 @@ part ; memory "fuse1" - size = 1; - offset = 0x1281; - readsize = 1; + size = 1; + offset = 0x1281; + readsize = 1; ; memory "bodcfg" @@ -17030,9 +13808,9 @@ part ; memory "fuse2" - size = 1; - offset = 0x1282; - readsize = 1; + size = 1; + offset = 0x1282; + readsize = 1; ; memory "osccfg" @@ -17040,9 +13818,9 @@ part ; memory "fuse4" - size = 1; - offset = 0x1284; - readsize = 1; + size = 1; + offset = 0x1284; + readsize = 1; ; memory "tcd0cfg" @@ -17050,9 +13828,9 @@ part ; memory "fuse5" - size = 1; - offset = 0x1285; - readsize = 1; + size = 1; + offset = 0x1285; + readsize = 1; ; memory "syscfg0" @@ -17060,9 +13838,9 @@ part ; memory "fuse6" - size = 1; - offset = 0x1286; - readsize = 1; + size = 1; + offset = 0x1286; + readsize = 1; ; memory "syscfg1" @@ -17070,9 +13848,9 @@ part ; memory "fuse7" - size = 1; - offset = 0x1287; - readsize = 1; + size = 1; + offset = 0x1287; + readsize = 1; ; memory "append" @@ -17084,9 +13862,9 @@ part ; memory "fuse8" - size = 1; - offset = 0x1288; - readsize = 1; + size = 1; + offset = 0x1288; + readsize = 1; ; memory "bootend" @@ -17097,15 +13875,71 @@ part alias "fuse8"; ; + memory "fuses" + size = 9; + page_size = 10; + offset = 0x1280; + readsize = 10; + ; + memory "lock" - size = 1; - offset = 0x128a; - readsize = 1; + size = 1; + offset = 0x128a; + readsize = 1; + ; + + memory "tempsense" + size = 2; + offset = 0x1120; + readsize = 1; + ; + + memory "signature" + size = 3; + offset = 0x1100; + readsize = 3; + ; + + memory "prodsig" + size = 61; + page_size = 61; + offset = 0x1103; + readsize = 61; + ; + + memory "sernum" + size = 10; + offset = 0x1104; + readsize = 1; + ; + + memory "osccal16" + size = 2; + offset = 0x1118; + readsize = 1; + ; + + memory "osccal20" + size = 2; + offset = 0x111a; + readsize = 1; + ; + + memory "osc16err" + size = 2; + offset = 0x1122; + readsize = 1; + ; + + memory "osc20err" + size = 2; + offset = 0x1124; + readsize = 1; ; memory "data" # SRAM, only used to supply the offset - offset = 0x1000000; + offset = 0x1000000; ; ; @@ -17113,16 +13947,18 @@ part # AVR8X tiny family common values #------------------------------------------------------------ -part parent ".avr8x" - id = ".avr8x_tiny"; - desc = "AVR8X tiny family common values"; - family_id = "tinyAVR"; +part parent ".avr8x" + desc = "AVR8X tiny family common values"; + id = ".avr8x_tiny"; + family_id = "tinyAVR"; + # Shared UPDI pin, HV on UPDI pin + hvupdi_variant = 0; memory "userrow" - size = 0x20; - offset = 0x1300; - page_size = 0x20; - readsize = 0x100; + size = 32; + page_size = 32; + offset = 0x1300; + readsize = 256; ; memory "usersig" @@ -17134,16 +13970,18 @@ part parent ".avr8x" # AVR8X mega family common values #------------------------------------------------------------ -part parent ".avr8x" - id = ".avr8x_mega"; - desc = "AVR8X mega family common values"; - family_id = "megaAVR"; +part parent ".avr8x" + desc = "AVR8X mega family common values"; + id = ".avr8x_mega"; + family_id = "megaAVR"; + # Dedicated UPDI pin, no HV + hvupdi_variant = 1; memory "userrow" - size = 0x40; - offset = 0x1300; - page_size = 0x40; - readsize = 0x100; + size = 64; + page_size = 64; + offset = 0x1300; + readsize = 256; ; memory "usersig" @@ -17155,23 +13993,25 @@ part parent ".avr8x" # ATtiny202 #------------------------------------------------------------ -part parent ".avr8x_tiny" - id = "t202"; - desc = "ATtiny202"; - signature = 0x1E 0x91 0x23; - - memory "flash" - size = 0x800; - offset = 0x8000; - page_size = 0x40; - readsize = 0x100; - ; +part parent ".avr8x_tiny" + desc = "ATtiny202"; + id = "t202"; + mcuid = 280; + n_interrupts = 26; + signature = 0x1e 0x91 0x23; memory "eeprom" - size = 0x40; - offset = 0x1400; - page_size = 0x20; - readsize = 0x100; + size = 64; + page_size = 32; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 2048; + page_size = 64; + offset = 0x8000; + readsize = 256; ; ; @@ -17179,23 +14019,25 @@ part parent ".avr8x_tiny" # ATtiny204 #------------------------------------------------------------ -part parent ".avr8x_tiny" - id = "t204"; - desc = "ATtiny204"; - signature = 0x1E 0x91 0x22; - - memory "flash" - size = 0x800; - offset = 0x8000; - page_size = 0x40; - readsize = 0x100; - ; +part parent ".avr8x_tiny" + desc = "ATtiny204"; + id = "t204"; + mcuid = 281; + n_interrupts = 26; + signature = 0x1e 0x91 0x22; memory "eeprom" - size = 0x40; - offset = 0x1400; - page_size = 0x20; - readsize = 0x100; + size = 64; + page_size = 32; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 2048; + page_size = 64; + offset = 0x8000; + readsize = 256; ; ; @@ -17203,23 +14045,25 @@ part parent ".avr8x_tiny" # ATtiny402 #------------------------------------------------------------ -part parent ".avr8x_tiny" - id = "t402"; - desc = "ATtiny402"; - signature = 0x1E 0x92 0x27; - - memory "flash" - size = 0x1000; - offset = 0x8000; - page_size = 0x40; - readsize = 0x100; - ; +part parent ".avr8x_tiny" + desc = "ATtiny402"; + id = "t402"; + mcuid = 284; + n_interrupts = 26; + signature = 0x1e 0x92 0x27; memory "eeprom" - size = 0x80; - offset = 0x1400; - page_size = 0x20; - readsize = 0x100; + size = 128; + page_size = 32; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 4096; + page_size = 64; + offset = 0x8000; + readsize = 256; ; ; @@ -17227,23 +14071,25 @@ part parent ".avr8x_tiny" # ATtiny404 #------------------------------------------------------------ -part parent ".avr8x_tiny" - id = "t404"; - desc = "ATtiny404"; - signature = 0x1E 0x92 0x26; - - memory "flash" - size = 0x1000; - offset = 0x8000; - page_size = 0x40; - readsize = 0x100; - ; +part parent ".avr8x_tiny" + desc = "ATtiny404"; + id = "t404"; + mcuid = 285; + n_interrupts = 26; + signature = 0x1e 0x92 0x26; memory "eeprom" - size = 0x80; - offset = 0x1400; - page_size = 0x20; - readsize = 0x100; + size = 128; + page_size = 32; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 4096; + page_size = 64; + offset = 0x8000; + readsize = 256; ; ; @@ -17251,23 +14097,25 @@ part parent ".avr8x_tiny" # ATtiny406 #------------------------------------------------------------ -part parent ".avr8x_tiny" - id = "t406"; - desc = "ATtiny406"; - signature = 0x1E 0x92 0x25; - - memory "flash" - size = 0x1000; - offset = 0x8000; - page_size = 0x40; - readsize = 0x100; - ; +part parent ".avr8x_tiny" + desc = "ATtiny406"; + id = "t406"; + mcuid = 286; + n_interrupts = 26; + signature = 0x1e 0x92 0x25; memory "eeprom" - size = 0x80; - offset = 0x1400; - page_size = 0x20; - readsize = 0x100; + size = 128; + page_size = 32; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 4096; + page_size = 64; + offset = 0x8000; + readsize = 256; ; ; @@ -17275,23 +14123,25 @@ part parent ".avr8x_tiny" # ATtiny804 #------------------------------------------------------------ -part parent ".avr8x_tiny" - id = "t804"; - desc = "ATtiny804"; - signature = 0x1E 0x93 0x25; - - memory "flash" - size = 0x2000; - offset = 0x8000; - page_size = 0x40; - readsize = 0x100; - ; +part parent ".avr8x_tiny" + desc = "ATtiny804"; + id = "t804"; + mcuid = 295; + n_interrupts = 31; + signature = 0x1e 0x93 0x25; memory "eeprom" - size = 0x80; - offset = 0x1400; - page_size = 0x20; - readsize = 0x100; + size = 128; + page_size = 32; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 8192; + page_size = 64; + offset = 0x8000; + readsize = 256; ; ; @@ -17299,23 +14149,25 @@ part parent ".avr8x_tiny" # ATtiny806 #------------------------------------------------------------ -part parent ".avr8x_tiny" - id = "t806"; - desc = "ATtiny806"; - signature = 0x1E 0x93 0x24; - - memory "flash" - size = 0x2000; - offset = 0x8000; - page_size = 0x40; - readsize = 0x100; - ; +part parent ".avr8x_tiny" + desc = "ATtiny806"; + id = "t806"; + mcuid = 296; + n_interrupts = 31; + signature = 0x1e 0x93 0x24; memory "eeprom" - size = 0x80; - offset = 0x1400; - page_size = 0x20; - readsize = 0x100; + size = 128; + page_size = 32; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 8192; + page_size = 64; + offset = 0x8000; + readsize = 256; ; ; @@ -17323,23 +14175,25 @@ part parent ".avr8x_tiny" # ATtiny807 #------------------------------------------------------------ -part parent ".avr8x_tiny" - id = "t807"; - desc = "ATtiny807"; - signature = 0x1E 0x93 0x23; - - memory "flash" - size = 0x2000; - offset = 0x8000; - page_size = 0x40; - readsize = 0x100; - ; +part parent ".avr8x_tiny" + desc = "ATtiny807"; + id = "t807"; + mcuid = 297; + n_interrupts = 31; + signature = 0x1e 0x93 0x23; memory "eeprom" - size = 0x80; - offset = 0x1400; - page_size = 0x20; - readsize = 0x100; + size = 128; + page_size = 32; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 8192; + page_size = 64; + offset = 0x8000; + readsize = 256; ; ; @@ -17347,23 +14201,25 @@ part parent ".avr8x_tiny" # ATtiny1604 #------------------------------------------------------------ -part parent ".avr8x_tiny" - id = "t1604"; - desc = "ATtiny1604"; - signature = 0x1E 0x94 0x25; - - memory "flash" - size = 0x4000; - offset = 0x8000; - page_size = 0x40; - readsize = 0x100; - ; +part parent ".avr8x_tiny" + desc = "ATtiny1604"; + id = "t1604"; + mcuid = 304; + n_interrupts = 31; + signature = 0x1e 0x94 0x25; memory "eeprom" - size = 0x100; - offset = 0x1400; - page_size = 0x20; - readsize = 0x100; + size = 256; + page_size = 32; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 0x4000; + page_size = 64; + offset = 0x8000; + readsize = 256; ; ; @@ -17371,23 +14227,25 @@ part parent ".avr8x_tiny" # ATtiny1606 #------------------------------------------------------------ -part parent ".avr8x_tiny" - id = "t1606"; - desc = "ATtiny1606"; - signature = 0x1E 0x94 0x24; - - memory "flash" - size = 0x4000; - offset = 0x8000; - page_size = 0x40; - readsize = 0x100; - ; +part parent ".avr8x_tiny" + desc = "ATtiny1606"; + id = "t1606"; + mcuid = 305; + n_interrupts = 31; + signature = 0x1e 0x94 0x24; memory "eeprom" - size = 0x100; - offset = 0x1400; - page_size = 0x20; - readsize = 0x100; + size = 256; + page_size = 32; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 0x4000; + page_size = 64; + offset = 0x8000; + readsize = 256; ; ; @@ -17395,23 +14253,25 @@ part parent ".avr8x_tiny" # ATtiny1607 #------------------------------------------------------------ -part parent ".avr8x_tiny" - id = "t1607"; - desc = "ATtiny1607"; - signature = 0x1E 0x94 0x23; - - memory "flash" - size = 0x4000; - offset = 0x8000; - page_size = 0x40; - readsize = 0x100; - ; +part parent ".avr8x_tiny" + desc = "ATtiny1607"; + id = "t1607"; + mcuid = 306; + n_interrupts = 31; + signature = 0x1e 0x94 0x23; memory "eeprom" - size = 0x100; - offset = 0x1400; - page_size = 0x20; - readsize = 0x100; + size = 256; + page_size = 32; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 0x4000; + page_size = 64; + offset = 0x8000; + readsize = 256; ; ; @@ -17419,23 +14279,25 @@ part parent ".avr8x_tiny" # ATtiny212 #------------------------------------------------------------ -part parent ".avr8x_tiny" - id = "t212"; - desc = "ATtiny212"; - signature = 0x1E 0x91 0x21; - - memory "flash" - size = 0x800; - offset = 0x8000; - page_size = 0x40; - readsize = 0x100; - ; +part parent ".avr8x_tiny" + desc = "ATtiny212"; + id = "t212"; + mcuid = 282; + n_interrupts = 26; + signature = 0x1e 0x91 0x21; memory "eeprom" - size = 0x40; - offset = 0x1400; - page_size = 0x20; - readsize = 0x100; + size = 64; + page_size = 32; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 2048; + page_size = 64; + offset = 0x8000; + readsize = 256; ; ; @@ -17443,23 +14305,25 @@ part parent ".avr8x_tiny" # ATtiny214 #------------------------------------------------------------ -part parent ".avr8x_tiny" - id = "t214"; - desc = "ATtiny214"; - signature = 0x1E 0x91 0x20; - - memory "flash" - size = 0x800; - offset = 0x8000; - page_size = 0x40; - readsize = 0x100; - ; +part parent ".avr8x_tiny" + desc = "ATtiny214"; + id = "t214"; + mcuid = 283; + n_interrupts = 26; + signature = 0x1e 0x91 0x20; memory "eeprom" - size = 0x40; - offset = 0x1400; - page_size = 0x20; - readsize = 0x100; + size = 64; + page_size = 32; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 2048; + page_size = 64; + offset = 0x8000; + readsize = 256; ; ; @@ -17467,48 +14331,51 @@ part parent ".avr8x_tiny" # ATtiny412 #------------------------------------------------------------ -part parent ".avr8x_tiny" - id = "t412"; - desc = "ATtiny412"; - signature = 0x1E 0x92 0x23; - - memory "flash" - size = 0x1000; - offset = 0x8000; - page_size = 0x40; - readsize = 0x100; - ; +part parent ".avr8x_tiny" + desc = "ATtiny412"; + id = "t412"; + mcuid = 287; + n_interrupts = 26; + signature = 0x1e 0x92 0x23; memory "eeprom" - size = 0x80; - offset = 0x1400; - page_size = 0x20; - readsize = 0x100; + size = 128; + page_size = 32; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 4096; + page_size = 64; + offset = 0x8000; + readsize = 256; ; ; - #------------------------------------------------------------ # ATtiny414 #------------------------------------------------------------ -part parent ".avr8x_tiny" - id = "t414"; - desc = "ATtiny414"; - signature = 0x1E 0x92 0x22; - - memory "flash" - size = 0x1000; - offset = 0x8000; - page_size = 0x40; - readsize = 0x100; - ; +part parent ".avr8x_tiny" + desc = "ATtiny414"; + id = "t414"; + mcuid = 288; + n_interrupts = 26; + signature = 0x1e 0x92 0x22; memory "eeprom" - size = 0x80; - offset = 0x1400; - page_size = 0x20; - readsize = 0x100; + size = 128; + page_size = 32; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 4096; + page_size = 64; + offset = 0x8000; + readsize = 256; ; ; @@ -17516,98 +14383,103 @@ part parent ".avr8x_tiny" # ATtiny416 #------------------------------------------------------------ -part parent ".avr8x_tiny" - id = "t416"; - desc = "ATtiny416"; - signature = 0x1E 0x92 0x21; - - memory "flash" - size = 0x1000; - offset = 0x8000; - page_size = 0x40; - readsize = 0x100; - ; +part parent ".avr8x_tiny" + desc = "ATtiny416"; + id = "t416"; + mcuid = 289; + n_interrupts = 26; + signature = 0x1e 0x92 0x21; memory "eeprom" - size = 0x80; - offset = 0x1400; - page_size = 0x20; - readsize = 0x100; + size = 128; + page_size = 32; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 4096; + page_size = 64; + offset = 0x8000; + readsize = 256; ; ; - #------------------------------------------------------------ # ATtiny417 #------------------------------------------------------------ -part parent ".avr8x_tiny" - id = "t417"; - desc = "ATtiny417"; - signature = 0x1E 0x92 0x20; - - memory "flash" - size = 0x1000; - offset = 0x8000; - page_size = 0x40; - readsize = 0x100; - ; +part parent ".avr8x_tiny" + desc = "ATtiny417"; + id = "t417"; + mcuid = 291; + n_interrupts = 26; + signature = 0x1e 0x92 0x20; memory "eeprom" - size = 0x80; - offset = 0x1400; - page_size = 0x20; - readsize = 0x100; + size = 128; + page_size = 32; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 4096; + page_size = 64; + offset = 0x8000; + readsize = 256; ; ; - #------------------------------------------------------------ # ATtiny814 #------------------------------------------------------------ -part parent ".avr8x_tiny" - id = "t814"; - desc = "ATtiny814"; - signature = 0x1E 0x93 0x22; - - memory "flash" - size = 0x2000; - offset = 0x8000; - page_size = 0x40; - readsize = 0x100; - ; +part parent ".avr8x_tiny" + desc = "ATtiny814"; + id = "t814"; + mcuid = 298; + n_interrupts = 26; + signature = 0x1e 0x93 0x22; memory "eeprom" - size = 0x80; - offset = 0x1400; - page_size = 0x20; - readsize = 0x100; + size = 128; + page_size = 32; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 8192; + page_size = 64; + offset = 0x8000; + readsize = 256; ; ; - #------------------------------------------------------------ # ATtiny816 #------------------------------------------------------------ -part parent ".avr8x_tiny" - id = "t816"; - desc = "ATtiny816"; - signature = 0x1E 0x93 0x21; - - memory "flash" - size = 0x2000; - offset = 0x8000; - page_size = 0x40; - readsize = 0x100; - ; +part parent ".avr8x_tiny" + desc = "ATtiny816"; + id = "t816"; + mcuid = 299; + n_interrupts = 26; + signature = 0x1e 0x93 0x21; memory "eeprom" - size = 0x80; - offset = 0x1400; - page_size = 0x20; - readsize = 0x100; + size = 128; + page_size = 32; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 8192; + page_size = 64; + offset = 0x8000; + readsize = 256; ; ; @@ -17615,23 +14487,25 @@ part parent ".avr8x_tiny" # ATtiny817 #------------------------------------------------------------ -part parent ".avr8x_tiny" - id = "t817"; - desc = "ATtiny817"; - signature = 0x1E 0x93 0x20; - - memory "flash" - size = 0x2000; - offset = 0x8000; - page_size = 0x40; - readsize = 0x100; - ; +part parent ".avr8x_tiny" + desc = "ATtiny817"; + id = "t817"; + mcuid = 300; + n_interrupts = 26; + signature = 0x1e 0x93 0x20; memory "eeprom" - size = 0x80; - offset = 0x1400; - page_size = 0x20; - readsize = 0x100; + size = 128; + page_size = 32; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 8192; + page_size = 64; + offset = 0x8000; + readsize = 256; ; ; @@ -17639,23 +14513,25 @@ part parent ".avr8x_tiny" # ATtiny1614 #------------------------------------------------------------ -part parent ".avr8x_tiny" - id = "t1614"; - desc = "ATtiny1614"; - signature = 0x1E 0x94 0x22; - - memory "flash" - size = 0x4000; - offset = 0x8000; - page_size = 0x40; - readsize = 0x100; - ; +part parent ".avr8x_tiny" + desc = "ATtiny1614"; + id = "t1614"; + mcuid = 307; + n_interrupts = 31; + signature = 0x1e 0x94 0x22; memory "eeprom" - size = 0x100; - offset = 0x1400; - page_size = 0x20; - readsize = 0x100; + size = 256; + page_size = 32; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 0x4000; + page_size = 64; + offset = 0x8000; + readsize = 256; ; ; @@ -17663,23 +14539,25 @@ part parent ".avr8x_tiny" # ATtiny1616 #------------------------------------------------------------ -part parent ".avr8x_tiny" - id = "t1616"; - desc = "ATtiny1616"; - signature = 0x1E 0x94 0x21; - - memory "flash" - size = 0x4000; - offset = 0x8000; - page_size = 0x40; - readsize = 0x100; - ; +part parent ".avr8x_tiny" + desc = "ATtiny1616"; + id = "t1616"; + mcuid = 308; + n_interrupts = 31; + signature = 0x1e 0x94 0x21; memory "eeprom" - size = 0x100; - offset = 0x1400; - page_size = 0x20; - readsize = 0x100; + size = 256; + page_size = 32; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 0x4000; + page_size = 64; + offset = 0x8000; + readsize = 256; ; ; @@ -17687,23 +14565,25 @@ part parent ".avr8x_tiny" # ATtiny1617 #------------------------------------------------------------ -part parent ".avr8x_tiny" - id = "t1617"; - desc = "ATtiny1617"; - signature = 0x1E 0x94 0x20; - - memory "flash" - size = 0x4000; - offset = 0x8000; - page_size = 0x40; - readsize = 0x100; - ; +part parent ".avr8x_tiny" + desc = "ATtiny1617"; + id = "t1617"; + mcuid = 309; + n_interrupts = 31; + signature = 0x1e 0x94 0x20; memory "eeprom" - size = 0x100; - offset = 0x1400; - page_size = 0x20; - readsize = 0x100; + size = 256; + page_size = 32; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 0x4000; + page_size = 64; + offset = 0x8000; + readsize = 256; ; ; @@ -17711,23 +14591,34 @@ part parent ".avr8x_tiny" # ATtiny3216 #------------------------------------------------------------ -part parent ".avr8x_tiny" - id = "t3216"; - desc = "ATtiny3216"; - signature = 0x1E 0x95 0x21; - - memory "flash" - size = 0x8000; - offset = 0x8000; - page_size = 0x80; - readsize = 0x100; - ; +part parent ".avr8x_tiny" + desc = "ATtiny3216"; + id = "t3216"; + mcuid = 314; + n_interrupts = 31; + signature = 0x1e 0x95 0x21; memory "eeprom" - size = 0x100; - offset = 0x1400; - page_size = 0x40; - readsize = 0x100; + size = 256; + page_size = 64; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 0x8000; + page_size = 128; + offset = 0x8000; + readsize = 256; + ; + + memory "userrow" + size = 64; + page_size = 64; + ; + + memory "usersig" + alias "userrow"; ; ; @@ -17735,47 +14626,36 @@ part parent ".avr8x_tiny" # ATtiny3217 #------------------------------------------------------------ -part parent ".avr8x_tiny" - id = "t3217"; - desc = "ATtiny3217"; - signature = 0x1E 0x95 0x22; - - memory "flash" - size = 0x8000; - offset = 0x8000; - page_size = 0x80; - readsize = 0x100; - ; - - memory "eeprom" - size = 0x100; - offset = 0x1400; - page_size = 0x40; - readsize = 0x100; - ; +part parent "t3216" + desc = "ATtiny3217"; + id = "t3217"; + mcuid = 315; + signature = 0x1e 0x95 0x22; ; #------------------------------------------------------------ # ATtiny424 #------------------------------------------------------------ -part parent ".avr8x_tiny" - id = "t424"; - desc = "ATtiny424"; - signature = 0x1E 0x92 0x2C; - - memory "flash" - size = 0x1000; - offset = 0x8000; - page_size = 0x40; - readsize = 0x100; - ; +part parent ".avr8x_tiny" + desc = "ATtiny424"; + id = "t424"; + mcuid = 292; + n_interrupts = 30; + signature = 0x1e 0x92 0x2c; memory "eeprom" - size = 0x80; - offset = 0x1400; - page_size = 0x20; - readsize = 0x100; + size = 128; + page_size = 32; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 4096; + page_size = 64; + offset = 0x8000; + readsize = 256; ; ; @@ -17783,23 +14663,25 @@ part parent ".avr8x_tiny" # ATtiny426 #------------------------------------------------------------ -part parent ".avr8x_tiny" - id = "t426"; - desc = "ATtiny426"; - signature = 0x1E 0x92 0x2B; - - memory "flash" - size = 0x1000; - offset = 0x8000; - page_size = 0x40; - readsize = 0x100; - ; +part parent ".avr8x_tiny" + desc = "ATtiny426"; + id = "t426"; + mcuid = 293; + n_interrupts = 30; + signature = 0x1e 0x92 0x2b; memory "eeprom" - size = 0x80; - offset = 0x1400; - page_size = 0x20; - readsize = 0x100; + size = 128; + page_size = 32; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 4096; + page_size = 64; + offset = 0x8000; + readsize = 256; ; ; @@ -17807,23 +14689,25 @@ part parent ".avr8x_tiny" # ATtiny427 #------------------------------------------------------------ -part parent ".avr8x_tiny" - id = "t427"; - desc = "ATtiny427"; - signature = 0x1E 0x92 0x2A; - - memory "flash" - size = 0x1000; - offset = 0x8000; - page_size = 0x40; - readsize = 0x100; - ; +part parent ".avr8x_tiny" + desc = "ATtiny427"; + id = "t427"; + mcuid = 294; + n_interrupts = 30; + signature = 0x1e 0x92 0x2a; memory "eeprom" - size = 0x80; - offset = 0x1400; - page_size = 0x20; - readsize = 0x100; + size = 128; + page_size = 32; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 4096; + page_size = 64; + offset = 0x8000; + readsize = 256; ; ; @@ -17831,23 +14715,25 @@ part parent ".avr8x_tiny" # ATtiny824 #------------------------------------------------------------ -part parent ".avr8x_tiny" - id = "t824"; - desc = "ATtiny824"; - signature = 0x1E 0x93 0x29; - - memory "flash" - size = 0x2000; - offset = 0x8000; - page_size = 0x40; - readsize = 0x100; - ; +part parent ".avr8x_tiny" + desc = "ATtiny824"; + id = "t824"; + mcuid = 301; + n_interrupts = 30; + signature = 0x1e 0x93 0x29; memory "eeprom" - size = 0x80; - offset = 0x1400; - page_size = 0x20; - readsize = 0x100; + size = 128; + page_size = 32; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 8192; + page_size = 64; + offset = 0x8000; + readsize = 256; ; ; @@ -17855,23 +14741,25 @@ part parent ".avr8x_tiny" # ATtiny826 #------------------------------------------------------------ -part parent ".avr8x_tiny" - id = "t826"; - desc = "ATtiny826"; - signature = 0x1E 0x93 0x28; - - memory "flash" - size = 0x2000; - offset = 0x8000; - page_size = 0x40; - readsize = 0x100; - ; +part parent ".avr8x_tiny" + desc = "ATtiny826"; + id = "t826"; + mcuid = 302; + n_interrupts = 30; + signature = 0x1e 0x93 0x28; memory "eeprom" - size = 0x80; - offset = 0x1400; - page_size = 0x20; - readsize = 0x100; + size = 128; + page_size = 32; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 8192; + page_size = 64; + offset = 0x8000; + readsize = 256; ; ; @@ -17879,23 +14767,25 @@ part parent ".avr8x_tiny" # ATtiny827 #------------------------------------------------------------ -part parent ".avr8x_tiny" - id = "t827"; - desc = "ATtiny827"; - signature = 0x1E 0x93 0x27; - - memory "flash" - size = 0x2000; - offset = 0x8000; - page_size = 0x40; - readsize = 0x100; - ; +part parent ".avr8x_tiny" + desc = "ATtiny827"; + id = "t827"; + mcuid = 303; + n_interrupts = 30; + signature = 0x1e 0x93 0x27; memory "eeprom" - size = 0x80; - offset = 0x1400; - page_size = 0x20; - readsize = 0x100; + size = 128; + page_size = 32; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 8192; + page_size = 64; + offset = 0x8000; + readsize = 256; ; ; @@ -17903,46 +14793,51 @@ part parent ".avr8x_tiny" # ATtiny1624 #------------------------------------------------------------ -part parent ".avr8x_tiny" - id = "t1624"; - desc = "ATtiny1624"; - signature = 0x1E 0x94 0x2A; - - memory "flash" - size = 0x4000; - offset = 0x8000; - page_size = 0x40; - readsize = 0x100; - ; +part parent ".avr8x_tiny" + desc = "ATtiny1624"; + id = "t1624"; + mcuid = 310; + n_interrupts = 30; + signature = 0x1e 0x94 0x2a; memory "eeprom" - size = 0x100; - offset = 0x1400; - page_size = 0x20; - readsize = 0x100; + size = 256; + page_size = 32; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 0x4000; + page_size = 64; + offset = 0x8000; + readsize = 256; ; ; + #------------------------------------------------------------ # ATtiny1626 #------------------------------------------------------------ -part parent ".avr8x_tiny" - id = "t1626"; - desc = "ATtiny1626"; - signature = 0x1E 0x94 0x29; - - memory "flash" - size = 0x4000; - offset = 0x8000; - page_size = 0x40; - readsize = 0x100; - ; +part parent ".avr8x_tiny" + desc = "ATtiny1626"; + id = "t1626"; + mcuid = 311; + n_interrupts = 30; + signature = 0x1e 0x94 0x29; memory "eeprom" - size = 0x100; - offset = 0x1400; - page_size = 0x20; - readsize = 0x100; + size = 256; + page_size = 32; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 0x4000; + page_size = 64; + offset = 0x8000; + readsize = 256; ; ; @@ -17950,23 +14845,25 @@ part parent ".avr8x_tiny" # ATtiny1627 #------------------------------------------------------------ -part parent ".avr8x_tiny" - id = "t1627"; - desc = "ATtiny1627"; - signature = 0x1E 0x94 0x28; - - memory "flash" - size = 0x4000; - offset = 0x8000; - page_size = 0x40; - readsize = 0x100; - ; +part parent ".avr8x_tiny" + desc = "ATtiny1627"; + id = "t1627"; + mcuid = 312; + n_interrupts = 30; + signature = 0x1e 0x94 0x28; memory "eeprom" - size = 0x100; - offset = 0x1400; - page_size = 0x20; - readsize = 0x100; + size = 256; + page_size = 32; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 0x4000; + page_size = 64; + offset = 0x8000; + readsize = 256; ; ; @@ -17974,23 +14871,25 @@ part parent ".avr8x_tiny" # ATtiny3224 #------------------------------------------------------------ -part parent ".avr8x_tiny" - id = "t3224"; - desc = "ATtiny3224"; - signature = 0x1E 0x95 0x28; - - memory "flash" - size = 0x8000; - offset = 0x8000; - page_size = 0x80; - readsize = 0x100; - ; +part parent ".avr8x_tiny" + desc = "ATtiny3224"; + id = "t3224"; + mcuid = 316; + n_interrupts = 30; + signature = 0x1e 0x95 0x28; memory "eeprom" - size = 0x100; - offset = 0x1400; - page_size = 0x40; - readsize = 0x100; + size = 256; + page_size = 64; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 0x8000; + page_size = 128; + offset = 0x8000; + readsize = 256; ; ; @@ -17998,23 +14897,25 @@ part parent ".avr8x_tiny" # ATtiny3226 #------------------------------------------------------------ -part parent ".avr8x_tiny" - id = "t3226"; - desc = "ATtiny3226"; - signature = 0x1E 0x95 0x27; - - memory "flash" - size = 0x8000; - offset = 0x8000; - page_size = 0x80; - readsize = 0x100; - ; +part parent ".avr8x_tiny" + desc = "ATtiny3226"; + id = "t3226"; + mcuid = 317; + n_interrupts = 30; + signature = 0x1e 0x95 0x27; memory "eeprom" - size = 0x100; - offset = 0x1400; - page_size = 0x40; - readsize = 0x100; + size = 256; + page_size = 64; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 0x8000; + page_size = 128; + offset = 0x8000; + readsize = 256; ; ; @@ -18022,23 +14923,25 @@ part parent ".avr8x_tiny" # ATtiny3227 #------------------------------------------------------------ -part parent ".avr8x_tiny" - id = "t3227"; - desc = "ATtiny3227"; - signature = 0x1E 0x95 0x26; - - memory "flash" - size = 0x8000; - offset = 0x8000; - page_size = 0x80; - readsize = 0x100; - ; +part parent ".avr8x_tiny" + desc = "ATtiny3227"; + id = "t3227"; + mcuid = 318; + n_interrupts = 30; + signature = 0x1e 0x95 0x26; memory "eeprom" - size = 0x100; - offset = 0x1400; - page_size = 0x40; - readsize = 0x100; + size = 256; + page_size = 64; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 0x8000; + page_size = 128; + offset = 0x8000; + readsize = 256; ; ; @@ -18046,23 +14949,25 @@ part parent ".avr8x_tiny" # ATmega808 #------------------------------------------------------------ -part parent ".avr8x_tiny" - id = "m808"; - desc = "ATmega808"; - signature = 0x1E 0x93 0x26; - - memory "flash" - size = 0x2000; - offset = 0x4000; - page_size = 0x40; - readsize = 0x100; - ; +part parent ".avr8x_tiny" + desc = "ATmega808"; + id = "m808"; + mcuid = 319; + n_interrupts = 36; + signature = 0x1e 0x93 0x26; memory "eeprom" - size = 0x100; - offset = 0x1400; - page_size = 0x20; - readsize = 0x100; + size = 256; + page_size = 32; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 8192; + page_size = 64; + offset = 0x4000; + readsize = 256; ; ; @@ -18070,23 +14975,25 @@ part parent ".avr8x_tiny" # ATmega809 #------------------------------------------------------------ -part parent ".avr8x_tiny" - id = "m809"; - desc = "ATmega809"; - signature = 0x1E 0x93 0x2A; - - memory "flash" - size = 0x2000; - offset = 0x4000; - page_size = 0x40; - readsize = 0x100; - ; +part parent ".avr8x_tiny" + desc = "ATmega809"; + id = "m809"; + mcuid = 320; + n_interrupts = 40; + signature = 0x1e 0x93 0x2a; memory "eeprom" - size = 0x100; - offset = 0x1400; - page_size = 0x20; - readsize = 0x100; + size = 256; + page_size = 32; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 8192; + page_size = 64; + offset = 0x4000; + readsize = 256; ; ; @@ -18094,23 +15001,25 @@ part parent ".avr8x_tiny" # ATmega1608 #------------------------------------------------------------ -part parent ".avr8x_tiny" - id = "m1608"; - desc = "ATmega1608"; - signature = 0x1E 0x94 0x27; - - memory "flash" - size = 0x4000; - offset = 0x4000; - page_size = 0x40; - readsize = 0x100; - ; +part parent ".avr8x_tiny" + desc = "ATmega1608"; + id = "m1608"; + mcuid = 321; + n_interrupts = 36; + signature = 0x1e 0x94 0x27; memory "eeprom" - size = 0x100; - offset = 0x1400; - page_size = 0x20; - readsize = 0x100; + size = 256; + page_size = 32; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 0x4000; + page_size = 64; + offset = 0x4000; + readsize = 256; ; ; @@ -18118,23 +15027,25 @@ part parent ".avr8x_tiny" # ATmega1609 #------------------------------------------------------------ -part parent ".avr8x_tiny" - id = "m1609"; - desc = "ATmega1609"; - signature = 0x1E 0x94 0x26; - - memory "flash" - size = 0x4000; - offset = 0x4000; - page_size = 0x40; - readsize = 0x100; - ; +part parent ".avr8x_tiny" + desc = "ATmega1609"; + id = "m1609"; + mcuid = 322; + n_interrupts = 40; + signature = 0x1e 0x94 0x26; memory "eeprom" - size = 0x100; - offset = 0x1400; - page_size = 0x20; - readsize = 0x100; + size = 256; + page_size = 32; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 0x4000; + page_size = 64; + offset = 0x4000; + readsize = 256; ; ; @@ -18142,23 +15053,25 @@ part parent ".avr8x_tiny" # ATmega3208 #------------------------------------------------------------ -part parent ".avr8x_mega" - id = "m3208"; - desc = "ATmega3208"; - signature = 0x1E 0x95 0x30; - - memory "flash" - size = 0x8000; - offset = 0x4000; - page_size = 0x80; - readsize = 0x100; - ; +part parent ".avr8x_mega" + desc = "ATmega3208"; + id = "m3208"; + mcuid = 323; + n_interrupts = 36; + signature = 0x1e 0x95 0x30; memory "eeprom" - size = 0x100; - offset = 0x1400; - page_size = 0x40; - readsize = 0x100; + size = 256; + page_size = 64; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 0x8000; + page_size = 128; + offset = 0x4000; + readsize = 256; ; ; @@ -18166,23 +15079,25 @@ part parent ".avr8x_mega" # ATmega3209 #------------------------------------------------------------ -part parent ".avr8x_mega" - id = "m3209"; - desc = "ATmega3209"; - signature = 0x1E 0x95 0x31; - - memory "flash" - size = 0x8000; - offset = 0x4000; - page_size = 0x80; - readsize = 0x100; - ; +part parent ".avr8x_mega" + desc = "ATmega3209"; + id = "m3209"; + mcuid = 324; + n_interrupts = 40; + signature = 0x1e 0x95 0x31; memory "eeprom" - size = 0x100; - offset = 0x1400; - page_size = 0x40; - readsize = 0x100; + size = 256; + page_size = 64; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 0x8000; + page_size = 128; + offset = 0x4000; + readsize = 256; ; ; @@ -18190,23 +15105,25 @@ part parent ".avr8x_mega" # ATmega4808 #------------------------------------------------------------ -part parent ".avr8x_mega" - id = "m4808"; - desc = "ATmega4808"; - signature = 0x1E 0x96 0x50; - - memory "flash" - size = 0xC000; - offset = 0x4000; - page_size = 0x80; - readsize = 0x100; - ; +part parent ".avr8x_mega" + desc = "ATmega4808"; + id = "m4808"; + mcuid = 325; + n_interrupts = 36; + signature = 0x1e 0x96 0x50; memory "eeprom" - size = 0x100; - offset = 0x1400; - page_size = 0x40; - readsize = 0x100; + size = 256; + page_size = 64; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 0xc000; + page_size = 128; + offset = 0x4000; + readsize = 256; ; ; @@ -18214,23 +15131,25 @@ part parent ".avr8x_mega" # ATmega4809 #------------------------------------------------------------ -part parent ".avr8x_mega" - id = "m4809"; - desc = "ATmega4809"; - signature = 0x1E 0x96 0x51; - - memory "flash" - size = 0xC000; - offset = 0x4000; - page_size = 0x80; - readsize = 0x100; - ; +part parent ".avr8x_mega" + desc = "ATmega4809"; + id = "m4809"; + mcuid = 326; + n_interrupts = 40; + signature = 0x1e 0x96 0x51; memory "eeprom" - size = 0x100; - offset = 0x1400; - page_size = 0x40; - readsize = 0x100; + size = 256; + page_size = 64; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 0xc000; + page_size = 128; + offset = 0x4000; + readsize = 256; ; ; @@ -18239,48 +15158,20 @@ part parent ".avr8x_mega" #------------------------------------------------------------ part - id = ".avrdx"; - desc = "AVR-Dx family common values"; - has_updi = yes; - nvm_base = 0x1000; - ocd_base = 0x0F80; - - memory "signature" - size = 3; - offset = 0x1100; - readsize = 0x3; - ; - - memory "prodsig" - size = 0x7D; - offset = 0x1103; - page_size = 0x7D; - readsize = 0x7D; - ; - - memory "tempsense" - size = 2; - offset = 0x1104; - readsize = 1; - ; - - memory "sernum" - size = 16; - offset = 0x1110; - readsize = 1; - ; - - memory "fuses" - size = 9; - offset = 0x1050; - page_size = 0x10; - readsize = 0x10; - ; + desc = "AVR-Dx family common values"; + id = ".avrdx"; + family_id = "AVR "; + prog_modes = PM_SPM | PM_UPDI; + n_boot_sections = 1; + # Dedicated UPDI pin, no HV + hvupdi_variant = 1; + nvm_base = 0x1000; + ocd_base = 0x0f80; memory "fuse0" - size = 1; - offset = 0x1050; - readsize = 1; + size = 1; + offset = 0x1050; + readsize = 1; ; memory "wdtcfg" @@ -18288,9 +15179,9 @@ part ; memory "fuse1" - size = 1; - offset = 0x1051; - readsize = 1; + size = 1; + offset = 0x1051; + readsize = 1; ; memory "bodcfg" @@ -18298,9 +15189,9 @@ part ; memory "fuse2" - size = 1; - offset = 0x1052; - readsize = 1; + size = 1; + offset = 0x1052; + readsize = 1; ; memory "osccfg" @@ -18308,9 +15199,9 @@ part ; memory "fuse4" - size = 1; - offset = 0x1054; - readsize = 1; + size = 1; + offset = 0x1054; + readsize = 1; ; memory "tcd0cfg" @@ -18318,9 +15209,9 @@ part ; memory "fuse5" - size = 1; - offset = 0x1055; - readsize = 1; + size = 1; + offset = 0x1055; + readsize = 1; ; memory "syscfg0" @@ -18328,9 +15219,9 @@ part ; memory "fuse6" - size = 1; - offset = 0x1056; - readsize = 1; + size = 1; + offset = 0x1056; + readsize = 1; ; memory "syscfg1" @@ -18338,9 +15229,9 @@ part ; memory "fuse7" - size = 1; - offset = 0x1057; - readsize = 1; + size = 1; + offset = 0x1057; + readsize = 1; ; memory "codesize" @@ -18352,9 +15243,9 @@ part ; memory "fuse8" - size = 1; - offset = 0x1058; - readsize = 1; + size = 1; + offset = 0x1058; + readsize = 1; ; memory "bootsize" @@ -18365,18 +15256,49 @@ part alias "fuse8"; ; + memory "fuses" + size = 9; + page_size = 16; + offset = 0x1050; + readsize = 16; + ; + memory "lock" - size = 4; - offset = 0x1040; - page_size = 0x1; - readsize = 0x4; + size = 4; + offset = 0x1040; + readsize = 4; + ; + + memory "tempsense" + size = 2; + offset = 0x1104; + readsize = 1; + ; + + memory "signature" + size = 3; + offset = 0x1100; + readsize = 3; + ; + + memory "prodsig" + size = 125; + page_size = 125; + offset = 0x1103; + readsize = 125; + ; + + memory "sernum" + size = 16; + offset = 0x1110; + readsize = 1; ; memory "userrow" - size = 0x20; - offset = 0x1080; - page_size = 0x20; - readsize = 0x20; + size = 32; + page_size = 32; + offset = 0x1080; + readsize = 32; ; memory "usersig" @@ -18385,7 +15307,7 @@ part memory "data" # SRAM, only used to supply the offset - offset = 0x1000000; + offset = 0x1000000; ; ; @@ -18393,23 +15315,25 @@ part # AVR32DA28 #------------------------------------------------------------ -part parent ".avrdx" - id = "avr32da28"; - desc = "AVR32DA28"; - signature = 0x1E 0x95 0x34; - - memory "flash" - size = 0x8000; - offset = 0x800000; - page_size = 0x200; - readsize = 0x100; - ; +part parent ".avrdx" + desc = "AVR32DA28"; + id = "avr32da28"; + family_id = " AVR"; + mcuid = 338; + n_interrupts = 41; + signature = 0x1e 0x95 0x34; memory "eeprom" - size = 0x200; - offset = 0x1400; - page_size = 0x1; - readsize = 0x100; + size = 512; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 0x8000; + page_size = 512; + offset = 0x800000; + readsize = 256; ; ; @@ -18417,23 +15341,25 @@ part parent ".avrdx" # AVR32DA32 #------------------------------------------------------------ -part parent ".avrdx" - id = "avr32da32"; - desc = "AVR32DA32"; - signature = 0x1E 0x95 0x33; - - memory "flash" - size = 0x8000; - offset = 0x800000; - page_size = 0x200; - readsize = 0x100; - ; +part parent ".avrdx" + desc = "AVR32DA32"; + id = "avr32da32"; + family_id = " AVR"; + mcuid = 342; + n_interrupts = 44; + signature = 0x1e 0x95 0x33; memory "eeprom" - size = 0x200; - offset = 0x1400; - page_size = 0x1; - readsize = 0x100; + size = 512; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 0x8000; + page_size = 512; + offset = 0x800000; + readsize = 256; ; ; @@ -18441,23 +15367,25 @@ part parent ".avrdx" # AVR32DA48 #------------------------------------------------------------ -part parent ".avrdx" - id = "avr32da48"; - desc = "AVR32DA48"; - signature = 0x1E 0x95 0x32; - - memory "flash" - size = 0x8000; - offset = 0x800000; - page_size = 0x200; - readsize = 0x100; - ; +part parent ".avrdx" + desc = "AVR32DA48"; + id = "avr32da48"; + family_id = " AVR"; + mcuid = 346; + n_interrupts = 58; + signature = 0x1e 0x95 0x32; memory "eeprom" - size = 0x200; - offset = 0x1400; - page_size = 0x1; - readsize = 0x100; + size = 512; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 0x8000; + page_size = 512; + offset = 0x800000; + readsize = 256; ; ; @@ -18465,23 +15393,25 @@ part parent ".avrdx" # AVR64DA28 #------------------------------------------------------------ -part parent ".avrdx" - id = "avr64da28"; - desc = "AVR64DA28"; - signature = 0x1E 0x96 0x15; - - memory "flash" - size = 0x10000; - offset = 0x800000; - page_size = 0x200; - readsize = 0x100; - ; +part parent ".avrdx" + desc = "AVR64DA28"; + id = "avr64da28"; + family_id = " AVR"; + mcuid = 351; + n_interrupts = 41; + signature = 0x1e 0x96 0x15; memory "eeprom" - size = 0x200; - offset = 0x1400; - page_size = 0x1; - readsize = 0x100; + size = 512; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 0x10000; + page_size = 512; + offset = 0x800000; + readsize = 256; ; ; @@ -18489,23 +15419,25 @@ part parent ".avrdx" # AVR64DA32 #------------------------------------------------------------ -part parent ".avrdx" - id = "avr64da32"; - desc = "AVR64DA32"; - signature = 0x1E 0x96 0x14; - - memory "flash" - size = 0x10000; - offset = 0x800000; - page_size = 0x200; - readsize = 0x100; - ; +part parent ".avrdx" + desc = "AVR64DA32"; + id = "avr64da32"; + family_id = " AVR"; + mcuid = 355; + n_interrupts = 44; + signature = 0x1e 0x96 0x14; memory "eeprom" - size = 0x200; - offset = 0x1400; - page_size = 0x1; - readsize = 0x100; + size = 512; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 0x10000; + page_size = 512; + offset = 0x800000; + readsize = 256; ; ; @@ -18513,23 +15445,25 @@ part parent ".avrdx" # AVR64DA48 #------------------------------------------------------------ -part parent ".avrdx" - id = "avr64da48"; - desc = "AVR64DA48"; - signature = 0x1E 0x96 0x13; - - memory "flash" - size = 0x10000; - offset = 0x800000; - page_size = 0x200; - readsize = 0x100; - ; +part parent ".avrdx" + desc = "AVR64DA48"; + id = "avr64da48"; + family_id = " AVR"; + mcuid = 359; + n_interrupts = 58; + signature = 0x1e 0x96 0x13; memory "eeprom" - size = 0x200; - offset = 0x1400; - page_size = 0x1; - readsize = 0x100; + size = 512; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 0x10000; + page_size = 512; + offset = 0x800000; + readsize = 256; ; ; @@ -18537,23 +15471,25 @@ part parent ".avrdx" # AVR64DA64 #------------------------------------------------------------ -part parent ".avrdx" - id = "avr64da64"; - desc = "AVR64DA64"; - signature = 0x1E 0x96 0x12; - - memory "flash" - size = 0x10000; - offset = 0x800000; - page_size = 0x200; - readsize = 0x100; - ; +part parent ".avrdx" + desc = "AVR64DA64"; + id = "avr64da64"; + family_id = " AVR"; + mcuid = 362; + n_interrupts = 64; + signature = 0x1e 0x96 0x12; memory "eeprom" - size = 0x200; - offset = 0x1400; - page_size = 0x1; - readsize = 0x100; + size = 512; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 0x10000; + page_size = 512; + offset = 0x800000; + readsize = 256; ; ; @@ -18561,23 +15497,25 @@ part parent ".avrdx" # AVR128DA28 #------------------------------------------------------------ -part parent ".avrdx" - id = "avr128da28"; - desc = "AVR128DA28"; - signature = 0x1E 0x97 0x0A; - - memory "flash" - size = 0x20000; - offset = 0x800000; - page_size = 0x200; - readsize = 0x100; - ; +part parent ".avrdx" + desc = "AVR128DA28"; + id = "avr128da28"; + family_id = " AVR"; + mcuid = 364; + n_interrupts = 41; + signature = 0x1e 0x97 0x0a; memory "eeprom" - size = 0x200; - offset = 0x1400; - page_size = 0x1; - readsize = 0x100; + size = 512; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 0x20000; + page_size = 512; + offset = 0x800000; + readsize = 256; ; ; @@ -18585,23 +15523,25 @@ part parent ".avrdx" # AVR128DA32 #------------------------------------------------------------ -part parent ".avrdx" - id = "avr128da32"; - desc = "AVR128DA32"; - signature = 0x1E 0x97 0x09; - - memory "flash" - size = 0x20000; - offset = 0x800000; - page_size = 0x200; - readsize = 0x100; - ; +part parent ".avrdx" + desc = "AVR128DA32"; + id = "avr128da32"; + family_id = " AVR"; + mcuid = 366; + n_interrupts = 44; + signature = 0x1e 0x97 0x09; memory "eeprom" - size = 0x200; - offset = 0x1400; - page_size = 0x1; - readsize = 0x100; + size = 512; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 0x20000; + page_size = 512; + offset = 0x800000; + readsize = 256; ; ; @@ -18609,23 +15549,25 @@ part parent ".avrdx" # AVR128DA48 #------------------------------------------------------------ -part parent ".avrdx" - id = "avr128da48"; - desc = "AVR128DA48"; - signature = 0x1E 0x97 0x08; - - memory "flash" - size = 0x20000; - offset = 0x800000; - page_size = 0x200; - readsize = 0x100; - ; +part parent ".avrdx" + desc = "AVR128DA48"; + id = "avr128da48"; + family_id = " AVR"; + mcuid = 368; + n_interrupts = 58; + signature = 0x1e 0x97 0x08; memory "eeprom" - size = 0x200; - offset = 0x1400; - page_size = 0x1; - readsize = 0x100; + size = 512; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 0x20000; + page_size = 512; + offset = 0x800000; + readsize = 256; ; ; @@ -18633,23 +15575,25 @@ part parent ".avrdx" # AVR128DA64 #------------------------------------------------------------ -part parent ".avrdx" - id = "avr128da64"; - desc = "AVR128DA64"; - signature = 0x1E 0x97 0x07; - - memory "flash" - size = 0x20000; - offset = 0x800000; - page_size = 0x200; - readsize = 0x100; - ; +part parent ".avrdx" + desc = "AVR128DA64"; + id = "avr128da64"; + family_id = " AVR"; + mcuid = 370; + n_interrupts = 64; + signature = 0x1e 0x97 0x07; memory "eeprom" - size = 0x200; - offset = 0x1400; - page_size = 0x1; - readsize = 0x100; + size = 512; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 0x20000; + page_size = 512; + offset = 0x800000; + readsize = 256; ; ; @@ -18657,23 +15601,24 @@ part parent ".avrdx" # AVR32DB28 #------------------------------------------------------------ -part parent ".avrdx" - id = "avr32db28"; - desc = "AVR32DB28"; - signature = 0x1E 0x95 0x37; - - memory "flash" - size = 0x8000; - offset = 0x800000; - page_size = 0x200; - readsize = 0x100; - ; +part parent ".avrdx" + desc = "AVR32DB28"; + id = "avr32db28"; + mcuid = 339; + n_interrupts = 42; + signature = 0x1e 0x95 0x37; memory "eeprom" - size = 0x200; - offset = 0x1400; - page_size = 0x1; - readsize = 0x100; + size = 512; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 0x8000; + page_size = 512; + offset = 0x800000; + readsize = 256; ; ; @@ -18681,23 +15626,24 @@ part parent ".avrdx" # AVR32DB32 #------------------------------------------------------------ -part parent ".avrdx" - id = "avr32db32"; - desc = "AVR32DB32"; - signature = 0x1E 0x95 0x36; - - memory "flash" - size = 0x8000; - offset = 0x800000; - page_size = 0x200; - readsize = 0x100; - ; +part parent ".avrdx" + desc = "AVR32DB32"; + id = "avr32db32"; + mcuid = 343; + n_interrupts = 44; + signature = 0x1e 0x95 0x36; memory "eeprom" - size = 0x200; - offset = 0x1400; - page_size = 0x1; - readsize = 0x100; + size = 512; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 0x8000; + page_size = 512; + offset = 0x800000; + readsize = 256; ; ; @@ -18705,23 +15651,24 @@ part parent ".avrdx" # AVR32DB48 #------------------------------------------------------------ -part parent ".avrdx" - id = "avr32db48"; - desc = "AVR32DB48"; - signature = 0x1E 0x95 0x35; - - memory "flash" - size = 0x8000; - offset = 0x800000; - page_size = 0x200; - readsize = 0x100; - ; +part parent ".avrdx" + desc = "AVR32DB48"; + id = "avr32db48"; + mcuid = 347; + n_interrupts = 61; + signature = 0x1e 0x95 0x35; memory "eeprom" - size = 0x200; - offset = 0x1400; - page_size = 0x1; - readsize = 0x100; + size = 512; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 0x8000; + page_size = 512; + offset = 0x800000; + readsize = 256; ; ; @@ -18729,23 +15676,24 @@ part parent ".avrdx" # AVR64DB28 #------------------------------------------------------------ -part parent ".avrdx" - id = "avr64db28"; - desc = "AVR64DB28"; - signature = 0x1E 0x96 0x19; - - memory "flash" - size = 0x10000; - offset = 0x800000; - page_size = 0x200; - readsize = 0x100; - ; +part parent ".avrdx" + desc = "AVR64DB28"; + id = "avr64db28"; + mcuid = 352; + n_interrupts = 42; + signature = 0x1e 0x96 0x19; memory "eeprom" - size = 0x200; - offset = 0x1400; - page_size = 0x1; - readsize = 0x100; + size = 512; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 0x10000; + page_size = 512; + offset = 0x800000; + readsize = 256; ; ; @@ -18753,23 +15701,24 @@ part parent ".avrdx" # AVR64DB32 #------------------------------------------------------------ -part parent ".avrdx" - id = "avr64db32"; - desc = "AVR64DB32"; - signature = 0x1E 0x96 0x18; - - memory "flash" - size = 0x10000; - offset = 0x800000; - page_size = 0x200; - readsize = 0x100; - ; +part parent ".avrdx" + desc = "AVR64DB32"; + id = "avr64db32"; + mcuid = 356; + n_interrupts = 44; + signature = 0x1e 0x96 0x18; memory "eeprom" - size = 0x200; - offset = 0x1400; - page_size = 0x1; - readsize = 0x100; + size = 512; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 0x10000; + page_size = 512; + offset = 0x800000; + readsize = 256; ; ; @@ -18777,23 +15726,24 @@ part parent ".avrdx" # AVR64DB48 #------------------------------------------------------------ -part parent ".avrdx" - id = "avr64db48"; - desc = "AVR64DB48"; - signature = 0x1E 0x96 0x17; - - memory "flash" - size = 0x10000; - offset = 0x800000; - page_size = 0x200; - readsize = 0x100; - ; +part parent ".avrdx" + desc = "AVR64DB48"; + id = "avr64db48"; + mcuid = 360; + n_interrupts = 61; + signature = 0x1e 0x96 0x17; memory "eeprom" - size = 0x200; - offset = 0x1400; - page_size = 0x1; - readsize = 0x100; + size = 512; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 0x10000; + page_size = 512; + offset = 0x800000; + readsize = 256; ; ; @@ -18801,23 +15751,24 @@ part parent ".avrdx" # AVR64DB64 #------------------------------------------------------------ -part parent ".avrdx" - id = "avr64db64"; - desc = "AVR64DB64"; - signature = 0x1E 0x96 0x16; - - memory "flash" - size = 0x10000; - offset = 0x800000; - page_size = 0x200; - readsize = 0x100; - ; +part parent ".avrdx" + desc = "AVR64DB64"; + id = "avr64db64"; + mcuid = 363; + n_interrupts = 65; + signature = 0x1e 0x96 0x16; memory "eeprom" - size = 0x200; - offset = 0x1400; - page_size = 0x1; - readsize = 0x100; + size = 512; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 0x10000; + page_size = 512; + offset = 0x800000; + readsize = 256; ; ; @@ -18825,23 +15776,24 @@ part parent ".avrdx" # AVR128DB28 #------------------------------------------------------------ -part parent ".avrdx" - id = "avr128db28"; - desc = "AVR128DB28"; - signature = 0x1E 0x97 0x0E; - - memory "flash" - size = 0x20000; - offset = 0x800000; - page_size = 0x200; - readsize = 0x100; - ; +part parent ".avrdx" + desc = "AVR128DB28"; + id = "avr128db28"; + mcuid = 365; + n_interrupts = 42; + signature = 0x1e 0x97 0x0e; memory "eeprom" - size = 0x200; - offset = 0x1400; - page_size = 0x1; - readsize = 0x100; + size = 512; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 0x20000; + page_size = 512; + offset = 0x800000; + readsize = 256; ; ; @@ -18849,23 +15801,24 @@ part parent ".avrdx" # AVR128DB32 #------------------------------------------------------------ -part parent ".avrdx" - id = "avr128db32"; - desc = "AVR128DB32"; - signature = 0x1E 0x97 0x0D; - - memory "flash" - size = 0x20000; - offset = 0x800000; - page_size = 0x200; - readsize = 0x100; - ; +part parent ".avrdx" + desc = "AVR128DB32"; + id = "avr128db32"; + mcuid = 367; + n_interrupts = 44; + signature = 0x1e 0x97 0x0d; memory "eeprom" - size = 0x200; - offset = 0x1400; - page_size = 0x1; - readsize = 0x100; + size = 512; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 0x20000; + page_size = 512; + offset = 0x800000; + readsize = 256; ; ; @@ -18873,23 +15826,24 @@ part parent ".avrdx" # AVR128DB48 #------------------------------------------------------------ -part parent ".avrdx" - id = "avr128db48"; - desc = "AVR128DB48"; - signature = 0x1E 0x97 0x0C; - - memory "flash" - size = 0x20000; - offset = 0x800000; - page_size = 0x200; - readsize = 0x100; - ; +part parent ".avrdx" + desc = "AVR128DB48"; + id = "avr128db48"; + mcuid = 369; + n_interrupts = 61; + signature = 0x1e 0x97 0x0c; memory "eeprom" - size = 0x200; - offset = 0x1400; - page_size = 0x1; - readsize = 0x100; + size = 512; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 0x20000; + page_size = 512; + offset = 0x800000; + readsize = 256; ; ; @@ -18897,23 +15851,24 @@ part parent ".avrdx" # AVR128DB64 #------------------------------------------------------------ -part parent ".avrdx" - id = "avr128db64"; - desc = "AVR128DB64"; - signature = 0x1E 0x97 0x0B; - - memory "flash" - size = 0x20000; - offset = 0x800000; - page_size = 0x200; - readsize = 0x100; - ; +part parent ".avrdx" + desc = "AVR128DB64"; + id = "avr128db64"; + mcuid = 371; + n_interrupts = 65; + signature = 0x1e 0x97 0x0b; memory "eeprom" - size = 0x200; - offset = 0x1400; - page_size = 0x1; - readsize = 0x100; + size = 512; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 0x20000; + page_size = 512; + offset = 0x800000; + readsize = 256; ; ; @@ -18921,23 +15876,25 @@ part parent ".avrdx" # AVR16DD14 #------------------------------------------------------------ -part parent ".avrdx" - id = "avr16dd14"; - desc = "AVR16DD14"; - signature = 0x1E 0x94 0x34; - - memory "flash" - size = 0x4000; - offset = 0x800000; - page_size = 0x200; - readsize = 0x100; - ; +part parent ".avrdx" + desc = "AVR16DD14"; + id = "avr16dd14"; + mcuid = 329; + n_interrupts = 36; + hvupdi_variant = 2; + signature = 0x1e 0x94 0x34; memory "eeprom" - size = 0x100; - offset = 0x1400; - page_size = 0x1; - readsize = 0x100; + size = 256; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 0x4000; + page_size = 512; + offset = 0x800000; + readsize = 256; ; ; @@ -18945,23 +15902,25 @@ part parent ".avrdx" # AVR16DD20 #------------------------------------------------------------ -part parent ".avrdx" - id = "avr16dd20"; - desc = "AVR16DD20"; - signature = 0x1E 0x94 0x33; - - memory "flash" - size = 0x4000; - offset = 0x800000; - page_size = 0x200; - readsize = 0x100; - ; +part parent ".avrdx" + desc = "AVR16DD20"; + id = "avr16dd20"; + mcuid = 330; + n_interrupts = 36; + hvupdi_variant = 2; + signature = 0x1e 0x94 0x33; memory "eeprom" - size = 0x100; - offset = 0x1400; - page_size = 0x1; - readsize = 0x100; + size = 256; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 0x4000; + page_size = 512; + offset = 0x800000; + readsize = 256; ; ; @@ -18969,23 +15928,25 @@ part parent ".avrdx" # AVR16DD28 #------------------------------------------------------------ -part parent ".avrdx" - id = "avr16dd28"; - desc = "AVR16DD28"; - signature = 0x1E 0x94 0x32; - - memory "flash" - size = 0x4000; - offset = 0x800000; - page_size = 0x200; - readsize = 0x100; - ; +part parent ".avrdx" + desc = "AVR16DD28"; + id = "avr16dd28"; + mcuid = 331; + n_interrupts = 36; + hvupdi_variant = 2; + signature = 0x1e 0x94 0x32; memory "eeprom" - size = 0x100; - offset = 0x1400; - page_size = 0x1; - readsize = 0x100; + size = 256; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 0x4000; + page_size = 512; + offset = 0x800000; + readsize = 256; ; ; @@ -18993,23 +15954,25 @@ part parent ".avrdx" # AVR16DD32 #------------------------------------------------------------ -part parent ".avrdx" - id = "avr16dd32"; - desc = "AVR16DD32"; - signature = 0x1E 0x94 0x31; - - memory "flash" - size = 0x4000; - offset = 0x800000; - page_size = 0x200; - readsize = 0x100; - ; +part parent ".avrdx" + desc = "AVR16DD32"; + id = "avr16dd32"; + mcuid = 333; + n_interrupts = 36; + hvupdi_variant = 2; + signature = 0x1e 0x94 0x31; memory "eeprom" - size = 0x100; - offset = 0x1400; - page_size = 0x1; - readsize = 0x100; + size = 256; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 0x4000; + page_size = 512; + offset = 0x800000; + readsize = 256; ; ; @@ -19017,23 +15980,25 @@ part parent ".avrdx" # AVR32DD14 #------------------------------------------------------------ -part parent ".avrdx" - id = "avr32dd14"; - desc = "AVR32DD14"; - signature = 0x1E 0x95 0x3B; - - memory "flash" - size = 0x8000; - offset = 0x800000; - page_size = 0x200; - readsize = 0x100; - ; +part parent ".avrdx" + desc = "AVR32DD14"; + id = "avr32dd14"; + mcuid = 336; + n_interrupts = 36; + hvupdi_variant = 2; + signature = 0x1e 0x95 0x3b; memory "eeprom" - size = 0x100; - offset = 0x1400; - page_size = 0x1; - readsize = 0x100; + size = 256; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 0x8000; + page_size = 512; + offset = 0x800000; + readsize = 256; ; ; @@ -19041,23 +16006,25 @@ part parent ".avrdx" # AVR32DD20 #------------------------------------------------------------ -part parent ".avrdx" - id = "avr32dd20"; - desc = "AVR32DD20"; - signature = 0x1E 0x95 0x3A; - - memory "flash" - size = 0x8000; - offset = 0x800000; - page_size = 0x200; - readsize = 0x100; - ; +part parent ".avrdx" + desc = "AVR32DD20"; + id = "avr32dd20"; + mcuid = 337; + n_interrupts = 36; + hvupdi_variant = 2; + signature = 0x1e 0x95 0x3a; memory "eeprom" - size = 0x100; - offset = 0x1400; - page_size = 0x1; - readsize = 0x100; + size = 256; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 0x8000; + page_size = 512; + offset = 0x800000; + readsize = 256; ; ; @@ -19065,23 +16032,25 @@ part parent ".avrdx" # AVR32DD28 #------------------------------------------------------------ -part parent ".avrdx" - id = "avr32dd28"; - desc = "AVR32DD28"; - signature = 0x1E 0x95 0x39; - - memory "flash" - size = 0x8000; - offset = 0x800000; - page_size = 0x200; - readsize = 0x100; - ; +part parent ".avrdx" + desc = "AVR32DD28"; + id = "avr32dd28"; + mcuid = 340; + n_interrupts = 36; + hvupdi_variant = 2; + signature = 0x1e 0x95 0x39; memory "eeprom" - size = 0x100; - offset = 0x1400; - page_size = 0x1; - readsize = 0x100; + size = 256; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 0x8000; + page_size = 512; + offset = 0x800000; + readsize = 256; ; ; @@ -19089,23 +16058,25 @@ part parent ".avrdx" # AVR32DD32 #------------------------------------------------------------ -part parent ".avrdx" - id = "avr32dd32"; - desc = "AVR32DD32"; - signature = 0x1E 0x95 0x38; - - memory "flash" - size = 0x8000; - offset = 0x800000; - page_size = 0x200; - readsize = 0x100; - ; +part parent ".avrdx" + desc = "AVR32DD32"; + id = "avr32dd32"; + mcuid = 344; + n_interrupts = 36; + hvupdi_variant = 2; + signature = 0x1e 0x95 0x38; memory "eeprom" - size = 0x100; - offset = 0x1400; - page_size = 0x1; - readsize = 0x100; + size = 256; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 0x8000; + page_size = 512; + offset = 0x800000; + readsize = 256; ; ; @@ -19113,23 +16084,25 @@ part parent ".avrdx" # AVR64DD14 #------------------------------------------------------------ -part parent ".avrdx" - id = "avr64dd14"; - desc = "AVR64DD14"; - signature = 0x1E 0x96 0x1D; - - memory "flash" - size = 0x10000; - offset = 0x800000; - page_size = 0x200; - readsize = 0x100; - ; +part parent ".avrdx" + desc = "AVR64DD14"; + id = "avr64dd14"; + mcuid = 349; + n_interrupts = 36; + hvupdi_variant = 2; + signature = 0x1e 0x96 0x1d; memory "eeprom" - size = 0x100; - offset = 0x1400; - page_size = 0x1; - readsize = 0x100; + size = 256; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 0x10000; + page_size = 512; + offset = 0x800000; + readsize = 256; ; ; @@ -19137,23 +16110,25 @@ part parent ".avrdx" # AVR64DD20 #------------------------------------------------------------ -part parent ".avrdx" - id = "avr64dd20"; - desc = "AVR64DD20"; - signature = 0x1E 0x96 0x1C; - - memory "flash" - size = 0x10000; - offset = 0x800000; - page_size = 0x200; - readsize = 0x100; - ; +part parent ".avrdx" + desc = "AVR64DD20"; + id = "avr64dd20"; + mcuid = 350; + n_interrupts = 36; + hvupdi_variant = 2; + signature = 0x1e 0x96 0x1c; memory "eeprom" - size = 0x100; - offset = 0x1400; - page_size = 0x1; - readsize = 0x100; + size = 256; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 0x10000; + page_size = 512; + offset = 0x800000; + readsize = 256; ; ; @@ -19161,23 +16136,25 @@ part parent ".avrdx" # AVR64DD28 #------------------------------------------------------------ -part parent ".avrdx" - id = "avr64dd28"; - desc = "AVR64DD28"; - signature = 0x1E 0x96 0x1B; - - memory "flash" - size = 0x10000; - offset = 0x800000; - page_size = 0x200; - readsize = 0x100; - ; +part parent ".avrdx" + desc = "AVR64DD28"; + id = "avr64dd28"; + mcuid = 353; + n_interrupts = 36; + hvupdi_variant = 2; + signature = 0x1e 0x96 0x1b; memory "eeprom" - size = 0x100; - offset = 0x1400; - page_size = 0x1; - readsize = 0x100; + size = 256; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 0x10000; + page_size = 512; + offset = 0x800000; + readsize = 256; ; ; @@ -19185,23 +16162,25 @@ part parent ".avrdx" # AVR64DD32 #------------------------------------------------------------ -part parent ".avrdx" - id = "avr64dd32"; - desc = "AVR64DD32"; - signature = 0x1E 0x96 0x1A; - - memory "flash" - size = 0x10000; - offset = 0x800000; - page_size = 0x200; - readsize = 0x100; - ; +part parent ".avrdx" + desc = "AVR64DD32"; + id = "avr64dd32"; + mcuid = 357; + n_interrupts = 36; + hvupdi_variant = 2; + signature = 0x1e 0x96 0x1a; memory "eeprom" - size = 0x100; - offset = 0x1400; - page_size = 0x1; - readsize = 0x100; + size = 256; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 0x10000; + page_size = 512; + offset = 0x800000; + readsize = 256; ; ; @@ -19209,15 +16188,16 @@ part parent ".avrdx" # AVR-Ex family common values #------------------------------------------------------------ -part parent ".avrdx" - id = ".avrex"; - desc = "AVR-Ex family common values"; +part parent ".avrdx" + desc = "AVR-Ex family common values"; + id = ".avrex"; + # Shared UPDI pin, HV on _RESET + hvupdi_variant = 2; memory "userrow" - size = 0x40; - offset = 0x1080; - page_size = 0x40; - readsize = 0x40; + size = 64; + page_size = 64; + readsize = 64; ; memory "usersig" @@ -19229,23 +16209,24 @@ part parent ".avrdx" # AVR8EA28 #------------------------------------------------------------ -part parent ".avrex" - id = "avr8ea28"; - desc = "AVR8EA28"; - signature = 0x1E 0x93 0x2C; - - memory "flash" - size = 0x2000; - offset = 0x800000; - page_size = 0x40; - readsize = 0x100; - ; +part parent ".avrex" + desc = "AVR8EA28"; + id = "avr8ea28"; + mcuid = 327; + signature = 0x1e 0x93 0x2c; memory "eeprom" - size = 0x200; - offset = 0x1400; - page_size = 0x8; - readsize = 0x100; + size = 512; + page_size = 8; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 8192; + page_size = 64; + offset = 0x800000; + readsize = 256; ; ; @@ -19253,23 +16234,24 @@ part parent ".avrex" # AVR8EA32 #------------------------------------------------------------ -part parent ".avrex" - id = "avr8ea32"; - desc = "AVR8EA32"; - signature = 0x1E 0x93 0x2B; - - memory "flash" - size = 0x2000; - offset = 0x800000; - page_size = 0x40; - readsize = 0x100; - ; +part parent ".avrex" + desc = "AVR8EA32"; + id = "avr8ea32"; + mcuid = 328; + signature = 0x1e 0x93 0x2b; memory "eeprom" - size = 0x200; - offset = 0x1400; - page_size = 0x8; - readsize = 0x100; + size = 512; + page_size = 8; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 8192; + page_size = 64; + offset = 0x800000; + readsize = 256; ; ; @@ -19277,23 +16259,24 @@ part parent ".avrex" # AVR16EA28 #------------------------------------------------------------ -part parent ".avrex" - id = "avr16ea28"; - desc = "AVR16EA28"; - signature = 0x1E 0x94 0x37; - - memory "flash" - size = 0x4000; - offset = 0x800000; - page_size = 0x40; - readsize = 0x100; - ; +part parent ".avrex" + desc = "AVR16EA28"; + id = "avr16ea28"; + mcuid = 332; + signature = 0x1e 0x94 0x37; memory "eeprom" - size = 0x200; - offset = 0x1400; - page_size = 0x8; - readsize = 0x100; + size = 512; + page_size = 8; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 0x4000; + page_size = 64; + offset = 0x800000; + readsize = 256; ; ; @@ -19301,23 +16284,24 @@ part parent ".avrex" # AVR16EA32 #------------------------------------------------------------ -part parent ".avrex" - id = "avr16ea32"; - desc = "AVR16EA32"; - signature = 0x1E 0x94 0x36; - - memory "flash" - size = 0x4000; - offset = 0x800000; - page_size = 0x40; - readsize = 0x100; - ; +part parent ".avrex" + desc = "AVR16EA32"; + id = "avr16ea32"; + mcuid = 334; + signature = 0x1e 0x94 0x36; memory "eeprom" - size = 0x200; - offset = 0x1400; - page_size = 0x8; - readsize = 0x100; + size = 512; + page_size = 8; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 0x4000; + page_size = 64; + offset = 0x800000; + readsize = 256; ; ; @@ -19325,23 +16309,24 @@ part parent ".avrex" # AVR16EA48 #------------------------------------------------------------ -part parent ".avrex" - id = "avr16ea48"; - desc = "AVR16EA48"; - signature = 0x1E 0x94 0x35; - - memory "flash" - size = 0x4000; - offset = 0x800000; - page_size = 0x40; - readsize = 0x100; - ; +part parent ".avrex" + desc = "AVR16EA48"; + id = "avr16ea48"; + mcuid = 335; + signature = 0x1e 0x94 0x35; memory "eeprom" - size = 0x200; - offset = 0x1400; - page_size = 0x8; - readsize = 0x100; + size = 512; + page_size = 8; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 0x4000; + page_size = 64; + offset = 0x800000; + readsize = 256; ; ; @@ -19349,23 +16334,24 @@ part parent ".avrex" # AVR32EA28 #------------------------------------------------------------ -part parent ".avrex" - id = "avr32ea28"; - desc = "AVR32EA28"; - signature = 0x1E 0x95 0x3E; - - memory "flash" - size = 0x8000; - offset = 0x800000; - page_size = 0x40; - readsize = 0x100; - ; +part parent ".avrex" + desc = "AVR32EA28"; + id = "avr32ea28"; + mcuid = 341; + signature = 0x1e 0x95 0x3e; memory "eeprom" - size = 0x200; - offset = 0x1400; - page_size = 0x8; - readsize = 0x100; + size = 512; + page_size = 8; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 0x8000; + page_size = 64; + offset = 0x800000; + readsize = 256; ; ; @@ -19373,23 +16359,24 @@ part parent ".avrex" # AVR32EA32 #------------------------------------------------------------ -part parent ".avrex" - id = "avr32ea32"; - desc = "AVR32EA32"; - signature = 0x1E 0x95 0x3D; - - memory "flash" - size = 0x8000; - offset = 0x800000; - page_size = 0x40; - readsize = 0x100; - ; +part parent ".avrex" + desc = "AVR32EA32"; + id = "avr32ea32"; + mcuid = 345; + signature = 0x1e 0x95 0x3d; memory "eeprom" - size = 0x200; - offset = 0x1400; - page_size = 0x8; - readsize = 0x100; + size = 512; + page_size = 8; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 0x8000; + page_size = 64; + offset = 0x800000; + readsize = 256; ; ; @@ -19397,23 +16384,24 @@ part parent ".avrex" # AVR32EA48 #------------------------------------------------------------ -part parent ".avrex" - id = "avr32ea48"; - desc = "AVR32EA48"; - signature = 0x1E 0x95 0x3C; - - memory "flash" - size = 0x8000; - offset = 0x800000; - page_size = 0x40; - readsize = 0x100; - ; +part parent ".avrex" + desc = "AVR32EA48"; + id = "avr32ea48"; + mcuid = 348; + signature = 0x1e 0x95 0x3c; memory "eeprom" - size = 0x200; - offset = 0x1400; - page_size = 0x8; - readsize = 0x100; + size = 512; + page_size = 8; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 0x8000; + page_size = 64; + offset = 0x800000; + readsize = 256; ; ; @@ -19421,23 +16409,25 @@ part parent ".avrex" # AVR64EA28 #------------------------------------------------------------ -part parent ".avrex" - id = "avr64ea28"; - desc = "AVR64EA28"; - signature = 0x1E 0x96 0x20; - - memory "flash" - size = 0x10000; - offset = 0x800000; - page_size = 0x80; - readsize = 0x100; - ; +part parent ".avrex" + desc = "AVR64EA28"; + id = "avr64ea28"; + mcuid = 354; + n_interrupts = 37; + signature = 0x1e 0x96 0x20; memory "eeprom" - size = 0x200; - offset = 0x1400; - page_size = 0x8; - readsize = 0x100; + size = 512; + page_size = 8; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 0x10000; + page_size = 128; + offset = 0x800000; + readsize = 256; ; ; @@ -19445,23 +16435,25 @@ part parent ".avrex" # AVR64EA32 #------------------------------------------------------------ -part parent ".avrex" - id = "avr64ea32"; - desc = "AVR64EA32"; - signature = 0x1E 0x96 0x1F; - - memory "flash" - size = 0x10000; - offset = 0x800000; - page_size = 0x80; - readsize = 0x100; - ; +part parent ".avrex" + desc = "AVR64EA32"; + id = "avr64ea32"; + mcuid = 358; + n_interrupts = 37; + signature = 0x1e 0x96 0x1f; memory "eeprom" - size = 0x200; - offset = 0x1400; - page_size = 0x8; - readsize = 0x100; + size = 512; + page_size = 8; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 0x10000; + page_size = 128; + offset = 0x800000; + readsize = 256; ; ; @@ -19469,23 +16461,25 @@ part parent ".avrex" # AVR64EA48 #------------------------------------------------------------ -part parent ".avrex" - id = "avr64ea48"; - desc = "AVR64EA48"; - signature = 0x1E 0x96 0x1E; - - memory "flash" - size = 0x10000; - offset = 0x800000; - page_size = 0x80; - readsize = 0x100; - ; +part parent ".avrex" + desc = "AVR64EA48"; + id = "avr64ea48"; + mcuid = 361; + n_interrupts = 45; + signature = 0x1e 0x96 0x1e; memory "eeprom" - size = 0x200; - offset = 0x1400; - page_size = 0x8; - readsize = 0x100; + size = 512; + page_size = 8; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 0x10000; + page_size = 128; + offset = 0x800000; + readsize = 256; ; ; @@ -19494,25 +16488,33 @@ part parent ".avrex" #------------------------------------------------------------ part parent "m88" - id = "lgt8f88p"; - desc = "LGT8F88P"; - signature = 0x1e 0x93 0x0f; + desc = "LGT8F88P"; + id = "lgt8f88p"; + mcuid = 227; + signature = 0x1e 0x93 0x0f; + autobaud_sync = 0x1c; +; - ocdrev = 1; - ; +#------------------------------------------------------------ +# LGT8F168P +#------------------------------------------------------------ part parent "m168" - id = "lgt8f168p"; - desc = "LGT8F168P"; - signature = 0x1e 0x94 0x0b; - - ocdrev = 1; + desc = "LGT8F168P"; + id = "lgt8f168p"; + mcuid = 228; + signature = 0x1e 0x94 0x0b; + autobaud_sync = 0x1c; ; +#------------------------------------------------------------ +# LGT8F328P +#------------------------------------------------------------ + part parent "m328" - id = "lgt8f328p"; - desc = "LGT8F328P"; - signature = 0x1e 0x95 0x0F; - - ocdrev = 1; + desc = "LGT8F328P"; + id = "lgt8f328p"; + mcuid = 229; + signature = 0x1e 0x95 0x0f; + autobaud_sync = 0x1c; ; diff --git a/src/avrdude.h b/src/avrdude.h index 9574c78a..8219252a 100644 --- a/src/avrdude.h +++ b/src/avrdude.h @@ -21,27 +21,77 @@ #ifndef avrdude_h #define avrdude_h +#include + #define SYSTEM_CONF_FILE "avrdude.conf" #if defined(WIN32) #define USER_CONF_FILE "avrdude.rc" #else #define USER_CONF_FILE ".avrduderc" +#define XDG_USER_CONF_FILE "avrdude/avrdude.rc" #endif -extern char * progname; /* name of program, for messages */ -extern char progbuf[]; /* spaces same length as progname */ +extern char *progname; // Name of program, for messages +extern char progbuf[]; // Spaces same length as progname -extern int ovsigck; /* override signature check (-F) */ -extern int verbose; /* verbosity level (-v, -vv, ...) */ -extern int quell_progress; /* quietness level (-q, -qq) */ +extern int ovsigck; // Override signature check (-F) +extern int verbose; // Verbosity level (-v, -vv, ...) +extern int quell_progress; // Quell progress report -q, reduce effective verbosity level (-qq, -qqq) +extern const char *partdesc; // Part id -int avrdude_message(const int msglvl, const char *format, ...); +int avrdude_message(int msglvl, const char *format, ...); +int avrdude_message2(FILE *fp, int lno, const char *file, const char *func, int msgmode, int msglvl, const char *format, ...); -#define MSG_INFO (0) /* no -v option, can be suppressed with -qq */ -#define MSG_NOTICE (1) /* displayed with -v */ -#define MSG_NOTICE2 (2) /* displayed with -vv, used rarely */ -#define MSG_DEBUG (3) /* displayed with -vvv */ -#define MSG_TRACE (4) /* displayed with -vvvv, show trace communication */ -#define MSG_TRACE2 (5) /* displayed with -vvvvv */ +#define MSG_EXT_ERROR (-3) // OS-type error, no -v option, can be suppressed with -qqqqq +#define MSG_ERROR (-2) // Avrdude error, no -v option, can be suppressed with -qqqq +#define MSG_WARNING (-1) // Warning, no -v option, can be suppressed with -qqq +#define MSG_INFO 0 // Commentary, no -v option, can be suppressed with -qq +#define MSG_NOTICE 1 // Displayed with -v +#define MSG_NOTICE2 2 // Displayed with -vv +#define MSG_DEBUG 3 // Displayed with -vvv +#define MSG_TRACE 4 // Displayed with -vvvv, show trace communication +#define MSG_TRACE2 5 // Displayed with -vvvvv + +#define MSG2_PROGNAME 1 // Start by printing progname +#define MSG2_FUNCTION 2 // Print calling function (1st arg) after progname if >= notice +#define MSG2_FILELINE 4 // Print source file and line number after function if >= debug +#define MSG2_TYPE 8 // Print message type after function or progname +#define MSG2_INDENT1 16 // Start by printing indentation of progname+1 blanks +#define MSG2_INDENT2 32 // Start by printing indentation of progname+2 blanks +#define MSG2_FLUSH 64 // Flush before and after printing + +// Shortcuts +#define msg_ext_error(...) avrdude_message2(stderr, __LINE__, __FILE__, __func__, 0, MSG_EXT_ERROR, __VA_ARGS__) +#define msg_error(...) avrdude_message2(stderr, __LINE__, __FILE__, __func__, 0, MSG_ERROR, __VA_ARGS__) +#define msg_warning(...) avrdude_message2(stderr, __LINE__, __FILE__, __func__, 0, MSG_WARNING, __VA_ARGS__) +#define msg_info(...) avrdude_message2(stderr, __LINE__, __FILE__, __func__, 0, MSG_INFO, __VA_ARGS__) +#define msg_notice(...) avrdude_message2(stderr, __LINE__, __FILE__, __func__, 0, MSG_NOTICE, __VA_ARGS__) +#define msg_notice2(...) avrdude_message2(stderr, __LINE__, __FILE__, __func__, 0, MSG_NOTICE2, __VA_ARGS__) +#define msg_debug(...) avrdude_message2(stderr, __LINE__, __FILE__, __func__, 0, MSG_DEBUG, __VA_ARGS__) +#define msg_trace(...) avrdude_message2(stderr, __LINE__, __FILE__, __func__, 0, MSG_TRACE, __VA_ARGS__) +#define msg_trace2(...) avrdude_message2(stderr, __LINE__, __FILE__, __func__, 0, MSG_TRACE2, __VA_ARGS__) + +#define pmsg_ext_error(...) avrdude_message2(stderr, __LINE__, __FILE__, __func__, MSG2_PROGNAME|MSG2_FUNCTION|MSG2_FILELINE|MSG2_TYPE|MSG2_FLUSH, MSG_EXT_ERROR, __VA_ARGS__) +#define pmsg_error(...) avrdude_message2(stderr, __LINE__, __FILE__, __func__, MSG2_PROGNAME|MSG2_FUNCTION|MSG2_FILELINE|MSG2_TYPE|MSG2_FLUSH, MSG_ERROR, __VA_ARGS__) +#define pmsg_warning(...) avrdude_message2(stderr, __LINE__, __FILE__, __func__, MSG2_PROGNAME|MSG2_FUNCTION|MSG2_FILELINE|MSG2_TYPE|MSG2_FLUSH, MSG_WARNING, __VA_ARGS__) +#define pmsg_info(...) avrdude_message2(stderr, __LINE__, __FILE__, __func__, MSG2_PROGNAME|MSG2_FLUSH, MSG_INFO, __VA_ARGS__) +#define pmsg_notice(...) avrdude_message2(stderr, __LINE__, __FILE__, __func__, MSG2_PROGNAME|MSG2_FLUSH, MSG_NOTICE, __VA_ARGS__) +#define pmsg_notice2(...) avrdude_message2(stderr, __LINE__, __FILE__, __func__, MSG2_PROGNAME|MSG2_FLUSH, MSG_NOTICE2, __VA_ARGS__) +#define pmsg_debug(...) avrdude_message2(stderr, __LINE__, __FILE__, __func__, MSG2_PROGNAME|MSG2_FLUSH, MSG_DEBUG, __VA_ARGS__) +#define pmsg_trace(...) avrdude_message2(stderr, __LINE__, __FILE__, __func__, MSG2_PROGNAME|MSG2_FLUSH, MSG_TRACE, __VA_ARGS__) +#define pmsg_trace2(...) avrdude_message2(stderr, __LINE__, __FILE__, __func__, MSG2_PROGNAME|MSG2_FLUSH, MSG_TRACE2, __VA_ARGS__) + +#define imsg_ext_error(...) avrdude_message2(stderr, __LINE__, __FILE__, __func__, MSG2_INDENT1|MSG2_FLUSH, MSG_EXT_ERROR, __VA_ARGS__) +#define imsg_error(...) avrdude_message2(stderr, __LINE__, __FILE__, __func__, MSG2_INDENT1|MSG2_FLUSH, MSG_ERROR, __VA_ARGS__) +#define imsg_warning(...) avrdude_message2(stderr, __LINE__, __FILE__, __func__, MSG2_INDENT1|MSG2_FLUSH, MSG_WARNING, __VA_ARGS__) +#define imsg_info(...) avrdude_message2(stderr, __LINE__, __FILE__, __func__, MSG2_INDENT2|MSG2_FLUSH, MSG_INFO, __VA_ARGS__) +#define imsg_notice(...) avrdude_message2(stderr, __LINE__, __FILE__, __func__, MSG2_INDENT2|MSG2_FLUSH, MSG_NOTICE, __VA_ARGS__) +#define imsg_notice2(...) avrdude_message2(stderr, __LINE__, __FILE__, __func__, MSG2_INDENT2|MSG2_FLUSH, MSG_NOTICE2, __VA_ARGS__) +#define imsg_debug(...) avrdude_message2(stderr, __LINE__, __FILE__, __func__, MSG2_INDENT2|MSG2_FLUSH, MSG_DEBUG, __VA_ARGS__) +#define imsg_trace(...) avrdude_message2(stderr, __LINE__, __FILE__, __func__, MSG2_INDENT2|MSG2_FLUSH, MSG_TRACE, __VA_ARGS__) +#define imsg_trace2(...) avrdude_message2(stderr, __LINE__, __FILE__, __func__, MSG2_INDENT2|MSG2_FLUSH, MSG_TRACE2, __VA_ARGS__) + +#define term_out(...) avrdude_message2(stdout, __LINE__, __FILE__, __func__, MSG2_FLUSH, MSG_INFO, __VA_ARGS__) +#define fmsg_out(fp, ...) avrdude_message2(fp, __LINE__, __FILE__, __func__, MSG2_FLUSH, MSG_INFO, __VA_ARGS__) #endif diff --git a/src/avrftdi.c b/src/avrftdi.c index e41d775e..b255c395 100644 --- a/src/avrftdi.c +++ b/src/avrftdi.c @@ -50,23 +50,19 @@ #ifdef DO_NOT_BUILD_AVRFTDI -static int avrftdi_noftdi_open (struct programmer_t *pgm, char * name) -{ - avrdude_message(MSG_INFO, "%s: Error: no libftdi or libusb support. Install libftdi1/libusb-1.0 or libftdi/libusb and run configure/make again.\n", - progname); - +static int avrftdi_noftdi_open(PROGRAMMER *pgm, const char *name) { + pmsg_error("no libftdi or libusb support; install libftdi1/libusb-1.0 or libftdi/libusb and run configure/make again\n"); return -1; } -void avrftdi_initpgm(PROGRAMMER * pgm) -{ +void avrftdi_initpgm(PROGRAMMER *pgm) { strcpy(pgm->type, "avrftdi"); pgm->open = avrftdi_noftdi_open; } #else -enum { FTDI_SCK = 0, FTDI_MOSI, FTDI_MISO, FTDI_RESET }; +enum { FTDI_SCK = 0, FTDI_SDO, FTDI_SDI, FTDI_RESET }; static int write_flush(avrftdi_t *); @@ -142,14 +138,14 @@ void avrftdi_log(int level, const char * func, int line, if(!skip_prefix) { switch(level) { - case ERR: avrdude_message(MSG_INFO, "E "); break; - case WARN: avrdude_message(MSG_INFO, "W "); break; - case INFO: avrdude_message(MSG_INFO, "I "); break; - case DEBUG: avrdude_message(MSG_INFO, "D "); break; - case TRACE: avrdude_message(MSG_INFO, "T "); break; - default: avrdude_message(MSG_INFO, " "); break; + case ERR: msg_error("E "); break; + case WARN: msg_error("W "); break; + case INFO: msg_error("I "); break; + case DEBUG: msg_error("D "); break; + case TRACE: msg_error("T "); break; + default: msg_error(" "); break; } - avrdude_message(MSG_INFO, "%s(%d): ", func, line); + msg_error("%s(%d): ", func, line); } va_start(ap, fmt); vfprintf(stderr, fmt, ap); @@ -172,16 +168,16 @@ static void buf_dump(const unsigned char *buf, int len, char *desc, int offset, int width) { int i; - avrdude_message(MSG_INFO, "%s begin:\n", desc); + msg_info("%s begin:\n", desc); for (i = 0; i < offset; i++) - avrdude_message(MSG_INFO, "%02x ", buf[i]); - avrdude_message(MSG_INFO, "\n"); + msg_info("%02x ", buf[i]); + msg_info("\n"); for (i++; i <= len; i++) { - avrdude_message(MSG_INFO, "%02x ", buf[i-1]); + msg_info("%02x ", buf[i-1]); if((i-offset) != 0 && (i-offset)%width == 0) - avrdude_message(MSG_INFO, "\n"); + msg_info("\n"); } - avrdude_message(MSG_INFO, "%s end\n", desc); + msg_info("%s end\n", desc); } /* @@ -220,15 +216,17 @@ static int set_frequency(avrftdi_t* ftdi, uint32_t freq) } /* - * This function sets or clears any pin, except SCK, MISO and MOSI. Depending + * This function sets or clears any pin, except SCK, SDI and SDO. Depending * on the pin configuration, a non-zero value sets the pin in the 'active' * state (high active, low active) and a zero value sets the pin in the * inactive state. * Because we configured the pin direction mask earlier, nothing bad can happen * here. */ -static int set_pin(PROGRAMMER * pgm, int pinfunc, int value) -{ +static int set_pin(const PROGRAMMER *pgm, int pinfunc, int value) { + if(pinfunc < 0 || pinfunc >= N_PINS) + return -1; + avrftdi_t* pdata = to_pdata(pgm); struct pindef_t pin = pgm->pin[pinfunc]; @@ -250,54 +248,50 @@ static int set_pin(PROGRAMMER * pgm, int pinfunc, int value) /* * Mandatory callbacks which boil down to GPIO. */ -static int set_led_pgm(struct programmer_t * pgm, int value) -{ +static int set_led_pgm(const PROGRAMMER *pgm, int value) { return set_pin(pgm, PIN_LED_PGM, value); } -static int set_led_rdy(struct programmer_t * pgm, int value) -{ +static int set_led_rdy(const PROGRAMMER *pgm, int value) { return set_pin(pgm, PIN_LED_RDY, value); } -static int set_led_err(struct programmer_t * pgm, int value) -{ +static int set_led_err(const PROGRAMMER *pgm, int value) { return set_pin(pgm, PIN_LED_ERR, value); } -static int set_led_vfy(struct programmer_t * pgm, int value) -{ +static int set_led_vfy(const PROGRAMMER *pgm, int value) { return set_pin(pgm, PIN_LED_VFY, value); } -static void avrftdi_enable(PROGRAMMER * pgm) -{ +static void avrftdi_enable(PROGRAMMER *pgm, const AVRPART *p) { set_pin(pgm, PPI_AVR_BUFF, ON); + + // Switch to TPI initialisation in avrftdi_tpi.c + if(p->prog_modes & PM_TPI) + avrftdi_tpi_initpgm(pgm); } -static void avrftdi_disable(PROGRAMMER * pgm) -{ +static void avrftdi_disable(const PROGRAMMER *pgm) { set_pin(pgm, PPI_AVR_BUFF, OFF); } -static void avrftdi_powerup(PROGRAMMER * pgm) -{ +static void avrftdi_powerup(const PROGRAMMER *pgm) { set_pin(pgm, PPI_AVR_VCC, ON); } -static void avrftdi_powerdown(PROGRAMMER * pgm) -{ +static void avrftdi_powerdown(const PROGRAMMER *pgm) { set_pin(pgm, PPI_AVR_VCC, OFF); } -static inline int set_data(PROGRAMMER * pgm, unsigned char *buf, unsigned char data, bool read_data) { +static inline int set_data(const PROGRAMMER *pgm, unsigned char *buf, unsigned char data, bool read_data) { int j; int buf_pos = 0; unsigned char bit = 0x80; avrftdi_t* pdata = to_pdata(pgm); for (j=0; j<8; j++) { - pdata->pin_value = SET_BITS_0(pdata->pin_value,pgm,PIN_AVR_MOSI,data & bit); + pdata->pin_value = SET_BITS_0(pdata->pin_value,pgm,PIN_AVR_SDO,data & bit); pdata->pin_value = SET_BITS_0(pdata->pin_value,pgm,PIN_AVR_SCK,0); buf[buf_pos++] = SET_BITS_LOW; buf[buf_pos++] = (pdata->pin_value) & 0xff; @@ -324,7 +318,7 @@ static inline int set_data(PROGRAMMER * pgm, unsigned char *buf, unsigned char d return buf_pos; } -static inline unsigned char extract_data(PROGRAMMER * pgm, unsigned char *buf, int offset) { +static inline unsigned char extract_data(const PROGRAMMER *pgm, unsigned char *buf, int offset) { int j; unsigned char bit = 0x80; unsigned char r = 0; @@ -332,7 +326,7 @@ static inline unsigned char extract_data(PROGRAMMER * pgm, unsigned char *buf, i buf += offset * 16; // 2 bytes per bit, 8 bits for (j=0; j<8; j++) { uint16_t in = buf[0] | (buf[1] << 8); - if (GET_BITS_0(in,pgm,PIN_AVR_MISO)) { + if (GET_BITS_0(in,pgm,PIN_AVR_SDI)) { r |= bit; } buf += 2; // 2 bytes per input @@ -342,7 +336,7 @@ static inline unsigned char extract_data(PROGRAMMER * pgm, unsigned char *buf, i } -static int avrftdi_transmit_bb(PROGRAMMER * pgm, unsigned char mode, const unsigned char *buf, +static int avrftdi_transmit_bb(const PROGRAMMER *pgm, unsigned char mode, const unsigned char *buf, unsigned char *data, int buf_size) { size_t remaining = buf_size; @@ -351,10 +345,10 @@ static int avrftdi_transmit_bb(PROGRAMMER * pgm, unsigned char mode, const unsig size_t blocksize = pdata->rx_buffer_size/2; // we are reading 2 bytes per data byte // determine a maximum size of data block - size_t max_size = MIN(pdata->ftdic->max_packet_size,pdata->tx_buffer_size); + size_t max_size = MIN(pdata->ftdic->max_packet_size, (unsigned int) pdata->tx_buffer_size); // select block size so that resulting commands does not exceed max_size if possible blocksize = MAX(1,(max_size-7)/((8*2*6)+(8*1*2))); - //avrdude_message(MSG_INFO, "blocksize %d \n",blocksize); + // msg_info("blocksize %d \n", blocksize); unsigned char* send_buffer = alloca((8 * 2 * 6) * blocksize + (8 * 1 * 2) * blocksize + 7); unsigned char* recv_buffer = alloca(2 * 16 * blocksize); @@ -368,9 +362,8 @@ static int avrftdi_transmit_bb(PROGRAMMER * pgm, unsigned char mode, const unsig // (8*1) inputs per data byte, 2 transmit bytes per input (GET_BITS_LOW/HIGH), // 1x SEND_IMMEDIATE int len = 0; - int i; - for(i = 0 ; i< transfer_size; i++) { + for(size_t i = 0 ; i < transfer_size; i++) { len += set_data(pgm, send_buffer + len, buf[written+i], (mode & MPSSE_DO_READ) != 0); } @@ -387,14 +380,14 @@ static int avrftdi_transmit_bb(PROGRAMMER * pgm, unsigned char mode, const unsig E(ftdi_write_data(pdata->ftdic, send_buffer, len) != len, pdata->ftdic); if (mode & MPSSE_DO_READ) { int n; - int k = 0; + size_t k = 0; do { n = ftdi_read_data(pdata->ftdic, &recv_buffer[k], 2*16*transfer_size - k); E(n < 0, pdata->ftdic); k += n; } while (k < transfer_size); - for(i = 0 ; i< transfer_size; i++) { + for(size_t i = 0 ; i< transfer_size; i++) { data[written + i] = extract_data(pgm, recv_buffer, i); } } @@ -437,7 +430,7 @@ static int avrftdi_transmit_mpsse(avrftdi_t* pdata, unsigned char mode, const un { size_t transfer_size = (remaining > blocksize) ? blocksize : remaining; - E(ftdi_write_data(pdata->ftdic, (unsigned char*)&buf[written], transfer_size) != transfer_size, pdata->ftdic); + E((size_t) ftdi_write_data(pdata->ftdic, (unsigned char*)&buf[written], transfer_size) != transfer_size, pdata->ftdic); #if 0 if(remaining < blocksize) E(ftdi_write_data(pdata->ftdic, &si, sizeof(si)) != sizeof(si), pdata->ftdic); @@ -445,7 +438,7 @@ static int avrftdi_transmit_mpsse(avrftdi_t* pdata, unsigned char mode, const un if (mode & MPSSE_DO_READ) { int n; - int k = 0; + size_t k = 0; do { n = ftdi_read_data(pdata->ftdic, &data[written + k], transfer_size - k); E(n < 0, pdata->ftdic); @@ -461,7 +454,7 @@ static int avrftdi_transmit_mpsse(avrftdi_t* pdata, unsigned char mode, const un return written; } -static inline int avrftdi_transmit(PROGRAMMER * pgm, unsigned char mode, const unsigned char *buf, +static inline int avrftdi_transmit(const PROGRAMMER *pgm, unsigned char mode, const unsigned char *buf, unsigned char *data, int buf_size) { avrftdi_t* pdata = to_pdata(pgm); @@ -520,8 +513,7 @@ static int write_flush(avrftdi_t* pdata) } -static int avrftdi_check_pins_bb(PROGRAMMER * pgm, bool output) -{ +static int avrftdi_check_pins_bb(const PROGRAMMER *pgm, bool output) { int pin; /* pin checklist. */ @@ -548,8 +540,7 @@ static int avrftdi_check_pins_bb(PROGRAMMER * pgm, bool output) return pins_check(pgm, pin_checklist, N_PINS, output); } -static int avrftdi_check_pins_mpsse(PROGRAMMER * pgm, bool output) -{ +static int avrftdi_check_pins_mpsse(const PROGRAMMER *pgm, bool output) { int pin; /* pin checklist. */ @@ -557,16 +548,16 @@ static int avrftdi_check_pins_mpsse(PROGRAMMER * pgm, bool output) avrftdi_t* pdata = to_pdata(pgm); - /* SCK/MOSI/MISO are fixed and not invertible?*/ - /* TODO: inverted SCK/MISO/MOSI */ - static const struct pindef_t valid_pins_SCK = {{0x01},{0x00}} ; - static const struct pindef_t valid_pins_MOSI = {{0x02},{0x00}} ; - static const struct pindef_t valid_pins_MISO = {{0x04},{0x00}} ; + /* SCK/SDO/SDI are fixed and not invertible? */ + /* TODO: inverted SCK/SDI/SDO */ + static const struct pindef_t valid_pins_SCK = {{0x01},{0x00}}; + static const struct pindef_t valid_pins_SDO = {{0x02},{0x00}}; + static const struct pindef_t valid_pins_SDI = {{0x04},{0x00}}; /* value for 8/12/16 bit wide interface for other pins */ int valid_mask = ((1 << pdata->pin_limit) - 1); - /* mask out SCK/MISO/MOSI */ - valid_mask &= ~((1 << FTDI_SCK) | (1 << FTDI_MOSI) | (1 << FTDI_MISO)); + /* mask out SCK/SDI/SDO */ + valid_mask &= ~((1 << FTDI_SCK) | (1 << FTDI_SDO) | (1 << FTDI_SDI)); log_debug("Using valid mask mpsse: 0x%08x\n", valid_mask); static struct pindef_t valid_pins_others; @@ -583,18 +574,17 @@ static int avrftdi_check_pins_mpsse(PROGRAMMER * pgm, bool output) /* now set mpsse specific pins */ pin_checklist[PIN_AVR_SCK].mandatory = 1; pin_checklist[PIN_AVR_SCK].valid_pins = &valid_pins_SCK; - pin_checklist[PIN_AVR_MOSI].mandatory = 1; - pin_checklist[PIN_AVR_MOSI].valid_pins = &valid_pins_MOSI; - pin_checklist[PIN_AVR_MISO].mandatory = 1; - pin_checklist[PIN_AVR_MISO].valid_pins = &valid_pins_MISO; + pin_checklist[PIN_AVR_SDO].mandatory = 1; + pin_checklist[PIN_AVR_SDO].valid_pins = &valid_pins_SDO; + pin_checklist[PIN_AVR_SDI].mandatory = 1; + pin_checklist[PIN_AVR_SDI].valid_pins = &valid_pins_SDI; pin_checklist[PIN_AVR_RESET].mandatory = 1; /* assumes all checklists above have same number of entries */ return pins_check(pgm, pin_checklist, N_PINS, output); } -static int avrftdi_pin_setup(PROGRAMMER * pgm) -{ +static int avrftdi_pin_setup(const PROGRAMMER *pgm) { int pin; /************* @@ -612,30 +602,31 @@ static int avrftdi_pin_setup(PROGRAMMER * pgm) avrftdi_check_pins_bb(pgm, true); log_err("Pin configuration for FTDI MPSSE must be:\n"); log_err("%s: 0, %s: 1, %s: 2 (is: %s, %s, %s)\n", avr_pin_name(PIN_AVR_SCK), - avr_pin_name(PIN_AVR_MOSI), avr_pin_name(PIN_AVR_MISO), - pins_to_str(&pgm->pin[PIN_AVR_SCK]), - pins_to_str(&pgm->pin[PIN_AVR_MOSI]), - pins_to_str(&pgm->pin[PIN_AVR_MISO])); + avr_pin_name(PIN_AVR_SDO), avr_pin_name(PIN_AVR_SDI), + pins_to_str(&pgm->pin[PIN_AVR_SCK]), + pins_to_str(&pgm->pin[PIN_AVR_SDO]), + pins_to_str(&pgm->pin[PIN_AVR_SDI])); log_err("If other pin configuration is used, fallback to slower bitbanging mode is used.\n"); return -1; } pdata->use_bitbanging = !pin_check_mpsse; - if (pdata->use_bitbanging) log_info("Because of pin configuration fallback to bitbanging mode.\n"); + if (pdata->use_bitbanging) + log_info("Because of pin configuration fallback to bitbanging mode.\n"); /* * TODO: No need to fail for a wrongly configured led or something. - * Maybe we should only fail for SCK; MISO, MOSI, RST (and probably + * Maybe we should only fail for SCK; SDI, SDO, RST (and probably * VCC and BUFF). */ - /* everything is an output, except MISO */ + /* everything is an output, except SDI */ for(pin = 0; pin < N_PINS; ++pin) { pdata->pin_direction |= pgm->pin[pin].mask[0]; pdata->pin_value = SET_BITS_0(pdata->pin_value, pgm, pin, OFF); } - pdata->pin_direction &= ~pgm->pin[PIN_AVR_MISO].mask[0]; + pdata->pin_direction &= ~pgm->pin[PIN_AVR_SDI].mask[0]; for(pin = PIN_LED_ERR; pin < N_PINS; ++pin) { pdata->led_mask |= pgm->pin[pin].mask[0]; @@ -648,10 +639,9 @@ static int avrftdi_pin_setup(PROGRAMMER * pgm) return 0; } -static int avrftdi_open(PROGRAMMER * pgm, char *port) -{ +static int avrftdi_open(PROGRAMMER *pgm, const char *port) { int vid, pid, interface, index, err; - char * serial, *desc; + const char *serial, *desc; avrftdi_t* pdata = to_pdata(pgm); @@ -671,8 +661,7 @@ static int avrftdi_open(PROGRAMMER * pgm, char *port) if (usbpid) { pid = *(int *)(ldata(usbpid)); if (lnext(usbpid)) - avrdude_message(MSG_INFO, "%s: Warning: using PID 0x%04x, ignoring remaining PIDs in list\n", - progname, pid); + pmsg_warning("using PID 0x%04x, ignoring remaining PIDs in list\n", pid); } else pid = USB_DEVICE_FT2232; @@ -817,11 +806,10 @@ static void avrftdi_close(PROGRAMMER * pgm) return; } -static int avrftdi_initialize(PROGRAMMER * pgm, AVRPART * p) -{ +static int avrftdi_initialize(const PROGRAMMER *pgm, const AVRPART *p) { avrftdi_powerup(pgm); - if(p->flags & AVRPART_HAS_TPI) + if(p->prog_modes & PM_TPI) { /* see avrftdi_tpi.c */ avrftdi_tpi_initialize(pgm, p); @@ -847,21 +835,18 @@ static int avrftdi_initialize(PROGRAMMER * pgm, AVRPART * p) return pgm->program_enable(pgm, p); } -static void avrftdi_display(PROGRAMMER * pgm, const char *p) -{ +static void avrftdi_display(const PROGRAMMER *pgm, const char *p) { // print the full pin definitions as in ft245r ? return; } -static int avrftdi_cmd(PROGRAMMER * pgm, const unsigned char *cmd, unsigned char *res) -{ +static int avrftdi_cmd(const PROGRAMMER *pgm, const unsigned char *cmd, unsigned char *res) { return avrftdi_transmit(pgm, MPSSE_DO_READ | MPSSE_DO_WRITE, cmd, res, 4); } -static int avrftdi_program_enable(PROGRAMMER * pgm, AVRPART * p) -{ +static int avrftdi_program_enable(const PROGRAMMER *pgm, const AVRPART *p) { int i; unsigned char buf[4]; @@ -892,8 +877,7 @@ static int avrftdi_program_enable(PROGRAMMER * pgm, AVRPART * p) } -static int avrftdi_chip_erase(PROGRAMMER * pgm, AVRPART * p) -{ +static int avrftdi_chip_erase(const PROGRAMMER *pgm, const AVRPART *p) { unsigned char cmd[4]; unsigned char res[4]; @@ -915,10 +899,20 @@ static int avrftdi_chip_erase(PROGRAMMER * pgm, AVRPART * p) /* Load extended address byte command */ static int -avrftdi_lext(PROGRAMMER *pgm, AVRPART *p, AVRMEM *m, unsigned int address) -{ +avrftdi_lext(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *m, unsigned int address) { + /* nothing to do if load extended address command unavailable */ + if(m->op[AVR_OP_LOAD_EXT_ADDR] == NULL) + return 0; + + avrftdi_t *pdata = to_pdata(pgm); unsigned char buf[] = { 0x00, 0x00, 0x00, 0x00 }; + /* only send load extended address command if high byte changed */ + if(pdata->lext_byte == (uint8_t) (address>>16)) + return 0; + + pdata->lext_byte = (uint8_t) (address>>16); + avr_set_bits(m->op[AVR_OP_LOAD_EXT_ADDR], buf); avr_set_addr(m->op[AVR_OP_LOAD_EXT_ADDR], buf, address); @@ -932,7 +926,7 @@ avrftdi_lext(PROGRAMMER *pgm, AVRPART *p, AVRMEM *m, unsigned int address) return 0; } -static int avrftdi_eeprom_write(PROGRAMMER *pgm, AVRPART *p, AVRMEM *m, +static int avrftdi_eeprom_write(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *m, unsigned int page_size, unsigned int addr, unsigned int len) { unsigned char cmd[] = { 0x00, 0x00, 0x00, 0x00 }; @@ -954,7 +948,7 @@ static int avrftdi_eeprom_write(PROGRAMMER *pgm, AVRPART *p, AVRMEM *m, return len; } -static int avrftdi_eeprom_read(PROGRAMMER *pgm, AVRPART *p, AVRMEM *m, +static int avrftdi_eeprom_read(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *m, unsigned int page_size, unsigned int addr, unsigned int len) { unsigned char cmd[4]; @@ -980,11 +974,9 @@ static int avrftdi_eeprom_read(PROGRAMMER *pgm, AVRPART *p, AVRMEM *m, return len; } -static int avrftdi_flash_write(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m, +static int avrftdi_flash_write(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *m, unsigned int page_size, unsigned int addr, unsigned int len) { - int use_lext_address = m->op[AVR_OP_LOAD_EXT_ADDR] != NULL; - unsigned int word; unsigned int poll_index; @@ -1006,29 +998,19 @@ static int avrftdi_flash_write(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m, return -1; } - if(page_size != m->page_size) { + if(page_size != (unsigned int) m->page_size) { log_warn("Parameter page_size is %d, ", page_size); log_warn("but m->page_size is %d. Using the latter.\n", m->page_size); } page_size = m->page_size; - /* if we do cross a 64k word boundary (or write the - * first page), we need to issue a 'load extended - * address byte' command, which is defined as 0x4d - * 0x00
0x00. As far as i know, this - * is only available on 256k parts. 64k word is 128k - * bytes. - * write the command only once. - */ - if(use_lext_address && (((addr/2) & 0xffff0000))) { - if (0 > avrftdi_lext(pgm, p, m, addr/2)) - return -1; - } + /* on large-flash devices > 128k issue extended address command when needed */ + if(avrftdi_lext(pgm, p, m, addr/2) < 0) + return -1; /* prepare the command stream for the whole page */ - /* addr is in bytes, but we program in words. addr/2 should be something - * like addr >> WORD_SHIFT, though */ + /* addr is in bytes, but we program in words. */ for(word = addr/2; word < (len + addr)/2; word++) { log_debug("-< bytes = %d of %d\n", word * 2, len + addr); @@ -1060,12 +1042,11 @@ static int avrftdi_flash_write(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m, /* find a poll byte. We cannot poll a value of 0xff, so look * for a value != 0xff */ - for(poll_index = addr+len-1; poll_index > addr-1; poll_index--) + for(poll_index = addr+len-1; poll_index+1 > addr; poll_index--) if(m->buf[poll_index] != 0xff) break; - if((poll_index < addr + len) && m->buf[poll_index] != 0xff) - { + if(poll_index+1 > addr) { buf_size = bufptr - buf; if(verbose > TRACE) @@ -1102,18 +1083,15 @@ static int avrftdi_flash_write(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m, /* *Reading from flash */ -static int avrftdi_flash_read(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m, +static int avrftdi_flash_read(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *m, unsigned int page_size, unsigned int addr, unsigned int len) { OPCODE * readop; - int byte, word; - int use_lext_address = m->op[AVR_OP_LOAD_EXT_ADDR] != NULL; - unsigned int address = addr/2; unsigned int buf_size = 4 * len + 4; unsigned char* o_buf = alloca(buf_size); unsigned char* i_buf = alloca(buf_size); - unsigned int index; + memset(o_buf, 0, buf_size); memset(i_buf, 0, buf_size); @@ -1128,13 +1106,11 @@ static int avrftdi_flash_read(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m, return -1; } - if(use_lext_address && ((address & 0xffff0000))) { - if (0 > avrftdi_lext(pgm, p, m, address)) - return -1; - } + if(avrftdi_lext(pgm, p, m, addr/2) < 0) + return -1; /* word addressing! */ - for(word = addr/2, index = 0; word < (addr + len)/2; word++) + for(unsigned int word = addr/2, index = 0; word < (addr + len)/2; word++) { /* one byte is transferred via a 4-byte opcode. * TODO: reduce magic numbers @@ -1165,7 +1141,7 @@ static int avrftdi_flash_read(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m, memset(&m->buf[addr], 0, page_size); /* every (read) op is 4 bytes in size and yields one byte of memory data */ - for(byte = 0; byte < page_size; byte++) { + for(unsigned int byte = 0; byte < page_size; byte++) { if(byte & 1) readop = m->op[AVR_OP_READ_HI]; else @@ -1183,7 +1159,7 @@ static int avrftdi_flash_read(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m, return len; } -static int avrftdi_paged_write(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m, +static int avrftdi_paged_write(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *m, unsigned int page_size, unsigned int addr, unsigned int n_bytes) { if (strcmp(m->desc, "flash") == 0) @@ -1194,7 +1170,7 @@ static int avrftdi_paged_write(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m, return -2; } -static int avrftdi_paged_load(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m, +static int avrftdi_paged_load(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *m, unsigned int page_size, unsigned int addr, unsigned int n_bytes) { if (strcmp(m->desc, "flash") == 0) @@ -1210,7 +1186,11 @@ avrftdi_setup(PROGRAMMER * pgm) { avrftdi_t* pdata; - pgm->cookie = malloc(sizeof(avrftdi_t)); + + if(!(pgm->cookie = calloc(sizeof(avrftdi_t), 1))) { + log_err("Error allocating memory.\n"); + exit(1); + } pdata = to_pdata(pgm); pdata->ftdic = ftdi_new(); @@ -1224,6 +1204,7 @@ avrftdi_setup(PROGRAMMER * pgm) pdata->pin_value = 0; pdata->pin_direction = 0; pdata->led_mask = 0; + pdata->lext_byte = 0xff; } static void @@ -1238,9 +1219,7 @@ avrftdi_teardown(PROGRAMMER * pgm) } } -void avrftdi_initpgm(PROGRAMMER * pgm) -{ - +void avrftdi_initpgm(PROGRAMMER *pgm) { strcpy(pgm->type, "avrftdi"); /* diff --git a/src/avrftdi.h b/src/avrftdi.h index af323352..167264df 100644 --- a/src/avrftdi.h +++ b/src/avrftdi.h @@ -29,7 +29,7 @@ extern "C" { extern const char avrftdi_desc[]; -void avrftdi_initpgm (PROGRAMMER * pgm); +void avrftdi_initpgm(PROGRAMMER *pgm); #ifdef __cplusplus } diff --git a/src/avrftdi_private.h b/src/avrftdi_private.h index 3c965ed8..6fd973ca 100644 --- a/src/avrftdi_private.h +++ b/src/avrftdi_private.h @@ -14,7 +14,8 @@ # define HAVE_LIBFTDI_TYPE_232H 1 #elif defined(HAVE_LIBFTDI) #include -#else +#else + #ifdef _MSC_VER #pragma message("No libftdi or libusb support. Install libftdi1/libusb-1.0 or libftdi/libusb and run configure/make again.") #else @@ -30,7 +31,7 @@ enum { ERR, WARN, INFO, DEBUG, TRACE }; #define __log(lvl, fmt, ...) \ do { \ avrftdi_log(lvl, __func__, __LINE__, fmt, ##__VA_ARGS__); \ - } while(0) + } while(0) #define log_err(fmt, ...) __log(ERR, fmt, ##__VA_ARGS__) @@ -40,47 +41,49 @@ enum { ERR, WARN, INFO, DEBUG, TRACE }; #define log_trace(fmt, ...) __log(TRACE, fmt, ##__VA_ARGS__) #define E(x, ftdi) \ - do { \ - if ((x)) \ - { \ - avrdude_message(MSG_INFO, "%s:%d %s() %s: %s (%d)\n\t%s\n", \ - __FILE__, __LINE__, __FUNCTION__, \ - #x, strerror(errno), errno, ftdi_get_error_string(ftdi)); \ - return -1; \ - } \ - } while(0) + do { \ + if ((x)) \ + { \ + msg_error("%s:%d %s() %s: %s (%d)\n\t%s\n", \ + __FILE__, __LINE__, __FUNCTION__, \ + #x, strerror(errno), errno, ftdi_get_error_string(ftdi)); \ + return -1; \ + } \ + } while(0) #define E_VOID(x, ftdi) \ - do { \ - if ((x)) \ - { \ - avrdude_message(MSG_INFO, "%s:%d %s() %s: %s (%d)\n\t%s\n", \ - __FILE__, __LINE__, __FUNCTION__, \ - #x, strerror(errno), errno, ftdi_get_error_string(ftdi)); \ - } \ - } while(0) + do { \ + if ((x)) \ + { \ + msg_error("%s:%d %s() %s: %s (%d)\n\t%s\n", \ + __FILE__, __LINE__, __FUNCTION__, \ + #x, strerror(errno), errno, ftdi_get_error_string(ftdi)); \ + } \ + } while(0) #define to_pdata(pgm) \ - ((avrftdi_t *)((pgm)->cookie)) + ((avrftdi_t *)((pgm)->cookie)) typedef struct avrftdi_s { - /* pointer to struct maintained by libftdi to identify the device */ - struct ftdi_context* ftdic; - /* bitmask of values for pins. bit 0 represents pin 0 ([A|B]DBUS0) */ - uint16_t pin_value; - /* bitmask of pin direction. a '1' make a pin an output. - * bit 0 corresponds to pin 0. */ - uint16_t pin_direction; - /* don't know. not useful. someone put it in. */ - uint16_t led_mask; - /* total number of pins supported by a programmer. varies with FTDI chips */ - int pin_limit; - /* internal RX buffer of the device. needed for INOUT transfers */ - int rx_buffer_size; - int tx_buffer_size; - /* use bitbanging instead of mpsse spi */ - bool use_bitbanging; + /* pointer to struct maintained by libftdi to identify the device */ + struct ftdi_context* ftdic; + /* bitmask of values for pins. bit 0 represents pin 0 ([A|B]DBUS0) */ + uint16_t pin_value; + /* bitmask of pin direction. a '1' make a pin an output. + * bit 0 corresponds to pin 0. */ + uint16_t pin_direction; + /* don't know. not useful. someone put it in. */ + uint16_t led_mask; + /* total number of pins supported by a programmer. varies with FTDI chips */ + int pin_limit; + /* internal RX buffer of the device. needed for INOUT transfers */ + int rx_buffer_size; + int tx_buffer_size; + /* use bitbanging instead of mpsse spi */ + bool use_bitbanging; + /* bits 16-23 of extended 24-bit word flash address for parts with flash > 128k */ + uint8_t lext_byte; } avrftdi_t; void avrftdi_log(int level, const char * func, int line, const char * fmt, ...); diff --git a/src/avrftdi_tpi.c b/src/avrftdi_tpi.c index efb56266..f4cd18f9 100644 --- a/src/avrftdi_tpi.c +++ b/src/avrftdi_tpi.c @@ -15,8 +15,8 @@ #ifndef DO_NOT_BUILD_AVRFTDI -static void avrftdi_tpi_disable(PROGRAMMER *); -static int avrftdi_tpi_program_enable(PROGRAMMER * pgm, AVRPART * p); +static void avrftdi_tpi_disable(const PROGRAMMER *); +static int avrftdi_tpi_program_enable(const PROGRAMMER *pgm, const AVRPART *p); #ifdef notyet static void @@ -63,27 +63,16 @@ avrftdi_debug_frame(uint16_t frame) #endif /* notyet */ int -avrftdi_tpi_initialize(PROGRAMMER * pgm, AVRPART * p) -{ +avrftdi_tpi_initialize(const PROGRAMMER *pgm, const AVRPART *p) { int ret; avrftdi_t* pdata = to_pdata(pgm); unsigned char buf[] = { MPSSE_DO_WRITE | MPSSE_WRITE_NEG | MPSSE_LSB, 0x01, 0x00, 0xff, 0xff }; - log_info("Using TPI interface\n"); - - pgm->program_enable = avrftdi_tpi_program_enable; - pgm->cmd_tpi = avrftdi_cmd_tpi; - pgm->chip_erase = avr_tpi_chip_erase; - pgm->disable = avrftdi_tpi_disable; - - pgm->paged_load = NULL; - pgm->paged_write = NULL; - log_info("Setting /Reset pin low\n"); pgm->setpin(pgm, PIN_AVR_RESET, OFF); pgm->setpin(pgm, PIN_AVR_SCK, OFF); - pgm->setpin(pgm, PIN_AVR_MOSI, ON); + pgm->setpin(pgm, PIN_AVR_SDO, ON); usleep(20 * 1000); pgm->setpin(pgm, PIN_AVR_RESET, ON); @@ -101,6 +90,20 @@ avrftdi_tpi_initialize(PROGRAMMER * pgm, AVRPART * p) return ret; } + +void avrftdi_tpi_initpgm(PROGRAMMER *pgm) { + log_info("Using TPI interface\n"); + + pgm->program_enable = avrftdi_tpi_program_enable; + pgm->cmd_tpi = avrftdi_cmd_tpi; + pgm->chip_erase = avr_tpi_chip_erase; + pgm->disable = avrftdi_tpi_disable; + + pgm->paged_load = NULL; + pgm->paged_write = NULL; +} + + #define TPI_PARITY_MASK 0x2000 static inline int count1s(unsigned int x) @@ -148,8 +151,7 @@ tpi_frame2byte(uint16_t frame, uint8_t * byte) #ifdef notyet static int -avrftdi_tpi_break(PROGRAMMER * pgm) -{ +avrftdi_tpi_break(const PROGRAMMER *pgm) { unsigned char buffer[] = { MPSSE_DO_WRITE | MPSSE_WRITE_NEG | MPSSE_LSB, 1, 0, 0, 0 }; E(ftdi_write_data(to_pdata(pgm)->ftdic, buffer, sizeof(buffer)) != sizeof(buffer), to_pdata(pgm)->ftdic); @@ -158,8 +160,7 @@ avrftdi_tpi_break(PROGRAMMER * pgm) #endif /* notyet */ static int -avrftdi_tpi_write_byte(PROGRAMMER * pgm, unsigned char byte) -{ +avrftdi_tpi_write_byte(const PROGRAMMER *pgm, unsigned char byte) { uint16_t frame; struct ftdi_context* ftdic = to_pdata(pgm)->ftdic; @@ -185,8 +186,7 @@ avrftdi_tpi_write_byte(PROGRAMMER * pgm, unsigned char byte) #define TPI_IDLE_BITS 2 static int -avrftdi_tpi_read_byte(PROGRAMMER * pgm, unsigned char * byte) -{ +avrftdi_tpi_read_byte(const PROGRAMMER *pgm, unsigned char *byte) { uint16_t frame; /* use 2 guard bits, 2 default idle bits + 12 frame bits = 16 bits total */ @@ -230,13 +230,12 @@ avrftdi_tpi_read_byte(PROGRAMMER * pgm, unsigned char * byte) } static int -avrftdi_tpi_program_enable(PROGRAMMER * pgm, AVRPART * p) -{ +avrftdi_tpi_program_enable(const PROGRAMMER *pgm, const AVRPART *p) { return avr_tpi_program_enable(pgm, p, TPIPCR_GT_2b); } int -avrftdi_cmd_tpi(PROGRAMMER * pgm, const unsigned char *cmd, int cmd_len, +avrftdi_cmd_tpi(const PROGRAMMER *pgm, const unsigned char *cmd, int cmd_len, unsigned char *res, int res_len) { int i, err = 0; @@ -259,8 +258,7 @@ avrftdi_cmd_tpi(PROGRAMMER * pgm, const unsigned char *cmd, int cmd_len, } static void -avrftdi_tpi_disable(PROGRAMMER * pgm) -{ +avrftdi_tpi_disable(const PROGRAMMER *pgm) { unsigned char cmd[] = {TPI_OP_SSTCS(TPIPCR), 0}; pgm->cmd_tpi(pgm, cmd, sizeof(cmd), NULL, 0); diff --git a/src/avrftdi_tpi.h b/src/avrftdi_tpi.h index 6082a379..f9a07515 100644 --- a/src/avrftdi_tpi.h +++ b/src/avrftdi_tpi.h @@ -1,9 +1,10 @@ #pragma once -//int avrftdi_tpi_write_byte(PROGRAMMER * pgm, unsigned char byte); -//int avrftdi_tpi_read_byte(PROGRAMMER * pgm, unsigned char * byte); -int avrftdi_cmd_tpi(PROGRAMMER * pgm, const unsigned char *cmd, int cmd_len, +//int avrftdi_tpi_write_byte(PROGRAMMER *pgm, unsigned char byte); +//int avrftdi_tpi_read_byte(PROGRAMMER *pgm, unsigned char * byte); +int avrftdi_cmd_tpi(const PROGRAMMER *pgm, const unsigned char *cmd, int cmd_len, unsigned char *res, int res_len); -int avrftdi_tpi_initialize(PROGRAMMER * pgm, AVRPART * p); +int avrftdi_tpi_initialize(const PROGRAMMER *pgm, const AVRPART *p); +void avrftdi_tpi_initpgm(PROGRAMMER *pgm); diff --git a/src/avrintel.c b/src/avrintel.c new file mode 100644 index 00000000..f24c4d91 --- /dev/null +++ b/src/avrintel.c @@ -0,0 +1,5458 @@ +/* + * Do not edit: automatically generated by mkavrintel.pl + * + * avrintel.c + * + * Atmel AVR8L, AVR8, XMEGA and AVR8X family description of interrupts and more + * + * published under GNU General Public License, version 3 (GPL-3.0) + * meta-author Stefan Rueger + * + * v 1.1 + * 02.01.2023 + * + */ + +#include "ac_cfg.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "avrintel.h" + +const uPcore_t uP_table[] = { // Value of -1 typically means unknown + //{mcu_name, mcuid, family, {sig, na, ture}, flstart, flsize, pgsiz, nb, bootsz, eestart, eesize, ep, rambeg, ramsiz, nf, nl, ni, isr_names}, // Source + {"ATtiny4", 0, F_AVR8L, {0x1E, 0x8F, 0x0A}, 0, 0x00200, 0x010, 0, 0, 0, 0, 0, 0x0040, 0x0020, 1, 1, 10, vtab_attiny9}, // atdf, avr-gcc 12.2.0, avrdude, boot size (manual) + {"ATtiny5", 1, F_AVR8L, {0x1E, 0x8F, 0x09}, 0, 0x00200, 0x010, 0, 0, 0, 0, 0, 0x0040, 0x0020, 1, 1, 11, vtab_attiny10}, // atdf, avr-gcc 12.2.0, avrdude, boot size (manual) + {"ATtiny9", 2, F_AVR8L, {0x1E, 0x90, 0x08}, 0, 0x00400, 0x010, 0, 0, 0, 0, 0, 0x0040, 0x0020, 1, 1, 10, vtab_attiny9}, // atdf, avr-gcc 12.2.0, avrdude, boot size (manual) + {"ATtiny10", 3, F_AVR8L, {0x1E, 0x90, 0x03}, 0, 0x00400, 0x010, 0, 0, 0, 0, 0, 0x0040, 0x0020, 1, 1, 11, vtab_attiny10}, // atdf, avr-gcc 12.2.0, avrdude, boot size (manual) + {"ATtiny20", 4, F_AVR8L, {0x1E, 0x91, 0x0F}, 0, 0x00800, 0x020, 0, 0, 0, 0, 0, 0x0040, 0x0080, 1, 1, 17, vtab_attiny20}, // atdf, avr-gcc 12.2.0, avrdude, boot size (manual) + {"ATtiny40", 5, F_AVR8L, {0x1E, 0x92, 0x0E}, 0, 0x01000, 0x040, 0, 0, 0, 0, 0, 0x0040, 0x0100, 1, 1, 18, vtab_attiny40}, // atdf, avr-gcc 12.2.0, avrdude, boot size (manual) + {"ATtiny102", 6, F_AVR8L, {0x1E, 0x90, 0x0C}, 0, 0x00400, 0x010, 0, 0, 0, 0, 0, 0x0040, 0x0020, 1, 1, 16, vtab_attiny104}, // atdf, avrdude, boot size (manual) + {"ATtiny104", 7, F_AVR8L, {0x1E, 0x90, 0x0B}, 0, 0x00400, 0x010, 0, 0, 0, 0, 0, 0x0040, 0x0020, 1, 1, 16, vtab_attiny104}, // atdf, avrdude, boot size (manual) + + {"ATtiny11", 8, F_AVR8, {0x1E, 0x90, 0x04}, 0, 0x00400, 0x001, 0, 0, 0, 0x0040, 1, 0x0060, 0x0020, 1, 1, 5, vtab_attiny11}, // atdf, avr-gcc 12.2.0, avrdude + {"ATtiny12", 9, F_AVR8, {0x1E, 0x90, 0x05}, 0, 0x00400, 0x001, 0, 0, 0, 0x0040, 2, 0x0060, 0x0020, 1, 1, 6, vtab_attiny12}, // atdf, avr-gcc 12.2.0, avrdude + {"ATtiny13", 10, F_AVR8, {0x1E, 0x90, 0x07}, 0, 0x00400, 0x020, 0, 0, 0, 0x0040, 4, 0x0060, 0x0040, 2, 1, 10, vtab_attiny13a}, // atdf, avr-gcc 12.2.0, avrdude + {"ATtiny13A", 11, F_AVR8, {0x1E, 0x90, 0x07}, 0, 0x00400, 0x020, 0, 0, 0, 0x0040, 4, 0x0060, 0x0040, 2, 1, 10, vtab_attiny13a}, // atdf, avr-gcc 12.2.0, avrdude + {"ATtiny15", 12, F_AVR8, {0x1E, 0x90, 0x06}, 0, 0x00400, 0x001, 0, 0, 0, 0x0040, 2, 0x0060, 0x0020, 1, 1, 9, vtab_attiny15}, // atdf, avr-gcc 12.2.0, avrdude + {"ATtiny22", 13, F_AVR8, {0x1E, 0x91, 0x06}, 0, 0x00800, -1, 0, 0, -1, -1, -1, 0x0060, 0x0080, 1, 1, 3, vtab_attiny22}, // avr-gcc 12.2.0, boot size (manual) + {"ATtiny24", 14, F_AVR8, {0x1E, 0x91, 0x0B}, 0, 0x00800, 0x020, 0, 0, 0, 0x0080, 4, 0x0060, 0x0080, 3, 1, 17, vtab_attiny84a}, // atdf, avr-gcc 12.2.0, avrdude + {"ATtiny24A", 15, F_AVR8, {0x1E, 0x91, 0x0B}, 0, 0x00800, 0x020, 0, 0, 0, 0x0080, 4, 0x0060, 0x0080, 3, 1, 17, vtab_attiny84a}, // atdf, avr-gcc 12.2.0, avrdude + {"ATtiny25", 16, F_AVR8, {0x1E, 0x91, 0x08}, 0, 0x00800, 0x020, 0, 0, 0, 0x0080, 4, 0x0060, 0x0080, 3, 1, 15, vtab_attiny85}, // atdf, avr-gcc 12.2.0, avrdude + {"ATtiny26", 17, F_AVR8, {0x1E, 0x91, 0x09}, 0, 0x00800, 0x020, 0, 0, 0, 0x0080, 4, 0x0060, 0x0080, 2, 1, 12, vtab_attiny26}, // atdf, avr-gcc 12.2.0, avrdude + {"ATtiny28", 18, F_AVR8, {0x1E, 0x91, 0x07}, 0, 0x00800, 0x002, 0, 0, 0, 0, 0, 0x0060, 0x0020, 1, 1, 6, vtab_attiny28}, // atdf, avr-gcc 12.2.0, avrdude + {"ATtiny43U", 19, F_AVR8, {0x1E, 0x92, 0x0C}, 0, 0x01000, 0x040, 0, 0, 0, 0x0040, 4, 0x0060, 0x0100, 3, 1, 16, vtab_attiny43u}, // atdf, avr-gcc 12.2.0, avrdude + {"ATtiny44", 20, F_AVR8, {0x1E, 0x92, 0x07}, 0, 0x01000, 0x040, 0, 0, 0, 0x0100, 4, 0x0060, 0x0100, 3, 1, 17, vtab_attiny84a}, // atdf, avr-gcc 12.2.0, avrdude + {"ATtiny44A", 21, F_AVR8, {0x1E, 0x92, 0x07}, 0, 0x01000, 0x040, 0, 0, 0, 0x0100, 4, 0x0060, 0x0100, 3, 1, 17, vtab_attiny84a}, // atdf, avr-gcc 12.2.0, avrdude + {"ATtiny45", 22, F_AVR8, {0x1E, 0x92, 0x06}, 0, 0x01000, 0x040, 0, 0, 0, 0x0100, 4, 0x0060, 0x0100, 3, 1, 15, vtab_attiny85}, // atdf, avr-gcc 12.2.0, avrdude + {"ATtiny48", 23, F_AVR8, {0x1E, 0x92, 0x09}, 0, 0x01000, 0x040, 0, 0, 0, 0x0040, 4, 0x0100, 0x0100, 3, 1, 20, vtab_attiny88}, // atdf, avr-gcc 12.2.0, avrdude + {"ATtiny84", 24, F_AVR8, {0x1E, 0x93, 0x0C}, 0, 0x02000, 0x040, 0, 0, 0, 0x0200, 4, 0x0060, 0x0200, 3, 1, 17, vtab_attiny84a}, // atdf, avr-gcc 12.2.0, avrdude + {"ATtiny84A", 25, F_AVR8, {0x1E, 0x93, 0x0C}, 0, 0x02000, 0x040, 0, 0, 0, 0x0200, 4, 0x0060, 0x0200, 3, 1, 17, vtab_attiny84a}, // atdf, avr-gcc 12.2.0, avrdude + {"ATtiny85", 26, F_AVR8, {0x1E, 0x93, 0x0B}, 0, 0x02000, 0x040, 0, 0, 0, 0x0200, 4, 0x0060, 0x0200, 3, 1, 15, vtab_attiny85}, // atdf, avr-gcc 12.2.0, avrdude + {"ATtiny87", 27, F_AVR8, {0x1E, 0x93, 0x87}, 0, 0x02000, 0x080, 0, 0, 0, 0x0200, 4, 0x0100, 0x0200, 3, 1, 20, vtab_attiny167}, // atdf, avr-gcc 12.2.0, avrdude + {"ATtiny88", 28, F_AVR8, {0x1E, 0x93, 0x11}, 0, 0x02000, 0x040, 0, 0, 0, 0x0040, 4, 0x0100, 0x0200, 3, 1, 20, vtab_attiny88}, // atdf, avr-gcc 12.2.0, avrdude + {"ATtiny167", 29, F_AVR8, {0x1E, 0x94, 0x87}, 0, 0x04000, 0x080, 0, 0, 0, 0x0200, 4, 0x0100, 0x0200, 3, 1, 20, vtab_attiny167}, // atdf, avr-gcc 12.2.0, avrdude + {"ATtiny261", 30, F_AVR8, {0x1E, 0x91, 0x0C}, 0, 0x00800, 0x020, 0, 0, 0, 0x0080, 4, 0x0060, 0x0080, 3, 1, 19, vtab_attiny861a}, // atdf, avr-gcc 12.2.0, avrdude + {"ATtiny261A", 31, F_AVR8, {0x1E, 0x91, 0x0C}, 0, 0x00800, 0x020, 0, 0, 0, 0x0080, 4, 0x0060, 0x0080, 3, 1, 19, vtab_attiny861a}, // atdf, avr-gcc 12.2.0, avrdude + {"ATtiny441", 32, F_AVR8, {0x1E, 0x92, 0x15}, 0, 0x01000, 0x010, 0, 0, 0, 0x0100, 4, 0x0100, 0x0100, 3, 1, 30, vtab_attiny841}, // atdf, avr-gcc 12.2.0, avrdude + {"ATtiny461", 33, F_AVR8, {0x1E, 0x92, 0x08}, 0, 0x01000, 0x040, 0, 0, 0, 0x0100, 4, 0x0060, 0x0100, 3, 1, 19, vtab_attiny861a}, // atdf, avr-gcc 12.2.0, avrdude + {"ATtiny461A", 34, F_AVR8, {0x1E, 0x92, 0x08}, 0, 0x01000, 0x040, 0, 0, 0, 0x0100, 4, 0x0060, 0x0100, 3, 1, 19, vtab_attiny861a}, // atdf, avr-gcc 12.2.0, avrdude + {"ATtiny828", 35, F_AVR8, {0x1E, 0x93, 0x14}, 0, 0x02000, 0x040, 4, 0x0100, 0, 0x0100, 4, 0x0100, 0x0200, 3, 1, 26, vtab_attiny828}, // atdf, avr-gcc 12.2.0, avrdude + {"ATtiny828R", 36, F_AVR8, {0x1E, 0x93, 0x14}, 0, 0x02000, 0x040, 4, 0x0100, 0, 0x0100, 4, 0x0100, 0x0200, 3, 1, 26, vtab_attiny828}, // avrdude, from ATtiny828 + {"ATtiny841", 37, F_AVR8, {0x1E, 0x93, 0x15}, 0, 0x02000, 0x010, 0, 0, 0, 0x0200, 4, 0x0100, 0x0200, 3, 1, 30, vtab_attiny841}, // atdf, avr-gcc 12.2.0, avrdude + {"ATtiny861", 38, F_AVR8, {0x1E, 0x93, 0x0D}, 0, 0x02000, 0x040, 0, 0, 0, 0x0200, 4, 0x0060, 0x0200, 3, 1, 19, vtab_attiny861a}, // atdf, avr-gcc 12.2.0, avrdude + {"ATtiny861A", 39, F_AVR8, {0x1E, 0x93, 0x0D}, 0, 0x02000, 0x040, 0, 0, 0, 0x0200, 4, 0x0060, 0x0200, 3, 1, 19, vtab_attiny861a}, // atdf, avr-gcc 12.2.0, avrdude + {"ATtiny1634", 40, F_AVR8, {0x1E, 0x94, 0x12}, 0, 0x04000, 0x020, 0, 0, 0, 0x0100, 4, 0x0100, 0x0400, 3, 1, 28, vtab_attiny1634}, // atdf, avr-gcc 12.2.0, avrdude + {"ATtiny1634R", 41, F_AVR8, {0x1E, 0x94, 0x12}, 0, 0x04000, 0x020, 0, 0, 0, 0x0100, 4, 0x0100, 0x0400, 3, 1, 28, vtab_attiny1634}, // avrdude, from ATtiny1634 + {"ATtiny2313", 42, F_AVR8, {0x1E, 0x91, 0x0A}, 0, 0x00800, 0x020, 0, 0, 0, 0x0080, 4, 0x0060, 0x0080, 3, 1, 19, vtab_attiny2313}, // atdf, avr-gcc 12.2.0, avrdude + {"ATtiny2313A", 43, F_AVR8, {0x1E, 0x91, 0x0A}, 0, 0x00800, 0x020, 0, 0, 0, 0x0080, 4, 0x0060, 0x0080, 3, 1, 21, vtab_attiny4313}, // atdf, avr-gcc 12.2.0, avrdude + {"ATtiny4313", 44, F_AVR8, {0x1E, 0x92, 0x0D}, 0, 0x01000, 0x040, 0, 0, 0, 0x0100, 4, 0x0060, 0x0100, 3, 1, 21, vtab_attiny4313}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega8", 45, F_AVR8, {0x1E, 0x93, 0x07}, 0, 0x02000, 0x040, 4, 0x0100, 0, 0x0200, 4, 0x0060, 0x0400, 2, 1, 19, vtab_atmega8a}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega8A", 46, F_AVR8, {0x1E, 0x93, 0x07}, 0, 0x02000, 0x040, 4, 0x0100, 0, 0x0200, 4, 0x0060, 0x0400, 2, 1, 19, vtab_atmega8a}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega8HVA", 47, F_AVR8, {0x1E, 0x93, 0x10}, 0, 0x02000, 0x080, 0, 0, 0, 0x0100, 4, 0x0100, 0x0200, 1, 1, 21, vtab_atmega16hva}, // atdf, avr-gcc 12.2.0 + {"ATmega8U2", 48, F_AVR8, {0x1E, 0x93, 0x89}, 0, 0x02000, 0x080, 4, 0x0200, 0, 0x0200, 4, 0x0100, 0x0200, 3, 1, 29, vtab_atmega32u2}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega16", 49, F_AVR8, {0x1E, 0x94, 0x03}, 0, 0x04000, 0x080, 4, 0x0100, 0, 0x0200, 4, 0x0060, 0x0400, 2, 1, 21, vtab_atmega16a}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega16A", 50, F_AVR8, {0x1E, 0x94, 0x03}, 0, 0x04000, 0x080, 4, 0x0100, 0, 0x0200, 4, 0x0060, 0x0400, 2, 1, 21, vtab_atmega16a}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega16HVA", 51, F_AVR8, {0x1E, 0x94, 0x0C}, 0, 0x04000, 0x080, 0, 0, 0, 0x0100, 4, 0x0100, 0x0200, 1, 1, 21, vtab_atmega16hva}, // atdf, avr-gcc 12.2.0 + {"ATmega16HVB", 52, F_AVR8, {0x1E, 0x94, 0x0D}, 0, 0x04000, 0x080, 4, 0x0200, 0, 0x0200, 4, 0x0100, 0x0400, 2, 1, 29, vtab_atmega32hvbrevb}, // atdf, avr-gcc 12.2.0 + {"ATmega16HVBrevB", 53, F_AVR8, {0x1E, 0x94, 0x0D}, 0, 0x04000, 0x080, 4, 0x0200, 0, 0x0200, 4, 0x0100, 0x0400, 2, 1, 29, vtab_atmega32hvbrevb}, // atdf, avr-gcc 12.2.0 + {"ATmega16M1", 54, F_AVR8, {0x1E, 0x94, 0x84}, 0, 0x04000, 0x080, 4, 0x0200, 0, 0x0200, 4, 0x0100, 0x0400, 3, 1, 31, vtab_atmega64m1}, // atdf, avr-gcc 12.2.0 + {"ATmega16HVA2", 55, F_AVR8, {0x1E, 0x94, 0x0E}, 0, 0x04000, 0x080, -1, -1, -1, -1, -1, 0x0100, 0x0400, 2, 1, 22, vtab_atmega16hva2}, // avr-gcc 12.2.0 + {"ATmega16U2", 56, F_AVR8, {0x1E, 0x94, 0x89}, 0, 0x04000, 0x080, 4, 0x0200, 0, 0x0200, 4, 0x0100, 0x0200, 3, 1, 29, vtab_atmega32u2}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega16U4", 57, F_AVR8, {0x1E, 0x94, 0x88}, 0, 0x04000, 0x080, 4, 0x0200, 0, 0x0200, 4, 0x0100, 0x0500, 3, 1, 43, vtab_atmega32u4}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega32", 58, F_AVR8, {0x1E, 0x95, 0x02}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0060, 0x0800, 2, 1, 21, vtab_atmega323}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega32A", 59, F_AVR8, {0x1E, 0x95, 0x02}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0060, 0x0800, 2, 1, 21, vtab_atmega323}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega32HVB", 60, F_AVR8, {0x1E, 0x95, 0x10}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0100, 0x0800, 2, 1, 29, vtab_atmega32hvbrevb}, // atdf, avr-gcc 12.2.0 + {"ATmega32HVBrevB", 61, F_AVR8, {0x1E, 0x95, 0x10}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0100, 0x0800, 2, 1, 29, vtab_atmega32hvbrevb}, // atdf, avr-gcc 12.2.0 + {"ATmega32C1", 62, F_AVR8, {0x1E, 0x95, 0x86}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0100, 0x0800, 3, 1, 31, vtab_atmega64m1}, // atdf, avr-gcc 12.2.0 + {"ATmega32M1", 63, F_AVR8, {0x1E, 0x95, 0x84}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0100, 0x0800, 3, 1, 31, vtab_atmega64m1}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega32U2", 64, F_AVR8, {0x1E, 0x95, 0x8A}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0100, 0x0400, 3, 1, 29, vtab_atmega32u2}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega32U4", 65, F_AVR8, {0x1E, 0x95, 0x87}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0100, 0x0a00, 3, 1, 43, vtab_atmega32u4}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega32U6", 66, F_AVR8, {0x1E, 0x95, 0x88}, 0, 0x08000, 0x080, 4, 0x0200, -1, -1, -1, 0x0100, 0x0a00, 3, 1, 38, vtab_atmega32u6}, // avr-gcc 12.2.0, boot size (manual) + {"ATmega48", 67, F_AVR8, {0x1E, 0x92, 0x05}, 0, 0x01000, 0x040, 0, 0, 0, 0x0100, 4, 0x0100, 0x0200, 3, 1, 26, vtab_atmega328p}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega48A", 68, F_AVR8, {0x1E, 0x92, 0x05}, 0, 0x01000, 0x040, 0, 0, 0, 0x0100, 4, 0x0100, 0x0200, 3, 1, 26, vtab_atmega328p}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega48P", 69, F_AVR8, {0x1E, 0x92, 0x0A}, 0, 0x01000, 0x040, 0, 0, 0, 0x0100, 4, 0x0100, 0x0200, 3, 1, 26, vtab_atmega328p}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega48PA", 70, F_AVR8, {0x1E, 0x92, 0x0A}, 0, 0x01000, 0x040, 0, 0, 0, 0x0100, 4, 0x0100, 0x0200, 3, 1, 26, vtab_atmega328p}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega48PB", 71, F_AVR8, {0x1E, 0x92, 0x10}, 0, 0x01000, 0x040, 0, 0, 0, 0x0100, 4, 0x0100, 0x0200, 3, 1, 27, vtab_atmega168pb}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega64", 72, F_AVR8, {0x1E, 0x96, 0x02}, 0, 0x10000, 0x100, 4, 0x0400, 0, 0x0800, 8, 0x0100, 0x1000, 3, 1, 35, vtab_atmega128a}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega64A", 73, F_AVR8, {0x1E, 0x96, 0x02}, 0, 0x10000, 0x100, 4, 0x0400, 0, 0x0800, 8, 0x0100, 0x1000, 3, 1, 35, vtab_atmega128a}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega64HVE", 74, F_AVR8, {0x1E, 0x96, 0x10}, 0, 0x10000, 0x080, 4, 0x0400, -1, -1, -1, 0x0100, 0x1000, 2, 1, 25, vtab_atmega64hve2}, // avr-gcc 12.2.0, boot size (manual) + {"ATmega64C1", 75, F_AVR8, {0x1E, 0x96, 0x86}, 0, 0x10000, 0x100, 4, 0x0400, 0, 0x0800, 8, 0x0100, 0x1000, 3, 1, 31, vtab_atmega64m1}, // atdf, avr-gcc 12.2.0 + {"ATmega64M1", 76, F_AVR8, {0x1E, 0x96, 0x84}, 0, 0x10000, 0x100, 4, 0x0400, 0, 0x0800, 8, 0x0100, 0x1000, 3, 1, 31, vtab_atmega64m1}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega64HVE2", 77, F_AVR8, {0x1E, 0x96, 0x10}, 0, 0x10000, 0x080, 4, 0x0400, 0, 0x0400, 4, 0x0100, 0x1000, 2, 1, 25, vtab_atmega64hve2}, // atdf, avr-gcc 12.2.0 + {"ATmega64RFR2", 78, F_AVR8, {0x1E, 0xA6, 0x02}, 0, 0x10000, 0x100, 4, 0x0400, 0, 0x0800, 8, 0x0200, 0x2000, 3, 1, 77, vtab_atmega2564rfr2}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega88", 79, F_AVR8, {0x1E, 0x93, 0x0A}, 0, 0x02000, 0x040, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0400, 3, 1, 26, vtab_atmega328p}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega88A", 80, F_AVR8, {0x1E, 0x93, 0x0A}, 0, 0x02000, 0x040, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0400, 3, 1, 26, vtab_atmega328p}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega88P", 81, F_AVR8, {0x1E, 0x93, 0x0F}, 0, 0x02000, 0x040, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0400, 3, 1, 26, vtab_atmega328p}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega88PA", 82, F_AVR8, {0x1E, 0x93, 0x0F}, 0, 0x02000, 0x040, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0400, 3, 1, 26, vtab_atmega328p}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega88PB", 83, F_AVR8, {0x1E, 0x93, 0x16}, 0, 0x02000, 0x040, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0400, 3, 1, 27, vtab_atmega168pb}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega103", 84, F_AVR8, {0x1E, 0x97, 0x01}, 0, 0x20000, 0x100, 0, 0, 0, 0x1000, 1, 0x0060, 0x0fa0, 1, 1, 24, vtab_atmega103}, // avr-gcc 12.2.0, avrdude, boot size (manual) + {"ATmega128", 85, F_AVR8, {0x1E, 0x97, 0x02}, 0, 0x20000, 0x100, 4, 0x0400, 0, 0x1000, 8, 0x0100, 0x1000, 3, 1, 35, vtab_atmega128a}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega128A", 86, F_AVR8, {0x1E, 0x97, 0x02}, 0, 0x20000, 0x100, 4, 0x0400, 0, 0x1000, 8, 0x0100, 0x1000, 3, 1, 35, vtab_atmega128a}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega128RFA1", 87, F_AVR8, {0x1E, 0xA7, 0x01}, 0, 0x20000, 0x100, 4, 0x0400, 0, 0x1000, 8, 0x0200, 0x4000, 3, 1, 72, vtab_atmega128rfa1}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega128RFR2", 88, F_AVR8, {0x1E, 0xA7, 0x02}, 0, 0x20000, 0x100, 4, 0x0400, 0, 0x1000, 8, 0x0200, 0x4000, 3, 1, 77, vtab_atmega2564rfr2}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega161", 89, F_AVR8, {0x1E, 0x94, 0x01}, 0, 0x04000, 0x080, 1, 0x0400, 0, 0x0200, 1, 0x0060, 0x0400, 1, 1, 21, vtab_atmega161}, // avr-gcc 12.2.0, avrdude, boot size (manual) + {"ATmega162", 90, F_AVR8, {0x1E, 0x94, 0x04}, 0, 0x04000, 0x080, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0400, 3, 1, 28, vtab_atmega162}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega163", 91, F_AVR8, {0x1E, 0x94, 0x02}, 0, 0x04000, 0x080, 4, 0x0100, 0, 0x0200, 1, 0x0060, 0x0400, 2, 1, 18, vtab_atmega163}, // avr-gcc 12.2.0, avrdude, boot size (manual) + {"ATmega164A", 92, F_AVR8, {0x1E, 0x94, 0x0F}, 0, 0x04000, 0x080, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0400, 3, 1, 31, vtab_atmega644pa}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega164P", 93, F_AVR8, {0x1E, 0x94, 0x0A}, 0, 0x04000, 0x080, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0400, 3, 1, 31, vtab_atmega644pa}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega164PA", 94, F_AVR8, {0x1E, 0x94, 0x0A}, 0, 0x04000, 0x080, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0400, 3, 1, 31, vtab_atmega644pa}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega165", 95, F_AVR8, {0x1E, 0x94, 0x10}, 0, 0x04000, 0x080, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0400, 3, 1, 22, vtab_atmega645p}, // avr-gcc 12.2.0, avrdude, boot size (manual) + {"ATmega165A", 96, F_AVR8, {0x1E, 0x94, 0x10}, 0, 0x04000, 0x080, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0400, 3, 1, 22, vtab_atmega645p}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega165P", 97, F_AVR8, {0x1E, 0x94, 0x07}, 0, 0x04000, 0x080, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0400, 3, 1, 22, vtab_atmega645p}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega165PA", 98, F_AVR8, {0x1E, 0x94, 0x07}, 0, 0x04000, 0x080, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0400, 3, 1, 22, vtab_atmega645p}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega168", 99, F_AVR8, {0x1E, 0x94, 0x06}, 0, 0x04000, 0x080, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0400, 3, 1, 26, vtab_atmega328}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega168A", 100, F_AVR8, {0x1E, 0x94, 0x06}, 0, 0x04000, 0x080, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0400, 3, 1, 26, vtab_atmega328p}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega168P", 101, F_AVR8, {0x1E, 0x94, 0x0B}, 0, 0x04000, 0x080, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0400, 3, 1, 26, vtab_atmega328p}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega168PA", 102, F_AVR8, {0x1E, 0x94, 0x0B}, 0, 0x04000, 0x080, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0400, 3, 1, 26, vtab_atmega328p}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega168PB", 103, F_AVR8, {0x1E, 0x94, 0x15}, 0, 0x04000, 0x080, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0400, 3, 1, 27, vtab_atmega168pb}, // atdf, avr-gcc 7.3.0, avrdude + {"ATmega169", 104, F_AVR8, {0x1E, 0x94, 0x05}, 0, 0x04000, 0x080, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0400, 3, 1, 23, vtab_atmega649p}, // avr-gcc 12.2.0, avrdude, boot size (manual) + {"ATmega169A", 105, F_AVR8, {0x1E, 0x94, 0x11}, 0, 0x04000, 0x080, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0400, 3, 1, 23, vtab_atmega649p}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega169P", 106, F_AVR8, {0x1E, 0x94, 0x05}, 0, 0x04000, 0x080, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0400, 3, 1, 23, vtab_atmega649p}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega169PA", 107, F_AVR8, {0x1E, 0x94, 0x05}, 0, 0x04000, 0x080, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0400, 3, 1, 23, vtab_atmega649p}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega256RFR2", 108, F_AVR8, {0x1E, 0xA8, 0x02}, 0, 0x40000, 0x100, 4, 0x0400, 0, 0x2000, 8, 0x0200, 0x8000, 3, 1, 77, vtab_atmega2564rfr2}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega323", 109, F_AVR8, {0x1E, 0x95, 0x01}, 0, 0x08000, 0x080, 4, 0x0200, -1, -1, -1, 0x0060, 0x0800, 2, 1, 21, vtab_atmega323}, // avr-gcc 12.2.0, boot size (manual) + {"ATmega324A", 110, F_AVR8, {0x1E, 0x95, 0x15}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0100, 0x0800, 3, 1, 31, vtab_atmega644pa}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega324P", 111, F_AVR8, {0x1E, 0x95, 0x08}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0100, 0x0800, 3, 1, 31, vtab_atmega644pa}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega324PA", 112, F_AVR8, {0x1E, 0x95, 0x11}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0100, 0x0800, 3, 1, 31, vtab_atmega644pa}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega324PB", 113, F_AVR8, {0x1E, 0x95, 0x17}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0100, 0x0800, 3, 1, 51, vtab_atmega324pb}, // atdf, avrdude + {"ATmega325", 114, F_AVR8, {0x1E, 0x95, 0x05}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0100, 0x0800, 3, 1, 22, vtab_atmega645p}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega325A", 115, F_AVR8, {0x1E, 0x95, 0x05}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0100, 0x0800, 3, 1, 22, vtab_atmega645p}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega325P", 116, F_AVR8, {0x1E, 0x95, 0x0D}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0100, 0x0800, 3, 1, 22, vtab_atmega645p}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega325PA", 117, F_AVR8, {0x1E, 0x95, 0x0D}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0100, 0x0800, 3, 1, 22, vtab_atmega645p}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega328", 118, F_AVR8, {0x1E, 0x95, 0x14}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0100, 0x0800, 3, 1, 26, vtab_atmega328}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega328P", 119, F_AVR8, {0x1E, 0x95, 0x0F}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0100, 0x0800, 3, 1, 26, vtab_atmega328p}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega328PB", 120, F_AVR8, {0x1E, 0x95, 0x16}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0100, 0x0800, 3, 1, 45, vtab_atmega328pb}, // atdf, avr-gcc 7.3.0, avrdude + {"ATmega329", 121, F_AVR8, {0x1E, 0x95, 0x03}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0100, 0x0800, 3, 1, 23, vtab_atmega649p}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega329A", 122, F_AVR8, {0x1E, 0x95, 0x03}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0100, 0x0800, 3, 1, 23, vtab_atmega649p}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega329P", 123, F_AVR8, {0x1E, 0x95, 0x0B}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0100, 0x0800, 3, 1, 23, vtab_atmega649p}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega329PA", 124, F_AVR8, {0x1E, 0x95, 0x0B}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0100, 0x0800, 3, 1, 23, vtab_atmega649p}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega406", 125, F_AVR8, {0x1E, 0x95, 0x07}, 0, 0x0a000, 0x080, 4, 0x0200, 0, 0x0200, 4, 0x0100, 0x0800, 2, 1, 23, vtab_atmega406}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega640", 126, F_AVR8, {0x1E, 0x96, 0x08}, 0, 0x10000, 0x100, 4, 0x0400, 0, 0x1000, 8, 0x0200, 0x2000, 3, 1, 57, vtab_atmega2561}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega644", 127, F_AVR8, {0x1E, 0x96, 0x09}, 0, 0x10000, 0x100, 4, 0x0400, 0, 0x0800, 8, 0x0100, 0x1000, 3, 1, 28, vtab_atmega644}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega644A", 128, F_AVR8, {0x1E, 0x96, 0x09}, 0, 0x10000, 0x100, 4, 0x0400, 0, 0x0800, 8, 0x0100, 0x1000, 3, 1, 31, vtab_atmega644pa}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega644P", 129, F_AVR8, {0x1E, 0x96, 0x0A}, 0, 0x10000, 0x100, 4, 0x0400, 0, 0x0800, 8, 0x0100, 0x1000, 3, 1, 31, vtab_atmega644pa}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega644PA", 130, F_AVR8, {0x1E, 0x96, 0x0A}, 0, 0x10000, 0x100, 4, 0x0400, 0, 0x0800, 8, 0x0100, 0x1000, 3, 1, 31, vtab_atmega644pa}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega644RFR2", 131, F_AVR8, {0x1E, 0xA6, 0x03}, 0, 0x10000, 0x100, 4, 0x0400, 0, 0x0800, 8, 0x0200, 0x2000, 3, 1, 77, vtab_atmega2564rfr2}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega645", 132, F_AVR8, {0x1E, 0x96, 0x05}, 0, 0x10000, 0x100, 4, 0x0400, 0, 0x0800, 8, 0x0100, 0x1000, 3, 1, 22, vtab_atmega645p}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega645A", 133, F_AVR8, {0x1E, 0x96, 0x05}, 0, 0x10000, 0x100, 4, 0x0400, 0, 0x0800, 8, 0x0100, 0x1000, 3, 1, 22, vtab_atmega645p}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega645P", 134, F_AVR8, {0x1E, 0x96, 0x0D}, 0, 0x10000, 0x100, 4, 0x0400, 0, 0x0800, 8, 0x0100, 0x1000, 3, 1, 22, vtab_atmega645p}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega649", 135, F_AVR8, {0x1E, 0x96, 0x03}, 0, 0x10000, 0x100, 4, 0x0400, 0, 0x0800, 8, 0x0100, 0x1000, 3, 1, 23, vtab_atmega649p}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega649A", 136, F_AVR8, {0x1E, 0x96, 0x03}, 0, 0x10000, 0x100, 4, 0x0400, 0, 0x0800, 8, 0x0100, 0x1000, 3, 1, 23, vtab_atmega649p}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega649P", 137, F_AVR8, {0x1E, 0x96, 0x0B}, 0, 0x10000, 0x100, 4, 0x0400, 0, 0x0800, 8, 0x0100, 0x1000, 3, 1, 23, vtab_atmega649p}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega1280", 138, F_AVR8, {0x1E, 0x97, 0x03}, 0, 0x20000, 0x100, 4, 0x0400, 0, 0x1000, 8, 0x0200, 0x2000, 3, 1, 57, vtab_atmega2561}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega1281", 139, F_AVR8, {0x1E, 0x97, 0x04}, 0, 0x20000, 0x100, 4, 0x0400, 0, 0x1000, 8, 0x0200, 0x2000, 3, 1, 57, vtab_atmega2561}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega1284", 140, F_AVR8, {0x1E, 0x97, 0x06}, 0, 0x20000, 0x100, 4, 0x0400, 0, 0x1000, 8, 0x0100, 0x4000, 3, 1, 35, vtab_atmega1284p}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega1284P", 141, F_AVR8, {0x1E, 0x97, 0x05}, 0, 0x20000, 0x100, 4, 0x0400, 0, 0x1000, 8, 0x0100, 0x4000, 3, 1, 35, vtab_atmega1284p}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega1284RFR2", 142, F_AVR8, {0x1E, 0xA7, 0x03}, 0, 0x20000, 0x100, 4, 0x0400, 0, 0x1000, 8, 0x0200, 0x4000, 3, 1, 77, vtab_atmega2564rfr2}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega2560", 143, F_AVR8, {0x1E, 0x98, 0x01}, 0, 0x40000, 0x100, 4, 0x0400, 0, 0x1000, 8, 0x0200, 0x2000, 3, 1, 57, vtab_atmega2561}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega2561", 144, F_AVR8, {0x1E, 0x98, 0x02}, 0, 0x40000, 0x100, 4, 0x0400, 0, 0x1000, 8, 0x0200, 0x2000, 3, 1, 57, vtab_atmega2561}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega2564RFR2", 145, F_AVR8, {0x1E, 0xA8, 0x03}, 0, 0x40000, 0x100, 4, 0x0400, 0, 0x2000, 8, 0x0200, 0x8000, 3, 1, 77, vtab_atmega2564rfr2}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega3250", 146, F_AVR8, {0x1E, 0x95, 0x06}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0100, 0x0800, 3, 1, 25, vtab_atmega6450p}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega3250A", 147, F_AVR8, {0x1E, 0x95, 0x06}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0100, 0x0800, 3, 1, 25, vtab_atmega6450p}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega3250P", 148, F_AVR8, {0x1E, 0x95, 0x0E}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0100, 0x0800, 3, 1, 25, vtab_atmega6450p}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega3250PA", 149, F_AVR8, {0x1E, 0x95, 0x0E}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0100, 0x0800, 3, 1, 25, vtab_atmega6450p}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega3290", 150, F_AVR8, {0x1E, 0x95, 0x04}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0100, 0x0800, 3, 1, 25, vtab_atmega6490p}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega3290A", 151, F_AVR8, {0x1E, 0x95, 0x04}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0100, 0x0800, 3, 1, 25, vtab_atmega6490p}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega3290P", 152, F_AVR8, {0x1E, 0x95, 0x0C}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0100, 0x0800, 3, 1, 25, vtab_atmega6490p}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega3290PA", 153, F_AVR8, {0x1E, 0x95, 0x0C}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0100, 0x0800, 3, 1, 25, vtab_atmega6490p}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega6450", 154, F_AVR8, {0x1E, 0x96, 0x06}, 0, 0x10000, 0x100, 4, 0x0400, 0, 0x0800, 8, 0x0100, 0x1000, 3, 1, 25, vtab_atmega6450p}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega6450A", 155, F_AVR8, {0x1E, 0x96, 0x06}, 0, 0x10000, 0x100, 4, 0x0400, 0, 0x0800, 8, 0x0100, 0x1000, 3, 1, 25, vtab_atmega6450p}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega6450P", 156, F_AVR8, {0x1E, 0x96, 0x0E}, 0, 0x10000, 0x100, 4, 0x0400, 0, 0x0800, 8, 0x0100, 0x1000, 3, 1, 25, vtab_atmega6450p}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega6490", 157, F_AVR8, {0x1E, 0x96, 0x04}, 0, 0x10000, 0x100, 4, 0x0400, 0, 0x0800, 8, 0x0100, 0x1000, 3, 1, 25, vtab_atmega6490p}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega6490A", 158, F_AVR8, {0x1E, 0x96, 0x04}, 0, 0x10000, 0x100, 4, 0x0400, 0, 0x0800, 8, 0x0100, 0x1000, 3, 1, 25, vtab_atmega6490p}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega6490P", 159, F_AVR8, {0x1E, 0x96, 0x0C}, 0, 0x10000, 0x100, 4, 0x0400, 0, 0x0800, 8, 0x0100, 0x1000, 3, 1, 25, vtab_atmega6490p}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega8515", 160, F_AVR8, {0x1E, 0x93, 0x06}, 0, 0x02000, 0x040, 4, 0x0100, 0, 0x0200, 4, 0x0060, 0x0200, 2, 1, 17, vtab_atmega8515}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega8535", 161, F_AVR8, {0x1E, 0x93, 0x08}, 0, 0x02000, 0x040, 4, 0x0100, 0, 0x0200, 4, 0x0060, 0x0200, 2, 1, 21, vtab_atmega8535}, // atdf, avr-gcc 12.2.0, avrdude + {"AT43USB320", 162, F_AVR8, {0xff, -1, -1}, 0, 0x10000, -1, -1, -1, -1, -1, -1, 0x0060, 0x0200, -1, -1, 0, NULL}, // avr-gcc 12.2.0 + {"AT43USB355", 163, F_AVR8, {0xff, -1, -1}, 0, 0x06000, -1, -1, -1, -1, -1, -1, 0x0060, 0x0400, -1, -1, 0, NULL}, // avr-gcc 12.2.0 + {"AT76C711", 164, F_AVR8, {0xff, -1, -1}, 0, 0x04000, -1, -1, -1, -1, -1, -1, 0x0060, 0x07a0, -1, -1, 0, NULL}, // avr-gcc 12.2.0 + {"AT86RF401", 165, F_AVR8, {0x1E, 0x91, 0x81}, 0, 0x00800, -1, -1, -1, -1, -1, -1, 0x0060, 0x0080, 0, 1, 3, vtab_at86rf401}, // avr-gcc 12.2.0 + {"AT90PWM1", 166, F_AVR8, {0x1E, 0x93, 0x83}, 0, 0x02000, 0x040, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0200, 3, 1, 32, vtab_at90pwm316}, // atdf, avr-gcc 12.2.0 + {"AT90PWM2", 167, F_AVR8, {0x1E, 0x93, 0x81}, 0, 0x02000, 0x040, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0200, 3, 1, 32, vtab_at90pwm2}, // avr-gcc 12.2.0, avrdude, boot size (manual) + {"AT90PWM2B", 168, F_AVR8, {0x1E, 0x93, 0x83}, 0, 0x02000, 0x040, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0200, 3, 1, 32, vtab_at90pwm3b}, // atdf, avr-gcc 12.2.0, avrdude + {"AT90PWM3", 169, F_AVR8, {0x1E, 0x93, 0x81}, 0, 0x02000, 0x040, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0200, 3, 1, 32, vtab_at90pwm3b}, // atdf, avr-gcc 12.2.0, avrdude + {"AT90PWM3B", 170, F_AVR8, {0x1E, 0x93, 0x83}, 0, 0x02000, 0x040, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0200, 3, 1, 32, vtab_at90pwm3b}, // atdf, avr-gcc 12.2.0, avrdude + {"AT90CAN32", 171, F_AVR8, {0x1E, 0x95, 0x81}, 0, 0x08000, 0x100, 4, 0x0400, 0, 0x0400, 8, 0x0100, 0x0800, 3, 1, 37, vtab_at90can128}, // atdf, avr-gcc 12.2.0, avrdude + {"AT90CAN64", 172, F_AVR8, {0x1E, 0x96, 0x81}, 0, 0x10000, 0x100, 4, 0x0400, 0, 0x0800, 8, 0x0100, 0x1000, 3, 1, 37, vtab_at90can128}, // atdf, avr-gcc 12.2.0, avrdude + {"AT90PWM81", 173, F_AVR8, {0x1E, 0x93, 0x88}, 0, 0x02000, 0x040, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0100, 3, 1, 20, vtab_at90pwm161}, // atdf, avr-gcc 12.2.0 + {"AT90USB82", 174, F_AVR8, {0x1E, 0x93, 0x82}, 0, 0x02000, 0x080, 4, 0x0200, 0, 0x0200, 4, 0x0100, 0x0200, 3, 1, 29, vtab_atmega32u2}, // atdf, avr-gcc 12.2.0, avrdude + {"AT90SCR100", 175, F_AVR8, {0x1E, 0x96, 0xC1}, 0, 0x10000, 0x100, 4, 0x0200, -1, -1, -1, 0x0100, 0x1000, 3, 1, 38, vtab_at90scr100}, // avr-gcc 12.2.0, boot size (manual) + {"AT90CAN128", 176, F_AVR8, {0x1E, 0x97, 0x81}, 0, 0x20000, 0x100, 4, 0x0400, 0, 0x1000, 8, 0x0100, 0x1000, 3, 1, 37, vtab_at90can128}, // atdf, avr-gcc 12.2.0, avrdude + {"AT90PWM161", 177, F_AVR8, {0x1E, 0x94, 0x8B}, 0, 0x04000, 0x080, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0400, 3, 1, 20, vtab_at90pwm161}, // atdf, avr-gcc 12.2.0 + {"AT90USB162", 178, F_AVR8, {0x1E, 0x94, 0x82}, 0, 0x04000, 0x080, 4, 0x0200, 0, 0x0200, 4, 0x0100, 0x0200, 3, 1, 29, vtab_atmega32u2}, // atdf, avr-gcc 12.2.0, avrdude + {"AT90PWM216", 179, F_AVR8, {0x1E, 0x94, 0x83}, 0, 0x04000, 0x080, 4, 0x0200, 0, 0x0200, 4, 0x0100, 0x0400, 3, 1, 32, vtab_at90pwm316}, // atdf, avr-gcc 12.2.0, avrdude + {"AT90PWM316", 180, F_AVR8, {0x1E, 0x94, 0x83}, 0, 0x04000, 0x080, 4, 0x0200, 0, 0x0200, 4, 0x0100, 0x0400, 3, 1, 32, vtab_at90pwm316}, // atdf, avr-gcc 12.2.0, avrdude + {"AT90USB646", 181, F_AVR8, {0x1E, 0x96, 0x82}, 0, 0x10000, 0x100, 4, 0x0400, 0, 0x0800, 8, 0x0100, 0x1000, 3, 1, 38, vtab_atmega32u6}, // atdf, avr-gcc 12.2.0, avrdude + {"AT90USB647", 182, F_AVR8, {0x1E, 0x96, 0x82}, 0, 0x10000, 0x100, 4, 0x0400, 0, 0x0800, 8, 0x0100, 0x1000, 3, 1, 38, vtab_atmega32u6}, // atdf, avr-gcc 12.2.0, avrdude + {"AT90S1200", 183, F_AVR8, {0x1E, 0x90, 0x01}, 0, 0x00400, 0x001, 0, 0, 0, 0x0040, 1, 0x0060, 0x0020, 1, 1, 4, vtab_at90s1200}, // avr-gcc 12.2.0, avrdude, boot size (manual) + {"AT90USB1286", 184, F_AVR8, {0x1E, 0x97, 0x82}, 0, 0x20000, 0x100, 4, 0x0400, 0, 0x1000, 8, 0x0100, 0x2000, 3, 1, 38, vtab_atmega32u6}, // atdf, avr-gcc 12.2.0, avrdude + {"AT90USB1287", 185, F_AVR8, {0x1E, 0x97, 0x82}, 0, 0x20000, 0x100, 4, 0x0400, 0, 0x1000, 8, 0x0100, 0x2000, 3, 1, 38, vtab_atmega32u6}, // atdf, avr-gcc 12.2.0, avrdude + {"AT90S2313", 186, F_AVR8, {0x1E, 0x91, 0x01}, 0, 0x00800, 0x001, 0, 0, 0, 0x0080, 1, 0x0060, 0x0080, 1, 1, 11, vtab_at90s2313}, // avr-gcc 12.2.0, avrdude, boot size (manual) + {"AT90S2323", 187, F_AVR8, {0x1E, 0x91, 0x02}, 0, 0x00800, -1, 0, 0, -1, -1, -1, 0x0060, 0x0080, 1, 1, 3, vtab_attiny22}, // avr-gcc 12.2.0, boot size (manual) + {"AT90S2333", 188, F_AVR8, {0x1E, 0x91, 0x05}, 0, 0x00800, 0x001, 0, 0, 0, 0x0080, 1, 0x0060, 0x0080, -1, -1, 14, vtab_at90s4433}, // avr-gcc 12.2.0, avrdude, boot size (manual) + {"AT90S2343", 189, F_AVR8, {0x1E, 0x91, 0x03}, 0, 0x00800, 0x001, 0, 0, 0, 0x0080, 1, 0x0060, 0x0080, 1, 1, 3, vtab_attiny22}, // avr-gcc 12.2.0, avrdude, boot size (manual) + {"AT90S4414", 190, F_AVR8, {0x1E, 0x92, 0x01}, 0, 0x01000, 0x001, 0, 0, 0, 0x0100, 1, 0x0060, 0x0100, 1, 1, 13, vtab_at90s8515}, // avr-gcc 12.2.0, avrdude, boot size (manual) + {"AT90S4433", 191, F_AVR8, {0x1E, 0x92, 0x03}, 0, 0x01000, 0x001, 0, 0, 0, 0x0100, 1, 0x0060, 0x0080, 1, 1, 14, vtab_at90s4433}, // avr-gcc 12.2.0, avrdude, boot size (manual) + {"AT90S4434", 192, F_AVR8, {0x1E, 0x92, 0x02}, 0, 0x01000, 0x001, 0, 0, 0, 0x0100, 1, 0x0060, 0x0100, 1, 1, 17, vtab_at90s8535}, // avr-gcc 12.2.0, avrdude, boot size (manual) + {"AT90S8515", 193, F_AVR8, {0x1E, 0x93, 0x01}, 0, 0x02000, 0x001, 0, 0, 0, 0x0200, 1, 0x0060, 0x0200, 1, 1, 13, vtab_at90s8515}, // avr-gcc 12.2.0, avrdude, boot size (manual) + {"AT90C8534", 194, F_AVR8, {0xff, -1, -1}, 0, 0x02000, -1, -1, -1, -1, -1, -1, 0x0060, 0x0100, -1, -1, 0, NULL}, // avr-gcc 12.2.0 + {"AT90S8535", 195, F_AVR8, {0x1E, 0x93, 0x03}, 0, 0x02000, 0x001, 0, 0, 0, 0x0200, 1, 0x0060, 0x0200, 1, 1, 17, vtab_at90s8535}, // avr-gcc 12.2.0, avrdude, boot size (manual) + {"AT94K", 196, F_AVR8, {0xff, -1, -1}, 0, 0x08000, -1, -1, -1, -1, -1, -1, 0x0060, 0x0fa0, -1, -1, 0, NULL}, // avr-gcc 12.2.0 + {"ATA5272", 197, F_AVR8, {0x1E, 0x93, 0x87}, 0, 0x02000, 0x080, 0, 0, 0, 0x0200, 4, 0x0100, 0x0200, 3, 1, 37, vtab_ata5272}, // atdf, avr-gcc 12.2.0 + {"ATA5505", 198, F_AVR8, {0x1E, 0x94, 0x87}, 0, 0x04000, 0x080, 0, 0, 0, 0x0200, 4, 0x0100, 0x0200, 3, 1, 20, vtab_attiny167}, // atdf, avr-gcc 12.2.0 + {"ATA5700M322", 199, F_AVR8, {0x1E, 0x95, 0x67}, 0x08000, 0x08000, 0x040, 0, 0, 0, 0x0880, 16, 0x0200, 0x0400, 1, 1, 51, vtab_ata5702m322}, // atdf + {"ATA5702M322", 200, F_AVR8, {0x1E, 0x95, 0x69}, 0x08000, 0x08000, 0x040, 0, 0, 0, 0x0880, 16, 0x0200, 0x0400, 1, 1, 51, vtab_ata5702m322}, // atdf, avr-gcc 12.2.0 + {"ATA5781", 201, F_AVR8, {0x1E, 0x95, 0x64}, -1, -1, -1, 0, 0, 0, 0x0400, 16, 0x0200, 0x0400, 1, 1, 42, vtab_ata8515}, // atdf + {"ATA5782", 202, F_AVR8, {0x1E, 0x95, 0x65}, 0x08000, 0x05000, 0x040, 1, 0x5000, 0, 0x0400, 16, 0x0200, 0x0400, 1, 1, 42, vtab_ata8515}, // atdf, avr-gcc 12.2.0 + {"ATA5783", 203, F_AVR8, {0x1E, 0x95, 0x66}, -1, -1, -1, 0, 0, 0, 0x0400, 16, 0x0200, 0x0400, 1, 1, 42, vtab_ata8515}, // atdf + {"ATA5787", 204, F_AVR8, {0x1E, 0x94, 0x6C}, 0x08000, 0x05200, 0x040, 0, 0, 0, 0x0400, 16, 0x0200, 0x0800, 1, 1, 44, vtab_ata5835}, // atdf + {"ATA5790", 205, F_AVR8, {0x1E, 0x94, 0x61}, 0, 0x04000, 0x080, 1, 0x0800, 0, 0x0800, 16, 0x0100, 0x0200, 1, 1, 30, vtab_ata5790}, // atdf, avr-gcc 12.2.0 + {"ATA5790N", 206, F_AVR8, {0x1E, 0x94, 0x62}, 0, 0x04000, 0x080, 1, 0x0800, 0, 0x0800, 16, 0x0100, 0x0200, 1, 1, 31, vtab_ata5791}, // atdf, avr-gcc 12.2.0 + {"ATA5791", 207, F_AVR8, {0x1E, 0x94, 0x62}, 0, 0x04000, 0x080, 1, 0x0800, 0, 0x0800, 16, 0x0100, 0x0200, 1, 1, 31, vtab_ata5791}, // atdf, avr-gcc 7.3.0 + {"ATA5795", 208, F_AVR8, {0x1E, 0x93, 0x61}, 0, 0x02000, 0x040, 1, 0x0800, 0, 0x0800, 16, 0x0100, 0x0200, 1, 1, 23, vtab_ata5795}, // atdf, avr-gcc 12.2.0 + {"ATA5831", 209, F_AVR8, {0x1E, 0x95, 0x61}, 0x08000, 0x05000, 0x040, 1, 0x5000, 0, 0x0400, 16, 0x0200, 0x0400, 1, 1, 42, vtab_ata8515}, // atdf, avr-gcc 12.2.0 + {"ATA5832", 210, F_AVR8, {0x1E, 0x95, 0x62}, -1, -1, -1, 0, 0, 0, 0x0400, 16, 0x0200, 0x0400, 1, 1, 42, vtab_ata8515}, // atdf + {"ATA5833", 211, F_AVR8, {0x1E, 0x95, 0x63}, -1, -1, -1, 0, 0, 0, 0x0400, 16, 0x0200, 0x0400, 1, 1, 42, vtab_ata8515}, // atdf + {"ATA5835", 212, F_AVR8, {0x1E, 0x94, 0x6B}, 0x08000, 0x05200, 0x040, 0, 0, 0, 0x0400, 16, 0x0200, 0x0800, 1, 1, 44, vtab_ata5835}, // atdf + {"ATA6285", 213, F_AVR8, {0x1E, 0x93, 0x82}, 0, 0x02000, 0x040, 4, 0x0100, 0, 0x0140, 4, 0x0100, 0x0200, 2, 1, 27, vtab_ata6289}, // atdf, avr-gcc 12.2.0 + {"ATA6286", 214, F_AVR8, {0x1E, 0x93, 0x82}, 0, 0x02000, 0x040, 4, 0x0100, 0, 0x0140, 4, 0x0100, 0x0200, 2, 1, 27, vtab_ata6289}, // atdf, avr-gcc 12.2.0 + {"ATA6289", 215, F_AVR8, {0x1E, 0x93, 0x82}, 0, 0x02000, 0x040, 4, 0x0100, -1, -1, -1, 0x0100, 0x0200, 2, 1, 27, vtab_ata6289}, // avr-gcc 12.2.0, boot size (manual) + {"ATA6612C", 216, F_AVR8, {0x1E, 0x93, 0x0A}, 0, 0x02000, 0x040, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0400, 3, 1, 26, vtab_atmega328p}, // atdf, avr-gcc 12.2.0 + {"ATA6613C", 217, F_AVR8, {0x1E, 0x94, 0x06}, 0, 0x04000, 0x080, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0400, 3, 1, 26, vtab_atmega328p}, // atdf, avr-gcc 12.2.0 + {"ATA6614Q", 218, F_AVR8, {0x1E, 0x95, 0x0F}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0100, 0x0800, 3, 1, 26, vtab_atmega328p}, // atdf, avr-gcc 12.2.0 + {"ATA6616C", 219, F_AVR8, {0x1E, 0x93, 0x87}, 0, 0x02000, 0x080, 0, 0, 0, 0x0200, 4, 0x0100, 0x0200, 3, 1, 20, vtab_attiny167}, // atdf, avr-gcc 12.2.0 + {"ATA6617C", 220, F_AVR8, {0x1E, 0x94, 0x87}, 0, 0x04000, 0x080, 0, 0, 0, 0x0200, 4, 0x0100, 0x0200, 3, 1, 20, vtab_attiny167}, // atdf, avr-gcc 12.2.0 + {"ATA8210", 221, F_AVR8, {0x1E, 0x95, 0x65}, 0x08000, 0x05000, 0x040, 1, 0x5000, 0, 0x0400, 16, 0x0200, 0x0400, 1, 1, 42, vtab_ata8515}, // atdf, avr-gcc 7.3.0 + {"ATA8215", 222, F_AVR8, {0x1E, 0x95, 0x64}, -1, -1, -1, 0, 0, 0, 0x0400, 16, 0x0200, 0x0400, 1, 1, 42, vtab_ata8515}, // atdf + {"ATA8510", 223, F_AVR8, {0x1E, 0x95, 0x61}, 0x08000, 0x05000, 0x040, 1, 0x5000, 0, 0x0400, 16, 0x0200, 0x0400, 1, 1, 42, vtab_ata8515}, // atdf, avr-gcc 7.3.0 + {"ATA8515", 224, F_AVR8, {0x1E, 0x95, 0x63}, -1, -1, -1, 0, 0, 0, 0x0400, 16, 0x0200, 0x0400, 1, 1, 42, vtab_ata8515}, // atdf + {"ATA664251", 225, F_AVR8, {0x1E, 0x94, 0x87}, 0, 0x04000, 0x080, 0, 0, 0, 0x0200, 4, 0x0100, 0x0200, 3, 1, 20, vtab_attiny167}, // atdf, avr-gcc 12.2.0 + {"M3000", 226, F_AVR8, {0xff, -1, -1}, 0, 0x10000, -1, -1, -1, -1, -1, -1, 0x1000, 0x1000, -1, -1, 0, NULL}, // avr-gcc 12.2.0 + {"LGT8F88P", 227, F_AVR8, {0x1E, 0x93, 0x0F}, 0, 0x02000, 0x040, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0400, 3, 1, 26, vtab_atmega328p}, // avrdude, from ATmega88 + {"LGT8F168P", 228, F_AVR8, {0x1E, 0x94, 0x0B}, 0, 0x04000, 0x080, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0400, 3, 1, 26, vtab_atmega328p}, // avrdude, from ATmega168P + {"LGT8F328P", 229, F_AVR8, {0x1E, 0x95, 0x0F}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0100, 0x0800, 3, 1, 26, vtab_atmega328p}, // avrdude, from ATmega328P + + {"ATxmega8E5", 230, F_XMEGA, {0x1E, 0x93, 0x41}, 0, 0x02800, 0x080, 1, 0x0800, 0, 0x0200, 32, 0x2000, 0x0400, 7, 1, 43, vtab_atxmega32e5}, // atdf, avr-gcc 12.2.0, avrdude + {"ATxmega16A4", 231, F_XMEGA, {0x1E, 0x94, 0x41}, 0, 0x05000, 0x100, 1, 0x1000, 0, 0x0400, 32, 0x2000, 0x0800, 6, 1, 94, vtab_atxmega32a4}, // atdf, avr-gcc 12.2.0, avrdude + {"ATxmega16A4U", 232, F_XMEGA, {0x1E, 0x94, 0x41}, 0, 0x05000, 0x100, 1, 0x1000, 0, 0x0400, 32, 0x2000, 0x0800, 6, 1, 127, vtab_atxmega128a4u}, // atdf, avr-gcc 12.2.0, avrdude + {"ATxmega16C4", 233, F_XMEGA, {0x1E, 0x94, 0x43}, 0, 0x05000, 0x100, 1, 0x1000, 0, 0x0400, 32, 0x2000, 0x0800, 6, 1, 127, vtab_atxmega32c4}, // atdf, avr-gcc 12.2.0, avrdude + {"ATxmega16D4", 234, F_XMEGA, {0x1E, 0x94, 0x42}, 0, 0x05000, 0x100, 1, 0x1000, 0, 0x0400, 32, 0x2000, 0x0800, 6, 1, 91, vtab_atxmega32d4}, // atdf, avr-gcc 12.2.0, avrdude + {"ATxmega16E5", 235, F_XMEGA, {0x1E, 0x94, 0x45}, 0, 0x05000, 0x080, 1, 0x1000, 0, 0x0200, 32, 0x2000, 0x0800, 7, 1, 43, vtab_atxmega32e5}, // atdf, avr-gcc 7.3.0, avrdude + {"ATxmega32C3", 236, F_XMEGA, {0x1E, 0x95, 0x49}, 0, 0x09000, 0x100, 1, 0x1000, 0, 0x0400, 32, 0x2000, 0x1000, 6, 1, 127, vtab_atxmega256c3}, // atdf, avr-gcc 12.2.0 + {"ATxmega32D3", 237, F_XMEGA, {0x1E, 0x95, 0x4A}, 0, 0x09000, 0x100, 1, 0x1000, 0, 0x0400, 32, 0x2000, 0x1000, 6, 1, 114, vtab_atxmega384d3}, // atdf, avr-gcc 12.2.0 + {"ATxmega32A4", 238, F_XMEGA, {0x1E, 0x95, 0x41}, 0, 0x09000, 0x100, 1, 0x1000, 0, 0x0400, 32, 0x2000, 0x1000, 6, 1, 94, vtab_atxmega32a4}, // atdf, avr-gcc 12.2.0, avrdude + {"ATxmega32A4U", 239, F_XMEGA, {0x1E, 0x95, 0x41}, 0, 0x09000, 0x100, 1, 0x1000, 0, 0x0400, 32, 0x2000, 0x1000, 6, 1, 127, vtab_atxmega128a4u}, // atdf, avr-gcc 12.2.0, avrdude + {"ATxmega32C4", 240, F_XMEGA, {0x1E, 0x95, 0x44}, 0, 0x09000, 0x100, 1, 0x1000, 0, 0x0400, 32, 0x2000, 0x1000, 6, 1, 127, vtab_atxmega32c4}, // atdf, avr-gcc 12.2.0, avrdude + {"ATxmega32D4", 241, F_XMEGA, {0x1E, 0x95, 0x42}, 0, 0x09000, 0x100, 1, 0x1000, 0, 0x0400, 32, 0x2000, 0x1000, 6, 1, 91, vtab_atxmega32d4}, // atdf, avr-gcc 12.2.0, avrdude + {"ATxmega32E5", 242, F_XMEGA, {0x1E, 0x95, 0x4C}, 0, 0x09000, 0x080, 1, 0x1000, 0, 0x0400, 32, 0x2000, 0x1000, 7, 1, 43, vtab_atxmega32e5}, // atdf, avr-gcc 12.2.0, avrdude + {"ATxmega64A1", 243, F_XMEGA, {0x1E, 0x96, 0x4E}, 0, 0x11000, 0x100, 1, 0x1000, 0, 0x0800, 32, 0x2000, 0x1000, 6, 1, 125, vtab_atxmega128a1}, // atdf, avr-gcc 12.2.0, avrdude + {"ATxmega64A1U", 244, F_XMEGA, {0x1E, 0x96, 0x4E}, 0, 0x11000, 0x100, 1, 0x1000, 0, 0x0800, 32, 0x2000, 0x1000, 6, 1, 127, vtab_atxmega128a1u}, // atdf, avr-gcc 12.2.0, avrdude + {"ATxmega64B1", 245, F_XMEGA, {0x1E, 0x96, 0x52}, 0, 0x11000, 0x100, 1, 0x1000, 0, 0x0800, 32, 0x2000, 0x1000, 6, 1, 81, vtab_atxmega128b1}, // atdf, avr-gcc 12.2.0, avrdude + {"ATxmega64A3", 246, F_XMEGA, {0x1E, 0x96, 0x42}, 0, 0x11000, 0x100, 1, 0x1000, 0, 0x0800, 32, 0x2000, 0x1000, 6, 1, 122, vtab_atxmega256a3}, // atdf, avr-gcc 12.2.0, avrdude + {"ATxmega64A3U", 247, F_XMEGA, {0x1E, 0x96, 0x42}, 0, 0x11000, 0x100, 1, 0x1000, 0, 0x0800, 32, 0x2000, 0x1000, 6, 1, 127, vtab_atxmega256a3u}, // atdf, avr-gcc 12.2.0, avrdude + {"ATxmega64B3", 248, F_XMEGA, {0x1E, 0x96, 0x51}, 0, 0x11000, 0x100, 1, 0x1000, 0, 0x0800, 32, 0x2000, 0x1000, 6, 1, 54, vtab_atxmega128b3}, // atdf, avr-gcc 12.2.0, avrdude + {"ATxmega64C3", 249, F_XMEGA, {0x1E, 0x96, 0x49}, 0, 0x11000, 0x100, 1, 0x1000, 0, 0x0800, 32, 0x2000, 0x1000, 6, 1, 127, vtab_atxmega256c3}, // atdf, avr-gcc 12.2.0, avrdude + {"ATxmega64D3", 250, F_XMEGA, {0x1E, 0x96, 0x4A}, 0, 0x11000, 0x100, 1, 0x1000, 0, 0x0800, 32, 0x2000, 0x1000, 6, 1, 114, vtab_atxmega384d3}, // atdf, avr-gcc 12.2.0, avrdude + {"ATxmega64A4", 251, F_XMEGA, {0x1E, 0x96, 0x46}, 0, 0x11000, 0x100, -1, -1, 0, 0x0800, 32, -1, -1, -1, -1, 0, NULL}, // avrdude + {"ATxmega64A4U", 252, F_XMEGA, {0x1E, 0x96, 0x46}, 0, 0x11000, 0x100, 1, 0x1000, 0, 0x0800, 32, 0x2000, 0x1000, 6, 1, 127, vtab_atxmega128a4u}, // atdf, avr-gcc 12.2.0, avrdude + {"ATxmega64D4", 253, F_XMEGA, {0x1E, 0x96, 0x47}, 0, 0x11000, 0x100, 1, 0x1000, 0, 0x0800, 32, 0x2000, 0x1000, 6, 1, 91, vtab_atxmega128d4}, // atdf, avr-gcc 12.2.0, avrdude + {"ATxmega128A1", 254, F_XMEGA, {0x1E, 0x97, 0x4C}, 0, 0x22000, 0x200, 1, 0x2000, 0, 0x0800, 32, 0x2000, 0x2000, 6, 1, 125, vtab_atxmega128a1}, // atdf, avr-gcc 12.2.0, avrdude + {"ATxmega128A1revD", 255, F_XMEGA, {0x1E, 0x97, 0x41}, 0, 0x22000, 0x200, -1, -1, 0, 0x0800, 32, -1, -1, -1, -1, 0, NULL}, // avrdude + {"ATxmega128A1U", 256, F_XMEGA, {0x1E, 0x97, 0x4C}, 0, 0x22000, 0x200, 1, 0x2000, 0, 0x0800, 32, 0x2000, 0x2000, 6, 1, 127, vtab_atxmega128a1u}, // atdf, avr-gcc 12.2.0, avrdude + {"ATxmega128B1", 257, F_XMEGA, {0x1E, 0x97, 0x4D}, 0, 0x22000, 0x100, 1, 0x2000, 0, 0x0800, 32, 0x2000, 0x2000, 6, 1, 81, vtab_atxmega128b1}, // atdf, avr-gcc 12.2.0, avrdude + {"ATxmega128A3", 258, F_XMEGA, {0x1E, 0x97, 0x42}, 0, 0x22000, 0x200, 1, 0x2000, 0, 0x0800, 32, 0x2000, 0x2000, 6, 1, 122, vtab_atxmega256a3}, // atdf, avr-gcc 12.2.0, avrdude + {"ATxmega128A3U", 259, F_XMEGA, {0x1E, 0x97, 0x42}, 0, 0x22000, 0x200, 1, 0x2000, 0, 0x0800, 32, 0x2000, 0x2000, 6, 1, 127, vtab_atxmega256a3u}, // atdf, avr-gcc 12.2.0, avrdude + {"ATxmega128B3", 260, F_XMEGA, {0x1E, 0x97, 0x4B}, 0, 0x22000, 0x100, 1, 0x2000, 0, 0x0800, 32, 0x2000, 0x2000, 6, 1, 54, vtab_atxmega128b3}, // atdf, avr-gcc 12.2.0, avrdude + {"ATxmega128C3", 261, F_XMEGA, {0x1E, 0x97, 0x52}, 0, 0x22000, 0x200, 1, 0x2000, 0, 0x0800, 32, 0x2000, 0x2000, 6, 1, 127, vtab_atxmega256c3}, // atdf, avr-gcc 12.2.0, avrdude + {"ATxmega128D3", 262, F_XMEGA, {0x1E, 0x97, 0x48}, 0, 0x22000, 0x200, 1, 0x2000, 0, 0x0800, 32, 0x2000, 0x2000, 6, 1, 114, vtab_atxmega384d3}, // atdf, avr-gcc 12.2.0, avrdude + {"ATxmega128A4", 263, F_XMEGA, {0x1E, 0x97, 0x46}, 0, 0x22000, 0x200, -1, -1, 0, 0x0800, 32, -1, -1, -1, -1, 0, NULL}, // avrdude + {"ATxmega128A4U", 264, F_XMEGA, {0x1E, 0x97, 0x46}, 0, 0x22000, 0x100, 1, 0x2000, 0, 0x0800, 32, 0x2000, 0x2000, 6, 1, 127, vtab_atxmega128a4u}, // atdf, avr-gcc 12.2.0, avrdude + {"ATxmega128D4", 265, F_XMEGA, {0x1E, 0x97, 0x47}, 0, 0x22000, 0x100, 1, 0x2000, 0, 0x0800, 32, 0x2000, 0x2000, 6, 1, 91, vtab_atxmega128d4}, // atdf, avr-gcc 12.2.0, avrdude + {"ATxmega192A1", 266, F_XMEGA, {0x1E, 0x97, 0x4E}, 0, 0x32000, 0x200, -1, -1, 0, 0x0800, 32, -1, -1, -1, -1, 0, NULL}, // avrdude + {"ATxmega192A3", 267, F_XMEGA, {0x1E, 0x97, 0x44}, 0, 0x32000, 0x200, 1, 0x2000, 0, 0x0800, 32, 0x2000, 0x4000, 6, 1, 122, vtab_atxmega256a3}, // atdf, avr-gcc 12.2.0, avrdude + {"ATxmega192A3U", 268, F_XMEGA, {0x1E, 0x97, 0x44}, 0, 0x32000, 0x200, 1, 0x2000, 0, 0x0800, 32, 0x2000, 0x4000, 6, 1, 127, vtab_atxmega256a3u}, // atdf, avr-gcc 12.2.0, avrdude + {"ATxmega192C3", 269, F_XMEGA, {0x1E, 0x97, 0x51}, 0, 0x32000, 0x200, 1, 0x2000, 0, 0x0800, 32, 0x2000, 0x4000, 6, 1, 127, vtab_atxmega256c3}, // atdf, avr-gcc 12.2.0, avrdude + {"ATxmega192D3", 270, F_XMEGA, {0x1E, 0x97, 0x49}, 0, 0x32000, 0x200, 1, 0x2000, 0, 0x0800, 32, 0x2000, 0x4000, 6, 1, 114, vtab_atxmega384d3}, // atdf, avr-gcc 12.2.0, avrdude + {"ATxmega256A1", 271, F_XMEGA, {0x1E, 0x98, 0x46}, 0, 0x42000, 0x200, -1, -1, 0, 0x1000, 32, -1, -1, -1, -1, 0, NULL}, // avrdude + {"ATxmega256A3", 272, F_XMEGA, {0x1E, 0x98, 0x42}, 0, 0x42000, 0x200, 1, 0x2000, 0, 0x1000, 32, 0x2000, 0x4000, 6, 1, 122, vtab_atxmega256a3}, // atdf, avr-gcc 12.2.0, avrdude + {"ATxmega256A3B", 273, F_XMEGA, {0x1E, 0x98, 0x43}, 0, 0x42000, 0x200, 1, 0x2000, 0, 0x1000, 32, 0x2000, 0x4000, 6, 1, 122, vtab_atxmega256a3b}, // atdf, avr-gcc 12.2.0, avrdude + {"ATxmega256A3BU", 274, F_XMEGA, {0x1E, 0x98, 0x43}, 0, 0x42000, 0x200, 1, 0x2000, 0, 0x1000, 32, 0x2000, 0x4000, 6, 1, 127, vtab_atxmega256a3bu}, // atdf, avr-gcc 12.2.0, avrdude + {"ATxmega256A3U", 275, F_XMEGA, {0x1E, 0x98, 0x42}, 0, 0x42000, 0x200, 1, 0x2000, 0, 0x1000, 32, 0x2000, 0x4000, 6, 1, 127, vtab_atxmega256a3u}, // atdf, avr-gcc 12.2.0, avrdude + {"ATxmega256C3", 276, F_XMEGA, {0x1E, 0x98, 0x46}, 0, 0x42000, 0x200, 1, 0x2000, 0, 0x1000, 32, 0x2000, 0x4000, 6, 1, 127, vtab_atxmega256c3}, // atdf, avr-gcc 12.2.0, avrdude + {"ATxmega256D3", 277, F_XMEGA, {0x1E, 0x98, 0x44}, 0, 0x42000, 0x200, 1, 0x2000, 0, 0x1000, 32, 0x2000, 0x4000, 6, 1, 114, vtab_atxmega384d3}, // atdf, avr-gcc 12.2.0, avrdude + {"ATxmega384C3", 278, F_XMEGA, {0x1E, 0x98, 0x45}, 0, 0x62000, 0x200, 1, 0x2000, 0, 0x1000, 32, 0x2000, 0x8000, 6, 1, 127, vtab_atxmega384c3}, // atdf, avr-gcc 12.2.0, avrdude + {"ATxmega384D3", 279, F_XMEGA, {0x1E, 0x98, 0x47}, 0, 0x62000, 0x200, 1, 0x2000, 0, 0x1000, 32, 0x2000, 0x8000, 6, 1, 114, vtab_atxmega384d3}, // atdf, avr-gcc 12.2.0, avrdude + + {"ATtiny202", 280, F_AVR8X, {0x1E, 0x91, 0x23}, 0, 0x00800, 0x040, 1, 0, 0x01400, 0x0040, 32, 0x3f80, 0x0080, 10, 1, 26, vtab_attiny402}, // atdf, avr-gcc 12.2.0, avrdude + {"ATtiny204", 281, F_AVR8X, {0x1E, 0x91, 0x22}, 0, 0x00800, 0x040, 1, 0, 0x01400, 0x0040, 32, 0x3f80, 0x0080, 10, 1, 26, vtab_attiny404}, // atdf, avr-gcc 12.2.0, avrdude + {"ATtiny212", 282, F_AVR8X, {0x1E, 0x91, 0x21}, 0, 0x00800, 0x040, 1, 0, 0x01400, 0x0040, 32, 0x3f80, 0x0080, 10, 1, 26, vtab_attiny412}, // atdf, avr-gcc 12.2.0, avrdude + {"ATtiny214", 283, F_AVR8X, {0x1E, 0x91, 0x20}, 0, 0x00800, 0x040, 1, 0, 0x01400, 0x0040, 32, 0x3f80, 0x0080, 10, 1, 26, vtab_attiny814}, // atdf, avr-gcc 12.2.0, avrdude + {"ATtiny402", 284, F_AVR8X, {0x1E, 0x92, 0x27}, 0, 0x01000, 0x040, 1, 0, 0x01400, 0x0080, 32, 0x3f00, 0x0100, 10, 1, 26, vtab_attiny402}, // atdf, avr-gcc 12.2.0, avrdude + {"ATtiny404", 285, F_AVR8X, {0x1E, 0x92, 0x26}, 0, 0x01000, 0x040, 1, 0, 0x01400, 0x0080, 32, 0x3f00, 0x0100, 10, 1, 26, vtab_attiny404}, // atdf, avr-gcc 12.2.0, avrdude + {"ATtiny406", 286, F_AVR8X, {0x1E, 0x92, 0x25}, 0, 0x01000, 0x040, 1, 0, 0x01400, 0x0080, 32, 0x3f00, 0x0100, 10, 1, 26, vtab_attiny406}, // atdf, avr-gcc 12.2.0, avrdude + {"ATtiny412", 287, F_AVR8X, {0x1E, 0x92, 0x23}, 0, 0x01000, 0x040, 1, 0, 0x01400, 0x0080, 32, 0x3f00, 0x0100, 10, 1, 26, vtab_attiny412}, // atdf, avr-gcc 12.2.0, avrdude + {"ATtiny414", 288, F_AVR8X, {0x1E, 0x92, 0x22}, 0, 0x01000, 0x040, 1, 0, 0x01400, 0x0080, 32, 0x3f00, 0x0100, 10, 1, 26, vtab_attiny814}, // atdf, avr-gcc 12.2.0, avrdude + {"ATtiny416", 289, F_AVR8X, {0x1E, 0x92, 0x21}, 0, 0x01000, 0x040, 1, 0, 0x01400, 0x0080, 32, 0x3f00, 0x0100, 10, 1, 26, vtab_attiny817}, // atdf, avr-gcc 12.2.0, avrdude + {"ATtiny416auto", 290, F_AVR8X, {0x1E, 0x92, 0x28}, 0, 0x01000, 0x040, 1, 0, 0x01400, 0x0080, 32, 0x3f00, 0x0100, 10, 1, 26, vtab_attiny817}, // atdf + {"ATtiny417", 291, F_AVR8X, {0x1E, 0x92, 0x20}, 0, 0x01000, 0x040, 1, 0, 0x01400, 0x0080, 32, 0x3f00, 0x0100, 10, 1, 26, vtab_attiny817}, // atdf, avr-gcc 12.2.0, avrdude + {"ATtiny424", 292, F_AVR8X, {0x1E, 0x92, 0x2C}, 0, 0x01000, 0x040, 1, 0, 0x01400, 0x0080, 32, 0x3e00, 0x0200, 10, 1, 30, vtab_attiny3227}, // atdf, avrdude + {"ATtiny426", 293, F_AVR8X, {0x1E, 0x92, 0x2B}, 0, 0x01000, 0x040, 1, 0, 0x01400, 0x0080, 32, 0x3e00, 0x0200, 10, 1, 30, vtab_attiny3227}, // atdf, avrdude + {"ATtiny427", 294, F_AVR8X, {0x1E, 0x92, 0x2A}, 0, 0x01000, 0x040, 1, 0, 0x01400, 0x0080, 32, 0x3e00, 0x0200, 10, 1, 30, vtab_attiny3227}, // atdf, avrdude + {"ATtiny804", 295, F_AVR8X, {0x1E, 0x93, 0x25}, 0, 0x02000, 0x040, 1, 0, 0x01400, 0x0080, 32, 0x3e00, 0x0200, 10, 1, 31, vtab_attiny1607}, // atdf, avr-gcc 12.2.0, avrdude + {"ATtiny806", 296, F_AVR8X, {0x1E, 0x93, 0x24}, 0, 0x02000, 0x040, 1, 0, 0x01400, 0x0080, 32, 0x3e00, 0x0200, 10, 1, 31, vtab_attiny1607}, // atdf, avr-gcc 12.2.0, avrdude + {"ATtiny807", 297, F_AVR8X, {0x1E, 0x93, 0x23}, 0, 0x02000, 0x040, 1, 0, 0x01400, 0x0080, 32, 0x3e00, 0x0200, 10, 1, 31, vtab_attiny1607}, // atdf, avr-gcc 12.2.0, avrdude + {"ATtiny814", 298, F_AVR8X, {0x1E, 0x93, 0x22}, 0, 0x02000, 0x040, 1, 0, 0x01400, 0x0080, 32, 0x3e00, 0x0200, 10, 1, 26, vtab_attiny814}, // atdf, avr-gcc 12.2.0, avrdude + {"ATtiny816", 299, F_AVR8X, {0x1E, 0x93, 0x21}, 0, 0x02000, 0x040, 1, 0, 0x01400, 0x0080, 32, 0x3e00, 0x0200, 10, 1, 26, vtab_attiny817}, // atdf, avr-gcc 12.2.0, avrdude + {"ATtiny817", 300, F_AVR8X, {0x1E, 0x93, 0x20}, 0, 0x02000, 0x040, 1, 0, 0x01400, 0x0080, 32, 0x3e00, 0x0200, 10, 1, 26, vtab_attiny817}, // atdf, avr-gcc 12.2.0, avrdude + {"ATtiny824", 301, F_AVR8X, {0x1E, 0x93, 0x29}, 0, 0x02000, 0x040, 1, 0, 0x01400, 0x0080, 32, 0x3c00, 0x0400, 10, 1, 30, vtab_attiny3227}, // atdf, avrdude + {"ATtiny826", 302, F_AVR8X, {0x1E, 0x93, 0x28}, 0, 0x02000, 0x040, 1, 0, 0x01400, 0x0080, 32, 0x3c00, 0x0400, 10, 1, 30, vtab_attiny3227}, // atdf, avrdude + {"ATtiny827", 303, F_AVR8X, {0x1E, 0x93, 0x27}, 0, 0x02000, 0x040, 1, 0, 0x01400, 0x0080, 32, 0x3c00, 0x0400, 10, 1, 30, vtab_attiny3227}, // atdf, avrdude + {"ATtiny1604", 304, F_AVR8X, {0x1E, 0x94, 0x25}, 0, 0x04000, 0x040, 1, 0, 0x01400, 0x0100, 32, 0x3c00, 0x0400, 10, 1, 31, vtab_attiny1607}, // atdf, avr-gcc 12.2.0, avrdude + {"ATtiny1606", 305, F_AVR8X, {0x1E, 0x94, 0x24}, 0, 0x04000, 0x040, 1, 0, 0x01400, 0x0100, 32, 0x3c00, 0x0400, 10, 1, 31, vtab_attiny1607}, // atdf, avr-gcc 12.2.0, avrdude + {"ATtiny1607", 306, F_AVR8X, {0x1E, 0x94, 0x23}, 0, 0x04000, 0x040, 1, 0, 0x01400, 0x0100, 32, 0x3c00, 0x0400, 10, 1, 31, vtab_attiny1607}, // atdf, avr-gcc 12.2.0, avrdude + {"ATtiny1614", 307, F_AVR8X, {0x1E, 0x94, 0x22}, 0, 0x04000, 0x040, 1, 0, 0x01400, 0x0100, 32, 0x3800, 0x0800, 10, 1, 31, vtab_attiny1614}, // atdf, avr-gcc 12.2.0, avrdude + {"ATtiny1616", 308, F_AVR8X, {0x1E, 0x94, 0x21}, 0, 0x04000, 0x040, 1, 0, 0x01400, 0x0100, 32, 0x3800, 0x0800, 10, 1, 31, vtab_attiny3217}, // atdf, avr-gcc 12.2.0, avrdude + {"ATtiny1617", 309, F_AVR8X, {0x1E, 0x94, 0x20}, 0, 0x04000, 0x040, 1, 0, 0x01400, 0x0100, 32, 0x3800, 0x0800, 10, 1, 31, vtab_attiny3217}, // atdf, avr-gcc 12.2.0, avrdude + {"ATtiny1624", 310, F_AVR8X, {0x1E, 0x94, 0x2A}, 0, 0x04000, 0x040, 1, 0, 0x01400, 0x0100, 32, 0x3800, 0x0800, 10, 1, 30, vtab_attiny3227}, // atdf, avrdude + {"ATtiny1626", 311, F_AVR8X, {0x1E, 0x94, 0x29}, 0, 0x04000, 0x040, 1, 0, 0x01400, 0x0100, 32, 0x3800, 0x0800, 10, 1, 30, vtab_attiny3227}, // atdf, avrdude + {"ATtiny1627", 312, F_AVR8X, {0x1E, 0x94, 0x28}, 0, 0x04000, 0x040, 1, 0, 0x01400, 0x0100, 32, 0x3800, 0x0800, 10, 1, 30, vtab_attiny3227}, // atdf, avrdude + {"ATtiny3214", 313, F_AVR8X, {0x1E, 0x95, 0x20}, 0, 0x08000, 0x080, 1, 0, 0x01400, 0x0100, 64, 0x3800, 0x0800, 10, 1, 31, vtab_attiny3214}, // avr-gcc 12.2.0 + {"ATtiny3216", 314, F_AVR8X, {0x1E, 0x95, 0x21}, 0, 0x08000, 0x080, 1, 0, 0x01400, 0x0100, 64, 0x3800, 0x0800, 10, 1, 31, vtab_attiny3217}, // atdf, avr-gcc 12.2.0, avrdude + {"ATtiny3217", 315, F_AVR8X, {0x1E, 0x95, 0x22}, 0, 0x08000, 0x080, 1, 0, 0x01400, 0x0100, 64, 0x3800, 0x0800, 10, 1, 31, vtab_attiny3217}, // atdf, avr-gcc 12.2.0, avrdude + {"ATtiny3224", 316, F_AVR8X, {0x1E, 0x95, 0x28}, 0, 0x08000, 0x080, 1, 0, 0x01400, 0x0100, 64, 0x3400, 0x0c00, 10, 1, 30, vtab_attiny3227}, // atdf, avrdude + {"ATtiny3226", 317, F_AVR8X, {0x1E, 0x95, 0x27}, 0, 0x08000, 0x080, 1, 0, 0x01400, 0x0100, 64, 0x3400, 0x0c00, 10, 1, 30, vtab_attiny3227}, // atdf, avrdude + {"ATtiny3227", 318, F_AVR8X, {0x1E, 0x95, 0x26}, 0, 0x08000, 0x080, 1, 0, 0x01400, 0x0100, 64, 0x3400, 0x0c00, 10, 1, 30, vtab_attiny3227}, // atdf, avrdude + {"ATmega808", 319, F_AVR8X, {0x1E, 0x93, 0x26}, 0, 0x02000, 0x040, 1, 0, 0x01400, 0x0100, 32, 0x3c00, 0x0400, 10, 1, 36, vtab_atmega4808}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega809", 320, F_AVR8X, {0x1E, 0x93, 0x2A}, 0, 0x02000, 0x040, 1, 0, 0x01400, 0x0100, 32, 0x3c00, 0x0400, 10, 1, 40, vtab_atmega4809}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega1608", 321, F_AVR8X, {0x1E, 0x94, 0x27}, 0, 0x04000, 0x040, 1, 0, 0x01400, 0x0100, 32, 0x3800, 0x0800, 10, 1, 36, vtab_atmega4808}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega1609", 322, F_AVR8X, {0x1E, 0x94, 0x26}, 0, 0x04000, 0x040, 1, 0, 0x01400, 0x0100, 32, 0x3800, 0x0800, 10, 1, 40, vtab_atmega4809}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega3208", 323, F_AVR8X, {0x1E, 0x95, 0x30}, 0, 0x08000, 0x080, 1, 0, 0x01400, 0x0100, 64, 0x3000, 0x1000, 10, 1, 36, vtab_atmega4808}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega3209", 324, F_AVR8X, {0x1E, 0x95, 0x31}, 0, 0x08000, 0x080, 1, 0, 0x01400, 0x0100, 64, 0x3000, 0x1000, 10, 1, 40, vtab_atmega4809}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega4808", 325, F_AVR8X, {0x1E, 0x96, 0x50}, 0, 0x0c000, 0x080, 1, 0, 0x01400, 0x0100, 64, 0x2800, 0x1800, 10, 1, 36, vtab_atmega4808}, // atdf, avr-gcc 12.2.0, avrdude + {"ATmega4809", 326, F_AVR8X, {0x1E, 0x96, 0x51}, 0, 0x0c000, 0x080, 1, 0, 0x01400, 0x0100, 64, 0x2800, 0x1800, 10, 1, 40, vtab_atmega4809}, // atdf, avr-gcc 12.2.0, avrdude + {"AVR8EA28", 327, F_AVR8X, {0x1E, 0x93, 0x2C}, 0, 0x02000, 0x040, 1, 0, 0x01400, 0x0200, 8, -1, -1, -1, -1, 0, NULL}, // avrdude + {"AVR8EA32", 328, F_AVR8X, {0x1E, 0x93, 0x2B}, 0, 0x02000, 0x040, 1, 0, 0x01400, 0x0200, 8, -1, -1, -1, -1, 0, NULL}, // avrdude + {"AVR16DD14", 329, F_AVR8X, {0x1E, 0x94, 0x34}, 0, 0x04000, 0x200, 1, 0, 0x01400, 0x0100, 1, 0x7800, 0x0800, 16, 4, 36, vtab_avr64dd32}, // atdf, avrdude + {"AVR16DD20", 330, F_AVR8X, {0x1E, 0x94, 0x33}, 0, 0x04000, 0x200, 1, 0, 0x01400, 0x0100, 1, 0x7800, 0x0800, 16, 4, 36, vtab_avr64dd32}, // atdf, avrdude + {"AVR16DD28", 331, F_AVR8X, {0x1E, 0x94, 0x32}, 0, 0x04000, 0x200, 1, 0, 0x01400, 0x0100, 1, 0x7800, 0x0800, 16, 4, 36, vtab_avr64dd32}, // atdf, avrdude + {"AVR16EA28", 332, F_AVR8X, {0x1E, 0x94, 0x37}, 0, 0x04000, 0x040, 1, 0, 0x01400, 0x0200, 8, -1, -1, -1, -1, 0, NULL}, // avrdude + {"AVR16DD32", 333, F_AVR8X, {0x1E, 0x94, 0x31}, 0, 0x04000, 0x200, 1, 0, 0x01400, 0x0100, 1, 0x7800, 0x0800, 16, 4, 36, vtab_avr64dd32}, // atdf, avrdude + {"AVR16EA32", 334, F_AVR8X, {0x1E, 0x94, 0x36}, 0, 0x04000, 0x040, 1, 0, 0x01400, 0x0200, 8, -1, -1, -1, -1, 0, NULL}, // avrdude + {"AVR16EA48", 335, F_AVR8X, {0x1E, 0x94, 0x35}, 0, 0x04000, 0x040, 1, 0, 0x01400, 0x0200, 8, -1, -1, -1, -1, 0, NULL}, // avrdude + {"AVR32DD14", 336, F_AVR8X, {0x1E, 0x95, 0x3B}, 0, 0x08000, 0x200, 1, 0, 0x01400, 0x0100, 1, 0x7000, 0x1000, 16, 4, 36, vtab_avr64dd32}, // atdf, avrdude + {"AVR32DD20", 337, F_AVR8X, {0x1E, 0x95, 0x3A}, 0, 0x08000, 0x200, 1, 0, 0x01400, 0x0100, 1, 0x7000, 0x1000, 16, 4, 36, vtab_avr64dd32}, // atdf, avrdude + {"AVR32DA28", 338, F_AVR8X, {0x1E, 0x95, 0x34}, 0, 0x08000, 0x200, 1, 0, 0x01400, 0x0200, 1, 0x7000, 0x1000, 16, 4, 41, vtab_avr128da28}, // atdf, avrdude + {"AVR32DB28", 339, F_AVR8X, {0x1E, 0x95, 0x37}, 0, 0x08000, 0x200, 1, 0, 0x01400, 0x0200, 1, 0x7000, 0x1000, 16, 4, 42, vtab_avr128db28}, // atdf, avrdude + {"AVR32DD28", 340, F_AVR8X, {0x1E, 0x95, 0x39}, 0, 0x08000, 0x200, 1, 0, 0x01400, 0x0100, 1, 0x7000, 0x1000, 16, 4, 36, vtab_avr64dd32}, // atdf, avrdude + {"AVR32EA28", 341, F_AVR8X, {0x1E, 0x95, 0x3E}, 0, 0x08000, 0x040, 1, 0, 0x01400, 0x0200, 8, -1, -1, -1, -1, 0, NULL}, // avrdude + {"AVR32DA32", 342, F_AVR8X, {0x1E, 0x95, 0x33}, 0, 0x08000, 0x200, 1, 0, 0x01400, 0x0200, 1, 0x7000, 0x1000, 16, 4, 44, vtab_avr128da32}, // atdf, avrdude + {"AVR32DB32", 343, F_AVR8X, {0x1E, 0x95, 0x36}, 0, 0x08000, 0x200, 1, 0, 0x01400, 0x0200, 1, 0x7000, 0x1000, 16, 4, 44, vtab_avr128db32}, // atdf, avrdude + {"AVR32DD32", 344, F_AVR8X, {0x1E, 0x95, 0x38}, 0, 0x08000, 0x200, 1, 0, 0x01400, 0x0100, 1, 0x7000, 0x1000, 16, 4, 36, vtab_avr64dd32}, // atdf, avrdude + {"AVR32EA32", 345, F_AVR8X, {0x1E, 0x95, 0x3D}, 0, 0x08000, 0x040, 1, 0, 0x01400, 0x0200, 8, -1, -1, -1, -1, 0, NULL}, // avrdude + {"AVR32DA48", 346, F_AVR8X, {0x1E, 0x95, 0x32}, 0, 0x08000, 0x200, 1, 0, 0x01400, 0x0200, 1, 0x7000, 0x1000, 16, 4, 58, vtab_avr128da48}, // atdf, avrdude + {"AVR32DB48", 347, F_AVR8X, {0x1E, 0x95, 0x35}, 0, 0x08000, 0x200, 1, 0, 0x01400, 0x0200, 1, 0x7000, 0x1000, 16, 4, 61, vtab_avr128db48}, // atdf, avrdude + {"AVR32EA48", 348, F_AVR8X, {0x1E, 0x95, 0x3C}, 0, 0x08000, 0x040, 1, 0, 0x01400, 0x0200, 8, -1, -1, -1, -1, 0, NULL}, // avrdude + {"AVR64DD14", 349, F_AVR8X, {0x1E, 0x96, 0x1D}, 0, 0x10000, 0x200, 1, 0, 0x01400, 0x0100, 1, 0x6000, 0x2000, 16, 4, 36, vtab_avr64dd32}, // atdf, avrdude + {"AVR64DD20", 350, F_AVR8X, {0x1E, 0x96, 0x1C}, 0, 0x10000, 0x200, 1, 0, 0x01400, 0x0100, 1, 0x6000, 0x2000, 16, 4, 36, vtab_avr64dd32}, // atdf, avrdude + {"AVR64DA28", 351, F_AVR8X, {0x1E, 0x96, 0x15}, 0, 0x10000, 0x200, 1, 0, 0x01400, 0x0200, 1, 0x6000, 0x2000, 16, 4, 41, vtab_avr128da28}, // atdf, avrdude + {"AVR64DB28", 352, F_AVR8X, {0x1E, 0x96, 0x19}, 0, 0x10000, 0x200, 1, 0, 0x01400, 0x0200, 1, 0x6000, 0x2000, 16, 4, 42, vtab_avr128db28}, // atdf, avrdude + {"AVR64DD28", 353, F_AVR8X, {0x1E, 0x96, 0x1B}, 0, 0x10000, 0x200, 1, 0, 0x01400, 0x0100, 1, 0x6000, 0x2000, 16, 4, 36, vtab_avr64dd32}, // atdf, avrdude + {"AVR64EA28", 354, F_AVR8X, {0x1E, 0x96, 0x20}, 0, 0x10000, 0x080, 1, 0, 0x01400, 0x0200, 8, 0x6800, 0x1800, 16, 4, 37, vtab_avr64ea32}, // atdf, avrdude + {"AVR64DA32", 355, F_AVR8X, {0x1E, 0x96, 0x14}, 0, 0x10000, 0x200, 1, 0, 0x01400, 0x0200, 1, 0x6000, 0x2000, 16, 4, 44, vtab_avr128da32}, // atdf, avrdude + {"AVR64DB32", 356, F_AVR8X, {0x1E, 0x96, 0x18}, 0, 0x10000, 0x200, 1, 0, 0x01400, 0x0200, 1, 0x6000, 0x2000, 16, 4, 44, vtab_avr128db32}, // atdf, avrdude + {"AVR64DD32", 357, F_AVR8X, {0x1E, 0x96, 0x1A}, 0, 0x10000, 0x200, 1, 0, 0x01400, 0x0100, 1, 0x6000, 0x2000, 16, 4, 36, vtab_avr64dd32}, // atdf, avrdude + {"AVR64EA32", 358, F_AVR8X, {0x1E, 0x96, 0x1F}, 0, 0x10000, 0x080, 1, 0, 0x01400, 0x0200, 8, 0x6800, 0x1800, 16, 4, 37, vtab_avr64ea32}, // atdf, avrdude + {"AVR64DA48", 359, F_AVR8X, {0x1E, 0x96, 0x13}, 0, 0x10000, 0x200, 1, 0, 0x01400, 0x0200, 1, 0x6000, 0x2000, 16, 4, 58, vtab_avr128da48}, // atdf, avrdude + {"AVR64DB48", 360, F_AVR8X, {0x1E, 0x96, 0x17}, 0, 0x10000, 0x200, 1, 0, 0x01400, 0x0200, 1, 0x6000, 0x2000, 16, 4, 61, vtab_avr128db48}, // atdf, avrdude + {"AVR64EA48", 361, F_AVR8X, {0x1E, 0x96, 0x1E}, 0, 0x10000, 0x080, 1, 0, 0x01400, 0x0200, 8, 0x6800, 0x1800, 16, 4, 45, vtab_avr64ea48}, // atdf, avrdude + {"AVR64DA64", 362, F_AVR8X, {0x1E, 0x96, 0x12}, 0, 0x10000, 0x200, 1, 0, 0x01400, 0x0200, 1, 0x6000, 0x2000, 16, 4, 64, vtab_avr128da64}, // atdf, avrdude + {"AVR64DB64", 363, F_AVR8X, {0x1E, 0x96, 0x16}, 0, 0x10000, 0x200, 1, 0, 0x01400, 0x0200, 1, 0x6000, 0x2000, 16, 4, 65, vtab_avr128db64}, // atdf, avrdude + {"AVR128DA28", 364, F_AVR8X, {0x1E, 0x97, 0x0A}, 0, 0x20000, 0x200, 1, 0, 0x01400, 0x0200, 1, 0x4000, 0x4000, 16, 4, 41, vtab_avr128da28}, // atdf, avrdude + {"AVR128DB28", 365, F_AVR8X, {0x1E, 0x97, 0x0E}, 0, 0x20000, 0x200, 1, 0, 0x01400, 0x0200, 1, 0x4000, 0x4000, 16, 4, 42, vtab_avr128db28}, // atdf, avrdude + {"AVR128DA32", 366, F_AVR8X, {0x1E, 0x97, 0x09}, 0, 0x20000, 0x200, 1, 0, 0x01400, 0x0200, 1, 0x4000, 0x4000, 16, 4, 44, vtab_avr128da32}, // atdf, avrdude + {"AVR128DB32", 367, F_AVR8X, {0x1E, 0x97, 0x0D}, 0, 0x20000, 0x200, 1, 0, 0x01400, 0x0200, 1, 0x4000, 0x4000, 16, 4, 44, vtab_avr128db32}, // atdf, avrdude + {"AVR128DA48", 368, F_AVR8X, {0x1E, 0x97, 0x08}, 0, 0x20000, 0x200, 1, 0, 0x01400, 0x0200, 1, 0x4000, 0x4000, 16, 4, 58, vtab_avr128da48}, // atdf, avrdude + {"AVR128DB48", 369, F_AVR8X, {0x1E, 0x97, 0x0C}, 0, 0x20000, 0x200, 1, 0, 0x01400, 0x0200, 1, 0x4000, 0x4000, 16, 4, 61, vtab_avr128db48}, // atdf, avrdude + {"AVR128DA64", 370, F_AVR8X, {0x1E, 0x97, 0x07}, 0, 0x20000, 0x200, 1, 0, 0x01400, 0x0200, 1, 0x4000, 0x4000, 16, 4, 64, vtab_avr128da64}, // atdf, avrdude + {"AVR128DB64", 371, F_AVR8X, {0x1E, 0x97, 0x0B}, 0, 0x20000, 0x200, 1, 0, 0x01400, 0x0200, 1, 0x4000, 0x4000, 16, 4, 65, vtab_avr128db64}, // atdf, avrdude +}; + +const char * const vtab_attiny9[vts_attiny9] = { // ATtiny9, ATtiny4 + "RESET", // 0: Reset (various reasons) + "INT0", // 1: External Interrupt 0 + "PCINT0", // 2: Pin Change Interrupt 0 + "TIM0_CAPT", // 3: Timer 0 Capture Event + "TIM0_OVF", // 4: Timer 0 Overflow + "TIM0_COMPA", // 5: Timer 0 Compare Match A + "TIM0_COMPB", // 6: Timer 0 Compare Match B + "ANA_COMP", // 7: Analog Comparator + "WDT", // 8: Watchdog Time-out + "VLM", // 9: Vcc Voltage Level Monitor +}; + +const char * const vtab_attiny10[vts_attiny10] = { // ATtiny10, ATtiny5 + "RESET", // 0: Reset (various reasons) + "INT0", // 1: External Interrupt 0 + "PCINT0", // 2: Pin Change Interrupt 0 + "TIM0_CAPT", // 3: Timer 0 Capture Event + "TIM0_OVF", // 4: Timer 0 Overflow + "TIM0_COMPA", // 5: Timer 0 Compare Match A + "TIM0_COMPB", // 6: Timer 0 Compare Match B + "ANA_COMP", // 7: Analog Comparator + "WDT", // 8: Watchdog Time-out + "VLM", // 9: Vcc Voltage Level Monitor + "ADC", // 10: ADC Conversion Complete +}; + +const char * const vtab_attiny20[vts_attiny20] = { // ATtiny20 + "RESET", // 0: Reset (various reasons) + "INT0", // 1: External Interrupt 0 + "PCINT0", // 2: Pin Change Interrupt 0 + "PCINT1", // 3: Pin Change Interrupt 1 + "WDT", // 4: Watchdog Time-out + "TIM1_CAPT", // 5: Timer 1 Capture Event + "TIM1_COMPA", // 6: Timer 1 Compare Match A + "TIM1_COMPB", // 7: Timer 1 Compare Match B + "TIM1_OVF", // 8: Timer 1 Overflow + "TIM0_COMPA", // 9: Timer 0 Compare Match A + "TIM0_COMPB", // 10: Timer 0 Compare Match B + "TIM0_OVF", // 11: Timer 0 Overflow + "ANA_COMP", // 12: Analog Comparator + "ADC_ADC", // 13: Conversion Complete + "TWI_PERIPHERAL", // 14: 2-Wire Interface Peripheral + "SPI", // 15: SPI Serial Peripheral Interface + "QTRIP", // 16: Touch Sensing +}; + +const char * const vtab_attiny40[vts_attiny40] = { // ATtiny40 + "RESET", // 0: Reset (various reasons) + "INT0", // 1: External Interrupt 0 + "PCINT0", // 2: Pin Change Interrupt 0 + "PCINT1", // 3: Pin Change Interrupt 1 + "PCINT2", // 4: Pin Change Interrupt 2 + "WDT", // 5: Watchdog Time-out + "TIM1_CAPT", // 6: Timer 1 Capture Event + "TIM1_COMPA", // 7: Timer 1 Compare Match A + "TIM1_COMPB", // 8: Timer 1 Compare Match B + "TIM1_OVF", // 9: Timer 1 Overflow + "TIM0_COMPA", // 10: Timer 0 Compare Match A + "TIM0_COMPB", // 11: Timer 0 Compare Match B + "TIM0_OVF", // 12: Timer 0 Overflow + "ANA_COMP", // 13: Analog Comparator + "ADC", // 14: ADC Conversion Complete + "TWI_PERIPHERAL", // 15: 2-Wire Interface Peripheral + "SPI", // 16: SPI Serial Peripheral Interface + "QTRIP", // 17: Touch Sensing +}; + +const char * const vtab_attiny104[vts_attiny104] = { // ATtiny104, ATtiny102 + "RESET", // 0: Reset (various reasons) + "INT0", // 1: External Interrupt 0 + "PCINT0", // 2: Pin Change Interrupt 0 + "PCINT1", // 3: Pin Change Interrupt 1 + "TIM0_CAPT", // 4: Timer 0 Capture Event + "TIM0_OVF", // 5: Timer 0 Overflow + "TIM0_COMPA", // 6: Timer 0 Compare Match A + "TIM0_COMPB", // 7: Timer 0 Compare Match B + "ANA_COMP", // 8: Analog Comparator + "WDT", // 9: Watchdog Time-out + "VLM", // 10: Vcc Voltage Level Monitor + "ADC", // 11: ADC Conversion Complete + "USART_RXS", // 12: USART Receive Start + "USART_RXC", // 13: USART Receive Complete + "USART_DRE", // 14: USART Data Register Empty + "USART_TXC", // 15: USART Transmit Complete +}; + +const char * const vtab_attiny11[vts_attiny11] = { // ATtiny11 + "RESET", // 0: Reset (various reasons) + "INT0", // 1: External Interrupt 0 + "IO_PINS", // 2: External Interrupt + "TIMER0_OVF", // 3: Timer 0 Overflow + "ANA_COMP", // 4: Analog Comparator +}; + +const char * const vtab_attiny12[vts_attiny12] = { // ATtiny12 + "RESET", // 0: Reset (various reasons) + "INT0", // 1: External Interrupt 0 + "IO_PINS", // 2: External Interrupt + "TIMER0_OVF", // 3: Timer 0 Overflow + "EE_RDY", // 4: EEPROM Ready + "ANA_COMP", // 5: Analog Comparator +}; + +const char * const vtab_attiny13a[vts_attiny13a] = { // ATtiny13A, ATtiny13 + "RESET", // 0: Reset (various reasons) + "INT0", // 1: External Interrupt 0 + "PCINT0", // 2: Pin Change Interrupt 0 + "TIM0_OVF", // 3: Timer 0 Overflow + "EE_RDY", // 4: EEPROM Ready + "ANA_COMP", // 5: Analog Comparator + "TIM0_COMPA", // 6: Timer 0 Compare Match A + "TIM0_COMPB", // 7: Timer 0 Compare Match B + "WDT", // 8: Watchdog Time-out + "ADC", // 9: ADC Conversion Complete +}; + +const char * const vtab_attiny15[vts_attiny15] = { // ATtiny15 + "RESET", // 0: Reset (various reasons) + "INT0", // 1: External Interrupt 0 + "IO_PINS", // 2: External Interrupt + "TIMER1_COMP", // 3: Timer 1 Compare + "TIMER1_OVF", // 4: Timer 1 Overflow + "TIMER0_OVF", // 5: Timer 0 Overflow + "EE_RDY", // 6: EEPROM Ready + "ANA_COMP", // 7: Analog Comparator + "ADC", // 8: ADC Conversion Complete +}; + +const char * const vtab_attiny22[vts_attiny22] = { // ATtiny22, AT90S2343, AT90S2323 + "RESET", // 0: Reset (various reasons) + "INT0", // 1: External Interrupt 0 + "TIMER0_OVF0", // 2: Timer 0 Overflow +}; + +const char * const vtab_attiny26[vts_attiny26] = { // ATtiny26 + "RESET", // 0: Reset (various reasons) + "INT0", // 1: External Interrupt 0 + "IO_PINS", // 2: External Interrupt + "TIMER1_CMPA", // 3: Timer 1 Compare Match A + "TIMER1_CMPB", // 4: Timer 1 Compare Match B + "TIMER1_OVF1", // 5: Timer 1 Overflow + "TIMER0_OVF0", // 6: Timer 0 Overflow + "USI_STRT", // 7: USI Start Condition + "USI_OVF", // 8: USI Overflow + "EE_RDY", // 9: EEPROM Ready + "ANA_COMP", // 10: Analog Comparator + "ADC", // 11: ADC Conversion Complete +}; + +const char * const vtab_attiny28[vts_attiny28] = { // ATtiny28 + "RESET", // 0: Reset (various reasons) + "INT0", // 1: External Interrupt 0 + "INT1", // 2: External Interrupt 1 + "LOW_LEVEL_IO_PINS", // 3: Low-level Input + "TIMER0_OVF", // 4: Timer 0 Overflow + "ANA_COMP", // 5: Analog Comparator +}; + +const char * const vtab_attiny43u[vts_attiny43u] = { // ATtiny43U + "RESET", // 0: Reset (various reasons) + "INT0", // 1: External Interrupt 0 + "PCINT0", // 2: Pin Change Interrupt 0 + "PCINT1", // 3: Pin Change Interrupt 1 + "WDT", // 4: Watchdog Time-out + "TIM1_COMPA", // 5: Timer 1 Compare Match A + "TIM1_COMPB", // 6: Timer 1 Compare Match B + "TIM1_OVF", // 7: Timer 1 Overflow + "TIM0_COMPA", // 8: Timer 0 Compare Match A + "TIM0_COMPB", // 9: Timer 0 Compare Match B + "TIM0_OVF", // 10: Timer 0 Overflow + "ANA_COMP", // 11: Analog Comparator + "ADC", // 12: ADC Conversion Complete + "EE_RDY", // 13: EEPROM Ready + "USI_START", // 14: USI Start Condition + "USI_OVF", // 15: USI Overflow +}; + +const char * const vtab_attiny84a[vts_attiny84a] = { // ATtiny84A, ATtiny84, ATtiny44A, ATtiny44, ATtiny24A, ATtiny24 + "RESET", // 0: Reset (various reasons) + "EXT_INT0", // 1: External Interrupt 0 + "PCINT0", // 2: Pin Change Interrupt 0 + "PCINT1", // 3: Pin Change Interrupt 1 + "WDT", // 4: Watchdog Time-out + "TIM1_CAPT", // 5: Timer 1 Capture Event + "TIM1_COMPA", // 6: Timer 1 Compare Match A + "TIM1_COMPB", // 7: Timer 1 Compare Match B + "TIM1_OVF", // 8: Timer 1 Overflow + "TIM0_COMPA", // 9: Timer 0 Compare Match A + "TIM0_COMPB", // 10: Timer 0 Compare Match B + "TIM0_OVF", // 11: Timer 0 Overflow + "ANA_COMP", // 12: Analog Comparator + "ADC", // 13: ADC Conversion Complete + "EE_RDY", // 14: EEPROM Ready + "USI_STR", // 15: USI Start Condition + "USI_OVF", // 16: USI Overflow +}; + +const char * const vtab_attiny85[vts_attiny85] = { // ATtiny85, ATtiny45, ATtiny25 + "RESET", // 0: Reset (various reasons) + "INT0", // 1: External Interrupt 0 + "PCINT0", // 2: Pin Change Interrupt 0 + "TIMER1_COMPA", // 3: Timer 1 Compare Match A + "TIMER1_OVF", // 4: Timer 1 Overflow + "TIMER0_OVF", // 5: Timer 0 Overflow + "EE_RDY", // 6: EEPROM Ready + "ANA_COMP", // 7: Analog Comparator + "ADC", // 8: ADC Conversion Complete + "TIMER1_COMPB", // 9: Timer 1 Compare Match B + "TIMER0_COMPA", // 10: Timer 0 Compare Match A + "TIMER0_COMPB", // 11: Timer 0 Compare Match B + "WDT", // 12: Watchdog Time-out + "USI_START", // 13: USI Start Condition + "USI_OVF", // 14: USI Overflow +}; + +const char * const vtab_attiny88[vts_attiny88] = { // ATtiny88, ATtiny48 + "RESET", // 0: Reset (various reasons) + "INT0", // 1: External Interrupt 0 + "INT1", // 2: External Interrupt 1 + "PCINT0", // 3: Pin Change Interrupt 0 + "PCINT1", // 4: Pin Change Interrupt 1 + "PCINT2", // 5: Pin Change Interrupt 2 + "PCINT3", // 6: Pin Change Interrupt 3 + "WDT", // 7: Watchdog Time-out + "TIMER1_CAPT", // 8: Timer 1 Capture Event + "TIMER1_COMPA", // 9: Timer 1 Compare Match A + "TIMER1_COMPB", // 10: Timer 1 Compare Match B + "TIMER1_OVF", // 11: Timer 1 Overflow + "TIMER0_COMPA", // 12: Timer 0 Compare Match A + "TIMER0_COMPB", // 13: Timer 0 Compare Match B + "TIMER0_OVF", // 14: Timer 0 Overflow + "SPI_STC", // 15: SPI Serial Transfer Complete + "ADC", // 16: ADC Conversion Complete + "EE_RDY", // 17: EEPROM Ready + "ANALOG_COMP", // 18: Analog Comparator + "TWI", // 19: 2-Wire Interface +}; + +const char * const vtab_attiny167[vts_attiny167] = { // ATtiny167, ATtiny87, ATA664251, ATA6617C, ATA6616C, ATA5505 + "RESET", // 0: Reset (various reasons) + "INT0", // 1: External Interrupt 0 + "INT1", // 2: External Interrupt 1 + "PCINT0", // 3: Pin Change Interrupt 0 + "PCINT1", // 4: Pin Change Interrupt 1 + "WDT", // 5: Watchdog Time-out + "TIMER1_CAPT", // 6: Timer 1 Capture Event + "TIMER1_COMPA", // 7: Timer 1 Compare Match A + "TIMER1_COMPB", // 8: Timer 1 Compare Match B + "TIMER1_OVF", // 9: Timer 1 Overflow + "TIMER0_COMPA", // 10: Timer 0 Compare Match A + "TIMER0_OVF", // 11: Timer 0 Overflow + "LIN_TC", // 12: LIN Transfer Complete + "LIN_ERR", // 13: LIN Error + "SPI_STC", // 14: SPI Serial Transfer Complete + "ADC", // 15: ADC Conversion Complete + "EE_RDY", // 16: EEPROM Ready + "ANA_COMP", // 17: Analog Comparator + "USI_START", // 18: USI Start Condition + "USI_OVF", // 19: USI Overflow +}; + +const char * const vtab_attiny828[vts_attiny828] = { // ATtiny828 + "RESET", // 0: Reset (various reasons) + "INT0", // 1: External Interrupt 0 + "INT1", // 2: External Interrupt 1 + "PCINT0", // 3: Pin Change Interrupt 0 + "PCINT1", // 4: Pin Change Interrupt 1 + "PCINT2", // 5: Pin Change Interrupt 2 + "PCINT3", // 6: Pin Change Interrupt 3 + "WDT", // 7: Watchdog Time-out + "TIMER1_CAPT", // 8: Timer 1 Capture Event + "TIMER1_COMPA", // 9: Timer 1 Compare Match A + "TIMER1_COMPB", // 10: Timer 1 Compare Match B + "TIMER1_OVF", // 11: Timer 1 Overflow + "TIMER0_COMPA", // 12: Timer 0 Compare Match A + "TIMER0_COMPB", // 13: Timer 0 Compare Match B + "TIMER0_OVF", // 14: Timer 0 Overflow + "SPI_STC", // 15: SPI Serial Transfer Complete + "USART_START", // 16: USART Start + "USART_RX", // 17: USART Receive Complete + "USART_UDRE", // 18: USART Data Register Empty + "USART_TX", // 19: USART Transmit Complete + "ADC", // 20: ADC Conversion Complete + "EE_READY", // 21: EEPROM Ready + "ANALOG_COMP", // 22: Analog Comparator + "TWI_PERIPHERAL", // 23: 2-Wire Interface Peripheral + "SPM_Ready", // 24: Store Program Memory Ready + "QTRIP", // 25: Touch Sensing +}; + +const char * const vtab_attiny841[vts_attiny841] = { // ATtiny841, ATtiny441 + "RESET", // 0: Reset (various reasons) + "INT0", // 1: External Interrupt 0 + "PCINT0", // 2: Pin Change Interrupt 0 + "PCINT1", // 3: Pin Change Interrupt 1 + "WDT", // 4: Watchdog Time-out + "TIMER1_CAPT", // 5: Timer 1 Capture Event + "TIMER1_COMPA", // 6: Timer 1 Compare Match A + "TIMER1_COMPB", // 7: Timer 1 Compare Match B + "TIMER1_OVF", // 8: Timer 1 Overflow + "TIMER0_COMPA", // 9: Timer 0 Compare Match A + "TIMER0_COMPB", // 10: Timer 0 Compare Match B + "TIMER0_OVF", // 11: Timer 0 Overflow + "ANA_COMP0", // 12: Analog Comparator 0 + "ADC", // 13: ADC Conversion Complete + "EE_RDY", // 14: EEPROM Ready + "ANA_COMP1", // 15: Analog Comparator 1 + "TIMER2_CAPT", // 16: Timer 2 Capture Event + "TIMER2_COMPA", // 17: Timer 2 Compare Match A + "TIMER2_COMPB", // 18: Timer 2 Compare Match B + "TIMER2_OVF", // 19: Timer 2 Overflow + "SPI", // 20: SPI Serial Peripheral Interface + "USART0_START", // 21: USART 0 Receive Start + "USART0_RX", // 22: USART 0 Receive Complete + "USART0_UDRE", // 23: USART 0 Data Register Empty + "USART0_TX", // 24: USART 0 Transmit Complete + "USART1_START", // 25: USART 1 Receive Start + "USART1_RX", // 26: USART 1 Receive Complete + "USART1_UDRE", // 27: USART 1 Data Register Empty + "USART1_TX", // 28: USART 1 Transmit Complete + "TWI_PERIPHERAL", // 29: 2-Wire Interface Peripheral +}; + +const char * const vtab_attiny861a[vts_attiny861a] = { // ATtiny861A, ATtiny861, ATtiny461A, ATtiny461, ATtiny261A, ATtiny261 + "RESET", // 0: Reset (various reasons) + "INT0", // 1: External Interrupt 0 + "PCINT", // 2: Pin Change Interrupt + "TIMER1_COMPA", // 3: Timer 1 Compare Match A + "TIMER1_COMPB", // 4: Timer 1 Compare Match B + "TIMER1_OVF", // 5: Timer 1 Overflow + "TIMER0_OVF", // 6: Timer 0 Overflow + "USI_START", // 7: USI Start Condition + "USI_OVF", // 8: USI Overflow + "EE_RDY", // 9: EEPROM Ready + "ANA_COMP", // 10: Analog Comparator + "ADC", // 11: ADC Conversion Complete + "WDT", // 12: Watchdog Time-out + "INT1", // 13: External Interrupt 1 + "TIMER0_COMPA", // 14: Timer 0 Compare Match A + "TIMER0_COMPB", // 15: Timer 0 Compare Match B + "TIMER0_CAPT", // 16: Timer 0 Capture Event + "TIMER1_COMPD", // 17: Timer 1 Compare Match D + "FAULT_PROTECTION", // 18: Timer 1 Fault Protection +}; + +const char * const vtab_attiny1634[vts_attiny1634] = { // ATtiny1634 + "RESET", // 0: Reset (various reasons) + "INT0", // 1: External Interrupt 0 + "PCINT0", // 2: Pin Change Interrupt 0 + "PCINT1", // 3: Pin Change Interrupt 1 + "PCINT2", // 4: Pin Change Interrupt 2 + "WDT", // 5: Watchdog Time-out + "TIMER1_CAPT", // 6: Timer 1 Capture Event + "TIMER1_COMPA", // 7: Timer 1 Compare Match A + "TIMER1_COMPB", // 8: Timer 1 Compare Match B + "TIMER1_OVF", // 9: Timer 1 Overflow + "TIMER0_COMPA", // 10: Timer 0 Compare Match A + "TIMER0_COMPB", // 11: Timer 0 Compare Match B + "TIMER0_OVF", // 12: Timer 0 Overflow + "ANA_COMP", // 13: Analog Comparator + "ADC_READY", // 14: ADC Conversion Complete + "USART0_START", // 15: USART 0 Receive Start + "USART0_RXC", // 16: USART 0 Receive Complete + "USART0_UDRE", // 17: USART 0 Data Register Empty + "USART0_TXC", // 18: USART 0 Transmit Complete + "USART1_START", // 19: USART 1 Receive Start + "USART1_RXC", // 20: USART 1 Receive Complete + "USART1_UDRE", // 21: USART 1 Data Register Empty + "USART1_TXC", // 22: USART 1 Transmit Complete + "USI_START", // 23: USI Start Condition + "USI_OVERFLOW", // 24: USI Overflow + "TWI/TWI_PERIPHERAL", // 25: 2-Wire Interface/2-Wire Interface Peripheral + "EE_RDY", // 26: EEPROM Ready + "QTRIP", // 27: Touch Sensing +}; + +const char * const vtab_attiny2313[vts_attiny2313] = { // ATtiny2313 + "RESET", // 0: Reset (various reasons) + "INT0", // 1: External Interrupt 0 + "INT1", // 2: External Interrupt 1 + "TIMER1_CAPT", // 3: Timer 1 Capture Event + "TIMER1_COMPA", // 4: Timer 1 Compare Match A + "TIMER1_OVF", // 5: Timer 1 Overflow + "TIMER0_OVF", // 6: Timer 0 Overflow + "USART_RX", // 7: USART Receive Complete + "USART_UDRE", // 8: USART Data Register Empty + "USART_TX", // 9: USART Transmit Complete + "ANA_COMP", // 10: Analog Comparator + "PCINT", // 11: Pin Change Interrupt + "TIMER1_COMPB", // 12: Timer 1 Compare Match B + "TIMER0_COMPA", // 13: Timer 0 Compare Match A + "TIMER0_COMPB", // 14: Timer 0 Compare Match B + "USI_START", // 15: USI Start Condition + "USI_OVERFLOW", // 16: USI Overflow + "EEPROM_Ready", // 17: EEPROM Ready + "WDT_OVERFLOW", // 18: Watchdog Timer Overflow +}; + +const char * const vtab_attiny4313[vts_attiny4313] = { // ATtiny4313, ATtiny2313A + "RESET", // 0: Reset (various reasons) + "INT0", // 1: External Interrupt 0 + "INT1", // 2: External Interrupt 1 + "TIMER1_CAPT", // 3: Timer 1 Capture Event + "TIMER1_COMPA", // 4: Timer 1 Compare Match A + "TIMER1_OVF", // 5: Timer 1 Overflow + "TIMER0_OVF", // 6: Timer 0 Overflow + "USART_RX", // 7: USART Receive Complete + "USART_UDRE", // 8: USART Data Register Empty + "USART_TX", // 9: USART Transmit Complete + "ANA_COMP", // 10: Analog Comparator + "PCINT_B", // 11: Pin Change Interrupt B + "TIMER1_COMPB", // 12: Timer 1 Compare Match B + "TIMER0_COMPA", // 13: Timer 0 Compare Match A + "TIMER0_COMPB", // 14: Timer 0 Compare Match B + "USI_START", // 15: USI Start Condition + "USI_OVERFLOW", // 16: USI Overflow + "EEPROM_Ready", // 17: EEPROM Ready + "WDT_OVERFLOW", // 18: Watchdog Timer Overflow + "PCINT_A", // 19: Pin Change Interrupt A + "PCINT_D", // 20: Pin Change Interrupt D +}; + +const char * const vtab_atmega8a[vts_atmega8a] = { // ATmega8A, ATmega8 + "RESET", // 0: Reset (various reasons) + "INT0", // 1: External Interrupt 0 + "INT1", // 2: External Interrupt 1 + "TIMER2_COMP", // 3: Timer 2 Compare Match + "TIMER2_OVF", // 4: Timer 2 Overflow + "TIMER1_CAPT", // 5: Timer 1 Capture Event + "TIMER1_COMPA", // 6: Timer 1 Compare Match A + "TIMER1_COMPB", // 7: Timer 1 Compare Match B + "TIMER1_OVF", // 8: Timer 1 Overflow + "TIMER0_OVF", // 9: Timer 0 Overflow + "SPI_STC", // 10: SPI Serial Transfer Complete + "USART_RXC", // 11: USART Receive Complete + "USART_UDRE", // 12: USART Data Register Empty + "USART_TXC", // 13: USART Transmit Complete + "ADC", // 14: ADC Conversion Complete + "EE_RDY", // 15: EEPROM Ready + "ANA_COMP", // 16: Analog Comparator + "TWI", // 17: 2-Wire Interface + "SPM_RDY", // 18: Store Program Memory Ready +}; + +const char * const vtab_atmega16a[vts_atmega16a] = { // ATmega16A, ATmega16 + "RESET", // 0: Reset (various reasons) + "INT0", // 1: External Interrupt 0 + "INT1", // 2: External Interrupt 1 + "TIMER2_COMP", // 3: Timer 2 Compare Match + "TIMER2_OVF", // 4: Timer 2 Overflow + "TIMER1_CAPT", // 5: Timer 1 Capture Event + "TIMER1_COMPA", // 6: Timer 1 Compare Match A + "TIMER1_COMPB", // 7: Timer 1 Compare Match B + "TIMER1_OVF", // 8: Timer 1 Overflow + "TIMER0_OVF", // 9: Timer 0 Overflow + "SPI_STC", // 10: SPI Serial Transfer Complete + "USART_RXC", // 11: USART Receive Complete + "USART_UDRE", // 12: USART Data Register Empty + "USART_TXC", // 13: USART Transmit Complete + "ADC", // 14: ADC Conversion Complete + "EE_RDY", // 15: EEPROM Ready + "ANA_COMP", // 16: Analog Comparator + "TWI", // 17: 2-Wire Interface + "INT2", // 18: External Interrupt 2 + "TIMER0_COMP", // 19: Timer 0 Compare Match + "SPM_RDY", // 20: Store Program Memory Ready +}; + +const char * const vtab_atmega16hva[vts_atmega16hva] = { // ATmega16HVA, ATmega8HVA + "RESET", // 0: Reset (various reasons) + "BPINT", // 1: Battery Protection Interrupt + "VREGMON", // 2: Voltage Regulator Monitor + "INT0", // 3: External Interrupt 0 + "INT1", // 4: External Interrupt 1 + "INT2", // 5: External Interrupt 2 + "WDT", // 6: Watchdog Time-out + "TIMER1_IC", // 7: Timer 1 Input Capture + "TIMER1_COMPA", // 8: Timer 1 Compare Match A + "TIMER1_COMPB", // 9: Timer 1 Compare Match B + "TIMER1_OVF", // 10: Timer 1 Overflow + "TIMER0_IC", // 11: Timer 0 Capture Event + "TIMER0_COMPA", // 12: Timer 0 Compare Match A + "TIMER0_COMPB", // 13: Timer 0 Compare Match B + "TIMER0_OVF", // 14: Timer 0 Overflow + "SPI_STC", // 15: SPI Serial Transfer Complete + "VADC", // 16: Voltage ADC Conversion Complete + "CCADC_CONV", // 17: Coulomb Counter ADC Conversion Complete + "CCADC_REG_CUR", // 18: Coloumb Counter ADC Regular Current + "CCADC_ACC", // 19: Coloumb Counter ADC Accumulator + "EE_READY", // 20: EEPROM Ready +}; + +const char * const vtab_atmega16hva2[vts_atmega16hva2] = { // ATmega16HVA2 + "RESET", // 0: Reset (various reasons) + "BPINT", // 1: Battery Protection Interrupt + "VREGMON", // 2: Voltage Regulator Monitor + "INT0", // 3: External Interrupt 0 + "INT1", // 4: External Interrupt 1 + "INT2", // 5: External Interrupt 2 + "PCINT0", // 6: Pin Change Interrupt 0 + "WDT", // 7: Watchdog Time-out + "TIMER1_IC", // 8: Timer 1 Input Capture + "TIMER1_COMPA", // 9: Timer 1 Compare Match A + "TIMER1_COMPB", // 10: Timer 1 Compare Match B + "TIMER1_OVF", // 11: Timer 1 Overflow + "TIMER0_IC", // 12: Timer 0 Capture Event + "TIMER0_COMPA", // 13: Timer 0 Compare Match A + "TIMER0_COMPB", // 14: Timer 0 Compare Match B + "TIMER0_OVF", // 15: Timer 0 Overflow + "SPI_STC", // 16: SPI Serial Transfer Complete + "VADC", // 17: Voltage ADC Conversion Complete + "CCADC_CONV", // 18: Coulomb Counter ADC Conversion Complete + "CCADC_REG_CUR", // 19: Coloumb Counter ADC Regular Current + "CCADC_ACC", // 20: Coloumb Counter ADC Accumulator + "EE_READY", // 21: EEPROM Ready +}; + +const char * const vtab_atmega32hvbrevb[vts_atmega32hvbrevb] = { // ATmega32HVBrevB, ATmega32HVB, ATmega16HVBrevB, ATmega16HVB + "RESET", // 0: Reset (various reasons) + "BPINT", // 1: Battery Protection Interrupt + "VREGMON", // 2: Voltage Regulator Monitor + "INT0", // 3: External Interrupt 0 + "INT1", // 4: External Interrupt 1 + "INT2", // 5: External Interrupt 2 + "INT3", // 6: External Interrupt 3 + "PCINT0", // 7: Pin Change Interrupt 0 + "PCINT1", // 8: Pin Change Interrupt 1 + "WDT", // 9: Watchdog Time-out + "BGSCD", // 10: Bandgap Buffer Short Circuit Detected + "CHDET", // 11: Charger Detect + "TIMER1_IC", // 12: Timer 1 Input Capture + "TIMER1_COMPA", // 13: Timer 1 Compare Match A + "TIMER1_COMPB", // 14: Timer 1 Compare Match B + "TIMER1_OVF", // 15: Timer 1 Overflow + "TIMER0_IC", // 16: Timer 0 Capture Event + "TIMER0_COMPA", // 17: Timer 0 Compare Match A + "TIMER0_COMPB", // 18: Timer 0 Compare Match B + "TIMER0_OVF", // 19: Timer 0 Overflow + "TWIBUSCD", // 20: 2-Wire Interface Bus Connect/Disconnect + "TWI", // 21: 2-Wire Interface + "SPI_STC", // 22: SPI Serial Transfer Complete + "VADC", // 23: Voltage ADC Conversion Complete + "CCADC_CONV", // 24: Coulomb Counter ADC Conversion Complete + "CCADC_REG_CUR", // 25: Coloumb Counter ADC Regular Current + "CCADC_ACC", // 26: Coloumb Counter ADC Accumulator + "EE_READY", // 27: EEPROM Ready + "SPM", // 28: SPM Ready +}; + +const char * const vtab_atmega32u2[vts_atmega32u2] = { // ATmega32U2, ATmega16U2, ATmega8U2, AT90USB162, AT90USB82 + "RESET", // 0: Reset (various reasons) + "INT0", // 1: External Interrupt 0 + "INT1", // 2: External Interrupt 1 + "INT2", // 3: External Interrupt 2 + "INT3", // 4: External Interrupt 3 + "INT4", // 5: External Interrupt 4 + "INT5", // 6: External Interrupt 5 + "INT6", // 7: External Interrupt 6 + "INT7", // 8: External Interrupt 7 + "PCINT0", // 9: Pin Change Interrupt 0 + "PCINT1", // 10: Pin Change Interrupt 1 + "USB_GEN", // 11: USB General + "USB_COM", // 12: USB Endpoint/Pipe Interrupt Communication Request + "WDT", // 13: Watchdog Time-out + "TIMER1_CAPT", // 14: Timer 1 Capture Event + "TIMER1_COMPA", // 15: Timer 1 Compare Match A + "TIMER1_COMPB", // 16: Timer 1 Compare Match B + "TIMER1_COMPC", // 17: Timer 1 Compare Match C + "TIMER1_OVF", // 18: Timer 1 Overflow + "TIMER0_COMPA", // 19: Timer 0 Compare Match A + "TIMER0_COMPB", // 20: Timer 0 Compare Match B + "TIMER0_OVF", // 21: Timer 0 Overflow + "SPI_STC", // 22: SPI Serial Transfer Complete + "USART1_RX", // 23: USART 1 Receive Complete + "USART1_UDRE", // 24: USART 1 Data Register Empty + "USART1_TX", // 25: USART 1 Transmit Complete + "ANALOG_COMP", // 26: Analog Comparator + "EE_READY", // 27: EEPROM Ready + "SPM_READY", // 28: Store Program Memory Ready +}; + +const char * const vtab_atmega32u4[vts_atmega32u4] = { // ATmega32U4, ATmega16U4 + "RESET", // 0: Reset (various reasons) + "INT0", // 1: External Interrupt 0 + "INT1", // 2: External Interrupt 1 + "INT2", // 3: External Interrupt 2 + "INT3", // 4: External Interrupt 3 + "Reserved1", // 5: Reserved 1 + "Reserved2", // 6: Reserved 2 + "INT6", // 7: External Interrupt 6 + "Reserved3", // 8: Reserved 3 + "PCINT0", // 9: Pin Change Interrupt 0 + "USB_GEN", // 10: USB General + "USB_COM", // 11: USB Endpoint/Pipe Interrupt Communication Request + "WDT", // 12: Watchdog Time-out + "Reserved4", // 13: Reserved 4 + "Reserved5", // 14: Reserved 5 + "Reserved6", // 15: Reserved 6 + "TIMER1_CAPT", // 16: Timer 1 Capture Event + "TIMER1_COMPA", // 17: Timer 1 Compare Match A + "TIMER1_COMPB", // 18: Timer 1 Compare Match B + "TIMER1_COMPC", // 19: Timer 1 Compare Match C + "TIMER1_OVF", // 20: Timer 1 Overflow + "TIMER0_COMPA", // 21: Timer 0 Compare Match A + "TIMER0_COMPB", // 22: Timer 0 Compare Match B + "TIMER0_OVF", // 23: Timer 0 Overflow + "SPI_STC", // 24: SPI Serial Transfer Complete + "USART1_RX", // 25: USART 1 Receive Complete + "USART1_UDRE", // 26: USART 1 Data Register Empty + "USART1_TX", // 27: USART 1 Transmit Complete + "ANALOG_COMP", // 28: Analog Comparator + "ADC", // 29: ADC Conversion Complete + "EE_READY", // 30: EEPROM Ready + "TIMER3_CAPT", // 31: Timer 3 Capture Event + "TIMER3_COMPA", // 32: Timer 3 Compare Match A + "TIMER3_COMPB", // 33: Timer 3 Compare Match B + "TIMER3_COMPC", // 34: Timer 3 Compare Match C + "TIMER3_OVF", // 35: Timer 3 Overflow + "TWI", // 36: 2-Wire Interface + "SPM_READY", // 37: Store Program Memory Ready + "TIMER4_COMPA", // 38: Timer 4 Compare Match A + "TIMER4_COMPB", // 39: Timer 4 Compare Match B + "TIMER4_COMPD", // 40: Timer 4 Compare Match D + "TIMER4_OVF", // 41: Timer 4 Overflow + "TIMER4_FPF", // 42: Timer 4 Fault Protection +}; + +const char * const vtab_atmega32u6[vts_atmega32u6] = { // ATmega32U6, AT90USB1287, AT90USB1286, AT90USB647, AT90USB646 + "RESET", // 0: Reset (various reasons) + "INT0", // 1: External Interrupt 0 + "INT1", // 2: External Interrupt 1 + "INT2", // 3: External Interrupt 2 + "INT3", // 4: External Interrupt 3 + "INT4", // 5: External Interrupt 4 + "INT5", // 6: External Interrupt 5 + "INT6", // 7: External Interrupt 6 + "INT7", // 8: External Interrupt 7 + "PCINT0", // 9: Pin Change Interrupt 0 + "USB_GEN", // 10: USB General + "USB_COM", // 11: USB Endpoint/Pipe Interrupt Communication Request + "WDT", // 12: Watchdog Time-out + "TIMER2_COMPA", // 13: Timer 2 Compare Match A + "TIMER2_COMPB", // 14: Timer 2 Compare Match B + "TIMER2_OVF", // 15: Timer 2 Overflow + "TIMER1_CAPT", // 16: Timer 1 Capture Event + "TIMER1_COMPA", // 17: Timer 1 Compare Match A + "TIMER1_COMPB", // 18: Timer 1 Compare Match B + "TIMER1_COMPC", // 19: Timer 1 Compare Match C + "TIMER1_OVF", // 20: Timer 1 Overflow + "TIMER0_COMPA", // 21: Timer 0 Compare Match A + "TIMER0_COMPB", // 22: Timer 0 Compare Match B + "TIMER0_OVF", // 23: Timer 0 Overflow + "SPI_STC", // 24: SPI Serial Transfer Complete + "USART1_RX", // 25: USART 1 Receive Complete + "USART1_UDRE", // 26: USART 1 Data Register Empty + "USART1_TX", // 27: USART 1 Transmit Complete + "ANALOG_COMP", // 28: Analog Comparator + "ADC", // 29: ADC Conversion Complete + "EE_READY", // 30: EEPROM Ready + "TIMER3_CAPT", // 31: Timer 3 Capture Event + "TIMER3_COMPA", // 32: Timer 3 Compare Match A + "TIMER3_COMPB", // 33: Timer 3 Compare Match B + "TIMER3_COMPC", // 34: Timer 3 Compare Match C + "TIMER3_OVF", // 35: Timer 3 Overflow + "TWI", // 36: 2-Wire Interface + "SPM_READY", // 37: Store Program Memory Ready +}; + +const char * const vtab_atmega64m1[vts_atmega64m1] = { // ATmega64M1, ATmega64C1, ATmega32M1, ATmega32C1, ATmega16M1 + "RESET", // 0: Reset (various reasons) + "ANACOMP0", // 1: Analog Comparator 0 + "ANACOMP1", // 2: Analog Comparator 1 + "ANACOMP2", // 3: Analog Comparator 2 + "ANACOMP3", // 4: Analog Comparator 3 + "PSC_FAULT", // 5: PSC Fault + "PSC_EC", // 6: PSC End of Cycle + "INT0", // 7: External Interrupt 0 + "INT1", // 8: External Interrupt 1 + "INT2", // 9: External Interrupt 2 + "INT3", // 10: External Interrupt 3 + "TIMER1_CAPT", // 11: Timer 1 Capture Event + "TIMER1_COMPA", // 12: Timer 1 Compare Match A + "TIMER1_COMPB", // 13: Timer 1 Compare Match B + "TIMER1_OVF", // 14: Timer 1 Overflow + "TIMER0_COMPA", // 15: Timer 0 Compare Match A + "TIMER0_COMPB", // 16: Timer 0 Compare Match B + "TIMER0_OVF", // 17: Timer 0 Overflow + "CAN_INT", // 18: CAN MOB, Burst, General Errors + "CAN_TOVF", // 19: CAN Timer Overflow + "LIN_TC", // 20: LIN Transfer Complete + "LIN_ERR", // 21: LIN Error + "PCINT0", // 22: Pin Change Interrupt 0 + "PCINT1", // 23: Pin Change Interrupt 1 + "PCINT2", // 24: Pin Change Interrupt 2 + "PCINT3", // 25: Pin Change Interrupt 3 + "SPI_STC", // 26: SPI Serial Transfer Complete + "ADC", // 27: ADC Conversion Complete + "WDT", // 28: Watchdog Time-out + "EE_READY", // 29: EEPROM Ready + "SPM_READY", // 30: Store Program Memory Ready +}; + +const char * const vtab_atmega64hve2[vts_atmega64hve2] = { // ATmega64HVE2, ATmega64HVE + "RESET", // 0: Reset (various reasons) + "INT0", // 1: External Interrupt 0 + "PCINT0", // 2: Pin Change Interrupt 0 + "PCINT1", // 3: Pin Change Interrupt 1 + "WDT", // 4: Watchdog Time-out + "WAKEUP", // 5: Wake Up + "TIMER1_IC", // 6: Timer 1 Input Capture + "TIMER1_COMPA", // 7: Timer 1 Compare Match A + "TIMER1_COMPB", // 8: Timer 1 Compare Match B + "TIMER1_OVF", // 9: Timer 1 Overflow + "TIMER0_IC", // 10: Timer 0 Capture Event + "TIMER0_COMPA", // 11: Timer 0 Compare Match A + "TIMER0_COMPB", // 12: Timer 0 Compare Match B + "TIMER0_OVF", // 13: Timer 0 Overflow + "LIN_STATUS", // 14: Local Interconnect Network Status + "LIN_ERROR", // 15: Local Interconnect Network Error + "SPI_STC", // 16: SPI Serial Transfer Complete + "VADC_CONV", // 17: Versatile Analog to Digital Conversion + "VADC_ACC", // 18: Versatile Analog to Digital Compare or Capture + "CADC_CONV", // 19: C-ADC Instantaneous Conversion Complete + "CADC_REG_CUR", // 20: C-ADC Regular Current + "CADC_ACC", // 21: C-ADC Accumulated Conversion Complete + "EE_READY", // 22: EEPROM Ready + "SPM", // 23: SPM Ready + "PLL", // 24: PLL +}; + +const char * const vtab_atmega103[vts_atmega103] = { // ATmega103 + "RESET", // 0: Reset (various reasons) + "INT0", // 1: External Interrupt 0 + "INT1", // 2: External Interrupt 1 + "INT2", // 3: External Interrupt 2 + "INT3", // 4: External Interrupt 3 + "INT4", // 5: External Interrupt 4 + "INT5", // 6: External Interrupt 5 + "INT6", // 7: External Interrupt 6 + "INT7", // 8: External Interrupt 7 + "TIMER2_COMP", // 9: Timer 2 Compare Match + "TIMER2_OVF", // 10: Timer 2 Overflow + "TIMER1_CAPT", // 11: Timer 1 Capture Event + "TIMER1_COMPA", // 12: Timer 1 Compare Match A + "TIMER1_COMPB", // 13: Timer 1 Compare Match B + "TIMER1_OVF", // 14: Timer 1 Overflow + "TIMER0_COMP", // 15: Timer 0 Compare Match + "TIMER0_OVF", // 16: Timer 0 Overflow + "SPI_STC", // 17: SPI Serial Transfer Complete + "UART_RX", // 18: UART Receive Complete + "UART_UDRE", // 19: UART Data Register Empty + "UART_TX", // 20: UART Transmit Complete + "ADC", // 21: ADC Conversion Complete + "EE_READY", // 22: EEPROM Ready + "ANALOG_COMP", // 23: Analog Comparator +}; + +const char * const vtab_atmega128a[vts_atmega128a] = { // ATmega128A, ATmega128, ATmega64A, ATmega64 + "RESET", // 0: Reset (various reasons) + "INT0", // 1: External Interrupt 0 + "INT1", // 2: External Interrupt 1 + "INT2", // 3: External Interrupt 2 + "INT3", // 4: External Interrupt 3 + "INT4", // 5: External Interrupt 4 + "INT5", // 6: External Interrupt 5 + "INT6", // 7: External Interrupt 6 + "INT7", // 8: External Interrupt 7 + "TIMER2_COMP", // 9: Timer 2 Compare Match + "TIMER2_OVF", // 10: Timer 2 Overflow + "TIMER1_CAPT", // 11: Timer 1 Capture Event + "TIMER1_COMPA", // 12: Timer 1 Compare Match A + "TIMER1_COMPB", // 13: Timer 1 Compare Match B + "TIMER1_OVF", // 14: Timer 1 Overflow + "TIMER0_COMP", // 15: Timer 0 Compare Match + "TIMER0_OVF", // 16: Timer 0 Overflow + "SPI_STC", // 17: SPI Serial Transfer Complete + "USART0_RX", // 18: USART 0 Receive Complete + "USART0_UDRE", // 19: USART 0 Data Register Empty + "USART0_TX", // 20: USART 0 Transmit Complete + "ADC", // 21: ADC Conversion Complete + "EE_READY", // 22: EEPROM Ready + "ANALOG_COMP", // 23: Analog Comparator + "TIMER1_COMPC", // 24: Timer 1 Compare Match C + "TIMER3_CAPT", // 25: Timer 3 Capture Event + "TIMER3_COMPA", // 26: Timer 3 Compare Match A + "TIMER3_COMPB", // 27: Timer 3 Compare Match B + "TIMER3_COMPC", // 28: Timer 3 Compare Match C + "TIMER3_OVF", // 29: Timer 3 Overflow + "USART1_RX", // 30: USART 1 Receive Complete + "USART1_UDRE", // 31: USART 1 Data Register Empty + "USART1_TX", // 32: USART 1 Transmit Complete + "TWI", // 33: 2-Wire Interface + "SPM_READY", // 34: Store Program Memory Ready +}; + +const char * const vtab_atmega128rfa1[vts_atmega128rfa1] = { // ATmega128RFA1 + "RESET", // 0: Reset (various reasons) + "INT0", // 1: External Interrupt 0 + "INT1", // 2: External Interrupt 1 + "INT2", // 3: External Interrupt 2 + "INT3", // 4: External Interrupt 3 + "INT4", // 5: External Interrupt 4 + "INT5", // 6: External Interrupt 5 + "INT6", // 7: External Interrupt 6 + "INT7", // 8: External Interrupt 7 + "PCINT0", // 9: Pin Change Interrupt 0 + "PCINT1", // 10: Pin Change Interrupt 1 + "PCINT2", // 11: Pin Change Interrupt 2 + "WDT", // 12: Watchdog Time-out + "TIMER2_COMPA", // 13: Timer 2 Compare Match A + "TIMER2_COMPB", // 14: Timer 2 Compare Match B + "TIMER2_OVF", // 15: Timer 2 Overflow + "TIMER1_CAPT", // 16: Timer 1 Capture Event + "TIMER1_COMPA", // 17: Timer 1 Compare Match A + "TIMER1_COMPB", // 18: Timer 1 Compare Match B + "TIMER1_COMPC", // 19: Timer 1 Compare Match C + "TIMER1_OVF", // 20: Timer 1 Overflow + "TIMER0_COMPA", // 21: Timer 0 Compare Match A + "TIMER0_COMPB", // 22: Timer 0 Compare Match B + "TIMER0_OVF", // 23: Timer 0 Overflow + "SPI_STC", // 24: SPI Serial Transfer Complete + "USART0_RX", // 25: USART 0 Receive Complete + "USART0_UDRE", // 26: USART 0 Data Register Empty + "USART0_TX", // 27: USART 0 Transmit Complete + "ANALOG_COMP", // 28: Analog Comparator + "ADC", // 29: ADC Conversion Complete + "EE_READY", // 30: EEPROM Ready + "TIMER3_CAPT", // 31: Timer 3 Capture Event + "TIMER3_COMPA", // 32: Timer 3 Compare Match A + "TIMER3_COMPB", // 33: Timer 3 Compare Match B + "TIMER3_COMPC", // 34: Timer 3 Compare Match C + "TIMER3_OVF", // 35: Timer 3 Overflow + "USART1_RX", // 36: USART 1 Receive Complete + "USART1_UDRE", // 37: USART 1 Data Register Empty + "USART1_TX", // 38: USART 1 Transmit Complete + "TWI", // 39: 2-Wire Interface + "SPM_READY", // 40: Store Program Memory Ready + "TIMER4_CAPT", // 41: Timer 4 Capture Event + "TIMER4_COMPA", // 42: Timer 4 Compare Match A + "TIMER4_COMPB", // 43: Timer 4 Compare Match B + "TIMER4_COMPC", // 44: Timer 4 Compare Match C + "TIMER4_OVF", // 45: Timer 4 Overflow + "TIMER5_CAPT", // 46: Timer 5 Capture Event + "TIMER5_COMPA", // 47: Timer 5 Compare Match A + "TIMER5_COMPB", // 48: Timer 5 Compare Match B + "TIMER5_COMPC", // 49: Timer 5 Compare Match C + "TIMER5_OVF", // 50: Timer 5 Overflow + "USART2_RX", // 51: USART 2 Receive Complete + "USART2_UDRE", // 52: USART 2 Data Register Empty + "USART2_TX", // 53: USART 2 Transmit Complete + "USART3_RX", // 54: USART 3 Receive Complete + "USART3_UDRE", // 55: USART 3 Data Register Empty + "USART3_TX", // 56: USART 3 Transmit Complete + "TRX24_PLL_LOCK", // 57: TRX24 PLL Lock + "TRX24_PLL_UNLOCK", // 58: TRX24 PLL Unlock + "TRX24_RX_START", // 59: TRX24 Receive Start + "TRX24_RX_END", // 60: TRX24 Receive End + "TRX24_CCA_ED_DONE", // 61: TRX24 CCA/ED Done + "TRX24_XAH_AMI", // 62: TRX24 XAH/AMI + "TRX24_TX_END", // 63: TRX24 Transmit End + "TRX24_AWAKE", // 64: TRX24 AWAKE - Transceiver is Reaching State TRX_OFF + "SCNT_CMP1", // 65: Symbol Counter - Compare Match 1 Interrupt + "SCNT_CMP2", // 66: Symbol Counter - Compare Match 2 Interrupt + "SCNT_CMP3", // 67: Symbol Counter - Compare Match 3 Interrupt + "SCNT_OVFL", // 68: Symbol Counter - Overflow Interrupt + "SCNT_BACKOFF", // 69: Symbol Counter - Backoff Interrupt + "AES_READY", // 70: AES Engine Ready + "BAT_LOW", // 71: Battery Voltage Below Threshold +}; + +const char * const vtab_atmega161[vts_atmega161] = { // ATmega161 + "RESET", // 0: Reset (various reasons) + "INT0", // 1: External Interrupt 0 + "INT1", // 2: External Interrupt 1 + "INT2", // 3: External Interrupt 2 + "TIMER2_COMP", // 4: Timer 2 Compare Match + "TIMER2_OVF", // 5: Timer 2 Overflow + "TIMER1_CAPT", // 6: Timer 1 Capture Event + "TIMER1_COMPA", // 7: Timer 1 Compare Match A + "TIMER1_COMPB", // 8: Timer 1 Compare Match B + "TIMER1_OVF", // 9: Timer 1 Overflow + "TIMER0_COMP", // 10: Timer 0 Compare Match + "TIMER0_OVF", // 11: Timer 0 Overflow + "SPI_STC", // 12: SPI Serial Transfer Complete + "UART0_RX", // 13: UART 0 Receive Complete + "UART1_RX", // 14: UART 1 Receive Complete + "UART0_UDRE", // 15: UART 0 Data Register Empty + "UART1_UDRE", // 16: UART 1 Data Register Empty + "UART0_TX", // 17: UART 0 Transmit Complete + "UART1_TX", // 18: UART 1 Transmit Complete + "EE_RDY", // 19: EEPROM Ready + "ANA_COMP", // 20: Analog Comparator +}; + +const char * const vtab_atmega162[vts_atmega162] = { // ATmega162 + "RESET", // 0: Reset (various reasons) + "INT0", // 1: External Interrupt 0 + "INT1", // 2: External Interrupt 1 + "INT2", // 3: External Interrupt 2 + "PCINT0", // 4: Pin Change Interrupt 0 + "PCINT1", // 5: Pin Change Interrupt 1 + "TIMER3_CAPT", // 6: Timer 3 Capture Event + "TIMER3_COMPA", // 7: Timer 3 Compare Match A + "TIMER3_COMPB", // 8: Timer 3 Compare Match B + "TIMER3_OVF", // 9: Timer 3 Overflow + "TIMER2_COMP", // 10: Timer 2 Compare Match + "TIMER2_OVF", // 11: Timer 2 Overflow + "TIMER1_CAPT", // 12: Timer 1 Capture Event + "TIMER1_COMPA", // 13: Timer 1 Compare Match A + "TIMER1_COMPB", // 14: Timer 1 Compare Match B + "TIMER1_OVF", // 15: Timer 1 Overflow + "TIMER0_COMP", // 16: Timer 0 Compare Match + "TIMER0_OVF", // 17: Timer 0 Overflow + "SPI_STC", // 18: SPI Serial Transfer Complete + "USART0_RXC", // 19: USART 0 Receive Complete + "USART1_RXC", // 20: USART 1 Receive Complete + "USART0_UDRE", // 21: USART 0 Data Register Empty + "USART1_UDRE", // 22: USART 1 Data Register Empty + "USART0_TXC", // 23: USART 0 Transmit Complete + "USART1_TXC", // 24: USART 1 Transmit Complete + "EE_RDY", // 25: EEPROM Ready + "ANA_COMP", // 26: Analog Comparator + "SPM_RDY", // 27: Store Program Memory Ready +}; + +const char * const vtab_atmega163[vts_atmega163] = { // ATmega163 + "RESET", // 0: Reset (various reasons) + "INT0", // 1: External Interrupt 0 + "INT1", // 2: External Interrupt 1 + "TIMER2_COMP", // 3: Timer 2 Compare Match + "TIMER2_OVF", // 4: Timer 2 Overflow + "TIMER1_CAPT", // 5: Timer 1 Capture Event + "TIMER1_COMPA", // 6: Timer 1 Compare Match A + "TIMER1_COMPB", // 7: Timer 1 Compare Match B + "TIMER1_OVF", // 8: Timer 1 Overflow + "TIMER0_OVF", // 9: Timer 0 Overflow + "SPI_STC", // 10: SPI Serial Transfer Complete + "UART_RX", // 11: UART Receive Complete + "UART_UDRE", // 12: UART Data Register Empty + "UART_TX", // 13: UART Transmit Complete + "ADC", // 14: ADC Conversion Complete + "EE_RDY", // 15: EEPROM Ready + "ANA_COMP", // 16: Analog Comparator + "TWI", // 17: 2-Wire Interface +}; + +const char * const vtab_atmega168pb[vts_atmega168pb] = { // ATmega168PB, ATmega88PB, ATmega48PB + "RESET", // 0: Reset (various reasons) + "INT0", // 1: External Interrupt 0 + "INT1", // 2: External Interrupt 1 + "PCINT0", // 3: Pin Change Interrupt 0 + "PCINT1", // 4: Pin Change Interrupt 1 + "PCINT2", // 5: Pin Change Interrupt 2 + "WDT", // 6: Watchdog Time-out + "TIMER2_COMPA", // 7: Timer 2 Compare Match A + "TIMER2_COMPB", // 8: Timer 2 Compare Match B + "TIMER2_OVF", // 9: Timer 2 Overflow + "TIMER1_CAPT", // 10: Timer 1 Capture Event + "TIMER1_COMPA", // 11: Timer 1 Compare Match A + "TIMER1_COMPB", // 12: Timer 1 Compare Match B + "TIMER1_OVF", // 13: Timer 1 Overflow + "TIMER0_COMPA", // 14: Timer 0 Compare Match A + "TIMER0_COMPB", // 15: Timer 0 Compare Match B + "TIMER0_OVF", // 16: Timer 0 Overflow + "SPI_STC", // 17: SPI Serial Transfer Complete + "USART_RX", // 18: USART Receive Complete + "USART_UDRE", // 19: USART Data Register Empty + "USART_TX", // 20: USART Transmit Complete + "ADC", // 21: ADC Conversion Complete + "EE_READY", // 22: EEPROM Ready + "ANALOG_COMP", // 23: Analog Comparator + "TWI", // 24: 2-Wire Interface + "SPM_Ready", // 25: Store Program Memory Ready + "USART_START", // 26: USART Start +}; + +const char * const vtab_atmega323[vts_atmega323] = { // ATmega323, ATmega32A, ATmega32 + "RESET", // 0: Reset (various reasons) + "INT0", // 1: External Interrupt 0 + "INT1", // 2: External Interrupt 1 + "INT2", // 3: External Interrupt 2 + "TIMER2_COMP", // 4: Timer 2 Compare Match + "TIMER2_OVF", // 5: Timer 2 Overflow + "TIMER1_CAPT", // 6: Timer 1 Capture Event + "TIMER1_COMPA", // 7: Timer 1 Compare Match A + "TIMER1_COMPB", // 8: Timer 1 Compare Match B + "TIMER1_OVF", // 9: Timer 1 Overflow + "TIMER0_COMP", // 10: Timer 0 Compare Match + "TIMER0_OVF", // 11: Timer 0 Overflow + "SPI_STC", // 12: SPI Serial Transfer Complete + "USART_RXC", // 13: USART Receive Complete + "USART_UDRE", // 14: USART Data Register Empty + "USART_TXC", // 15: USART Transmit Complete + "ADC", // 16: ADC Conversion Complete + "EE_RDY", // 17: EEPROM Ready + "ANA_COMP", // 18: Analog Comparator + "TWI", // 19: 2-Wire Interface + "SPM_RDY", // 20: Store Program Memory Ready +}; + +const char * const vtab_atmega324pb[vts_atmega324pb] = { // ATmega324PB + "RESET", // 0: Reset (various reasons) + "INT0", // 1: External Interrupt 0 + "INT1", // 2: External Interrupt 1 + "INT2", // 3: External Interrupt 2 + "PCINT0", // 4: Pin Change Interrupt 0 + "PCINT1", // 5: Pin Change Interrupt 1 + "PCINT2", // 6: Pin Change Interrupt 2 + "PCINT3", // 7: Pin Change Interrupt 3 + "WDT", // 8: Watchdog Time-out + "TIMER2_COMPA", // 9: Timer 2 Compare Match A + "TIMER2_COMPB", // 10: Timer 2 Compare Match B + "TIMER2_OVF", // 11: Timer 2 Overflow + "TIMER1_CAPT", // 12: Timer 1 Capture Event + "TIMER1_COMPA", // 13: Timer 1 Compare Match A + "TIMER1_COMPB", // 14: Timer 1 Compare Match B + "TIMER1_OVF", // 15: Timer 1 Overflow + "TIMER0_COMPA", // 16: Timer 0 Compare Match A + "TIMER0_COMPB", // 17: Timer 0 Compare Match B + "TIMER0_OVF", // 18: Timer 0 Overflow + "SPI0_STC", // 19: SPI 0 Serial Transfer Complete + "USART0_RX", // 20: USART 0 Receive Complete + "USART0_UDRE", // 21: USART 0 Data Register Empty + "USART0_TX", // 22: USART 0 Transmit Complete + "ANALOG_COMP", // 23: Analog Comparator + "ADC", // 24: ADC Conversion Complete + "EE_READY", // 25: EEPROM Ready + "TWI0", // 26: 2-Wire Interface 0 + "SPM_READY", // 27: Store Program Memory Ready + "USART1_RX", // 28: USART 1 Receive Complete + "USART1_UDRE", // 29: USART 1 Data Register Empty + "USART1_TX", // 30: USART 1 Transmit Complete + "TIMER3_CAPT", // 31: Timer 3 Capture Event + "TIMER3_COMPA", // 32: Timer 3 Compare Match A + "TIMER3_COMPB", // 33: Timer 3 Compare Match B + "TIMER3_OVF", // 34: Timer 3 Overflow + "USART0_START", // 35: USART 0 Receive Start + "USART1_START", // 36: USART 1 Receive Start + "PCINT4", // 37: Pin Change Interrupt 4 + "XOSCFD", // 38: Crystal Failure Detect + "PTC_EOC", // 39: PTC End of Conversion + "PTC_WCOMP", // 40: PTC Window Comparator Mode + "SPI1_STC", // 41: SPI 1 Serial Transfer Complete + "TWI1", // 42: 2-Wire Interface 1 + "TIMER4_CAPT", // 43: Timer 4 Capture Event + "TIMER4_COMPA", // 44: Timer 4 Compare Match A + "TIMER4_COMPB", // 45: Timer 4 Compare Match B + "TIMER4_OVF", // 46: Timer 4 Overflow + "USART2_RX", // 47: USART 2 Receive Complete + "USART2_UDRE", // 48: USART 2 Data Register Empty + "USART2_TX", // 49: USART 2 Transmit Complete + "USART2_START", // 50: USART 2 Receive Start +}; + +const char * const vtab_atmega328[vts_atmega328] = { // ATmega328, ATmega168 + "RESET", // 0: Reset (various reasons) + "INT0", // 1: External Interrupt 0 + "INT1", // 2: External Interrupt 1 + "PCINT0", // 3: Pin Change Interrupt 0 + "PCINT1", // 4: Pin Change Interrupt 1 + "PCINT2", // 5: Pin Change Interrupt 2 + "WDT", // 6: Watchdog Time-out + "TIMER2_COMPA", // 7: Timer 2 Compare Match A + "TIMER2_COMPB", // 8: Timer 2 Compare Match B + "TIMER2_OVF", // 9: Timer 2 Overflow + "TIMER1_CAPT", // 10: Timer 1 Capture Event + "TIMER1_COMPA", // 11: Timer 1 Compare Match A + "TIMER1_COMPB", // 12: Timer 1 Compare Match B + "TIMER1_OVF", // 13: Timer 1 Overflow + "TIMER0_COMPA", // 14: Timer 0 Compare Match A + "TIMER0_COMPB", // 15: Timer 0 Compare Match B + "TIMER0_OVF", // 16: Timer 0 Overflow + "SPI_STC", // 17: SPI Serial Transfer Complete + "USART_RX", // 18: USART Receive Complete + "USART_UDRE", // 19: USART Data Register Empty + "USART_TX", // 20: USART Transmit Complete + "ADC", // 21: ADC Conversion Complete + "EE_READY", // 22: EEPROM Ready + "ANALOG_COMP", // 23: Analog Comparator + "TWI", // 24: 2-Wire Interface + "SPM_READY", // 25: Store Program Memory Ready +}; + +const char * const vtab_atmega328p[vts_atmega328p] = { // ATmega328P, ATmega168PA, ATmega168P, ATmega168A, ATmega88PA, ATmega88P, ATmega88A, ATmega88, ATmega48PA, ATmega48P, ATmega48A, ATmega48, ATA6614Q, ATA6613C, ATA6612C + "RESET", // 0: Reset (various reasons) + "INT0", // 1: External Interrupt 0 + "INT1", // 2: External Interrupt 1 + "PCINT0", // 3: Pin Change Interrupt 0 + "PCINT1", // 4: Pin Change Interrupt 1 + "PCINT2", // 5: Pin Change Interrupt 2 + "WDT", // 6: Watchdog Time-out + "TIMER2_COMPA", // 7: Timer 2 Compare Match A + "TIMER2_COMPB", // 8: Timer 2 Compare Match B + "TIMER2_OVF", // 9: Timer 2 Overflow + "TIMER1_CAPT", // 10: Timer 1 Capture Event + "TIMER1_COMPA", // 11: Timer 1 Compare Match A + "TIMER1_COMPB", // 12: Timer 1 Compare Match B + "TIMER1_OVF", // 13: Timer 1 Overflow + "TIMER0_COMPA", // 14: Timer 0 Compare Match A + "TIMER0_COMPB", // 15: Timer 0 Compare Match B + "TIMER0_OVF", // 16: Timer 0 Overflow + "SPI_STC", // 17: SPI Serial Transfer Complete + "USART_RX", // 18: USART Receive Complete + "USART_UDRE", // 19: USART Data Register Empty + "USART_TX", // 20: USART Transmit Complete + "ADC", // 21: ADC Conversion Complete + "EE_READY", // 22: EEPROM Ready + "ANALOG_COMP", // 23: Analog Comparator + "TWI", // 24: 2-Wire Interface + "SPM_Ready", // 25: Store Program Memory Ready +}; + +const char * const vtab_atmega328pb[vts_atmega328pb] = { // ATmega328PB + "RESET", // 0: Reset (various reasons) + "INT0", // 1: External Interrupt 0 + "INT1", // 2: External Interrupt 1 + "PCINT0", // 3: Pin Change Interrupt 0 + "PCINT1", // 4: Pin Change Interrupt 1 + "PCINT2", // 5: Pin Change Interrupt 2 + "WDT", // 6: Watchdog Time-out + "TIMER2_COMPA", // 7: Timer 2 Compare Match A + "TIMER2_COMPB", // 8: Timer 2 Compare Match B + "TIMER2_OVF", // 9: Timer 2 Overflow + "TIMER1_CAPT", // 10: Timer 1 Capture Event + "TIMER1_COMPA", // 11: Timer 1 Compare Match A + "TIMER1_COMPB", // 12: Timer 1 Compare Match B + "TIMER1_OVF", // 13: Timer 1 Overflow + "TIMER0_COMPA", // 14: Timer 0 Compare Match A + "TIMER0_COMPB", // 15: Timer 0 Compare Match B + "TIMER0_OVF", // 16: Timer 0 Overflow + "SPI0_STC", // 17: SPI 0 Serial Transfer Complete + "USART0_RX", // 18: USART 0 Receive Complete + "USART0_UDRE", // 19: USART 0 Data Register Empty + "USART0_TX", // 20: USART 0 Transmit Complete + "ADC", // 21: ADC Conversion Complete + "EE_READY", // 22: EEPROM Ready + "ANALOG_COMP", // 23: Analog Comparator + "TWI0", // 24: 2-Wire Interface 0 + "SPM_Ready", // 25: Store Program Memory Ready + "USART0_START", // 26: USART 0 Receive Start + "PCINT3", // 27: Pin Change Interrupt 3 + "USART1_RX", // 28: USART 1 Receive Complete + "USART1_UDRE", // 29: USART 1 Data Register Empty + "USART1_TX", // 30: USART 1 Transmit Complete + "USART1_START", // 31: USART 1 Receive Start + "TIMER3_CAPT", // 32: Timer 3 Capture Event + "TIMER3_COMPA", // 33: Timer 3 Compare Match A + "TIMER3_COMPB", // 34: Timer 3 Compare Match B + "TIMER3_OVF", // 35: Timer 3 Overflow + "CFD", // 36: Clock Failure Detection + "PTC_EOC", // 37: PTC End of Conversion + "PTC_WCOMP", // 38: PTC Window Comparator Mode + "SPI1_STC", // 39: SPI 1 Serial Transfer Complete + "TWI1", // 40: 2-Wire Interface 1 + "TIMER4_CAPT", // 41: Timer 4 Capture Event + "TIMER4_COMPA", // 42: Timer 4 Compare Match A + "TIMER4_COMPB", // 43: Timer 4 Compare Match B + "TIMER4_OVF", // 44: Timer 4 Overflow +}; + +const char * const vtab_atmega406[vts_atmega406] = { // ATmega406 + "RESET", // 0: Reset (various reasons) + "BPINT", // 1: Battery Protection Interrupt + "INT0", // 2: External Interrupt 0 + "INT1", // 3: External Interrupt 1 + "INT2", // 4: External Interrupt 2 + "INT3", // 5: External Interrupt 3 + "PCINT0", // 6: Pin Change Interrupt 0 + "PCINT1", // 7: Pin Change Interrupt 1 + "WDT", // 8: Watchdog Time-out + "WAKE_UP", // 9: Wake Up + "TIM1_COMP", // 10: Timer 1 Compare and Match + "TIM1_OVF", // 11: Timer 1 Overflow + "TIM0_COMPA", // 12: Timer 0 Compare Match A + "TIM0_COMPB", // 13: Timer 0 Compare Match B + "TIM0_OVF", // 14: Timer 0 Overflow + "TWI_BUS_CD", // 15: 2-Wire Interface Bus Connect/Disconnect + "TWI", // 16: 2-Wire Interface + "VADC", // 17: Voltage ADC Conversion Complete + "CCADC_CONV", // 18: Coulomb Counter ADC Conversion Complete + "CCADC_REG_CUR", // 19: Coloumb Counter ADC Regular Current + "CCADC_ACC", // 20: Coloumb Counter ADC Accumulator + "EE_READY", // 21: EEPROM Ready + "SPM_READY", // 22: Store Program Memory Ready +}; + +const char * const vtab_atmega644[vts_atmega644] = { // ATmega644 + "RESET", // 0: Reset (various reasons) + "INT0", // 1: External Interrupt 0 + "INT1", // 2: External Interrupt 1 + "INT2", // 3: External Interrupt 2 + "PCINT0", // 4: Pin Change Interrupt 0 + "PCINT1", // 5: Pin Change Interrupt 1 + "PCINT2", // 6: Pin Change Interrupt 2 + "PCINT3", // 7: Pin Change Interrupt 3 + "WDT", // 8: Watchdog Time-out + "TIMER2_COMPA", // 9: Timer 2 Compare Match A + "TIMER2_COMPB", // 10: Timer 2 Compare Match B + "TIMER2_OVF", // 11: Timer 2 Overflow + "TIMER1_CAPT", // 12: Timer 1 Capture Event + "TIMER1_COMPA", // 13: Timer 1 Compare Match A + "TIMER1_COMPB", // 14: Timer 1 Compare Match B + "TIMER1_OVF", // 15: Timer 1 Overflow + "TIMER0_COMPA", // 16: Timer 0 Compare Match A + "TIMER0_COMPB", // 17: Timer 0 Compare Match B + "TIMER0_OVF", // 18: Timer 0 Overflow + "SPI_STC", // 19: SPI Serial Transfer Complete + "USART0_RX", // 20: USART 0 Receive Complete + "USART0_UDRE", // 21: USART 0 Data Register Empty + "USART0_TX", // 22: USART 0 Transmit Complete + "ANALOG_COMP", // 23: Analog Comparator + "ADC", // 24: ADC Conversion Complete + "EE_READY", // 25: EEPROM Ready + "TWI", // 26: 2-Wire Interface + "SPM_READY", // 27: Store Program Memory Ready +}; + +const char * const vtab_atmega644pa[vts_atmega644pa] = { // ATmega644PA, ATmega644P, ATmega644A, ATmega324PA, ATmega324P, ATmega324A, ATmega164PA, ATmega164P, ATmega164A + "RESET", // 0: Reset (various reasons) + "INT0", // 1: External Interrupt 0 + "INT1", // 2: External Interrupt 1 + "INT2", // 3: External Interrupt 2 + "PCINT0", // 4: Pin Change Interrupt 0 + "PCINT1", // 5: Pin Change Interrupt 1 + "PCINT2", // 6: Pin Change Interrupt 2 + "PCINT3", // 7: Pin Change Interrupt 3 + "WDT", // 8: Watchdog Time-out + "TIMER2_COMPA", // 9: Timer 2 Compare Match A + "TIMER2_COMPB", // 10: Timer 2 Compare Match B + "TIMER2_OVF", // 11: Timer 2 Overflow + "TIMER1_CAPT", // 12: Timer 1 Capture Event + "TIMER1_COMPA", // 13: Timer 1 Compare Match A + "TIMER1_COMPB", // 14: Timer 1 Compare Match B + "TIMER1_OVF", // 15: Timer 1 Overflow + "TIMER0_COMPA", // 16: Timer 0 Compare Match A + "TIMER0_COMPB", // 17: Timer 0 Compare Match B + "TIMER0_OVF", // 18: Timer 0 Overflow + "SPI_STC", // 19: SPI Serial Transfer Complete + "USART0_RX", // 20: USART 0 Receive Complete + "USART0_UDRE", // 21: USART 0 Data Register Empty + "USART0_TX", // 22: USART 0 Transmit Complete + "ANALOG_COMP", // 23: Analog Comparator + "ADC", // 24: ADC Conversion Complete + "EE_READY", // 25: EEPROM Ready + "TWI", // 26: 2-Wire Interface + "SPM_READY", // 27: Store Program Memory Ready + "USART1_RX", // 28: USART 1 Receive Complete + "USART1_UDRE", // 29: USART 1 Data Register Empty + "USART1_TX", // 30: USART 1 Transmit Complete +}; + +const char * const vtab_atmega645p[vts_atmega645p] = { // ATmega645P, ATmega645A, ATmega645, ATmega325PA, ATmega325P, ATmega325A, ATmega325, ATmega165PA, ATmega165P, ATmega165A, ATmega165 + "RESET", // 0: Reset (various reasons) + "INT0", // 1: External Interrupt 0 + "PCINT0", // 2: Pin Change Interrupt 0 + "PCINT1", // 3: Pin Change Interrupt 1 + "TIMER2_COMP", // 4: Timer 2 Compare Match + "TIMER2_OVF", // 5: Timer 2 Overflow + "TIMER1_CAPT", // 6: Timer 1 Capture Event + "TIMER1_COMPA", // 7: Timer 1 Compare Match A + "TIMER1_COMPB", // 8: Timer 1 Compare Match B + "TIMER1_OVF", // 9: Timer 1 Overflow + "TIMER0_COMP", // 10: Timer 0 Compare Match + "TIMER0_OVF", // 11: Timer 0 Overflow + "SPI_STC", // 12: SPI Serial Transfer Complete + "USART0_RX", // 13: USART 0 Receive Complete + "USART0_UDRE", // 14: USART 0 Data Register Empty + "USART0_TX", // 15: USART 0 Transmit Complete + "USI_START", // 16: USI Start Condition + "USI_OVERFLOW", // 17: USI Overflow + "ANALOG_COMP", // 18: Analog Comparator + "ADC", // 19: ADC Conversion Complete + "EE_READY", // 20: EEPROM Ready + "SPM_READY", // 21: Store Program Memory Ready +}; + +const char * const vtab_atmega649p[vts_atmega649p] = { // ATmega649P, ATmega649A, ATmega649, ATmega329PA, ATmega329P, ATmega329A, ATmega329, ATmega169PA, ATmega169P, ATmega169A, ATmega169 + "RESET", // 0: Reset (various reasons) + "INT0", // 1: External Interrupt 0 + "PCINT0", // 2: Pin Change Interrupt 0 + "PCINT1", // 3: Pin Change Interrupt 1 + "TIMER2_COMP", // 4: Timer 2 Compare Match + "TIMER2_OVF", // 5: Timer 2 Overflow + "TIMER1_CAPT", // 6: Timer 1 Capture Event + "TIMER1_COMPA", // 7: Timer 1 Compare Match A + "TIMER1_COMPB", // 8: Timer 1 Compare Match B + "TIMER1_OVF", // 9: Timer 1 Overflow + "TIMER0_COMP", // 10: Timer 0 Compare Match + "TIMER0_OVF", // 11: Timer 0 Overflow + "SPI_STC", // 12: SPI Serial Transfer Complete + "USART0_RX", // 13: USART 0 Receive Complete + "USART0_UDRE", // 14: USART 0 Data Register Empty + "USART0_TX", // 15: USART 0 Transmit Complete + "USI_START", // 16: USI Start Condition + "USI_OVERFLOW", // 17: USI Overflow + "ANALOG_COMP", // 18: Analog Comparator + "ADC", // 19: ADC Conversion Complete + "EE_READY", // 20: EEPROM Ready + "SPM_READY", // 21: Store Program Memory Ready + "LCD", // 22: LCD Start of Frame +}; + +const char * const vtab_atmega1284p[vts_atmega1284p] = { // ATmega1284P, ATmega1284 + "RESET", // 0: Reset (various reasons) + "INT0", // 1: External Interrupt 0 + "INT1", // 2: External Interrupt 1 + "INT2", // 3: External Interrupt 2 + "PCINT0", // 4: Pin Change Interrupt 0 + "PCINT1", // 5: Pin Change Interrupt 1 + "PCINT2", // 6: Pin Change Interrupt 2 + "PCINT3", // 7: Pin Change Interrupt 3 + "WDT", // 8: Watchdog Time-out + "TIMER2_COMPA", // 9: Timer 2 Compare Match A + "TIMER2_COMPB", // 10: Timer 2 Compare Match B + "TIMER2_OVF", // 11: Timer 2 Overflow + "TIMER1_CAPT", // 12: Timer 1 Capture Event + "TIMER1_COMPA", // 13: Timer 1 Compare Match A + "TIMER1_COMPB", // 14: Timer 1 Compare Match B + "TIMER1_OVF", // 15: Timer 1 Overflow + "TIMER0_COMPA", // 16: Timer 0 Compare Match A + "TIMER0_COMPB", // 17: Timer 0 Compare Match B + "TIMER0_OVF", // 18: Timer 0 Overflow + "SPI_STC", // 19: SPI Serial Transfer Complete + "USART0_RX", // 20: USART 0 Receive Complete + "USART0_UDRE", // 21: USART 0 Data Register Empty + "USART0_TX", // 22: USART 0 Transmit Complete + "ANALOG_COMP", // 23: Analog Comparator + "ADC", // 24: ADC Conversion Complete + "EE_READY", // 25: EEPROM Ready + "TWI", // 26: 2-Wire Interface + "SPM_READY", // 27: Store Program Memory Ready + "USART1_RX", // 28: USART 1 Receive Complete + "USART1_UDRE", // 29: USART 1 Data Register Empty + "USART1_TX", // 30: USART 1 Transmit Complete + "TIMER3_CAPT", // 31: Timer 3 Capture Event + "TIMER3_COMPA", // 32: Timer 3 Compare Match A + "TIMER3_COMPB", // 33: Timer 3 Compare Match B + "TIMER3_OVF", // 34: Timer 3 Overflow +}; + +const char * const vtab_atmega2561[vts_atmega2561] = { // ATmega2561, ATmega2560, ATmega1281, ATmega1280, ATmega640 + "RESET", // 0: Reset (various reasons) + "INT0", // 1: External Interrupt 0 + "INT1", // 2: External Interrupt 1 + "INT2", // 3: External Interrupt 2 + "INT3", // 4: External Interrupt 3 + "INT4", // 5: External Interrupt 4 + "INT5", // 6: External Interrupt 5 + "INT6", // 7: External Interrupt 6 + "INT7", // 8: External Interrupt 7 + "PCINT0", // 9: Pin Change Interrupt 0 + "PCINT1", // 10: Pin Change Interrupt 1 + "PCINT2", // 11: Pin Change Interrupt 2 + "WDT", // 12: Watchdog Time-out + "TIMER2_COMPA", // 13: Timer 2 Compare Match A + "TIMER2_COMPB", // 14: Timer 2 Compare Match B + "TIMER2_OVF", // 15: Timer 2 Overflow + "TIMER1_CAPT", // 16: Timer 1 Capture Event + "TIMER1_COMPA", // 17: Timer 1 Compare Match A + "TIMER1_COMPB", // 18: Timer 1 Compare Match B + "TIMER1_COMPC", // 19: Timer 1 Compare Match C + "TIMER1_OVF", // 20: Timer 1 Overflow + "TIMER0_COMPA", // 21: Timer 0 Compare Match A + "TIMER0_COMPB", // 22: Timer 0 Compare Match B + "TIMER0_OVF", // 23: Timer 0 Overflow + "SPI_STC", // 24: SPI Serial Transfer Complete + "USART0_RX", // 25: USART 0 Receive Complete + "USART0_UDRE", // 26: USART 0 Data Register Empty + "USART0_TX", // 27: USART 0 Transmit Complete + "ANALOG_COMP", // 28: Analog Comparator + "ADC", // 29: ADC Conversion Complete + "EE_READY", // 30: EEPROM Ready + "TIMER3_CAPT", // 31: Timer 3 Capture Event + "TIMER3_COMPA", // 32: Timer 3 Compare Match A + "TIMER3_COMPB", // 33: Timer 3 Compare Match B + "TIMER3_COMPC", // 34: Timer 3 Compare Match C + "TIMER3_OVF", // 35: Timer 3 Overflow + "USART1_RX", // 36: USART 1 Receive Complete + "USART1_UDRE", // 37: USART 1 Data Register Empty + "USART1_TX", // 38: USART 1 Transmit Complete + "TWI", // 39: 2-Wire Interface + "SPM_READY", // 40: Store Program Memory Ready + "TIMER4_CAPT", // 41: Timer 4 Capture Event + "TIMER4_COMPA", // 42: Timer 4 Compare Match A + "TIMER4_COMPB", // 43: Timer 4 Compare Match B + "TIMER4_COMPC", // 44: Timer 4 Compare Match C + "TIMER4_OVF", // 45: Timer 4 Overflow + "TIMER5_CAPT", // 46: Timer 5 Capture Event + "TIMER5_COMPA", // 47: Timer 5 Compare Match A + "TIMER5_COMPB", // 48: Timer 5 Compare Match B + "TIMER5_COMPC", // 49: Timer 5 Compare Match C + "TIMER5_OVF", // 50: Timer 5 Overflow + "USART2_RX", // 51: USART 2 Receive Complete + "USART2_UDRE", // 52: USART 2 Data Register Empty + "USART2_TX", // 53: USART 2 Transmit Complete + "USART3_RX", // 54: USART 3 Receive Complete + "USART3_UDRE", // 55: USART 3 Data Register Empty + "USART3_TX", // 56: USART 3 Transmit Complete +}; + +const char * const vtab_atmega2564rfr2[vts_atmega2564rfr2] = { // ATmega2564RFR2, ATmega1284RFR2, ATmega644RFR2, ATmega256RFR2, ATmega128RFR2, ATmega64RFR2 + "RESET", // 0: Reset (various reasons) + "INT0", // 1: External Interrupt 0 + "INT1", // 2: External Interrupt 1 + "INT2", // 3: External Interrupt 2 + "INT3", // 4: External Interrupt 3 + "INT4", // 5: External Interrupt 4 + "INT5", // 6: External Interrupt 5 + "INT6", // 7: External Interrupt 6 + "INT7", // 8: External Interrupt 7 + "PCINT0", // 9: Pin Change Interrupt 0 + "PCINT1", // 10: Pin Change Interrupt 1 + "PCINT2", // 11: Pin Change Interrupt 2 + "WDT", // 12: Watchdog Time-out + "TIMER2_COMPA", // 13: Timer 2 Compare Match A + "TIMER2_COMPB", // 14: Timer 2 Compare Match B + "TIMER2_OVF", // 15: Timer 2 Overflow + "TIMER1_CAPT", // 16: Timer 1 Capture Event + "TIMER1_COMPA", // 17: Timer 1 Compare Match A + "TIMER1_COMPB", // 18: Timer 1 Compare Match B + "TIMER1_COMPC", // 19: Timer 1 Compare Match C + "TIMER1_OVF", // 20: Timer 1 Overflow + "TIMER0_COMPA", // 21: Timer 0 Compare Match A + "TIMER0_COMPB", // 22: Timer 0 Compare Match B + "TIMER0_OVF", // 23: Timer 0 Overflow + "SPI_STC", // 24: SPI Serial Transfer Complete + "USART0_RX", // 25: USART 0 Receive Complete + "USART0_UDRE", // 26: USART 0 Data Register Empty + "USART0_TX", // 27: USART 0 Transmit Complete + "ANALOG_COMP", // 28: Analog Comparator + "ADC", // 29: ADC Conversion Complete + "EE_READY", // 30: EEPROM Ready + "TIMER3_CAPT", // 31: Timer 3 Capture Event + "TIMER3_COMPA", // 32: Timer 3 Compare Match A + "TIMER3_COMPB", // 33: Timer 3 Compare Match B + "TIMER3_COMPC", // 34: Timer 3 Compare Match C + "TIMER3_OVF", // 35: Timer 3 Overflow + "USART1_RX", // 36: USART 1 Receive Complete + "USART1_UDRE", // 37: USART 1 Data Register Empty + "USART1_TX", // 38: USART 1 Transmit Complete + "TWI", // 39: 2-Wire Interface + "SPM_READY", // 40: Store Program Memory Ready + "TIMER4_CAPT", // 41: Timer 4 Capture Event + "TIMER4_COMPA", // 42: Timer 4 Compare Match A + "TIMER4_COMPB", // 43: Timer 4 Compare Match B + "TIMER4_COMPC", // 44: Timer 4 Compare Match C + "TIMER4_OVF", // 45: Timer 4 Overflow + "TIMER5_CAPT", // 46: Timer 5 Capture Event + "TIMER5_COMPA", // 47: Timer 5 Compare Match A + "TIMER5_COMPB", // 48: Timer 5 Compare Match B + "TIMER5_COMPC", // 49: Timer 5 Compare Match C + "TIMER5_OVF", // 50: Timer 5 Overflow + "RESERVED_51", // 51: Reserved 51 + "RESERVED_52", // 52: Reserved 52 + "RESERVED_53", // 53: Reserved 53 + "RESERVED_54", // 54: Reserved 54 + "RESERVED_55", // 55: Reserved 55 + "RESERVED_56", // 56: Reserved 56 + "TRX24_PLL_LOCK", // 57: TRX24 PLL Lock + "TRX24_PLL_UNLOCK", // 58: TRX24 PLL Unlock + "TRX24_RX_START", // 59: TRX24 Receive Start + "TRX24_RX_END", // 60: TRX24 Receive End + "TRX24_CCA_ED_DONE", // 61: TRX24 CCA/ED Done + "TRX24_XAH_AMI", // 62: TRX24 XAH/AMI + "TRX24_TX_END", // 63: TRX24 Transmit End + "TRX24_AWAKE", // 64: TRX24 AWAKE - Transceiver is Reaching State TRX_OFF + "SCNT_CMP1", // 65: Symbol Counter - Compare Match 1 Interrupt + "SCNT_CMP2", // 66: Symbol Counter - Compare Match 2 Interrupt + "SCNT_CMP3", // 67: Symbol Counter - Compare Match 3 Interrupt + "SCNT_OVFL", // 68: Symbol Counter - Overflow Interrupt + "SCNT_BACKOFF", // 69: Symbol Counter - Backoff Interrupt + "AES_READY", // 70: AES Engine Ready + "BAT_LOW", // 71: Battery Voltage Below Threshold + "TRX24_TX_START", // 72: TRX24 Transmit Start + "TRX24_AMI0", // 73: TRX24 Address Match 0 + "TRX24_AMI1", // 74: TRX24 Address Match 1 + "TRX24_AMI2", // 75: TRX24 Address Match 2 + "TRX24_AMI3", // 76: TRX24 Address Match 3 +}; + +const char * const vtab_atmega6450p[vts_atmega6450p] = { // ATmega6450P, ATmega6450A, ATmega6450, ATmega3250PA, ATmega3250P, ATmega3250A, ATmega3250 + "RESET", // 0: Reset (various reasons) + "INT0", // 1: External Interrupt 0 + "PCINT0", // 2: Pin Change Interrupt 0 + "PCINT1", // 3: Pin Change Interrupt 1 + "TIMER2_COMP", // 4: Timer 2 Compare Match + "TIMER2_OVF", // 5: Timer 2 Overflow + "TIMER1_CAPT", // 6: Timer 1 Capture Event + "TIMER1_COMPA", // 7: Timer 1 Compare Match A + "TIMER1_COMPB", // 8: Timer 1 Compare Match B + "TIMER1_OVF", // 9: Timer 1 Overflow + "TIMER0_COMP", // 10: Timer 0 Compare Match + "TIMER0_OVF", // 11: Timer 0 Overflow + "SPI_STC", // 12: SPI Serial Transfer Complete + "USART_RX", // 13: USART Receive Complete + "USART_UDRE", // 14: USART Data Register Empty + "USART0_TX", // 15: USART 0 Transmit Complete + "USI_START", // 16: USI Start Condition + "USI_OVERFLOW", // 17: USI Overflow + "ANALOG_COMP", // 18: Analog Comparator + "ADC", // 19: ADC Conversion Complete + "EE_READY", // 20: EEPROM Ready + "SPM_READY", // 21: Store Program Memory Ready + "NOT_USED", // 22: Reserved + "PCINT2", // 23: Pin Change Interrupt 2 + "PCINT3", // 24: Pin Change Interrupt 3 +}; + +const char * const vtab_atmega6490p[vts_atmega6490p] = { // ATmega6490P, ATmega6490A, ATmega6490, ATmega3290PA, ATmega3290P, ATmega3290A, ATmega3290 + "RESET", // 0: Reset (various reasons) + "INT0", // 1: External Interrupt 0 + "PCINT0", // 2: Pin Change Interrupt 0 + "PCINT1", // 3: Pin Change Interrupt 1 + "TIMER2_COMP", // 4: Timer 2 Compare Match + "TIMER2_OVF", // 5: Timer 2 Overflow + "TIMER1_CAPT", // 6: Timer 1 Capture Event + "TIMER1_COMPA", // 7: Timer 1 Compare Match A + "TIMER1_COMPB", // 8: Timer 1 Compare Match B + "TIMER1_OVF", // 9: Timer 1 Overflow + "TIMER0_COMP", // 10: Timer 0 Compare Match + "TIMER0_OVF", // 11: Timer 0 Overflow + "SPI_STC", // 12: SPI Serial Transfer Complete + "USART_RX", // 13: USART Receive Complete + "USART_UDRE", // 14: USART Data Register Empty + "USART0_TX", // 15: USART 0 Transmit Complete + "USI_START", // 16: USI Start Condition + "USI_OVERFLOW", // 17: USI Overflow + "ANALOG_COMP", // 18: Analog Comparator + "ADC", // 19: ADC Conversion Complete + "EE_READY", // 20: EEPROM Ready + "SPM_READY", // 21: Store Program Memory Ready + "LCD", // 22: LCD Start of Frame + "PCINT2", // 23: Pin Change Interrupt 2 + "PCINT3", // 24: Pin Change Interrupt 3 +}; + +const char * const vtab_atmega8515[vts_atmega8515] = { // ATmega8515 + "RESET", // 0: Reset (various reasons) + "INT0", // 1: External Interrupt 0 + "INT1", // 2: External Interrupt 1 + "TIMER1_CAPT", // 3: Timer 1 Capture Event + "TIMER1_COMPA", // 4: Timer 1 Compare Match A + "TIMER1_COMPB", // 5: Timer 1 Compare Match B + "TIMER1_OVF", // 6: Timer 1 Overflow + "TIMER0_OVF", // 7: Timer 0 Overflow + "SPI_STC", // 8: SPI Serial Transfer Complete + "USART_RX", // 9: USART Receive Complete + "USART_UDRE", // 10: USART Data Register Empty + "USART_TX", // 11: USART Transmit Complete + "ANA_COMP", // 12: Analog Comparator + "INT2", // 13: External Interrupt 2 + "TIMER0_COMP", // 14: Timer 0 Compare Match + "EE_RDY", // 15: EEPROM Ready + "SPM_RDY", // 16: Store Program Memory Ready +}; + +const char * const vtab_atmega8535[vts_atmega8535] = { // ATmega8535 + "RESET", // 0: Reset (various reasons) + "INT0", // 1: External Interrupt 0 + "INT1", // 2: External Interrupt 1 + "TIMER2_COMP", // 3: Timer 2 Compare Match + "TIMER2_OVF", // 4: Timer 2 Overflow + "TIMER1_CAPT", // 5: Timer 1 Capture Event + "TIMER1_COMPA", // 6: Timer 1 Compare Match A + "TIMER1_COMPB", // 7: Timer 1 Compare Match B + "TIMER1_OVF", // 8: Timer 1 Overflow + "TIMER0_OVF", // 9: Timer 0 Overflow + "SPI_STC", // 10: SPI Serial Transfer Complete + "USART_RX", // 11: USART Receive Complete + "USART_UDRE", // 12: USART Data Register Empty + "USART_TX", // 13: USART Transmit Complete + "ADC", // 14: ADC Conversion Complete + "EE_RDY", // 15: EEPROM Ready + "ANA_COMP", // 16: Analog Comparator + "TWI", // 17: 2-Wire Interface + "INT2", // 18: External Interrupt 2 + "TIMER0_COMP", // 19: Timer 0 Compare Match + "SPM_RDY", // 20: Store Program Memory Ready +}; + +const char * const vtab_at86rf401[vts_at86rf401] = { // AT86RF401 + "RESET", // 0: Reset (various reasons) + "TXDONE", // 1: Transmit Complete + "TXEMPTY", // 2: Transmit Register Empty +}; + +const char * const vtab_at90pwm2[vts_at90pwm2] = { // AT90PWM2 + "RESET", // 0: Reset (various reasons) + "PSC2_CAPT", // 1: PSC 2 Capture Event + "PSC2_EC", // 2: PSC 2 End Cycle + "PSC1_CAPT", // 3: PSC 1 Capture Event + "PSC1_EC", // 4: PSC 1 End Cycle + "PSC0_CAPT", // 5: PSC 0 Capture Event + "PSC0_EC", // 6: PSC 0 End Cycle + "ANALOG_COMP_0", // 7: Analog Comparator 0 + "ANALOG_COMP_1", // 8: Analog Comparator 1 + "ANALOG_COMP_2", // 9: Analog Comparator 2 + "INT0", // 10: External Interrupt 0 + "TIMER1_CAPT", // 11: Timer 1 Capture Event + "TIMER1_COMPA", // 12: Timer 1 Compare Match A + "TIMER1_COMPB", // 13: Timer 1 Compare Match B + "UNUSED", // 14: not implemented on this device + "TIMER1_OVF", // 15: Timer 1 Overflow + "TIMER0_COMP_A", // 16: Timer 0 Compare Match A + "TIMER0_OVF", // 17: Timer 0 Overflow + "ADC", // 18: ADC Conversion Complete + "INT1", // 19: External Interrupt 1 + "SPI_STC", // 20: SPI Serial Transfer Complete + "USART_RX", // 21: USART Receive Complete + "USART_UDRE", // 22: USART Data Register Empty + "USART_TX", // 23: USART Transmit Complete + "INT2", // 24: External Interrupt 2 + "WDT", // 25: Watchdog Time-out + "EE_READY", // 26: EEPROM Ready + "TIMER0_COMPB", // 27: Timer 0 Compare Match B + "INT3", // 28: External Interrupt 3 + "UNUSED", // 29: not implemented on this device + "UNUSED", // 30: not implemented on this device + "SPM_READY", // 31: Store Program Memory Ready +}; + +const char * const vtab_at90pwm3b[vts_at90pwm3b] = { // AT90PWM3B, AT90PWM3, AT90PWM2B + "RESET", // 0: Reset (various reasons) + "PSC2_CAPT", // 1: PSC 2 Capture Event + "PSC2_EC", // 2: PSC 2 End Cycle + "PSC1_CAPT", // 3: PSC 1 Capture Event + "PSC1_EC", // 4: PSC 1 End Cycle + "PSC0_CAPT", // 5: PSC 0 Capture Event + "PSC0_EC", // 6: PSC 0 End Cycle + "ANALOG_COMP_0", // 7: Analog Comparator 0 + "ANALOG_COMP_1", // 8: Analog Comparator 1 + "ANALOG_COMP_2", // 9: Analog Comparator 2 + "INT0", // 10: External Interrupt 0 + "TIMER1_CAPT", // 11: Timer 1 Capture Event + "TIMER1_COMPA", // 12: Timer 1 Compare Match A + "TIMER1_COMPB", // 13: Timer 1 Compare Match B + "RESERVED15", // 14: Reserved 15 + "TIMER1_OVF", // 15: Timer 1 Overflow + "TIMER0_COMPA", // 16: Timer 0 Compare Match A + "TIMER0_OVF", // 17: Timer 0 Overflow + "ADC", // 18: ADC Conversion Complete + "INT1", // 19: External Interrupt 1 + "SPI_STC", // 20: SPI Serial Transfer Complete + "USART_RX", // 21: USART Receive Complete + "USART_UDRE", // 22: USART Data Register Empty + "USART_TX", // 23: USART Transmit Complete + "INT2", // 24: External Interrupt 2 + "WDT", // 25: Watchdog Time-out + "EE_READY", // 26: EEPROM Ready + "TIMER0_COMPB", // 27: Timer 0 Compare Match B + "INT3", // 28: External Interrupt 3 + "RESERVED30", // 29: Reserved 30 + "RESERVED31", // 30: Reserved 31 + "SPM_READY", // 31: Store Program Memory Ready +}; + +const char * const vtab_at90scr100[vts_at90scr100] = { // AT90SCR100 + "RESET", // 0: Reset (various reasons) + "INT0", // 1: External Interrupt 0 + "INT1", // 2: External Interrupt 1 + "INT2", // 3: External Interrupt 2 + "INT3", // 4: External Interrupt 3 + "PCINT0", // 5: Pin Change Interrupt 0 + "PCINT1", // 6: Pin Change Interrupt 1 + "PCINT2", // 7: Pin Change Interrupt 2 + "WDT", // 8: Watchdog Time-out + "TIMER2_COMPA", // 9: Timer 2 Compare Match A + "TIMER2_COMPB", // 10: Timer 2 Compare Match B + "TIMER2_OVF", // 11: Timer 2 Overflow + "TIMER1_CAPT", // 12: Timer 1 Capture Event + "TIMER1_COMPA", // 13: Timer 1 Compare Match A + "TIMER1_COMPB", // 14: Timer 1 Compare Match B + "TIMER1_OVF", // 15: Timer 1 Overflow + "TIMER0_COMPA", // 16: Timer 0 Compare Match A + "TIMER0_COMPB", // 17: Timer 0 Compare Match B + "TIMER0_OVF", // 18: Timer 0 Overflow + "SPI_STC", // 19: SPI Serial Transfer Complete + "USART0_RX", // 20: USART 0 Receive Complete + "USART0_UDRE", // 21: USART 0 Data Register Empty + "USART0_TX", // 22: USART 0 Transmit Complete + "SUPPLY_MON", // 23: Supply Monitor + "RFU", // 24: Reserved for Future Use + "EE_READY", // 25: EEPROM Ready + "TWI", // 26: 2-Wire Interface + "SPM_READY", // 27: Store Program Memory Ready + "KEYBOARD", // 28: Keyboard Input Change + "AES_Operation", // 29: AES Operation + "HSSPI", // 30: High-Speed SPI + "USB_Endpoint", // 31: USB Endpoint + "USB_Protocol", // 32: USB Protocol + "SCIB", // 33: Smart Card Reader Interface + "USBHost_Control", // 34: USB Host Controller + "USBHost_Pipe", // 35: USB Host Pipe + "CPRES", // 36: Card Presence Detection + "PCINT3", // 37: Pin Change Interrupt 3 +}; + +const char * const vtab_at90can128[vts_at90can128] = { // AT90CAN128, AT90CAN64, AT90CAN32 + "RESET", // 0: Reset (various reasons) + "INT0", // 1: External Interrupt 0 + "INT1", // 2: External Interrupt 1 + "INT2", // 3: External Interrupt 2 + "INT3", // 4: External Interrupt 3 + "INT4", // 5: External Interrupt 4 + "INT5", // 6: External Interrupt 5 + "INT6", // 7: External Interrupt 6 + "INT7", // 8: External Interrupt 7 + "TIMER2_COMP", // 9: Timer 2 Compare Match + "TIMER2_OVF", // 10: Timer 2 Overflow + "TIMER1_CAPT", // 11: Timer 1 Capture Event + "TIMER1_COMPA", // 12: Timer 1 Compare Match A + "TIMER1_COMPB", // 13: Timer 1 Compare Match B + "TIMER1_COMPC", // 14: Timer 1 Compare Match C + "TIMER1_OVF", // 15: Timer 1 Overflow + "TIMER0_COMP", // 16: Timer 0 Compare Match + "TIMER0_OVF", // 17: Timer 0 Overflow + "CANIT", // 18: CAN Transfer Complete or Error + "OVRIT", // 19: CAN Timer Overrun + "SPI_STC", // 20: SPI Serial Transfer Complete + "USART0_RX", // 21: USART 0 Receive Complete + "USART0_UDRE", // 22: USART 0 Data Register Empty + "USART0_TX", // 23: USART 0 Transmit Complete + "ANALOG_COMP", // 24: Analog Comparator + "ADC", // 25: ADC Conversion Complete + "EE_READY", // 26: EEPROM Ready + "TIMER3_CAPT", // 27: Timer 3 Capture Event + "TIMER3_COMPA", // 28: Timer 3 Compare Match A + "TIMER3_COMPB", // 29: Timer 3 Compare Match B + "TIMER3_COMPC", // 30: Timer 3 Compare Match C + "TIMER3_OVF", // 31: Timer 3 Overflow + "USART1_RX", // 32: USART 1 Receive Complete + "USART1_UDRE", // 33: USART 1 Data Register Empty + "USART1_TX", // 34: USART 1 Transmit Complete + "TWI", // 35: 2-Wire Interface + "SPM_READY", // 36: Store Program Memory Ready +}; + +const char * const vtab_at90pwm161[vts_at90pwm161] = { // AT90PWM161, AT90PWM81 + "RESET", // 0: Reset (various reasons) + "PSC2_CAPT", // 1: PSC 2 Capture Event + "PSC2_EC", // 2: PSC 2 End Cycle + "PSC2_EEC", // 3: PSC 2 End Of Enhanced Cycle + "PSC0_CAPT", // 4: PSC 0 Capture Event + "PSC0_EC", // 5: PSC 0 End Cycle + "PSC0_EEC", // 6: PSC 0 End Of Enhanced Cycle + "ANALOG_COMP_1", // 7: Analog Comparator 1 + "ANALOG_COMP_2", // 8: Analog Comparator 2 + "ANALOG_COMP_3", // 9: Analog Comparator 3 + "INT0", // 10: External Interrupt 0 + "TIMER1_CAPT", // 11: Timer 1 Capture Event + "TIMER1_OVF", // 12: Timer 1 Overflow + "ADC", // 13: ADC Conversion Complete + "INT1", // 14: External Interrupt 1 + "SPI_STC", // 15: SPI Serial Transfer Complete + "INT2", // 16: External Interrupt 2 + "WDT", // 17: Watchdog Time-out + "EE_READY", // 18: EEPROM Ready + "SPM_READY", // 19: Store Program Memory Ready +}; + +const char * const vtab_at90pwm316[vts_at90pwm316] = { // AT90PWM316, AT90PWM216, AT90PWM1 + "RESET", // 0: Reset (various reasons) + "PSC2_CAPT", // 1: PSC 2 Capture Event + "PSC2_EC", // 2: PSC 2 End Cycle + "PSC1_CAPT", // 3: PSC 1 Capture Event + "PSC1_EC", // 4: PSC 1 End Cycle + "PSC0_CAPT", // 5: PSC 0 Capture Event + "PSC0_EC", // 6: PSC 0 End Cycle + "ANALOG_COMP_0", // 7: Analog Comparator 0 + "ANALOG_COMP_1", // 8: Analog Comparator 1 + "ANALOG_COMP_2", // 9: Analog Comparator 2 + "INT0", // 10: External Interrupt 0 + "TIMER1_CAPT", // 11: Timer 1 Capture Event + "TIMER1_COMPA", // 12: Timer 1 Compare Match A + "TIMER1_COMPB", // 13: Timer 1 Compare Match B + "RESERVED15", // 14: Reserved 15 + "TIMER1_OVF", // 15: Timer 1 Overflow + "TIMER0_COMP_A", // 16: Timer 0 Compare Match A + "TIMER0_OVF", // 17: Timer 0 Overflow + "ADC", // 18: ADC Conversion Complete + "INT1", // 19: External Interrupt 1 + "SPI_STC", // 20: SPI Serial Transfer Complete + "USART_RX", // 21: USART Receive Complete + "USART_UDRE", // 22: USART Data Register Empty + "USART_TX", // 23: USART Transmit Complete + "INT2", // 24: External Interrupt 2 + "WDT", // 25: Watchdog Time-out + "EE_READY", // 26: EEPROM Ready + "TIMER0_COMPB", // 27: Timer 0 Compare Match B + "INT3", // 28: External Interrupt 3 + "RESERVED30", // 29: Reserved 30 + "RESERVED31", // 30: Reserved 31 + "SPM_READY", // 31: Store Program Memory Ready +}; + +const char * const vtab_at90s1200[vts_at90s1200] = { // AT90S1200 + "RESET", // 0: Reset (various reasons) + "INT0", // 1: External Interrupt 0 + "TIMER0_OVF", // 2: Timer 0 Overflow + "ANA_COMP", // 3: Analog Comparator +}; + +const char * const vtab_at90s2313[vts_at90s2313] = { // AT90S2313 + "RESET", // 0: Reset (various reasons) + "INT0", // 1: External Interrupt 0 + "INT1", // 2: External Interrupt 1 + "TIMER1_CAPT1", // 3: Timer 1 Capture Event + "TIMER1_COMP1", // 4: Timer 1 Compare + "TIMER1_OVF1", // 5: Timer 1 Overflow + "TIMER0_OVF0", // 6: Timer 0 Overflow + "UART_RX", // 7: UART Receive Complete + "UART_UDRE", // 8: UART Data Register Empty + "UART_TX", // 9: UART Transmit Complete + "ANA_COMP", // 10: Analog Comparator +}; + +const char * const vtab_at90s4433[vts_at90s4433] = { // AT90S4433, AT90S2333 + "RESET", // 0: Reset (various reasons) + "INT0", // 1: External Interrupt 0 + "INT1", // 2: External Interrupt 1 + "TIMER1_CAPT", // 3: Timer 1 Capture Event + "TIMER1_COMP", // 4: Timer 1 Compare + "TIMER1_OVF", // 5: Timer 1 Overflow + "TIMER0_OVF", // 6: Timer 0 Overflow + "SPI_STC", // 7: SPI Serial Transfer Complete + "UART_RX", // 8: UART Receive Complete + "UART_UDRE", // 9: UART Data Register Empty + "UART_TX", // 10: UART Transmit Complete + "ADC", // 11: ADC Conversion Complete + "EE_RDY", // 12: EEPROM Ready + "ANA_COMP", // 13: Analog Comparator +}; + +const char * const vtab_at90s8515[vts_at90s8515] = { // AT90S8515, AT90S4414 + "RESET", // 0: Reset (various reasons) + "INT0", // 1: External Interrupt 0 + "INT1", // 2: External Interrupt 1 + "TIMER1_CAPT", // 3: Timer 1 Capture Event + "TIMER1_COMPA", // 4: Timer 1 Compare Match A + "TIMER1_COMPB", // 5: Timer 1 Compare Match B + "TIMER1_OVF", // 6: Timer 1 Overflow + "TIMER0_OVF", // 7: Timer 0 Overflow + "SPI_STC", // 8: SPI Serial Transfer Complete + "UART_RX", // 9: UART Receive Complete + "UART_UDRE", // 10: UART Data Register Empty + "UART_TX", // 11: UART Transmit Complete + "ANA_COMP", // 12: Analog Comparator +}; + +const char * const vtab_at90s8535[vts_at90s8535] = { // AT90S8535, AT90S4434 + "RESET", // 0: Reset (various reasons) + "INT0", // 1: External Interrupt 0 + "INT1", // 2: External Interrupt 1 + "TIMER2_COMP", // 3: Timer 2 Compare Match + "TIMER2_OVF", // 4: Timer 2 Overflow + "TIMER1_CAPT", // 5: Timer 1 Capture Event + "TIMER1_COMPA", // 6: Timer 1 Compare Match A + "TIMER1_COMPB", // 7: Timer 1 Compare Match B + "TIMER1_OVF", // 8: Timer 1 Overflow + "TIMER0_OVF", // 9: Timer 0 Overflow + "SPI_STC", // 10: SPI Serial Transfer Complete + "UART_RX", // 11: UART Receive Complete + "UART_UDRE", // 12: UART Data Register Empty + "UART_TX", // 13: UART Transmit Complete + "ADC", // 14: ADC Conversion Complete + "EE_RDY", // 15: EEPROM Ready + "ANA_COMP", // 16: Analog Comparator +}; + +const char * const vtab_ata5272[vts_ata5272] = { // ATA5272 + "RESET", // 0: Reset (various reasons) + "INT0", // 1: External Interrupt 0 + "INT1", // 2: External Interrupt 1 + "PCINT0", // 3: Pin Change Interrupt 0 + "PCINT1", // 4: Pin Change Interrupt 1 + "WDT", // 5: Watchdog Time-out + "TIMER1_CAPT", // 6: Timer 1 Capture Event + "TIMER1_COMPA", // 7: Timer 1 Compare Match A + "TIMER1_COMPB", // 8: Timer 1 Compare Match B + "TIMER1_OVF", // 9: Timer 1 Overflow + "TIMER0_COMPA", // 10: Timer 0 Compare Match A + "TIMER0_OVF", // 11: Timer 0 Overflow + "LIN_TC", // 12: LIN Transfer Complete + "LIN_ERR", // 13: LIN Error + "SPI_STC", // 14: SPI Serial Transfer Complete + "ADC", // 15: ADC Conversion Complete + "EE_RDY", // 16: EEPROM Ready + "UNUSED", // 17: not implemented on this device + "UNUSED", // 18: not implemented on this device + "USI_OVF", // 19: USI Overflow + "UNUSED", // 20: not implemented on this device + "UNUSED", // 21: not implemented on this device + "UNUSED", // 22: not implemented on this device + "UNUSED", // 23: not implemented on this device + "UNUSED", // 24: not implemented on this device + "UNUSED", // 25: not implemented on this device + "UNUSED", // 26: not implemented on this device + "UNUSED", // 27: not implemented on this device + "UNUSED", // 28: not implemented on this device + "UNUSED", // 29: not implemented on this device + "UNUSED", // 30: not implemented on this device + "UNUSED", // 31: not implemented on this device + "UNUSED", // 32: not implemented on this device + "UNUSED", // 33: not implemented on this device + "ANA_COMP", // 34: Analog Comparator + "UNUSED", // 35: not implemented on this device + "USI_START", // 36: USI Start Condition +}; + +const char * const vtab_ata5702m322[vts_ata5702m322] = { // ATA5702M322, ATA5700M322 + "RESET", // 0: Reset (various reasons) + "INT0", // 1: External Interrupt 0 + "INT1", // 2: External Interrupt 1 + "PCI0", // 3: Pin Change Interrupt Request 0 + "PCI1", // 4: Pin Change Interrupt Request 1 + "VMON", // 5: Voltage Monitoring + "AVCCR", // 6: AVCC Reset + "AVCCL", // 7: AVCC Low + "T0INT", // 8: Timer 0 Interrupt + "T1COMP", // 9: Timer 1 Compare and Match + "T1OVF", // 10: Timer 1 Overflow + "T2COMP", // 11: Timer 2 Compare and Match + "T2OVF", // 12: Timer 2 Overflow + "T3CAP", // 13: Timer 3 Capture Event + "T3COMP", // 14: Timer 3 Compare and Match + "T3OVF", // 15: Timer 3 Overflow + "T4CAP", // 16: Timer 4 Capture Event + "T4COMP", // 17: Timer 4 Compare and Match + "T4OVF", // 18: Timer 4 Overflow + "T5COMP", // 19: Timer 5 Compare and Match + "T5OVF", // 20: Timer 5 Overflow + "SPI", // 21: SPI Serial Peripheral Interface + "SRX_FIFO", // 22: SPI Receive Buffer + "STX_FIFO", // 23: SPI Transmit Buffer + "SSM", // 24: Sequencer State Machine + "DFFLR", // 25: Data FIFO Fill Level Reached + "DFOUE", // 26: Data FIFO Overflow or Underflow Error + "SFFLR", // 27: RSSI/Preamble FIFO Fill Level Reached + "SFOUE", // 28: RSSI/Preamble FIFO Overflow or Underflow Error + "TMTCF", // 29: Transmit Modulator Telegram Finished + "AES", // 30: AES Crypto Unit + "TPINT", // 31: Transponder Mode Interrupt + "TPTOERR", // 32: Transponder Timeout Error + "LFID0INT", // 33: LF Receiver Identifier 0 Interrupt + "LFID1INT", // 34: LF Receiver Identifier 1 Interrupt + "LFFEINT", // 35: LF Receiver Frame End Interrupt + "LFBCR", // 36: LF Receiver Bit Count Reached + "LFPBD", // 37: LF Receiver PreBurst Detected + "LFDE", // 38: LF Receiver Decoder Error + "LFEOT", // 39: LF Receiver End of Telegram + "LFTCOR", // 40: LF Receiver Timer Compare + "LFRSCO", // 41: LF Receiver RSSI Measurement + "LDFFLR", // 42: Data FIFO Fill Level Reached + "LDFOUE", // 43: Data FIFO Overflow or Underflow Error + "EXCM", // 44: External Input Clock Break Down + "E2CINT", // 45: EEPROM Error Correction Interrupt + "ERDY", // 46: EEPROM Ready + "SPMR", // 47: Store Program Memory Ready + "TWI1", // 48: 2-Wire Interface 1 + "SPI2", // 49: SPI 2 Serial Peripheral Interface + "TWI2", // 50: 2-Wire Interface 2 +}; + +const char * const vtab_ata5790[vts_ata5790] = { // ATA5790 + "RESET", // 0: Reset (various reasons) + "TPINT", // 1: Transponder Mode Interrupt + "INT0", // 2: External Interrupt 0 + "PCINT0", // 3: Pin Change Interrupt 0 + "PCINT1", // 4: Pin Change Interrupt 1 + "VMINT", // 5: Voltage Monitoring Interrupt + "T0INT", // 6: Timer 0 Interrupt + "LFID0INT", // 7: LF Receiver Identifier 0 Interrupt + "LFID1INT", // 8: LF Receiver Identifier 1 Interrupt + "LFFEINT", // 9: LF Receiver Frame End Interrupt + "LFDBINT", // 10: LF Receiver Data Buffer Full Interrupt + "T3CAPINT", // 11: Timer 3 Capture Event Interrupt + "T3COMINT", // 12: Timer 3 Compare and Match Interrupt + "T3OVFINT", // 13: Timer 3 Overflow Interrupt + "T2COMINT", // 14: Timer 2 Compare and Match Interrupt + "T2OVFINT", // 15: Timer 2 Overflow Interrupt + "T1INT", // 16: Timer 1 Interrupt + "SPISTC", // 17: SPI Serial Transfer Complete + "TMRXBINT", // 18: Timer Modulator Receive Buffer Interrupt + "TMTXBINT", // 19: Timer Modulator Transmit Buffer Interrupt + "TMTXCINT", // 20: Timer Modulator Transmit Complete Interrupt + "AESINT", // 21: AES Crypto Unit Interrupt + "LFRSSINT", // 22: LF Receiver RSSI Interrupt + "LFSDINT", // 23: LF Receiver Signal Detect Interrupt + "LFMDINT", // 24: LF Receiver Manchester Decoder Error Interrupt + "EXCMINT", // 25: External Input Clock Monitoring Interrupt + "EXXMINT", // 26: External XTAL Oscillator Break Down Interrupt + "RTCINT", // 27: Real Time Clock Interrupt + "EEREADY", // 28: EEPROM Ready + "SPMREADY", // 29: Store Program Memory Ready +}; + +const char * const vtab_ata5791[vts_ata5791] = { // ATA5791, ATA5790N + "RESET", // 0: Reset (various reasons) + "TPINT", // 1: Transponder Mode Interrupt + "INT0", // 2: External Interrupt 0 + "PCINT0", // 3: Pin Change Interrupt 0 + "PCINT1", // 4: Pin Change Interrupt 1 + "VMINT", // 5: Voltage Monitoring Interrupt + "T0INT", // 6: Timer 0 Interrupt + "LFID0INT", // 7: LF Receiver Identifier 0 Interrupt + "LFID1INT", // 8: LF Receiver Identifier 1 Interrupt + "LFFEINT", // 9: LF Receiver Frame End Interrupt + "LFDBINT", // 10: LF Receiver Data Buffer Full Interrupt + "T3CAPINT", // 11: Timer 3 Capture Event Interrupt + "T3COMINT", // 12: Timer 3 Compare and Match Interrupt + "T3OVFINT", // 13: Timer 3 Overflow Interrupt + "T3COM2INT", // 14: Timer 3 Compare and Match 2 Interrupt + "T2COMINT", // 15: Timer 2 Compare and Match Interrupt + "T2OVFINT", // 16: Timer 2 Overflow Interrupt + "T1INT", // 17: Timer 1 Interrupt + "SPISTC", // 18: SPI Serial Transfer Complete + "TMRXBINT", // 19: Timer Modulator Receive Buffer Interrupt + "TMTXBINT", // 20: Timer Modulator Transmit Buffer Interrupt + "TMTXCINT", // 21: Timer Modulator Transmit Complete Interrupt + "AESINT", // 22: AES Crypto Unit Interrupt + "LFRSSINT", // 23: LF Receiver RSSI Interrupt + "LFSDINT", // 24: LF Receiver Signal Detect Interrupt + "LFMDINT", // 25: LF Receiver Manchester Decoder Error Interrupt + "EXCMINT", // 26: External Input Clock Monitoring Interrupt + "EXXMINT", // 27: External XTAL Oscillator Break Down Interrupt + "RTCINT", // 28: Real Time Clock Interrupt + "EEREADY", // 29: EEPROM Ready + "SPMREADY", // 30: Store Program Memory Ready +}; + +const char * const vtab_ata5795[vts_ata5795] = { // ATA5795 + "RESET", // 0: Reset (various reasons) + "TPINT", // 1: Transponder Mode Interrupt + "INT0", // 2: External Interrupt 0 + "PCINT0", // 3: Pin Change Interrupt 0 + "PCINT1", // 4: Pin Change Interrupt 1 + "VMINT", // 5: Voltage Monitoring Interrupt + "T0INT", // 6: Timer 0 Interrupt + "T3CAPINT", // 7: Timer 3 Capture Event Interrupt + "T3COMINT", // 8: Timer 3 Compare and Match Interrupt + "T3OVFINT", // 9: Timer 3 Overflow Interrupt + "T2COMINT", // 10: Timer 2 Compare and Match Interrupt + "T2OVFINT", // 11: Timer 2 Overflow Interrupt + "T1INT", // 12: Timer 1 Interrupt + "SPISTC", // 13: SPI Serial Transfer Complete + "TMRXBINT", // 14: Timer Modulator Receive Buffer Interrupt + "TMTXBINT", // 15: Timer Modulator Transmit Buffer Interrupt + "TMTXCINT", // 16: Timer Modulator Transmit Complete Interrupt + "AESINT", // 17: AES Crypto Unit Interrupt + "EXCMINT", // 18: External Input Clock Monitoring Interrupt + "EXXMINT", // 19: External XTAL Oscillator Break Down Interrupt + "RTCINT", // 20: Real Time Clock Interrupt + "EEREADY", // 21: EEPROM Ready + "SPMREADY", // 22: Store Program Memory Ready +}; + +const char * const vtab_ata5835[vts_ata5835] = { // ATA5835, ATA5787 + "RESET", // 0: Reset (various reasons) + "INT0", // 1: External Interrupt 0 + "INT1", // 2: External Interrupt 1 + "PCI0", // 3: Pin Change Interrupt Request 0 + "PCI1", // 4: Pin Change Interrupt Request 1 + "VMON", // 5: Voltage Monitoring + "AVCCR", // 6: AVCC Reset + "AVCCL", // 7: AVCC Low + "T0INT", // 8: Timer 0 Interrupt + "T1COMP", // 9: Timer 1 Compare and Match + "T1OVF", // 10: Timer 1 Overflow + "T2COMP", // 11: Timer 2 Compare and Match + "T2OVF", // 12: Timer 2 Overflow + "T3CAP", // 13: Timer 3 Capture Event + "T3COMP", // 14: Timer 3 Compare and Match + "T3OVF", // 15: Timer 3 Overflow + "T4CAP", // 16: Timer 4 Capture Event + "T4COMP", // 17: Timer 4 Compare and Match + "T4OVF", // 18: Timer 4 Overflow + "T5COMP", // 19: Timer 5 Compare and Match + "T5OVF", // 20: Timer 5 Overflow + "SPI", // 21: SPI Serial Peripheral Interface + "SRX_FIFO", // 22: SPI Receive Buffer + "STX_FIFO", // 23: SPI Transmit Buffer + "LINTC", // 24: LIN Transfer Complete + "LINERR", // 25: LIN Error + "SSM", // 26: Sequencer State Machine + "DFFLR", // 27: Data FIFO Fill Level Reached + "DFOUE", // 28: Data FIFO Overflow or Underflow Error + "SFFLR", // 29: RSSI/Preamble FIFO Fill Level Reached + "SFOUE", // 30: RSSI/Preamble FIFO Overflow or Underflow Error + "TMTCF", // 31: Transmit Modulator Telegram Finished + "UHF_WCOA", // 32: UHF Receiver Wake Up OK on Receive Path A + "UHF_WCOB", // 33: UHF Receiver Wake Up OK on Receive Path B + "UHF_SOTA", // 34: UHF Receiver Start of Telegram OK on Receive Path A + "UHF_SOTB", // 35: UHF Receiver Start of Telegram OK on Receive Path B + "UHF_EOTA", // 36: UHF Receiver End of Telegram on Receive Path A + "UHF_EOTB", // 37: UHF Receiver End of Telegram on Receive Path B + "UHF_NBITA", // 38: UHF Receiver New Bit on Receive Path A + "UHF_NBITB", // 39: UHF Receiver New Bit on Receive Path B + "EXCM", // 40: External Input Clock Break Down + "ERDY", // 41: EEPROM Ready + "SPMR", // 42: Store Program Memory Ready + "IDFULL", // 43: IDSCAN Full +}; + +const char * const vtab_ata6289[vts_ata6289] = { // ATA6289, ATA6286, ATA6285 + "RESET", // 0: Reset (various reasons) + "INT0", // 1: External Interrupt 0 + "INT1", // 2: External Interrupt 1 + "PCINT0", // 3: Pin Change Interrupt 0 + "PCINT1", // 4: Pin Change Interrupt 1 + "PCINT2", // 5: Pin Change Interrupt 2 + "INTVM", // 6: Voltage Monitor Interrupt + "SENINT", // 7: Sensor Interface Interrupt + "INTT0", // 8: Timer 0 Interval Interrupt + "LFWP", // 9: LF-Receiver Wake-up + "T3CAP", // 10: Timer 3 Capture Event + "T3COMA", // 11: Timer 3 Compare Match A + "T3COMB", // 12: Timer 3 Compare Match B + "T3OVF", // 13: Timer 3 Overflow + "T2CAP", // 14: Timer 2 Capture Event + "T2COM", // 15: Timer 2 Compare Match + "T2OVF", // 16: Timer 2 Overflow + "SPISTC", // 17: SPI Serial Transfer Complete + "LFRXB", // 18: LF Receive Buffer + "INTT1", // 19: Timer 1 Interval Interrupt + "T2RXB", // 20: Timer 2 SSI Receive Buffer + "T2TXB", // 21: Timer 2 SSI Transmit Buffer + "T2TXC", // 22: Timer 2 SSI Transmit Complete + "LFREOB", // 23: LF-Receiver End of Burst + "EXCM", // 24: External Input Clock Break Down + "EEREADY", // 25: EEPROM Ready + "SPM_RDY", // 26: Store Program Memory Ready +}; + +const char * const vtab_ata8515[vts_ata8515] = { // ATA8515, ATA8510, ATA8215, ATA8210, ATA5833, ATA5832, ATA5831, ATA5783, ATA5782, ATA5781 + "RESET", // 0: Reset (various reasons) + "INT0", // 1: External Interrupt 0 + "INT1", // 2: External Interrupt 1 + "PCI0", // 3: Pin Change Interrupt Request 0 + "PCI1", // 4: Pin Change Interrupt Request 1 + "VMON", // 5: Voltage Monitoring + "AVCCR", // 6: AVCC Reset + "AVCCL", // 7: AVCC Low + "T0INT", // 8: Timer 0 Interrupt + "T1COMP", // 9: Timer 1 Compare and Match + "T1OVF", // 10: Timer 1 Overflow + "T2COMP", // 11: Timer 2 Compare and Match + "T2OVF", // 12: Timer 2 Overflow + "T3CAP", // 13: Timer 3 Capture Event + "T3COMP", // 14: Timer 3 Compare and Match + "T3OVF", // 15: Timer 3 Overflow + "T4CAP", // 16: Timer 4 Capture Event + "T4COMP", // 17: Timer 4 Compare and Match + "T4OVF", // 18: Timer 4 Overflow + "T5COMP", // 19: Timer 5 Compare and Match + "T5OVF", // 20: Timer 5 Overflow + "SPI", // 21: SPI Serial Peripheral Interface + "SRX_FIFO", // 22: SPI Receive Buffer + "STX_FIFO", // 23: SPI Transmit Buffer + "SSM", // 24: Sequencer State Machine + "DFFLR", // 25: Data FIFO Fill Level Reached + "DFOUE", // 26: Data FIFO Overflow or Underflow Error + "SFFLR", // 27: RSSI/Preamble FIFO Fill Level Reached + "SFOUE", // 28: RSSI/Preamble FIFO Overflow or Underflow Error + "TMTCF", // 29: Transmit Modulator Telegram Finished + "UHF_WCOB", // 30: UHF Receiver Wake Up OK on Receive Path B + "UHF_WCOA", // 31: UHF Receiver Wake Up OK on Receive Path A + "UHF_SOTB", // 32: UHF Receiver Start of Telegram OK on Receive Path B + "UHF_SOTA", // 33: UHF Receiver Start of Telegram OK on Receive Path A + "UHF_EOTB", // 34: UHF Receiver End of Telegram on Receive Path B + "UHF_EOTA", // 35: UHF Receiver End of Telegram on Receive Path A + "UHF_NBITB", // 36: UHF Receiver New Bit on Receive Path B + "UHF_NBITA", // 37: UHF Receiver New Bit on Receive Path A + "EXCM", // 38: External Input Clock Break Down + "ERDY", // 39: EEPROM Ready + "SPMR", // 40: Store Program Memory Ready + "IDFULL", // 41: IDSCAN Full +}; + +const char * const vtab_atxmega32a4[vts_atxmega32a4] = { // ATxmega32A4, ATxmega16A4 + "RESET", // 0: Reset (various reasons) + "OSC_OSCF", // 1: Oscillator Failure NMI + "PORTC_INT0", // 2: External Interrupt 0 PORT C + "PORTC_INT1", // 3: External Interrupt 1 PORT C + "PORTR_INT0", // 4: External Interrupt 0 PORT R + "PORTR_INT1", // 5: External Interrupt 1 PORT R + "DMA_CH0", // 6: DMA Channel 0 + "DMA_CH1", // 7: DMA Channel 1 + "DMA_CH2", // 8: DMA Channel 2 + "DMA_CH3", // 9: DMA Channel 3 + "RTC_OVF", // 10: RTC Overflow + "RTC_COMP", // 11: RTC Compare + "TWIC_TWIP", // 12: 2-Wire Interface C Peripheral + "TWIC_TWIM", // 13: 2-Wire Interface C Controller + "TCC0_OVF", // 14: TC C0 Overflow + "TCC0_ERR", // 15: TC C0 Error + "TCC0_CCA", // 16: TC C0 Compare or Capture A + "TCC0_CCB", // 17: TC C0 Compare or Capture B + "TCC0_CCC", // 18: TC C0 Compare or Capture C + "TCC0_CCD", // 19: TC C0 Compare or Capture D + "TCC1_OVF", // 20: TC C1 Overflow + "TCC1_ERR", // 21: TC C1 Error + "TCC1_CCA", // 22: TC C1 Compare or Capture A + "TCC1_CCB", // 23: TC C1 Compare or Capture B + "SPIC_INT", // 24: SPI C Interrupt + "USARTC0_RXC", // 25: USARTC 0 Reception Complete + "USARTC0_DRE", // 26: USARTC 0 Data Register Empty + "USARTC0_TXC", // 27: USARTC 0 Transmission Complete + "USARTC1_RXC", // 28: USARTC 1 Reception Complete + "USARTC1_DRE", // 29: USARTC 1 Data Register Empty + "USARTC1_TXC", // 30: USARTC 1 Transmission Complete + "AES_INT", // 31: AES Interrupt + "NVM_EE", // 32: NVM EEPROM + "NVM_SPM", // 33: NVM SPM + "PORTB_INT0", // 34: External Interrupt 0 PORT B + "PORTB_INT1", // 35: External Interrupt 1 PORT B + "UNUSED", // 36: not implemented on this device + "UNUSED", // 37: not implemented on this device + "UNUSED", // 38: not implemented on this device + "UNUSED", // 39: not implemented on this device + "UNUSED", // 40: not implemented on this device + "UNUSED", // 41: not implemented on this device + "UNUSED", // 42: not implemented on this device + "PORTE_INT0", // 43: External Interrupt 0 PORT E + "PORTE_INT1", // 44: External Interrupt 1 PORT E + "TWIE_TWIP", // 45: 2-Wire Interface E Peripheral + "TWIE_TWIM", // 46: 2-Wire Interface E Controller + "TCE0_OVF", // 47: TC E0 Overflow + "TCE0_ERR", // 48: TC E0 Error + "TCE0_CCA", // 49: TC E0 Compare or Capture A + "TCE0_CCB", // 50: TC E0 Compare or Capture B + "TCE0_CCC", // 51: TC E0 Compare or Capture C + "TCE0_CCD", // 52: TC E0 Compare or Capture D + "HIRESE_OVF", // 53: High-resolution Extension Overflow + "HIRESE_ERR", // 54: High-resolution Extension Error + "HIRESE_CCA", // 55: High-resolution Extension Compare and Capture A + "HIRESE_CCB", // 56: High-resolution Extension Compare and Capture B + "UNUSED", // 57: not implemented on this device + "USARTE0_RXC", // 58: USARTE 0 Reception Complete + "USARTE0_DRE", // 59: USARTE 0 Data Register Empty + "USARTE0_TXC", // 60: USARTE 0 Transmission Complete + "UNUSED", // 61: not implemented on this device + "UNUSED", // 62: not implemented on this device + "UNUSED", // 63: not implemented on this device + "PORTD_INT0", // 64: External Interrupt 0 PORT D + "PORTD_INT1", // 65: External Interrupt 1 PORT D + "PORTA_INT0", // 66: External Interrupt 0 PORT A + "PORTA_INT1", // 67: External Interrupt 1 PORT A + "ACA_AC0", // 68: ACA AC 0 Interrupt + "ACA_AC1", // 69: ACA AC 1 Interrupt + "ACA_ACW", // 70: ACA AC Window Mode + "ADCA_CH0", // 71: ADCA Interrupt 0 + "ADCA_CH1", // 72: ADCA Interrupt 1 + "ADCA_CH2", // 73: ADCA Interrupt 2 + "ADCA_CH3", // 74: ADCA Interrupt 3 + "UNUSED", // 75: not implemented on this device + "UNUSED", // 76: not implemented on this device + "TCD0_OVF", // 77: TC D0 Overflow + "TCD0_ERR", // 78: TC D0 Error + "TCD0_CCA", // 79: TC D0 Compare or Capture A + "TCD0_CCB", // 80: TC D0 Compare or Capture B + "TCD0_CCC", // 81: TC D0 Compare or Capture C + "TCD0_CCD", // 82: TC D0 Compare or Capture D + "TCD1_OVF", // 83: TC D1 Overflow + "TCD1_ERR", // 84: TC D1 Error + "TCD1_CCA", // 85: TC D1 Compare or Capture A + "TCD1_CCB", // 86: TC D1 Compare or Capture B + "SPID_INT", // 87: SPI D Interrupt + "USARTD0_RXC", // 88: USARTD 0 Reception Complete + "USARTD0_DRE", // 89: USARTD 0 Data Register Empty + "USARTD0_TXC", // 90: USARTD 0 Transmission Complete + "USARTD1_RXC", // 91: USARTD 1 Reception Complete + "USARTD1_DRE", // 92: USARTD 1 Data Register Empty + "USARTD1_TXC", // 93: USARTD 1 Transmission Complete +}; + +const char * const vtab_atxmega32c4[vts_atxmega32c4] = { // ATxmega32C4, ATxmega16C4 + "RESET", // 0: Reset (various reasons) + "OSC_OSCF", // 1: Oscillator Failure NMI + "PORTC_INT0", // 2: External Interrupt 0 PORT C + "PORTC_INT1", // 3: External Interrupt 1 PORT C + "PORTR_INT0", // 4: External Interrupt 0 PORT R + "PORTR_INT1", // 5: External Interrupt 1 PORT R + "UNUSED", // 6: not implemented on this device + "UNUSED", // 7: not implemented on this device + "UNUSED", // 8: not implemented on this device + "UNUSED", // 9: not implemented on this device + "RTC_OVF", // 10: RTC Overflow + "RTC_COMP", // 11: RTC Compare + "TWIC_TWIP", // 12: 2-Wire Interface C Peripheral + "TWIC_TWIM", // 13: 2-Wire Interface C Controller + "TCC0_OVF/TCC2_LUNF", // 14: TC C0 Overflow/TC C2 Low Byte Underflow + "TCC0_ERR/TCC2_HUNF", // 15: TC C0 Error/TC C2 High Byte Underflow + "TCC0_CCA/TCC2_LCMPA", // 16: TC C0 Compare or Capture A/TC C2 Low Byte Compare A + "TCC0_CCB/TCC2_LCMPB", // 17: TC C0 Compare or Capture B/TC C2 Low Byte Compare B + "TCC0_CCC/TCC2_LCMPC", // 18: TC C0 Compare or Capture C/TC C2 Low Byte Compare C + "TCC0_CCD/TCC2_LCMPD", // 19: TC C0 Compare or Capture D/TC C2 Low Byte Compare D + "TCC1_OVF", // 20: TC C1 Overflow + "TCC1_ERR", // 21: TC C1 Error + "TCC1_CCA", // 22: TC C1 Compare or Capture A + "TCC1_CCB", // 23: TC C1 Compare or Capture B + "SPIC_INT", // 24: SPI C Interrupt + "USARTC0_RXC", // 25: USARTC 0 Reception Complete + "USARTC0_DRE", // 26: USARTC 0 Data Register Empty + "USARTC0_TXC", // 27: USARTC 0 Transmission Complete + "USARTC1_RXC", // 28: USARTC 1 Reception Complete + "USARTC1_DRE", // 29: USARTC 1 Data Register Empty + "USARTC1_TXC", // 30: USARTC 1 Transmission Complete + "UNUSED", // 31: not implemented on this device + "NVM_EE", // 32: NVM EEPROM + "NVM_SPM", // 33: NVM SPM + "PORTB_INT0", // 34: External Interrupt 0 PORT B + "PORTB_INT1", // 35: External Interrupt 1 PORT B + "UNUSED", // 36: not implemented on this device + "UNUSED", // 37: not implemented on this device + "UNUSED", // 38: not implemented on this device + "UNUSED", // 39: not implemented on this device + "UNUSED", // 40: not implemented on this device + "UNUSED", // 41: not implemented on this device + "UNUSED", // 42: not implemented on this device + "PORTE_INT0", // 43: External Interrupt 0 PORT E + "PORTE_INT1", // 44: External Interrupt 1 PORT E + "TWIE_TWIP", // 45: 2-Wire Interface E Peripheral + "TWIE_TWIM", // 46: 2-Wire Interface E Controller + "TCE0_OVF", // 47: TC E0 Overflow + "TCE0_ERR", // 48: TC E0 Error + "TCE0_CCA", // 49: TC E0 Compare or Capture A + "TCE0_CCB", // 50: TC E0 Compare or Capture B + "TCE0_CCC", // 51: TC E0 Compare or Capture C + "TCE0_CCD", // 52: TC E0 Compare or Capture D + "UNUSED", // 53: not implemented on this device + "UNUSED", // 54: not implemented on this device + "UNUSED", // 55: not implemented on this device + "UNUSED", // 56: not implemented on this device + "UNUSED", // 57: not implemented on this device + "UNUSED", // 58: not implemented on this device + "UNUSED", // 59: not implemented on this device + "UNUSED", // 60: not implemented on this device + "UNUSED", // 61: not implemented on this device + "UNUSED", // 62: not implemented on this device + "UNUSED", // 63: not implemented on this device + "PORTD_INT0", // 64: External Interrupt 0 PORT D + "PORTD_INT1", // 65: External Interrupt 1 PORT D + "PORTA_INT0", // 66: External Interrupt 0 PORT A + "PORTA_INT1", // 67: External Interrupt 1 PORT A + "ACA_AC0", // 68: ACA AC 0 Interrupt + "ACA_AC1", // 69: ACA AC 1 Interrupt + "ACA_ACW", // 70: ACA AC Window Mode + "ADCA_CH0", // 71: ADCA Interrupt 0 + "UNUSED", // 72: not implemented on this device + "UNUSED", // 73: not implemented on this device + "UNUSED", // 74: not implemented on this device + "UNUSED", // 75: not implemented on this device + "UNUSED", // 76: not implemented on this device + "TCD0_OVF/TCD2_LUNF", // 77: TC D0 Overflow/TC D2 Low Byte Underflow + "TCD0_ERR/TCD2_HUNF", // 78: TC D0 Error/TC D2 High Byte Underflow + "TCD0_CCA/TCD2_LCMPA", // 79: TC D0 Compare or Capture A/TC D2 Low Byte Compare A + "TCD0_CCB/TCD2_LCMPB", // 80: TC D0 Compare or Capture B/TC D2 Low Byte Compare B + "TCD0_CCC/TCD2_LCMPC", // 81: TC D0 Compare or Capture C/TC D2 Low Byte Compare C + "TCD0_CCD/TCD2_LCMPD", // 82: TC D0 Compare or Capture D/TC D2 Low Byte Compare D + "UNUSED", // 83: not implemented on this device + "UNUSED", // 84: not implemented on this device + "UNUSED", // 85: not implemented on this device + "UNUSED", // 86: not implemented on this device + "SPID_INT", // 87: SPI D Interrupt + "USARTD0_RXC", // 88: USARTD 0 Reception Complete + "USARTD0_DRE", // 89: USARTD 0 Data Register Empty + "USARTD0_TXC", // 90: USARTD 0 Transmission Complete + "UNUSED", // 91: not implemented on this device + "UNUSED", // 92: not implemented on this device + "UNUSED", // 93: not implemented on this device + "UNUSED", // 94: not implemented on this device + "UNUSED", // 95: not implemented on this device + "UNUSED", // 96: not implemented on this device + "UNUSED", // 97: not implemented on this device + "UNUSED", // 98: not implemented on this device + "UNUSED", // 99: not implemented on this device + "UNUSED", // 100: not implemented on this device + "UNUSED", // 101: not implemented on this device + "UNUSED", // 102: not implemented on this device + "UNUSED", // 103: not implemented on this device + "UNUSED", // 104: not implemented on this device + "UNUSED", // 105: not implemented on this device + "UNUSED", // 106: not implemented on this device + "UNUSED", // 107: not implemented on this device + "UNUSED", // 108: not implemented on this device + "UNUSED", // 109: not implemented on this device + "UNUSED", // 110: not implemented on this device + "UNUSED", // 111: not implemented on this device + "UNUSED", // 112: not implemented on this device + "UNUSED", // 113: not implemented on this device + "UNUSED", // 114: not implemented on this device + "UNUSED", // 115: not implemented on this device + "UNUSED", // 116: not implemented on this device + "UNUSED", // 117: not implemented on this device + "UNUSED", // 118: not implemented on this device + "UNUSED", // 119: not implemented on this device + "UNUSED", // 120: not implemented on this device + "UNUSED", // 121: not implemented on this device + "UNUSED", // 122: not implemented on this device + "UNUSED", // 123: not implemented on this device + "UNUSED", // 124: not implemented on this device + "USB_BUSEVENT", // 125: SOF, Suspend, Resume, Reset Bus Event Interrupts, CRC, Underflow, Overflow or Stall Error + "USB_TRNCOMPL", // 126: USB Transaction Complete +}; + +const char * const vtab_atxmega32d4[vts_atxmega32d4] = { // ATxmega32D4, ATxmega16D4 + "RESET", // 0: Reset (various reasons) + "OSC_OSCF", // 1: Oscillator Failure NMI + "PORTC_INT0", // 2: External Interrupt 0 PORT C + "PORTC_INT1", // 3: External Interrupt 1 PORT C + "PORTR_INT0", // 4: External Interrupt 0 PORT R + "PORTR_INT1", // 5: External Interrupt 1 PORT R + "UNUSED", // 6: not implemented on this device + "UNUSED", // 7: not implemented on this device + "UNUSED", // 8: not implemented on this device + "UNUSED", // 9: not implemented on this device + "RTC_OVF", // 10: RTC Overflow + "RTC_COMP", // 11: RTC Compare + "TWIC_TWIP", // 12: 2-Wire Interface C Peripheral + "TWIC_TWIM", // 13: 2-Wire Interface C Controller + "TCC0_OVF/TCC2_LUNF", // 14: TC C0 Overflow/TC C2 Low Byte Underflow + "TCC0_ERR/TCC2_HUNF", // 15: TC C0 Error/TC C2 High Byte Underflow + "TCC0_CCA/TCC2_LCMPA", // 16: TC C0 Compare or Capture A/TC C2 Low Byte Compare A + "TCC0_CCB/TCC2_LCMPB", // 17: TC C0 Compare or Capture B/TC C2 Low Byte Compare B + "TCC0_CCC/TCC2_LCMPC", // 18: TC C0 Compare or Capture C/TC C2 Low Byte Compare C + "TCC0_CCD/TCC2_LCMPD", // 19: TC C0 Compare or Capture D/TC C2 Low Byte Compare D + "TCC1_OVF", // 20: TC C1 Overflow + "TCC1_ERR", // 21: TC C1 Error + "TCC1_CCA", // 22: TC C1 Compare or Capture A + "TCC1_CCB", // 23: TC C1 Compare or Capture B + "SPIC_INT", // 24: SPI C Interrupt + "USARTC0_RXC", // 25: USARTC 0 Reception Complete + "USARTC0_DRE", // 26: USARTC 0 Data Register Empty + "USARTC0_TXC", // 27: USARTC 0 Transmission Complete + "UNUSED", // 28: not implemented on this device + "UNUSED", // 29: not implemented on this device + "UNUSED", // 30: not implemented on this device + "UNUSED", // 31: not implemented on this device + "NVM_EE", // 32: NVM EEPROM + "NVM_SPM", // 33: NVM SPM + "PORTB_INT0", // 34: External Interrupt 0 PORT B + "PORTB_INT1", // 35: External Interrupt 1 PORT B + "UNUSED", // 36: not implemented on this device + "UNUSED", // 37: not implemented on this device + "UNUSED", // 38: not implemented on this device + "UNUSED", // 39: not implemented on this device + "UNUSED", // 40: not implemented on this device + "UNUSED", // 41: not implemented on this device + "UNUSED", // 42: not implemented on this device + "PORTE_INT0", // 43: External Interrupt 0 PORT E + "PORTE_INT1", // 44: External Interrupt 1 PORT E + "TWIE_TWIP", // 45: 2-Wire Interface E Peripheral + "TWIE_TWIM", // 46: 2-Wire Interface E Controller + "TCE0_OVF", // 47: TC E0 Overflow + "TCE0_ERR", // 48: TC E0 Error + "TCE0_CCA", // 49: TC E0 Compare or Capture A + "TCE0_CCB", // 50: TC E0 Compare or Capture B + "TCE0_CCC", // 51: TC E0 Compare or Capture C + "TCE0_CCD", // 52: TC E0 Compare or Capture D + "UNUSED", // 53: not implemented on this device + "UNUSED", // 54: not implemented on this device + "UNUSED", // 55: not implemented on this device + "UNUSED", // 56: not implemented on this device + "UNUSED", // 57: not implemented on this device + "UNUSED", // 58: not implemented on this device + "UNUSED", // 59: not implemented on this device + "UNUSED", // 60: not implemented on this device + "UNUSED", // 61: not implemented on this device + "UNUSED", // 62: not implemented on this device + "UNUSED", // 63: not implemented on this device + "PORTD_INT0", // 64: External Interrupt 0 PORT D + "PORTD_INT1", // 65: External Interrupt 1 PORT D + "PORTA_INT0", // 66: External Interrupt 0 PORT A + "PORTA_INT1", // 67: External Interrupt 1 PORT A + "ACA_AC0", // 68: ACA AC 0 Interrupt + "ACA_AC1", // 69: ACA AC 1 Interrupt + "ACA_ACW", // 70: ACA AC Window Mode + "ADCA_CH0", // 71: ADCA Interrupt 0 + "ADCA_CH1", // 72: ADCA Interrupt 1 + "ADCA_CH2", // 73: ADCA Interrupt 2 + "ADCA_CH3", // 74: ADCA Interrupt 3 + "UNUSED", // 75: not implemented on this device + "UNUSED", // 76: not implemented on this device + "TCD0_OVF", // 77: TC D0 Overflow + "TCD0_ERR", // 78: TC D0 Error + "TCD0_CCA", // 79: TC D0 Compare or Capture A + "TCD0_CCB", // 80: TC D0 Compare or Capture B + "TCD0_CCC", // 81: TC D0 Compare or Capture C + "TCD0_CCD", // 82: TC D0 Compare or Capture D + "UNUSED", // 83: not implemented on this device + "UNUSED", // 84: not implemented on this device + "UNUSED", // 85: not implemented on this device + "UNUSED", // 86: not implemented on this device + "SPID_INT", // 87: SPI D Interrupt + "USARTD0_RXC", // 88: USARTD 0 Reception Complete + "USARTD0_DRE", // 89: USARTD 0 Data Register Empty + "USARTD0_TXC", // 90: USARTD 0 Transmission Complete +}; + +const char * const vtab_atxmega32e5[vts_atxmega32e5] = { // ATxmega32E5, ATxmega16E5, ATxmega8E5 + "RESET", // 0: Reset (various reasons) + "OSC_OSCF", // 1: Oscillator Failure NMI + "PORTR_INT", // 2: External Interrupt PORT R + "EDMA_CH0", // 3: External DMA Channel 0 + "EDMA_CH1", // 4: External DMA Channel 1 + "EDMA_CH2", // 5: External DMA Channel 2 + "EDMA_CH3", // 6: External DMA Channel 3 + "RTC_OVF", // 7: RTC Overflow + "RTC_COMP", // 8: RTC Compare + "PORTC_INT", // 9: External Interrupt PORT C + "TWIC_TWIP", // 10: 2-Wire Interface C Peripheral + "TWIC_TWIM", // 11: 2-Wire Interface C Controller + "TCC4_OVF", // 12: TC C4 Overflow + "TCC4_ERR", // 13: TC C4 Error + "TCC4_CCA", // 14: TC C4 Compare or Capture A + "TCC4_CCB", // 15: TC C4 Compare or Capture B + "TCC4_CCC", // 16: TC C4 Compare or Capture C + "TCC4_CCD", // 17: TC C4 Compare or Capture D + "TCC5_OVF", // 18: TC C5 Overflow + "TCC5_ERR", // 19: TC C5 Error + "TCC5_CCA", // 20: TC C5 Compare or Capture A + "TCC5_CCB", // 21: TC C5 Compare or Capture B + "SPIC_INT", // 22: SPI C Interrupt + "USARTC0_RXC", // 23: USARTC 0 Reception Complete + "USARTC0_DRE", // 24: USARTC 0 Data Register Empty + "USARTC0_TXC", // 25: USARTC 0 Transmission Complete + "NVM_EE", // 26: NVM EEPROM + "NVM_SPM", // 27: NVM SPM + "XCL_UNF", // 28: XMEGA Custom Logic Underflow + "XCL_CC", // 29: XMEGA Custom Logic Compare or Capture + "PORTA_INT", // 30: External Interrupt PORT A + "ACA_AC0", // 31: ACA AC 0 Interrupt + "ACA_AC1", // 32: ACA AC 1 Interrupt + "ACA_ACW", // 33: ACA AC Window Mode + "ADCA_CH0", // 34: ADCA Interrupt 0 + "PORTD_INT", // 35: External Interrupt PORT D + "TCD5_OVF", // 36: TC D5 Overflow + "TCD5_ERR", // 37: TC D5 Error + "TCD5_CCA", // 38: TC D5 Compare or Capture A + "TCD5_CCB", // 39: TC D5 Compare or Capture B + "USARTD0_RXC", // 40: USARTD 0 Reception Complete + "USARTD0_DRE", // 41: USARTD 0 Data Register Empty + "USARTD0_TXC", // 42: USARTD 0 Transmission Complete +}; + +const char * const vtab_atxmega128a1[vts_atxmega128a1] = { // ATxmega128A1, ATxmega64A1 + "RESET", // 0: Reset (various reasons) + "OSC_OSCF", // 1: Oscillator Failure NMI + "PORTC_INT0", // 2: External Interrupt 0 PORT C + "PORTC_INT1", // 3: External Interrupt 1 PORT C + "PORTR_INT0", // 4: External Interrupt 0 PORT R + "PORTR_INT1", // 5: External Interrupt 1 PORT R + "DMA_CH0", // 6: DMA Channel 0 + "DMA_CH1", // 7: DMA Channel 1 + "DMA_CH2", // 8: DMA Channel 2 + "DMA_CH3", // 9: DMA Channel 3 + "RTC_OVF", // 10: RTC Overflow + "RTC_COMP", // 11: RTC Compare + "TWIC_TWIP", // 12: 2-Wire Interface C Peripheral + "TWIC_TWIM", // 13: 2-Wire Interface C Controller + "TCC0_OVF", // 14: TC C0 Overflow + "TCC0_ERR", // 15: TC C0 Error + "TCC0_CCA", // 16: TC C0 Compare or Capture A + "TCC0_CCB", // 17: TC C0 Compare or Capture B + "TCC0_CCC", // 18: TC C0 Compare or Capture C + "TCC0_CCD", // 19: TC C0 Compare or Capture D + "TCC1_OVF", // 20: TC C1 Overflow + "TCC1_ERR", // 21: TC C1 Error + "TCC1_CCA", // 22: TC C1 Compare or Capture A + "TCC1_CCB", // 23: TC C1 Compare or Capture B + "SPIC_INT", // 24: SPI C Interrupt + "USARTC0_RXC", // 25: USARTC 0 Reception Complete + "USARTC0_DRE", // 26: USARTC 0 Data Register Empty + "USARTC0_TXC", // 27: USARTC 0 Transmission Complete + "USARTC1_RXC", // 28: USARTC 1 Reception Complete + "USARTC1_DRE", // 29: USARTC 1 Data Register Empty + "USARTC1_TXC", // 30: USARTC 1 Transmission Complete + "AES_INT", // 31: AES Interrupt + "NVM_EE", // 32: NVM EEPROM + "NVM_SPM", // 33: NVM SPM + "PORTB_INT0", // 34: External Interrupt 0 PORT B + "PORTB_INT1", // 35: External Interrupt 1 PORT B + "ACB_AC0", // 36: ACB AC 0 Interrupt + "ACB_AC1", // 37: ACB AC 1 Interrupt + "ACB_ACW", // 38: ACB AC Window Mode + "ADCB_CH0", // 39: ADCB Interrupt 0 + "ADCB_CH1", // 40: ADCB Interrupt 1 + "ADCB_CH2", // 41: ADCB Interrupt 2 + "ADCB_CH3", // 42: ADCB Interrupt 3 + "PORTE_INT0", // 43: External Interrupt 0 PORT E + "PORTE_INT1", // 44: External Interrupt 1 PORT E + "TWIE_TWIP", // 45: 2-Wire Interface E Peripheral + "TWIE_TWIM", // 46: 2-Wire Interface E Controller + "TCE0_OVF", // 47: TC E0 Overflow + "TCE0_ERR", // 48: TC E0 Error + "TCE0_CCA", // 49: TC E0 Compare or Capture A + "TCE0_CCB", // 50: TC E0 Compare or Capture B + "TCE0_CCC", // 51: TC E0 Compare or Capture C + "TCE0_CCD", // 52: TC E0 Compare or Capture D + "TCE1_OVF", // 53: TC E1 Overflow + "TCE1_ERR", // 54: TC E1 Error + "TCE1_CCA", // 55: TC E1 Compare or Capture A + "TCE1_CCB", // 56: TC E1 Compare or Capture B + "SPIE_INT", // 57: SPI E Interrupt + "USARTE0_RXC", // 58: USARTE 0 Reception Complete + "USARTE0_DRE", // 59: USARTE 0 Data Register Empty + "USARTE0_TXC", // 60: USARTE 0 Transmission Complete + "USARTE1_RXC", // 61: USARTE 1 Reception Complete + "USARTE1_DRE", // 62: USARTE 1 Data Register Empty + "USARTE1_TXC", // 63: USARTE 1 Transmission Complete + "PORTD_INT0", // 64: External Interrupt 0 PORT D + "PORTD_INT1", // 65: External Interrupt 1 PORT D + "PORTA_INT0", // 66: External Interrupt 0 PORT A + "PORTA_INT1", // 67: External Interrupt 1 PORT A + "ACA_AC0", // 68: ACA AC 0 Interrupt + "ACA_AC1", // 69: ACA AC 1 Interrupt + "ACA_ACW", // 70: ACA AC Window Mode + "ADCA_CH0", // 71: ADCA Interrupt 0 + "ADCA_CH1", // 72: ADCA Interrupt 1 + "ADCA_CH2", // 73: ADCA Interrupt 2 + "ADCA_CH3", // 74: ADCA Interrupt 3 + "TWID_TWIP", // 75: 2-Wire Interface D Peripheral + "TWID_TWIM", // 76: 2-Wire Interface D Controller + "TCD0_OVF", // 77: TC D0 Overflow + "TCD0_ERR", // 78: TC D0 Error + "TCD0_CCA", // 79: TC D0 Compare or Capture A + "TCD0_CCB", // 80: TC D0 Compare or Capture B + "TCD0_CCC", // 81: TC D0 Compare or Capture C + "TCD0_CCD", // 82: TC D0 Compare or Capture D + "TCD1_OVF", // 83: TC D1 Overflow + "TCD1_ERR", // 84: TC D1 Error + "TCD1_CCA", // 85: TC D1 Compare or Capture A + "TCD1_CCB", // 86: TC D1 Compare or Capture B + "SPID_INT", // 87: SPI D Interrupt + "USARTD0_RXC", // 88: USARTD 0 Reception Complete + "USARTD0_DRE", // 89: USARTD 0 Data Register Empty + "USARTD0_TXC", // 90: USARTD 0 Transmission Complete + "USARTD1_RXC", // 91: USARTD 1 Reception Complete + "USARTD1_DRE", // 92: USARTD 1 Data Register Empty + "USARTD1_TXC", // 93: USARTD 1 Transmission Complete + "PORTQ_INT0", // 94: External Interrupt 0 PORT Q + "PORTQ_INT1", // 95: External Interrupt 1 PORT Q + "PORTH_INT0", // 96: External Interrupt 0 PORT H + "PORTH_INT1", // 97: External Interrupt 1 PORT H + "PORTJ_INT0", // 98: External Interrupt 0 PORT J + "PORTJ_INT1", // 99: External Interrupt 1 PORT J + "PORTK_INT0", // 100: External Interrupt 0 PORT K + "PORTK_INT1", // 101: External Interrupt 1 PORT K + "UNUSED", // 102: not implemented on this device + "UNUSED", // 103: not implemented on this device + "PORTF_INT0", // 104: External Interrupt 0 PORT F + "PORTF_INT1", // 105: External Interrupt 1 PORT F + "TWIF_TWIP", // 106: 2-Wire Interface F Peripheral + "TWIF_TWIM", // 107: 2-Wire Interface F Controller + "TCF0_OVF", // 108: TC F0 Overflow + "TCF0_ERR", // 109: TC F0 Error + "TCF0_CCA", // 110: TC F0 Compare or Capture A + "TCF0_CCB", // 111: TC F0 Compare or Capture B + "TCF0_CCC", // 112: TC F0 Compare or Capture C + "TCF0_CCD", // 113: TC F0 Compare or Capture D + "TCF1_OVF", // 114: TC F1 Overflow + "TCF1_ERR", // 115: TC F1 Error + "TCF1_CCA", // 116: TC F1 Compare or Capture A + "TCF1_CCB", // 117: TC F1 Compare or Capture B + "SPIF_INT", // 118: SPI F Interrupt + "USARTF0_RXC", // 119: USARTF 0 Reception Complete + "USARTF0_DRE", // 120: USARTF 0 Data Register Empty + "USARTF0_TXC", // 121: USARTF 0 Transmission Complete + "USARTF1_RXC", // 122: USARTF 1 Reception Complete + "USARTF1_DRE", // 123: USARTF 1 Data Register Empty + "USARTF1_TXC", // 124: USARTF 1 Transmission Complete +}; + +const char * const vtab_atxmega128a1u[vts_atxmega128a1u] = { // ATxmega128A1U, ATxmega64A1U + "RESET", // 0: Reset (various reasons) + "OSC_OSCF", // 1: Oscillator Failure NMI + "PORTC_INT0", // 2: External Interrupt 0 PORT C + "PORTC_INT1", // 3: External Interrupt 1 PORT C + "PORTR_INT0", // 4: External Interrupt 0 PORT R + "PORTR_INT1", // 5: External Interrupt 1 PORT R + "DMA_CH0", // 6: DMA Channel 0 + "DMA_CH1", // 7: DMA Channel 1 + "DMA_CH2", // 8: DMA Channel 2 + "DMA_CH3", // 9: DMA Channel 3 + "RTC_OVF", // 10: RTC Overflow + "RTC_COMP", // 11: RTC Compare + "TWIC_TWIP", // 12: 2-Wire Interface C Peripheral + "TWIC_TWIM", // 13: 2-Wire Interface C Controller + "TCC0_OVF/TCC2_LUNF", // 14: TC C0 Overflow/TC C2 Low Byte Underflow + "TCC0_ERR/TCC2_HUNF", // 15: TC C0 Error/TC C2 High Byte Underflow + "TCC0_CCA/TCC2_LCMPA", // 16: TC C0 Compare or Capture A/TC C2 Low Byte Compare A + "TCC0_CCB/TCC2_LCMPB", // 17: TC C0 Compare or Capture B/TC C2 Low Byte Compare B + "TCC0_CCC/TCC2_LCMPC", // 18: TC C0 Compare or Capture C/TC C2 Low Byte Compare C + "TCC0_CCD/TCC2_LCMPD", // 19: TC C0 Compare or Capture D/TC C2 Low Byte Compare D + "TCC1_OVF", // 20: TC C1 Overflow + "TCC1_ERR", // 21: TC C1 Error + "TCC1_CCA", // 22: TC C1 Compare or Capture A + "TCC1_CCB", // 23: TC C1 Compare or Capture B + "SPIC_INT", // 24: SPI C Interrupt + "USARTC0_RXC", // 25: USARTC 0 Reception Complete + "USARTC0_DRE", // 26: USARTC 0 Data Register Empty + "USARTC0_TXC", // 27: USARTC 0 Transmission Complete + "USARTC1_RXC", // 28: USARTC 1 Reception Complete + "USARTC1_DRE", // 29: USARTC 1 Data Register Empty + "USARTC1_TXC", // 30: USARTC 1 Transmission Complete + "AES_INT", // 31: AES Interrupt + "NVM_EE", // 32: NVM EEPROM + "NVM_SPM", // 33: NVM SPM + "PORTB_INT0", // 34: External Interrupt 0 PORT B + "PORTB_INT1", // 35: External Interrupt 1 PORT B + "ACB_AC0", // 36: ACB AC 0 Interrupt + "ACB_AC1", // 37: ACB AC 1 Interrupt + "ACB_ACW", // 38: ACB AC Window Mode + "ADCB_CH0", // 39: ADCB Interrupt 0 + "ADCB_CH1", // 40: ADCB Interrupt 1 + "ADCB_CH2", // 41: ADCB Interrupt 2 + "ADCB_CH3", // 42: ADCB Interrupt 3 + "PORTE_INT0", // 43: External Interrupt 0 PORT E + "PORTE_INT1", // 44: External Interrupt 1 PORT E + "TWIE_TWIP", // 45: 2-Wire Interface E Peripheral + "TWIE_TWIM", // 46: 2-Wire Interface E Controller + "TCE0_OVF/TCE2_LUNF", // 47: TC E0 Overflow/TC E2 Low Byte Underflow + "TCE0_ERR/TCE2_HUNF", // 48: TC E0 Error/TC E2 High Byte Underflow + "TCE0_CCA/TCE2_LCMPA", // 49: TC E0 Compare or Capture A/TC E2 Low Byte Compare A + "TCE0_CCB/TCE2_LCMPB", // 50: TC E0 Compare or Capture B/TC E2 Low Byte Compare B + "TCE0_CCC/TCE2_LCMPC", // 51: TC E0 Compare or Capture C/TC E2 Low Byte Compare C + "TCE0_CCD/TCE2_LCMPD", // 52: TC E0 Compare or Capture D/TC E2 Low Byte Compare D + "TCE1_OVF", // 53: TC E1 Overflow + "TCE1_ERR", // 54: TC E1 Error + "TCE1_CCA", // 55: TC E1 Compare or Capture A + "TCE1_CCB", // 56: TC E1 Compare or Capture B + "SPIE_INT", // 57: SPI E Interrupt + "USARTE0_RXC", // 58: USARTE 0 Reception Complete + "USARTE0_DRE", // 59: USARTE 0 Data Register Empty + "USARTE0_TXC", // 60: USARTE 0 Transmission Complete + "USARTE1_RXC", // 61: USARTE 1 Reception Complete + "USARTE1_DRE", // 62: USARTE 1 Data Register Empty + "USARTE1_TXC", // 63: USARTE 1 Transmission Complete + "PORTD_INT0", // 64: External Interrupt 0 PORT D + "PORTD_INT1", // 65: External Interrupt 1 PORT D + "PORTA_INT0", // 66: External Interrupt 0 PORT A + "PORTA_INT1", // 67: External Interrupt 1 PORT A + "ACA_AC0", // 68: ACA AC 0 Interrupt + "ACA_AC1", // 69: ACA AC 1 Interrupt + "ACA_ACW", // 70: ACA AC Window Mode + "ADCA_CH0", // 71: ADCA Interrupt 0 + "ADCA_CH1", // 72: ADCA Interrupt 1 + "ADCA_CH2", // 73: ADCA Interrupt 2 + "ADCA_CH3", // 74: ADCA Interrupt 3 + "TWID_TWIP", // 75: 2-Wire Interface D Peripheral + "TWID_TWIM", // 76: 2-Wire Interface D Controller + "TCD0_OVF/TCD2_LUNF", // 77: TC D0 Overflow/TC D2 Low Byte Underflow + "TCD0_ERR/TCD2_HUNF", // 78: TC D0 Error/TC D2 High Byte Underflow + "TCD0_CCA/TCD2_LCMPA", // 79: TC D0 Compare or Capture A/TC D2 Low Byte Compare A + "TCD0_CCB/TCD2_LCMPB", // 80: TC D0 Compare or Capture B/TC D2 Low Byte Compare B + "TCD0_CCC/TCD2_LCMPC", // 81: TC D0 Compare or Capture C/TC D2 Low Byte Compare C + "TCD0_CCD/TCD2_LCMPD", // 82: TC D0 Compare or Capture D/TC D2 Low Byte Compare D + "TCD1_OVF", // 83: TC D1 Overflow + "TCD1_ERR", // 84: TC D1 Error + "TCD1_CCA", // 85: TC D1 Compare or Capture A + "TCD1_CCB", // 86: TC D1 Compare or Capture B + "SPID_INT", // 87: SPI D Interrupt + "USARTD0_RXC", // 88: USARTD 0 Reception Complete + "USARTD0_DRE", // 89: USARTD 0 Data Register Empty + "USARTD0_TXC", // 90: USARTD 0 Transmission Complete + "USARTD1_RXC", // 91: USARTD 1 Reception Complete + "USARTD1_DRE", // 92: USARTD 1 Data Register Empty + "USARTD1_TXC", // 93: USARTD 1 Transmission Complete + "PORTQ_INT0", // 94: External Interrupt 0 PORT Q + "PORTQ_INT1", // 95: External Interrupt 1 PORT Q + "PORTH_INT0", // 96: External Interrupt 0 PORT H + "PORTH_INT1", // 97: External Interrupt 1 PORT H + "PORTJ_INT0", // 98: External Interrupt 0 PORT J + "PORTJ_INT1", // 99: External Interrupt 1 PORT J + "PORTK_INT0", // 100: External Interrupt 0 PORT K + "PORTK_INT1", // 101: External Interrupt 1 PORT K + "UNUSED", // 102: not implemented on this device + "UNUSED", // 103: not implemented on this device + "PORTF_INT0", // 104: External Interrupt 0 PORT F + "PORTF_INT1", // 105: External Interrupt 1 PORT F + "TWIF_TWIP", // 106: 2-Wire Interface F Peripheral + "TWIF_TWIM", // 107: 2-Wire Interface F Controller + "TCF0_OVF/TCF2_LUNF", // 108: TC F0 Overflow/TC F2 Low Byte Underflow + "TCF0_ERR/TCF2_HUNF", // 109: TC F0 Error/TC F2 High Byte Underflow + "TCF0_CCA/TCF2_LCMPA", // 110: TC F0 Compare or Capture A/TC F2 Low Byte Compare A + "TCF0_CCB/TCF2_LCMPB", // 111: TC F0 Compare or Capture B/TC F2 Low Byte Compare B + "TCF0_CCC/TCF2_LCMPC", // 112: TC F0 Compare or Capture C/TC F2 Low Byte Compare C + "TCF0_CCD/TCF2_LCMPD", // 113: TC F0 Compare or Capture D/TC F2 Low Byte Compare D + "TCF1_OVF", // 114: TC F1 Overflow + "TCF1_ERR", // 115: TC F1 Error + "TCF1_CCA", // 116: TC F1 Compare or Capture A + "TCF1_CCB", // 117: TC F1 Compare or Capture B + "SPIF_INT", // 118: SPI F Interrupt + "USARTF0_RXC", // 119: USARTF 0 Reception Complete + "USARTF0_DRE", // 120: USARTF 0 Data Register Empty + "USARTF0_TXC", // 121: USARTF 0 Transmission Complete + "USARTF1_RXC", // 122: USARTF 1 Reception Complete + "USARTF1_DRE", // 123: USARTF 1 Data Register Empty + "USARTF1_TXC", // 124: USARTF 1 Transmission Complete + "USB_BUSEVENT", // 125: SOF, Suspend, Resume, Reset Bus Event Interrupts, CRC, Underflow, Overflow or Stall Error + "USB_TRNCOMPL", // 126: USB Transaction Complete +}; + +const char * const vtab_atxmega128b1[vts_atxmega128b1] = { // ATxmega128B1, ATxmega64B1 + "RESET", // 0: Reset (various reasons) + "OSC_OSCF", // 1: Oscillator Failure NMI + "PORTC_INT0", // 2: External Interrupt 0 PORT C + "PORTC_INT1", // 3: External Interrupt 1 PORT C + "PORTR_INT0", // 4: External Interrupt 0 PORT R + "PORTR_INT1", // 5: External Interrupt 1 PORT R + "DMA_CH0", // 6: DMA Channel 0 + "DMA_CH1", // 7: DMA Channel 1 + "UNUSED", // 8: not implemented on this device + "UNUSED", // 9: not implemented on this device + "RTC_OVF", // 10: RTC Overflow + "RTC_COMP", // 11: RTC Compare + "TWIC_TWIP", // 12: 2-Wire Interface C Peripheral + "TWIC_TWIM", // 13: 2-Wire Interface C Controller + "TCC0_OVF/TCC2_LUNF", // 14: TC C0 Overflow/TC C2 Low Byte Underflow + "TCC0_ERR/TCC2_HUNF", // 15: TC C0 Error/TC C2 High Byte Underflow + "TCC0_CCA/TCC2_LCMPA", // 16: TC C0 Compare or Capture A/TC C2 Low Byte Compare A + "TCC0_CCB/TCC2_LCMPB", // 17: TC C0 Compare or Capture B/TC C2 Low Byte Compare B + "TCC0_CCC/TCC2_LCMPC", // 18: TC C0 Compare or Capture C/TC C2 Low Byte Compare C + "TCC0_CCD/TCC2_LCMPD", // 19: TC C0 Compare or Capture D/TC C2 Low Byte Compare D + "TCC1_OVF", // 20: TC C1 Overflow + "TCC1_ERR", // 21: TC C1 Error + "TCC1_CCA", // 22: TC C1 Compare or Capture A + "TCC1_CCB", // 23: TC C1 Compare or Capture B + "SPIC_INT", // 24: SPI C Interrupt + "USARTC0_RXC", // 25: USARTC 0 Reception Complete + "USARTC0_DRE", // 26: USARTC 0 Data Register Empty + "USARTC0_TXC", // 27: USARTC 0 Transmission Complete + "UNUSED", // 28: not implemented on this device + "UNUSED", // 29: not implemented on this device + "UNUSED", // 30: not implemented on this device + "USB_BUSEVENT", // 31: SOF, Suspend, Resume, Reset Bus Event Interrupts, CRC, Underflow, Overflow or Stall Error + "USB_TRNCOMPL", // 32: USB Transaction Complete + "UNUSED", // 33: not implemented on this device + "UNUSED", // 34: not implemented on this device + "LCD_INT", // 35: LCD Interrupt + "AES_INT", // 36: AES Interrupt + "NVM_EE", // 37: NVM EEPROM + "NVM_SPM", // 38: NVM SPM + "PORTB_INT0", // 39: External Interrupt 0 PORT B + "PORTB_INT1", // 40: External Interrupt 1 PORT B + "ACB_AC0", // 41: ACB AC 0 Interrupt + "ACB_AC1", // 42: ACB AC 1 Interrupt + "ACB_ACW", // 43: ACB AC Window Mode + "ADCB_CH0", // 44: ADCB Interrupt 0 + "UNUSED", // 45: not implemented on this device + "UNUSED", // 46: not implemented on this device + "UNUSED", // 47: not implemented on this device + "PORTD_INT0", // 48: External Interrupt 0 PORT D + "PORTD_INT1", // 49: External Interrupt 1 PORT D + "PORTG_INT0", // 50: External Interrupt 0 PORT G + "PORTG_INT1", // 51: External Interrupt 1 PORT G + "PORTM_INT0", // 52: External Interrupt 0 PORT M + "PORTM_INT1", // 53: External Interrupt 1 PORT M + "PORTE_INT0", // 54: External Interrupt 0 PORT E + "PORTE_INT1", // 55: External Interrupt 1 PORT E + "UNUSED", // 56: not implemented on this device + "UNUSED", // 57: not implemented on this device + "TCE0_OVF/TCE2_LUNF", // 58: TC E0 Overflow/TC E2 Low Byte Underflow + "TCE0_ERR/TCE2_HUNF", // 59: TC E0 Error/TC E2 High Byte Underflow + "TCE0_CCA/TCE2_LCMPA", // 60: TC E0 Compare or Capture A/TC E2 Low Byte Compare A + "TCE0_CCB/TCE2_LCMPB", // 61: TC E0 Compare or Capture B/TC E2 Low Byte Compare B + "TCE0_CCC/TCE2_LCMPC", // 62: TC E0 Compare or Capture C/TC E2 Low Byte Compare C + "TCE0_CCD/TCE2_LCMPD", // 63: TC E0 Compare or Capture D/TC E2 Low Byte Compare D + "UNUSED", // 64: not implemented on this device + "UNUSED", // 65: not implemented on this device + "UNUSED", // 66: not implemented on this device + "UNUSED", // 67: not implemented on this device + "UNUSED", // 68: not implemented on this device + "USARTE0_RXC", // 69: USARTE 0 Reception Complete + "USARTE0_DRE", // 70: USARTE 0 Data Register Empty + "USARTE0_TXC", // 71: USARTE 0 Transmission Complete + "UNUSED", // 72: not implemented on this device + "UNUSED", // 73: not implemented on this device + "UNUSED", // 74: not implemented on this device + "PORTA_INT0", // 75: External Interrupt 0 PORT A + "PORTA_INT1", // 76: External Interrupt 1 PORT A + "ACA_AC0", // 77: ACA AC 0 Interrupt + "ACA_AC1", // 78: ACA AC 1 Interrupt + "ACA_ACW", // 79: ACA AC Window Mode + "ADCA_CH0", // 80: ADCA Interrupt 0 +}; + +const char * const vtab_atxmega128b3[vts_atxmega128b3] = { // ATxmega128B3, ATxmega64B3 + "RESET", // 0: Reset (various reasons) + "OSC_OSCF", // 1: Oscillator Failure NMI + "PORTC_INT0", // 2: External Interrupt 0 PORT C + "PORTC_INT1", // 3: External Interrupt 1 PORT C + "PORTR_INT0", // 4: External Interrupt 0 PORT R + "PORTR_INT1", // 5: External Interrupt 1 PORT R + "DMA_CH0", // 6: DMA Channel 0 + "DMA_CH1", // 7: DMA Channel 1 + "UNUSED", // 8: not implemented on this device + "UNUSED", // 9: not implemented on this device + "RTC_OVF", // 10: RTC Overflow + "RTC_COMP", // 11: RTC Compare + "TWIC_TWIP", // 12: 2-Wire Interface C Peripheral + "TWIC_TWIM", // 13: 2-Wire Interface C Controller + "TCC0_OVF/TCC2_LUNF", // 14: TC C0 Overflow/TC C2 Low Byte Underflow + "TCC0_ERR/TCC2_HUNF", // 15: TC C0 Error/TC C2 High Byte Underflow + "TCC0_CCA/TCC2_LCMPA", // 16: TC C0 Compare or Capture A/TC C2 Low Byte Compare A + "TCC0_CCB/TCC2_LCMPB", // 17: TC C0 Compare or Capture B/TC C2 Low Byte Compare B + "TCC0_CCC/TCC2_LCMPC", // 18: TC C0 Compare or Capture C/TC C2 Low Byte Compare C + "TCC0_CCD/TCC2_LCMPD", // 19: TC C0 Compare or Capture D/TC C2 Low Byte Compare D + "TCC1_OVF", // 20: TC C1 Overflow + "TCC1_ERR", // 21: TC C1 Error + "TCC1_CCA", // 22: TC C1 Compare or Capture A + "TCC1_CCB", // 23: TC C1 Compare or Capture B + "SPIC_INT", // 24: SPI C Interrupt + "USARTC0_RXC", // 25: USARTC 0 Reception Complete + "USARTC0_DRE", // 26: USARTC 0 Data Register Empty + "USARTC0_TXC", // 27: USARTC 0 Transmission Complete + "UNUSED", // 28: not implemented on this device + "UNUSED", // 29: not implemented on this device + "UNUSED", // 30: not implemented on this device + "USB_BUSEVENT", // 31: SOF, Suspend, Resume, Reset Bus Event Interrupts, CRC, Underflow, Overflow or Stall Error + "USB_TRNCOMPL", // 32: USB Transaction Complete + "UNUSED", // 33: not implemented on this device + "UNUSED", // 34: not implemented on this device + "LCD_INT", // 35: LCD Interrupt + "AES_INT", // 36: AES Interrupt + "NVM_EE", // 37: NVM EEPROM + "NVM_SPM", // 38: NVM SPM + "PORTB_INT0", // 39: External Interrupt 0 PORT B + "PORTB_INT1", // 40: External Interrupt 1 PORT B + "ACB_AC0", // 41: ACB AC 0 Interrupt + "ACB_AC1", // 42: ACB AC 1 Interrupt + "ACB_ACW", // 43: ACB AC Window Mode + "ADCB_CH0", // 44: ADCB Interrupt 0 + "UNUSED", // 45: not implemented on this device + "UNUSED", // 46: not implemented on this device + "UNUSED", // 47: not implemented on this device + "PORTD_INT0", // 48: External Interrupt 0 PORT D + "PORTD_INT1", // 49: External Interrupt 1 PORT D + "PORTG_INT0", // 50: External Interrupt 0 PORT G + "PORTG_INT1", // 51: External Interrupt 1 PORT G + "PORTM_INT0", // 52: External Interrupt 0 PORT M + "PORTM_INT1", // 53: External Interrupt 1 PORT M +}; + +const char * const vtab_atxmega128a4u[vts_atxmega128a4u] = { // ATxmega128A4U, ATxmega64A4U, ATxmega32A4U, ATxmega16A4U + "RESET", // 0: Reset (various reasons) + "OSC_OSCF", // 1: Oscillator Failure NMI + "PORTC_INT0", // 2: External Interrupt 0 PORT C + "PORTC_INT1", // 3: External Interrupt 1 PORT C + "PORTR_INT0", // 4: External Interrupt 0 PORT R + "PORTR_INT1", // 5: External Interrupt 1 PORT R + "DMA_CH0", // 6: DMA Channel 0 + "DMA_CH1", // 7: DMA Channel 1 + "DMA_CH2", // 8: DMA Channel 2 + "DMA_CH3", // 9: DMA Channel 3 + "RTC_OVF", // 10: RTC Overflow + "RTC_COMP", // 11: RTC Compare + "TWIC_TWIP", // 12: 2-Wire Interface C Peripheral + "TWIC_TWIM", // 13: 2-Wire Interface C Controller + "TCC0_OVF/TCC2_LUNF", // 14: TC C0 Overflow/TC C2 Low Byte Underflow + "TCC0_ERR/TCC2_HUNF", // 15: TC C0 Error/TC C2 High Byte Underflow + "TCC0_CCA/TCC2_LCMPA", // 16: TC C0 Compare or Capture A/TC C2 Low Byte Compare A + "TCC0_CCB/TCC2_LCMPB", // 17: TC C0 Compare or Capture B/TC C2 Low Byte Compare B + "TCC0_CCC/TCC2_LCMPC", // 18: TC C0 Compare or Capture C/TC C2 Low Byte Compare C + "TCC0_CCD/TCC2_LCMPD", // 19: TC C0 Compare or Capture D/TC C2 Low Byte Compare D + "TCC1_OVF", // 20: TC C1 Overflow + "TCC1_ERR", // 21: TC C1 Error + "TCC1_CCA", // 22: TC C1 Compare or Capture A + "TCC1_CCB", // 23: TC C1 Compare or Capture B + "SPIC_INT", // 24: SPI C Interrupt + "USARTC0_RXC", // 25: USARTC 0 Reception Complete + "USARTC0_DRE", // 26: USARTC 0 Data Register Empty + "USARTC0_TXC", // 27: USARTC 0 Transmission Complete + "USARTC1_RXC", // 28: USARTC 1 Reception Complete + "USARTC1_DRE", // 29: USARTC 1 Data Register Empty + "USARTC1_TXC", // 30: USARTC 1 Transmission Complete + "AES_INT", // 31: AES Interrupt + "NVM_EE", // 32: NVM EEPROM + "NVM_SPM", // 33: NVM SPM + "PORTB_INT0", // 34: External Interrupt 0 PORT B + "PORTB_INT1", // 35: External Interrupt 1 PORT B + "UNUSED", // 36: not implemented on this device + "UNUSED", // 37: not implemented on this device + "UNUSED", // 38: not implemented on this device + "UNUSED", // 39: not implemented on this device + "UNUSED", // 40: not implemented on this device + "UNUSED", // 41: not implemented on this device + "UNUSED", // 42: not implemented on this device + "PORTE_INT0", // 43: External Interrupt 0 PORT E + "PORTE_INT1", // 44: External Interrupt 1 PORT E + "TWIE_TWIP", // 45: 2-Wire Interface E Peripheral + "TWIE_TWIM", // 46: 2-Wire Interface E Controller + "TCE0_OVF", // 47: TC E0 Overflow + "TCE0_ERR", // 48: TC E0 Error + "TCE0_CCA", // 49: TC E0 Compare or Capture A + "TCE0_CCB", // 50: TC E0 Compare or Capture B + "TCE0_CCC", // 51: TC E0 Compare or Capture C + "TCE0_CCD", // 52: TC E0 Compare or Capture D + "UNUSED", // 53: not implemented on this device + "UNUSED", // 54: not implemented on this device + "UNUSED", // 55: not implemented on this device + "UNUSED", // 56: not implemented on this device + "UNUSED", // 57: not implemented on this device + "USARTE0_RXC", // 58: USARTE 0 Reception Complete + "USARTE0_DRE", // 59: USARTE 0 Data Register Empty + "USARTE0_TXC", // 60: USARTE 0 Transmission Complete + "UNUSED", // 61: not implemented on this device + "UNUSED", // 62: not implemented on this device + "UNUSED", // 63: not implemented on this device + "PORTD_INT0", // 64: External Interrupt 0 PORT D + "PORTD_INT1", // 65: External Interrupt 1 PORT D + "PORTA_INT0", // 66: External Interrupt 0 PORT A + "PORTA_INT1", // 67: External Interrupt 1 PORT A + "ACA_AC0", // 68: ACA AC 0 Interrupt + "ACA_AC1", // 69: ACA AC 1 Interrupt + "ACA_ACW", // 70: ACA AC Window Mode + "ADCA_CH0", // 71: ADCA Interrupt 0 + "ADCA_CH1", // 72: ADCA Interrupt 1 + "ADCA_CH2", // 73: ADCA Interrupt 2 + "ADCA_CH3", // 74: ADCA Interrupt 3 + "UNUSED", // 75: not implemented on this device + "UNUSED", // 76: not implemented on this device + "TCD0_OVF/TCD2_LUNF", // 77: TC D0 Overflow/TC D2 Low Byte Underflow + "TCD0_ERR/TCD2_HUNF", // 78: TC D0 Error/TC D2 High Byte Underflow + "TCD0_CCA/TCD2_LCMPA", // 79: TC D0 Compare or Capture A/TC D2 Low Byte Compare A + "TCD0_CCB/TCD2_LCMPB", // 80: TC D0 Compare or Capture B/TC D2 Low Byte Compare B + "TCD0_CCC/TCD2_LCMPC", // 81: TC D0 Compare or Capture C/TC D2 Low Byte Compare C + "TCD0_CCD/TCD2_LCMPD", // 82: TC D0 Compare or Capture D/TC D2 Low Byte Compare D + "TCD1_OVF", // 83: TC D1 Overflow + "TCD1_ERR", // 84: TC D1 Error + "TCD1_CCA", // 85: TC D1 Compare or Capture A + "TCD1_CCB", // 86: TC D1 Compare or Capture B + "SPID_INT", // 87: SPI D Interrupt + "USARTD0_RXC", // 88: USARTD 0 Reception Complete + "USARTD0_DRE", // 89: USARTD 0 Data Register Empty + "USARTD0_TXC", // 90: USARTD 0 Transmission Complete + "USARTD1_RXC", // 91: USARTD 1 Reception Complete + "USARTD1_DRE", // 92: USARTD 1 Data Register Empty + "USARTD1_TXC", // 93: USARTD 1 Transmission Complete + "UNUSED", // 94: not implemented on this device + "UNUSED", // 95: not implemented on this device + "UNUSED", // 96: not implemented on this device + "UNUSED", // 97: not implemented on this device + "UNUSED", // 98: not implemented on this device + "UNUSED", // 99: not implemented on this device + "UNUSED", // 100: not implemented on this device + "UNUSED", // 101: not implemented on this device + "UNUSED", // 102: not implemented on this device + "UNUSED", // 103: not implemented on this device + "UNUSED", // 104: not implemented on this device + "UNUSED", // 105: not implemented on this device + "UNUSED", // 106: not implemented on this device + "UNUSED", // 107: not implemented on this device + "UNUSED", // 108: not implemented on this device + "UNUSED", // 109: not implemented on this device + "UNUSED", // 110: not implemented on this device + "UNUSED", // 111: not implemented on this device + "UNUSED", // 112: not implemented on this device + "UNUSED", // 113: not implemented on this device + "UNUSED", // 114: not implemented on this device + "UNUSED", // 115: not implemented on this device + "UNUSED", // 116: not implemented on this device + "UNUSED", // 117: not implemented on this device + "UNUSED", // 118: not implemented on this device + "UNUSED", // 119: not implemented on this device + "UNUSED", // 120: not implemented on this device + "UNUSED", // 121: not implemented on this device + "UNUSED", // 122: not implemented on this device + "UNUSED", // 123: not implemented on this device + "UNUSED", // 124: not implemented on this device + "USB_BUSEVENT", // 125: SOF, Suspend, Resume, Reset Bus Event Interrupts, CRC, Underflow, Overflow or Stall Error + "USB_TRNCOMPL", // 126: USB Transaction Complete +}; + +const char * const vtab_atxmega128d4[vts_atxmega128d4] = { // ATxmega128D4, ATxmega64D4 + "RESET", // 0: Reset (various reasons) + "OSC_OSCF", // 1: Oscillator Failure NMI + "PORTC_INT0", // 2: External Interrupt 0 PORT C + "PORTC_INT1", // 3: External Interrupt 1 PORT C + "PORTR_INT0", // 4: External Interrupt 0 PORT R + "PORTR_INT1", // 5: External Interrupt 1 PORT R + "UNUSED", // 6: not implemented on this device + "UNUSED", // 7: not implemented on this device + "UNUSED", // 8: not implemented on this device + "UNUSED", // 9: not implemented on this device + "RTC_OVF", // 10: RTC Overflow + "RTC_COMP", // 11: RTC Compare + "TWIC_TWIP", // 12: 2-Wire Interface C Peripheral + "TWIC_TWIM", // 13: 2-Wire Interface C Controller + "TCC0_OVF/TCC2_LUNF", // 14: TC C0 Overflow/TC C2 Low Byte Underflow + "TCC0_ERR/TCC2_HUNF", // 15: TC C0 Error/TC C2 High Byte Underflow + "TCC0_CCA/TCC2_LCMPA", // 16: TC C0 Compare or Capture A/TC C2 Low Byte Compare A + "TCC0_CCB/TCC2_LCMPB", // 17: TC C0 Compare or Capture B/TC C2 Low Byte Compare B + "TCC0_CCC/TCC2_LCMPC", // 18: TC C0 Compare or Capture C/TC C2 Low Byte Compare C + "TCC0_CCD/TCC2_LCMPD", // 19: TC C0 Compare or Capture D/TC C2 Low Byte Compare D + "TCC1_OVF", // 20: TC C1 Overflow + "TCC1_ERR", // 21: TC C1 Error + "TCC1_CCA", // 22: TC C1 Compare or Capture A + "TCC1_CCB", // 23: TC C1 Compare or Capture B + "SPIC_INT", // 24: SPI C Interrupt + "USARTC0_RXC", // 25: USARTC 0 Reception Complete + "USARTC0_DRE", // 26: USARTC 0 Data Register Empty + "USARTC0_TXC", // 27: USARTC 0 Transmission Complete + "UNUSED", // 28: not implemented on this device + "UNUSED", // 29: not implemented on this device + "UNUSED", // 30: not implemented on this device + "UNUSED", // 31: not implemented on this device + "NVM_EE", // 32: NVM EEPROM + "NVM_SPM", // 33: NVM SPM + "PORTB_INT0", // 34: External Interrupt 0 PORT B + "PORTB_INT1", // 35: External Interrupt 1 PORT B + "UNUSED", // 36: not implemented on this device + "UNUSED", // 37: not implemented on this device + "UNUSED", // 38: not implemented on this device + "UNUSED", // 39: not implemented on this device + "UNUSED", // 40: not implemented on this device + "UNUSED", // 41: not implemented on this device + "UNUSED", // 42: not implemented on this device + "PORTE_INT0", // 43: External Interrupt 0 PORT E + "PORTE_INT1", // 44: External Interrupt 1 PORT E + "TWIE_TWIP", // 45: 2-Wire Interface E Peripheral + "TWIE_TWIM", // 46: 2-Wire Interface E Controller + "TCE0_OVF", // 47: TC E0 Overflow + "TCE0_ERR", // 48: TC E0 Error + "TCE0_CCA", // 49: TC E0 Compare or Capture A + "TCE0_CCB", // 50: TC E0 Compare or Capture B + "TCE0_CCC", // 51: TC E0 Compare or Capture C + "TCE0_CCD", // 52: TC E0 Compare or Capture D + "UNUSED", // 53: not implemented on this device + "UNUSED", // 54: not implemented on this device + "UNUSED", // 55: not implemented on this device + "UNUSED", // 56: not implemented on this device + "UNUSED", // 57: not implemented on this device + "USARTE0_RXC", // 58: USARTE 0 Reception Complete + "USARTE0_DRE", // 59: USARTE 0 Data Register Empty + "USARTE0_TXC", // 60: USARTE 0 Transmission Complete + "UNUSED", // 61: not implemented on this device + "UNUSED", // 62: not implemented on this device + "UNUSED", // 63: not implemented on this device + "PORTD_INT0", // 64: External Interrupt 0 PORT D + "PORTD_INT1", // 65: External Interrupt 1 PORT D + "PORTA_INT0", // 66: External Interrupt 0 PORT A + "PORTA_INT1", // 67: External Interrupt 1 PORT A + "ACA_AC0", // 68: ACA AC 0 Interrupt + "ACA_AC1", // 69: ACA AC 1 Interrupt + "ACA_ACW", // 70: ACA AC Window Mode + "ADCA_CH0", // 71: ADCA Interrupt 0 + "UNUSED", // 72: not implemented on this device + "UNUSED", // 73: not implemented on this device + "UNUSED", // 74: not implemented on this device + "UNUSED", // 75: not implemented on this device + "UNUSED", // 76: not implemented on this device + "TCD0_OVF/TCD2_LUNF", // 77: TC D0 Overflow/TC D2 Low Byte Underflow + "TCD0_ERR/TCD2_HUNF", // 78: TC D0 Error/TC D2 High Byte Underflow + "TCD0_CCA/TCD2_LCMPA", // 79: TC D0 Compare or Capture A/TC D2 Low Byte Compare A + "TCD0_CCB/TCD2_LCMPB", // 80: TC D0 Compare or Capture B/TC D2 Low Byte Compare B + "TCD0_CCC/TCD2_LCMPC", // 81: TC D0 Compare or Capture C/TC D2 Low Byte Compare C + "TCD0_CCD/TCD2_LCMPD", // 82: TC D0 Compare or Capture D/TC D2 Low Byte Compare D + "UNUSED", // 83: not implemented on this device + "UNUSED", // 84: not implemented on this device + "UNUSED", // 85: not implemented on this device + "UNUSED", // 86: not implemented on this device + "SPID_INT", // 87: SPI D Interrupt + "USARTD0_RXC", // 88: USARTD 0 Reception Complete + "USARTD0_DRE", // 89: USARTD 0 Data Register Empty + "USARTD0_TXC", // 90: USARTD 0 Transmission Complete +}; + +const char * const vtab_atxmega256a3[vts_atxmega256a3] = { // ATxmega256A3, ATxmega192A3, ATxmega128A3, ATxmega64A3 + "RESET", // 0: Reset (various reasons) + "OSC_OSCF", // 1: Oscillator Failure NMI + "PORTC_INT0", // 2: External Interrupt 0 PORT C + "PORTC_INT1", // 3: External Interrupt 1 PORT C + "PORTR_INT0", // 4: External Interrupt 0 PORT R + "PORTR_INT1", // 5: External Interrupt 1 PORT R + "DMA_CH0", // 6: DMA Channel 0 + "DMA_CH1", // 7: DMA Channel 1 + "DMA_CH2", // 8: DMA Channel 2 + "DMA_CH3", // 9: DMA Channel 3 + "RTC_OVF", // 10: RTC Overflow + "RTC_COMP", // 11: RTC Compare + "TWIC_TWIP", // 12: 2-Wire Interface C Peripheral + "TWIC_TWIM", // 13: 2-Wire Interface C Controller + "TCC0_OVF", // 14: TC C0 Overflow + "TCC0_ERR", // 15: TC C0 Error + "TCC0_CCA", // 16: TC C0 Compare or Capture A + "TCC0_CCB", // 17: TC C0 Compare or Capture B + "TCC0_CCC", // 18: TC C0 Compare or Capture C + "TCC0_CCD", // 19: TC C0 Compare or Capture D + "TCC1_OVF", // 20: TC C1 Overflow + "TCC1_ERR", // 21: TC C1 Error + "TCC1_CCA", // 22: TC C1 Compare or Capture A + "TCC1_CCB", // 23: TC C1 Compare or Capture B + "SPIC_INT", // 24: SPI C Interrupt + "USARTC0_RXC", // 25: USARTC 0 Reception Complete + "USARTC0_DRE", // 26: USARTC 0 Data Register Empty + "USARTC0_TXC", // 27: USARTC 0 Transmission Complete + "USARTC1_RXC", // 28: USARTC 1 Reception Complete + "USARTC1_DRE", // 29: USARTC 1 Data Register Empty + "USARTC1_TXC", // 30: USARTC 1 Transmission Complete + "AES_INT", // 31: AES Interrupt + "NVM_EE", // 32: NVM EEPROM + "NVM_SPM", // 33: NVM SPM + "PORTB_INT0", // 34: External Interrupt 0 PORT B + "PORTB_INT1", // 35: External Interrupt 1 PORT B + "ACB_AC0", // 36: ACB AC 0 Interrupt + "ACB_AC1", // 37: ACB AC 1 Interrupt + "ACB_ACW", // 38: ACB AC Window Mode + "ADCB_CH0", // 39: ADCB Interrupt 0 + "ADCB_CH1", // 40: ADCB Interrupt 1 + "ADCB_CH2", // 41: ADCB Interrupt 2 + "ADCB_CH3", // 42: ADCB Interrupt 3 + "PORTE_INT0", // 43: External Interrupt 0 PORT E + "PORTE_INT1", // 44: External Interrupt 1 PORT E + "TWIE_TWIP", // 45: 2-Wire Interface E Peripheral + "TWIE_TWIM", // 46: 2-Wire Interface E Controller + "TCE0_OVF", // 47: TC E0 Overflow + "TCE0_ERR", // 48: TC E0 Error + "TCE0_CCA", // 49: TC E0 Compare or Capture A + "TCE0_CCB", // 50: TC E0 Compare or Capture B + "TCE0_CCC", // 51: TC E0 Compare or Capture C + "TCE0_CCD", // 52: TC E0 Compare or Capture D + "TCE1_OVF", // 53: TC E1 Overflow + "TCE1_ERR", // 54: TC E1 Error + "TCE1_CCA", // 55: TC E1 Compare or Capture A + "TCE1_CCB", // 56: TC E1 Compare or Capture B + "SPIE_INT", // 57: SPI E Interrupt + "USARTE0_RXC", // 58: USARTE 0 Reception Complete + "USARTE0_DRE", // 59: USARTE 0 Data Register Empty + "USARTE0_TXC", // 60: USARTE 0 Transmission Complete + "USARTE1_RXC", // 61: USARTE 1 Reception Complete + "USARTE1_DRE", // 62: USARTE 1 Data Register Empty + "USARTE1_TXC", // 63: USARTE 1 Transmission Complete + "PORTD_INT0", // 64: External Interrupt 0 PORT D + "PORTD_INT1", // 65: External Interrupt 1 PORT D + "PORTA_INT0", // 66: External Interrupt 0 PORT A + "PORTA_INT1", // 67: External Interrupt 1 PORT A + "ACA_AC0", // 68: ACA AC 0 Interrupt + "ACA_AC1", // 69: ACA AC 1 Interrupt + "ACA_ACW", // 70: ACA AC Window Mode + "ADCA_CH0", // 71: ADCA Interrupt 0 + "ADCA_CH1", // 72: ADCA Interrupt 1 + "ADCA_CH2", // 73: ADCA Interrupt 2 + "ADCA_CH3", // 74: ADCA Interrupt 3 + "UNUSED", // 75: not implemented on this device + "UNUSED", // 76: not implemented on this device + "TCD0_OVF", // 77: TC D0 Overflow + "TCD0_ERR", // 78: TC D0 Error + "TCD0_CCA", // 79: TC D0 Compare or Capture A + "TCD0_CCB", // 80: TC D0 Compare or Capture B + "TCD0_CCC", // 81: TC D0 Compare or Capture C + "TCD0_CCD", // 82: TC D0 Compare or Capture D + "TCD1_OVF", // 83: TC D1 Overflow + "TCD1_ERR", // 84: TC D1 Error + "TCD1_CCA", // 85: TC D1 Compare or Capture A + "TCD1_CCB", // 86: TC D1 Compare or Capture B + "SPID_INT", // 87: SPI D Interrupt + "USARTD0_RXC", // 88: USARTD 0 Reception Complete + "USARTD0_DRE", // 89: USARTD 0 Data Register Empty + "USARTD0_TXC", // 90: USARTD 0 Transmission Complete + "USARTD1_RXC", // 91: USARTD 1 Reception Complete + "USARTD1_DRE", // 92: USARTD 1 Data Register Empty + "USARTD1_TXC", // 93: USARTD 1 Transmission Complete + "UNUSED", // 94: not implemented on this device + "UNUSED", // 95: not implemented on this device + "UNUSED", // 96: not implemented on this device + "UNUSED", // 97: not implemented on this device + "UNUSED", // 98: not implemented on this device + "UNUSED", // 99: not implemented on this device + "UNUSED", // 100: not implemented on this device + "UNUSED", // 101: not implemented on this device + "UNUSED", // 102: not implemented on this device + "UNUSED", // 103: not implemented on this device + "PORTF_INT0", // 104: External Interrupt 0 PORT F + "PORTF_INT1", // 105: External Interrupt 1 PORT F + "UNUSED", // 106: not implemented on this device + "UNUSED", // 107: not implemented on this device + "TCF0_OVF", // 108: TC F0 Overflow + "TCF0_ERR", // 109: TC F0 Error + "TCF0_CCA", // 110: TC F0 Compare or Capture A + "TCF0_CCB", // 111: TC F0 Compare or Capture B + "TCF0_CCC", // 112: TC F0 Compare or Capture C + "TCF0_CCD", // 113: TC F0 Compare or Capture D + "UNUSED", // 114: not implemented on this device + "UNUSED", // 115: not implemented on this device + "UNUSED", // 116: not implemented on this device + "UNUSED", // 117: not implemented on this device + "UNUSED", // 118: not implemented on this device + "USARTF0_RXC", // 119: USARTF 0 Reception Complete + "USARTF0_DRE", // 120: USARTF 0 Data Register Empty + "USARTF0_TXC", // 121: USARTF 0 Transmission Complete +}; + +const char * const vtab_atxmega256a3b[vts_atxmega256a3b] = { // ATxmega256A3B + "RESET", // 0: Reset (various reasons) + "OSC_OSCF", // 1: Oscillator Failure NMI + "PORTC_INT0", // 2: External Interrupt 0 PORT C + "PORTC_INT1", // 3: External Interrupt 1 PORT C + "PORTR_INT0", // 4: External Interrupt 0 PORT R + "PORTR_INT1", // 5: External Interrupt 1 PORT R + "DMA_CH0", // 6: DMA Channel 0 + "DMA_CH1", // 7: DMA Channel 1 + "DMA_CH2", // 8: DMA Channel 2 + "DMA_CH3", // 9: DMA Channel 3 + "RTC32_OVF", // 10: RTC32 Overflow + "RTC32_COMP", // 11: RTC32 Compare + "TWIC_TWIP", // 12: 2-Wire Interface C Peripheral + "TWIC_TWIM", // 13: 2-Wire Interface C Controller + "TCC0_OVF", // 14: TC C0 Overflow + "TCC0_ERR", // 15: TC C0 Error + "TCC0_CCA", // 16: TC C0 Compare or Capture A + "TCC0_CCB", // 17: TC C0 Compare or Capture B + "TCC0_CCC", // 18: TC C0 Compare or Capture C + "TCC0_CCD", // 19: TC C0 Compare or Capture D + "TCC1_OVF", // 20: TC C1 Overflow + "TCC1_ERR", // 21: TC C1 Error + "TCC1_CCA", // 22: TC C1 Compare or Capture A + "TCC1_CCB", // 23: TC C1 Compare or Capture B + "SPIC_INT", // 24: SPI C Interrupt + "USARTC0_RXC", // 25: USARTC 0 Reception Complete + "USARTC0_DRE", // 26: USARTC 0 Data Register Empty + "USARTC0_TXC", // 27: USARTC 0 Transmission Complete + "USARTC1_RXC", // 28: USARTC 1 Reception Complete + "USARTC1_DRE", // 29: USARTC 1 Data Register Empty + "USARTC1_TXC", // 30: USARTC 1 Transmission Complete + "AES_INT", // 31: AES Interrupt + "NVM_EE", // 32: NVM EEPROM + "NVM_SPM", // 33: NVM SPM + "PORTB_INT0", // 34: External Interrupt 0 PORT B + "PORTB_INT1", // 35: External Interrupt 1 PORT B + "ACB_AC0", // 36: ACB AC 0 Interrupt + "ACB_AC1", // 37: ACB AC 1 Interrupt + "ACB_ACW", // 38: ACB AC Window Mode + "ADCB_CH0", // 39: ADCB Interrupt 0 + "ADCB_CH1", // 40: ADCB Interrupt 1 + "ADCB_CH2", // 41: ADCB Interrupt 2 + "ADCB_CH3", // 42: ADCB Interrupt 3 + "PORTE_INT0", // 43: External Interrupt 0 PORT E + "PORTE_INT1", // 44: External Interrupt 1 PORT E + "TWIE_TWIP", // 45: 2-Wire Interface E Peripheral + "TWIE_TWIM", // 46: 2-Wire Interface E Controller + "TCE0_OVF", // 47: TC E0 Overflow + "TCE0_ERR", // 48: TC E0 Error + "TCE0_CCA", // 49: TC E0 Compare or Capture A + "TCE0_CCB", // 50: TC E0 Compare or Capture B + "TCE0_CCC", // 51: TC E0 Compare or Capture C + "TCE0_CCD", // 52: TC E0 Compare or Capture D + "TCE1_OVF", // 53: TC E1 Overflow + "TCE1_ERR", // 54: TC E1 Error + "TCE1_CCA", // 55: TC E1 Compare or Capture A + "TCE1_CCB", // 56: TC E1 Compare or Capture B + "UNUSED", // 57: not implemented on this device + "USARTE0_RXC", // 58: USARTE 0 Reception Complete + "USARTE0_DRE", // 59: USARTE 0 Data Register Empty + "USARTE0_TXC", // 60: USARTE 0 Transmission Complete + "UNUSED", // 61: not implemented on this device + "UNUSED", // 62: not implemented on this device + "UNUSED", // 63: not implemented on this device + "PORTD_INT0", // 64: External Interrupt 0 PORT D + "PORTD_INT1", // 65: External Interrupt 1 PORT D + "PORTA_INT0", // 66: External Interrupt 0 PORT A + "PORTA_INT1", // 67: External Interrupt 1 PORT A + "ACA_AC0", // 68: ACA AC 0 Interrupt + "ACA_AC1", // 69: ACA AC 1 Interrupt + "ACA_ACW", // 70: ACA AC Window Mode + "ADCA_CH0", // 71: ADCA Interrupt 0 + "ADCA_CH1", // 72: ADCA Interrupt 1 + "ADCA_CH2", // 73: ADCA Interrupt 2 + "ADCA_CH3", // 74: ADCA Interrupt 3 + "UNUSED", // 75: not implemented on this device + "UNUSED", // 76: not implemented on this device + "TCD0_OVF", // 77: TC D0 Overflow + "TCD0_ERR", // 78: TC D0 Error + "TCD0_CCA", // 79: TC D0 Compare or Capture A + "TCD0_CCB", // 80: TC D0 Compare or Capture B + "TCD0_CCC", // 81: TC D0 Compare or Capture C + "TCD0_CCD", // 82: TC D0 Compare or Capture D + "TCD1_OVF", // 83: TC D1 Overflow + "TCD1_ERR", // 84: TC D1 Error + "TCD1_CCA", // 85: TC D1 Compare or Capture A + "TCD1_CCB", // 86: TC D1 Compare or Capture B + "SPID_INT", // 87: SPI D Interrupt + "USARTD0_RXC", // 88: USARTD 0 Reception Complete + "USARTD0_DRE", // 89: USARTD 0 Data Register Empty + "USARTD0_TXC", // 90: USARTD 0 Transmission Complete + "USARTD1_RXC", // 91: USARTD 1 Reception Complete + "USARTD1_DRE", // 92: USARTD 1 Data Register Empty + "USARTD1_TXC", // 93: USARTD 1 Transmission Complete + "UNUSED", // 94: not implemented on this device + "UNUSED", // 95: not implemented on this device + "UNUSED", // 96: not implemented on this device + "UNUSED", // 97: not implemented on this device + "UNUSED", // 98: not implemented on this device + "UNUSED", // 99: not implemented on this device + "UNUSED", // 100: not implemented on this device + "UNUSED", // 101: not implemented on this device + "UNUSED", // 102: not implemented on this device + "UNUSED", // 103: not implemented on this device + "PORTF_INT0", // 104: External Interrupt 0 PORT F + "PORTF_INT1", // 105: External Interrupt 1 PORT F + "UNUSED", // 106: not implemented on this device + "UNUSED", // 107: not implemented on this device + "TCF0_OVF", // 108: TC F0 Overflow + "TCF0_ERR", // 109: TC F0 Error + "TCF0_CCA", // 110: TC F0 Compare or Capture A + "TCF0_CCB", // 111: TC F0 Compare or Capture B + "TCF0_CCC", // 112: TC F0 Compare or Capture C + "TCF0_CCD", // 113: TC F0 Compare or Capture D + "UNUSED", // 114: not implemented on this device + "UNUSED", // 115: not implemented on this device + "UNUSED", // 116: not implemented on this device + "UNUSED", // 117: not implemented on this device + "UNUSED", // 118: not implemented on this device + "USARTF0_RXC", // 119: USARTF 0 Reception Complete + "USARTF0_DRE", // 120: USARTF 0 Data Register Empty + "USARTF0_TXC", // 121: USARTF 0 Transmission Complete +}; + +const char * const vtab_atxmega256a3bu[vts_atxmega256a3bu] = { // ATxmega256A3BU + "RESET", // 0: Reset (various reasons) + "OSC_OSCF", // 1: Oscillator Failure NMI + "PORTC_INT0", // 2: External Interrupt 0 PORT C + "PORTC_INT1", // 3: External Interrupt 1 PORT C + "PORTR_INT0", // 4: External Interrupt 0 PORT R + "PORTR_INT1", // 5: External Interrupt 1 PORT R + "DMA_CH0", // 6: DMA Channel 0 + "DMA_CH1", // 7: DMA Channel 1 + "DMA_CH2", // 8: DMA Channel 2 + "DMA_CH3", // 9: DMA Channel 3 + "RTC32_OVF", // 10: RTC32 Overflow + "RTC32_COMP", // 11: RTC32 Compare + "TWIC_TWIP", // 12: 2-Wire Interface C Peripheral + "TWIC_TWIM", // 13: 2-Wire Interface C Controller + "TCC0_OVF/TCC2_LUNF", // 14: TC C0 Overflow/TC C2 Low Byte Underflow + "TCC0_ERR/TCC2_HUNF", // 15: TC C0 Error/TC C2 High Byte Underflow + "TCC0_CCA/TCC2_LCMPA", // 16: TC C0 Compare or Capture A/TC C2 Low Byte Compare A + "TCC0_CCB/TCC2_LCMPB", // 17: TC C0 Compare or Capture B/TC C2 Low Byte Compare B + "TCC0_CCC/TCC2_LCMPC", // 18: TC C0 Compare or Capture C/TC C2 Low Byte Compare C + "TCC0_CCD/TCC2_LCMPD", // 19: TC C0 Compare or Capture D/TC C2 Low Byte Compare D + "TCC1_OVF", // 20: TC C1 Overflow + "TCC1_ERR", // 21: TC C1 Error + "TCC1_CCA", // 22: TC C1 Compare or Capture A + "TCC1_CCB", // 23: TC C1 Compare or Capture B + "SPIC_INT", // 24: SPI C Interrupt + "USARTC0_RXC", // 25: USARTC 0 Reception Complete + "USARTC0_DRE", // 26: USARTC 0 Data Register Empty + "USARTC0_TXC", // 27: USARTC 0 Transmission Complete + "USARTC1_RXC", // 28: USARTC 1 Reception Complete + "USARTC1_DRE", // 29: USARTC 1 Data Register Empty + "USARTC1_TXC", // 30: USARTC 1 Transmission Complete + "AES_INT", // 31: AES Interrupt + "NVM_EE", // 32: NVM EEPROM + "NVM_SPM", // 33: NVM SPM + "PORTB_INT0", // 34: External Interrupt 0 PORT B + "PORTB_INT1", // 35: External Interrupt 1 PORT B + "ACB_AC0", // 36: ACB AC 0 Interrupt + "ACB_AC1", // 37: ACB AC 1 Interrupt + "ACB_ACW", // 38: ACB AC Window Mode + "ADCB_CH0", // 39: ADCB Interrupt 0 + "ADCB_CH1", // 40: ADCB Interrupt 1 + "ADCB_CH2", // 41: ADCB Interrupt 2 + "ADCB_CH3", // 42: ADCB Interrupt 3 + "PORTE_INT0", // 43: External Interrupt 0 PORT E + "PORTE_INT1", // 44: External Interrupt 1 PORT E + "TWIE_TWIP", // 45: 2-Wire Interface E Peripheral + "TWIE_TWIM", // 46: 2-Wire Interface E Controller + "TCE0_OVF/TCE2_LUNF", // 47: TC E0 Overflow/TC E2 Low Byte Underflow + "TCE0_ERR/TCE2_HUNF", // 48: TC E0 Error/TC E2 High Byte Underflow + "TCE0_CCA/TCE2_LCMPA", // 49: TC E0 Compare or Capture A/TC E2 Low Byte Compare A + "TCE0_CCB/TCE2_LCMPB", // 50: TC E0 Compare or Capture B/TC E2 Low Byte Compare B + "TCE0_CCC/TCE2_LCMPC", // 51: TC E0 Compare or Capture C/TC E2 Low Byte Compare C + "TCE0_CCD/TCE2_LCMPD", // 52: TC E0 Compare or Capture D/TC E2 Low Byte Compare D + "TCE1_OVF", // 53: TC E1 Overflow + "TCE1_ERR", // 54: TC E1 Error + "TCE1_CCA", // 55: TC E1 Compare or Capture A + "TCE1_CCB", // 56: TC E1 Compare or Capture B + "UNUSED", // 57: not implemented on this device + "USARTE0_RXC", // 58: USARTE 0 Reception Complete + "USARTE0_DRE", // 59: USARTE 0 Data Register Empty + "USARTE0_TXC", // 60: USARTE 0 Transmission Complete + "UNUSED", // 61: not implemented on this device + "UNUSED", // 62: not implemented on this device + "UNUSED", // 63: not implemented on this device + "PORTD_INT0", // 64: External Interrupt 0 PORT D + "PORTD_INT1", // 65: External Interrupt 1 PORT D + "PORTA_INT0", // 66: External Interrupt 0 PORT A + "PORTA_INT1", // 67: External Interrupt 1 PORT A + "ACA_AC0", // 68: ACA AC 0 Interrupt + "ACA_AC1", // 69: ACA AC 1 Interrupt + "ACA_ACW", // 70: ACA AC Window Mode + "ADCA_CH0", // 71: ADCA Interrupt 0 + "ADCA_CH1", // 72: ADCA Interrupt 1 + "ADCA_CH2", // 73: ADCA Interrupt 2 + "ADCA_CH3", // 74: ADCA Interrupt 3 + "UNUSED", // 75: not implemented on this device + "UNUSED", // 76: not implemented on this device + "TCD0_OVF/TCD2_LUNF", // 77: TC D0 Overflow/TC D2 Low Byte Underflow + "TCD0_ERR/TCD2_HUNF", // 78: TC D0 Error/TC D2 High Byte Underflow + "TCD0_CCA/TCD2_LCMPA", // 79: TC D0 Compare or Capture A/TC D2 Low Byte Compare A + "TCD0_CCB/TCD2_LCMPB", // 80: TC D0 Compare or Capture B/TC D2 Low Byte Compare B + "TCD0_CCC/TCD2_LCMPC", // 81: TC D0 Compare or Capture C/TC D2 Low Byte Compare C + "TCD0_CCD/TCD2_LCMPD", // 82: TC D0 Compare or Capture D/TC D2 Low Byte Compare D + "TCD1_OVF", // 83: TC D1 Overflow + "TCD1_ERR", // 84: TC D1 Error + "TCD1_CCA", // 85: TC D1 Compare or Capture A + "TCD1_CCB", // 86: TC D1 Compare or Capture B + "SPID_INT", // 87: SPI D Interrupt + "USARTD0_RXC", // 88: USARTD 0 Reception Complete + "USARTD0_DRE", // 89: USARTD 0 Data Register Empty + "USARTD0_TXC", // 90: USARTD 0 Transmission Complete + "USARTD1_RXC", // 91: USARTD 1 Reception Complete + "USARTD1_DRE", // 92: USARTD 1 Data Register Empty + "USARTD1_TXC", // 93: USARTD 1 Transmission Complete + "UNUSED", // 94: not implemented on this device + "UNUSED", // 95: not implemented on this device + "UNUSED", // 96: not implemented on this device + "UNUSED", // 97: not implemented on this device + "UNUSED", // 98: not implemented on this device + "UNUSED", // 99: not implemented on this device + "UNUSED", // 100: not implemented on this device + "UNUSED", // 101: not implemented on this device + "UNUSED", // 102: not implemented on this device + "UNUSED", // 103: not implemented on this device + "PORTF_INT0", // 104: External Interrupt 0 PORT F + "PORTF_INT1", // 105: External Interrupt 1 PORT F + "UNUSED", // 106: not implemented on this device + "UNUSED", // 107: not implemented on this device + "TCF0_OVF/TCF2_LUNF", // 108: TC F0 Overflow/TC F2 Low Byte Underflow + "TCF0_ERR/TCF2_HUNF", // 109: TC F0 Error/TC F2 High Byte Underflow + "TCF0_CCA/TCF2_LCMPA", // 110: TC F0 Compare or Capture A/TC F2 Low Byte Compare A + "TCF0_CCB/TCF2_LCMPB", // 111: TC F0 Compare or Capture B/TC F2 Low Byte Compare B + "TCF0_CCC/TCF2_LCMPC", // 112: TC F0 Compare or Capture C/TC F2 Low Byte Compare C + "TCF0_CCD/TCF2_LCMPD", // 113: TC F0 Compare or Capture D/TC F2 Low Byte Compare D + "UNUSED", // 114: not implemented on this device + "UNUSED", // 115: not implemented on this device + "UNUSED", // 116: not implemented on this device + "UNUSED", // 117: not implemented on this device + "UNUSED", // 118: not implemented on this device + "USARTF0_RXC", // 119: USARTF 0 Reception Complete + "USARTF0_DRE", // 120: USARTF 0 Data Register Empty + "USARTF0_TXC", // 121: USARTF 0 Transmission Complete + "UNUSED", // 122: not implemented on this device + "UNUSED", // 123: not implemented on this device + "UNUSED", // 124: not implemented on this device + "USB_BUSEVENT", // 125: SOF, Suspend, Resume, Reset Bus Event Interrupts, CRC, Underflow, Overflow or Stall Error + "USB_TRNCOMPL", // 126: USB Transaction Complete +}; + +const char * const vtab_atxmega256a3u[vts_atxmega256a3u] = { // ATxmega256A3U, ATxmega192A3U, ATxmega128A3U, ATxmega64A3U + "RESET", // 0: Reset (various reasons) + "OSC_OSCF", // 1: Oscillator Failure NMI + "PORTC_INT0", // 2: External Interrupt 0 PORT C + "PORTC_INT1", // 3: External Interrupt 1 PORT C + "PORTR_INT0", // 4: External Interrupt 0 PORT R + "PORTR_INT1", // 5: External Interrupt 1 PORT R + "DMA_CH0", // 6: DMA Channel 0 + "DMA_CH1", // 7: DMA Channel 1 + "DMA_CH2", // 8: DMA Channel 2 + "DMA_CH3", // 9: DMA Channel 3 + "RTC_OVF", // 10: RTC Overflow + "RTC_COMP", // 11: RTC Compare + "TWIC_TWIP", // 12: 2-Wire Interface C Peripheral + "TWIC_TWIM", // 13: 2-Wire Interface C Controller + "TCC0_OVF/TCC2_LUNF", // 14: TC C0 Overflow/TC C2 Low Byte Underflow + "TCC0_ERR/TCC2_HUNF", // 15: TC C0 Error/TC C2 High Byte Underflow + "TCC0_CCA/TCC2_LCMPA", // 16: TC C0 Compare or Capture A/TC C2 Low Byte Compare A + "TCC0_CCB/TCC2_LCMPB", // 17: TC C0 Compare or Capture B/TC C2 Low Byte Compare B + "TCC0_CCC/TCC2_LCMPC", // 18: TC C0 Compare or Capture C/TC C2 Low Byte Compare C + "TCC0_CCD/TCC2_LCMPD", // 19: TC C0 Compare or Capture D/TC C2 Low Byte Compare D + "TCC1_OVF", // 20: TC C1 Overflow + "TCC1_ERR", // 21: TC C1 Error + "TCC1_CCA", // 22: TC C1 Compare or Capture A + "TCC1_CCB", // 23: TC C1 Compare or Capture B + "SPIC_INT", // 24: SPI C Interrupt + "USARTC0_RXC", // 25: USARTC 0 Reception Complete + "USARTC0_DRE", // 26: USARTC 0 Data Register Empty + "USARTC0_TXC", // 27: USARTC 0 Transmission Complete + "USARTC1_RXC", // 28: USARTC 1 Reception Complete + "USARTC1_DRE", // 29: USARTC 1 Data Register Empty + "USARTC1_TXC", // 30: USARTC 1 Transmission Complete + "AES_INT", // 31: AES Interrupt + "NVM_EE", // 32: NVM EEPROM + "NVM_SPM", // 33: NVM SPM + "PORTB_INT0", // 34: External Interrupt 0 PORT B + "PORTB_INT1", // 35: External Interrupt 1 PORT B + "ACB_AC0", // 36: ACB AC 0 Interrupt + "ACB_AC1", // 37: ACB AC 1 Interrupt + "ACB_ACW", // 38: ACB AC Window Mode + "ADCB_CH0", // 39: ADCB Interrupt 0 + "ADCB_CH1", // 40: ADCB Interrupt 1 + "ADCB_CH2", // 41: ADCB Interrupt 2 + "ADCB_CH3", // 42: ADCB Interrupt 3 + "PORTE_INT0", // 43: External Interrupt 0 PORT E + "PORTE_INT1", // 44: External Interrupt 1 PORT E + "TWIE_TWIP", // 45: 2-Wire Interface E Peripheral + "TWIE_TWIM", // 46: 2-Wire Interface E Controller + "TCE0_OVF/TCE2_LUNF", // 47: TC E0 Overflow/TC E2 Low Byte Underflow + "TCE0_ERR/TCE2_HUNF", // 48: TC E0 Error/TC E2 High Byte Underflow + "TCE0_CCA/TCE2_LCMPA", // 49: TC E0 Compare or Capture A/TC E2 Low Byte Compare A + "TCE0_CCB/TCE2_LCMPB", // 50: TC E0 Compare or Capture B/TC E2 Low Byte Compare B + "TCE0_CCC/TCE2_LCMPC", // 51: TC E0 Compare or Capture C/TC E2 Low Byte Compare C + "TCE0_CCD/TCE2_LCMPD", // 52: TC E0 Compare or Capture D/TC E2 Low Byte Compare D + "TCE1_OVF", // 53: TC E1 Overflow + "TCE1_ERR", // 54: TC E1 Error + "TCE1_CCA", // 55: TC E1 Compare or Capture A + "TCE1_CCB", // 56: TC E1 Compare or Capture B + "SPIE_INT", // 57: SPI E Interrupt + "USARTE0_RXC", // 58: USARTE 0 Reception Complete + "USARTE0_DRE", // 59: USARTE 0 Data Register Empty + "USARTE0_TXC", // 60: USARTE 0 Transmission Complete + "USARTE1_RXC", // 61: USARTE 1 Reception Complete + "USARTE1_DRE", // 62: USARTE 1 Data Register Empty + "USARTE1_TXC", // 63: USARTE 1 Transmission Complete + "PORTD_INT0", // 64: External Interrupt 0 PORT D + "PORTD_INT1", // 65: External Interrupt 1 PORT D + "PORTA_INT0", // 66: External Interrupt 0 PORT A + "PORTA_INT1", // 67: External Interrupt 1 PORT A + "ACA_AC0", // 68: ACA AC 0 Interrupt + "ACA_AC1", // 69: ACA AC 1 Interrupt + "ACA_ACW", // 70: ACA AC Window Mode + "ADCA_CH0", // 71: ADCA Interrupt 0 + "ADCA_CH1", // 72: ADCA Interrupt 1 + "ADCA_CH2", // 73: ADCA Interrupt 2 + "ADCA_CH3", // 74: ADCA Interrupt 3 + "UNUSED", // 75: not implemented on this device + "UNUSED", // 76: not implemented on this device + "TCD0_OVF/TCD2_LUNF", // 77: TC D0 Overflow/TC D2 Low Byte Underflow + "TCD0_ERR/TCD2_HUNF", // 78: TC D0 Error/TC D2 High Byte Underflow + "TCD0_CCA/TCD2_LCMPA", // 79: TC D0 Compare or Capture A/TC D2 Low Byte Compare A + "TCD0_CCB/TCD2_LCMPB", // 80: TC D0 Compare or Capture B/TC D2 Low Byte Compare B + "TCD0_CCC/TCD2_LCMPC", // 81: TC D0 Compare or Capture C/TC D2 Low Byte Compare C + "TCD0_CCD/TCD2_LCMPD", // 82: TC D0 Compare or Capture D/TC D2 Low Byte Compare D + "TCD1_OVF", // 83: TC D1 Overflow + "TCD1_ERR", // 84: TC D1 Error + "TCD1_CCA", // 85: TC D1 Compare or Capture A + "TCD1_CCB", // 86: TC D1 Compare or Capture B + "SPID_INT", // 87: SPI D Interrupt + "USARTD0_RXC", // 88: USARTD 0 Reception Complete + "USARTD0_DRE", // 89: USARTD 0 Data Register Empty + "USARTD0_TXC", // 90: USARTD 0 Transmission Complete + "USARTD1_RXC", // 91: USARTD 1 Reception Complete + "USARTD1_DRE", // 92: USARTD 1 Data Register Empty + "USARTD1_TXC", // 93: USARTD 1 Transmission Complete + "UNUSED", // 94: not implemented on this device + "UNUSED", // 95: not implemented on this device + "UNUSED", // 96: not implemented on this device + "UNUSED", // 97: not implemented on this device + "UNUSED", // 98: not implemented on this device + "UNUSED", // 99: not implemented on this device + "UNUSED", // 100: not implemented on this device + "UNUSED", // 101: not implemented on this device + "UNUSED", // 102: not implemented on this device + "UNUSED", // 103: not implemented on this device + "PORTF_INT0", // 104: External Interrupt 0 PORT F + "PORTF_INT1", // 105: External Interrupt 1 PORT F + "UNUSED", // 106: not implemented on this device + "UNUSED", // 107: not implemented on this device + "TCF0_OVF/TCF2_LUNF", // 108: TC F0 Overflow/TC F2 Low Byte Underflow + "TCF0_ERR/TCF2_HUNF", // 109: TC F0 Error/TC F2 High Byte Underflow + "TCF0_CCA/TCF2_LCMPA", // 110: TC F0 Compare or Capture A/TC F2 Low Byte Compare A + "TCF0_CCB/TCF2_LCMPB", // 111: TC F0 Compare or Capture B/TC F2 Low Byte Compare B + "TCF0_CCC/TCF2_LCMPC", // 112: TC F0 Compare or Capture C/TC F2 Low Byte Compare C + "TCF0_CCD/TCF2_LCMPD", // 113: TC F0 Compare or Capture D/TC F2 Low Byte Compare D + "UNUSED", // 114: not implemented on this device + "UNUSED", // 115: not implemented on this device + "UNUSED", // 116: not implemented on this device + "UNUSED", // 117: not implemented on this device + "UNUSED", // 118: not implemented on this device + "USARTF0_RXC", // 119: USARTF 0 Reception Complete + "USARTF0_DRE", // 120: USARTF 0 Data Register Empty + "USARTF0_TXC", // 121: USARTF 0 Transmission Complete + "UNUSED", // 122: not implemented on this device + "UNUSED", // 123: not implemented on this device + "UNUSED", // 124: not implemented on this device + "USB_BUSEVENT", // 125: SOF, Suspend, Resume, Reset Bus Event Interrupts, CRC, Underflow, Overflow or Stall Error + "USB_TRNCOMPL", // 126: USB Transaction Complete +}; + +const char * const vtab_atxmega256c3[vts_atxmega256c3] = { // ATxmega256C3, ATxmega192C3, ATxmega128C3, ATxmega64C3, ATxmega32C3 + "RESET", // 0: Reset (various reasons) + "OSC_OSCF", // 1: Oscillator Failure NMI + "PORTC_INT0", // 2: External Interrupt 0 PORT C + "PORTC_INT1", // 3: External Interrupt 1 PORT C + "PORTR_INT0", // 4: External Interrupt 0 PORT R + "PORTR_INT1", // 5: External Interrupt 1 PORT R + "UNUSED", // 6: not implemented on this device + "UNUSED", // 7: not implemented on this device + "UNUSED", // 8: not implemented on this device + "UNUSED", // 9: not implemented on this device + "RTC_OVF", // 10: RTC Overflow + "RTC_COMP", // 11: RTC Compare + "TWIC_TWIP", // 12: 2-Wire Interface C Peripheral + "TWIC_TWIM", // 13: 2-Wire Interface C Controller + "TCC0_OVF/TCC2_LUNF", // 14: TC C0 Overflow/TC C2 Low Byte Underflow + "TCC0_ERR/TCC2_HUNF", // 15: TC C0 Error/TC C2 High Byte Underflow + "TCC0_CCA/TCC2_LCMPA", // 16: TC C0 Compare or Capture A/TC C2 Low Byte Compare A + "TCC0_CCB/TCC2_LCMPB", // 17: TC C0 Compare or Capture B/TC C2 Low Byte Compare B + "TCC0_CCC/TCC2_LCMPC", // 18: TC C0 Compare or Capture C/TC C2 Low Byte Compare C + "TCC0_CCD/TCC2_LCMPD", // 19: TC C0 Compare or Capture D/TC C2 Low Byte Compare D + "TCC1_OVF", // 20: TC C1 Overflow + "TCC1_ERR", // 21: TC C1 Error + "TCC1_CCA", // 22: TC C1 Compare or Capture A + "TCC1_CCB", // 23: TC C1 Compare or Capture B + "SPIC_INT", // 24: SPI C Interrupt + "USARTC0_RXC", // 25: USARTC 0 Reception Complete + "USARTC0_DRE", // 26: USARTC 0 Data Register Empty + "USARTC0_TXC", // 27: USARTC 0 Transmission Complete + "UNUSED", // 28: not implemented on this device + "UNUSED", // 29: not implemented on this device + "UNUSED", // 30: not implemented on this device + "UNUSED", // 31: not implemented on this device + "NVM_EE", // 32: NVM EEPROM + "NVM_SPM", // 33: NVM SPM + "PORTB_INT0", // 34: External Interrupt 0 PORT B + "PORTB_INT1", // 35: External Interrupt 1 PORT B + "UNUSED", // 36: not implemented on this device + "UNUSED", // 37: not implemented on this device + "UNUSED", // 38: not implemented on this device + "UNUSED", // 39: not implemented on this device + "UNUSED", // 40: not implemented on this device + "UNUSED", // 41: not implemented on this device + "UNUSED", // 42: not implemented on this device + "PORTE_INT0", // 43: External Interrupt 0 PORT E + "PORTE_INT1", // 44: External Interrupt 1 PORT E + "TWIE_TWIP", // 45: 2-Wire Interface E Peripheral + "TWIE_TWIM", // 46: 2-Wire Interface E Controller + "TCE0_OVF/TCE2_LUNF", // 47: TC E0 Overflow/TC E2 Low Byte Underflow + "TCE0_ERR/TCE2_HUNF", // 48: TC E0 Error/TC E2 High Byte Underflow + "TCE0_CCA/TCE2_LCMPA", // 49: TC E0 Compare or Capture A/TC E2 Low Byte Compare A + "TCE0_CCB/TCE2_LCMPB", // 50: TC E0 Compare or Capture B/TC E2 Low Byte Compare B + "TCE0_CCC/TCE2_LCMPC", // 51: TC E0 Compare or Capture C/TC E2 Low Byte Compare C + "TCE0_CCD/TCE2_LCMPD", // 52: TC E0 Compare or Capture D/TC E2 Low Byte Compare D + "UNUSED", // 53: not implemented on this device + "UNUSED", // 54: not implemented on this device + "UNUSED", // 55: not implemented on this device + "UNUSED", // 56: not implemented on this device + "UNUSED", // 57: not implemented on this device + "USARTE0_RXC", // 58: USARTE 0 Reception Complete + "USARTE0_DRE", // 59: USARTE 0 Data Register Empty + "USARTE0_TXC", // 60: USARTE 0 Transmission Complete + "UNUSED", // 61: not implemented on this device + "UNUSED", // 62: not implemented on this device + "UNUSED", // 63: not implemented on this device + "PORTD_INT0", // 64: External Interrupt 0 PORT D + "PORTD_INT1", // 65: External Interrupt 1 PORT D + "PORTA_INT0", // 66: External Interrupt 0 PORT A + "PORTA_INT1", // 67: External Interrupt 1 PORT A + "ACA_AC0", // 68: ACA AC 0 Interrupt + "ACA_AC1", // 69: ACA AC 1 Interrupt + "ACA_ACW", // 70: ACA AC Window Mode + "ADCA_CH0", // 71: ADCA Interrupt 0 + "UNUSED", // 72: not implemented on this device + "UNUSED", // 73: not implemented on this device + "UNUSED", // 74: not implemented on this device + "UNUSED", // 75: not implemented on this device + "UNUSED", // 76: not implemented on this device + "TCD0_OVF/TCD2_LUNF", // 77: TC D0 Overflow/TC D2 Low Byte Underflow + "TCD0_ERR/TCD2_HUNF", // 78: TC D0 Error/TC D2 High Byte Underflow + "TCD0_CCA/TCD2_LCMPA", // 79: TC D0 Compare or Capture A/TC D2 Low Byte Compare A + "TCD0_CCB/TCD2_LCMPB", // 80: TC D0 Compare or Capture B/TC D2 Low Byte Compare B + "TCD0_CCC/TCD2_LCMPC", // 81: TC D0 Compare or Capture C/TC D2 Low Byte Compare C + "TCD0_CCD/TCD2_LCMPD", // 82: TC D0 Compare or Capture D/TC D2 Low Byte Compare D + "UNUSED", // 83: not implemented on this device + "UNUSED", // 84: not implemented on this device + "UNUSED", // 85: not implemented on this device + "UNUSED", // 86: not implemented on this device + "SPID_INT", // 87: SPI D Interrupt + "USARTD0_RXC", // 88: USARTD 0 Reception Complete + "USARTD0_DRE", // 89: USARTD 0 Data Register Empty + "USARTD0_TXC", // 90: USARTD 0 Transmission Complete + "UNUSED", // 91: not implemented on this device + "UNUSED", // 92: not implemented on this device + "UNUSED", // 93: not implemented on this device + "UNUSED", // 94: not implemented on this device + "UNUSED", // 95: not implemented on this device + "UNUSED", // 96: not implemented on this device + "UNUSED", // 97: not implemented on this device + "UNUSED", // 98: not implemented on this device + "UNUSED", // 99: not implemented on this device + "UNUSED", // 100: not implemented on this device + "UNUSED", // 101: not implemented on this device + "UNUSED", // 102: not implemented on this device + "UNUSED", // 103: not implemented on this device + "PORTF_INT0", // 104: External Interrupt 0 PORT F + "PORTF_INT1", // 105: External Interrupt 1 PORT F + "UNUSED", // 106: not implemented on this device + "UNUSED", // 107: not implemented on this device + "TCF0_OVF/TCF2_LUNF", // 108: TC F0 Overflow/TC F2 Low Byte Underflow + "TCF0_ERR/TCF2_HUNF", // 109: TC F0 Error/TC F2 High Byte Underflow + "TCF0_CCA/TCF2_LCMPA", // 110: TC F0 Compare or Capture A/TC F2 Low Byte Compare A + "TCF0_CCB/TCF2_LCMPB", // 111: TC F0 Compare or Capture B/TC F2 Low Byte Compare B + "TCF0_CCC/TCF2_LCMPC", // 112: TC F0 Compare or Capture C/TC F2 Low Byte Compare C + "TCF0_CCD/TCF2_LCMPD", // 113: TC F0 Compare or Capture D/TC F2 Low Byte Compare D + "UNUSED", // 114: not implemented on this device + "UNUSED", // 115: not implemented on this device + "UNUSED", // 116: not implemented on this device + "UNUSED", // 117: not implemented on this device + "UNUSED", // 118: not implemented on this device + "UNUSED", // 119: not implemented on this device + "UNUSED", // 120: not implemented on this device + "UNUSED", // 121: not implemented on this device + "UNUSED", // 122: not implemented on this device + "UNUSED", // 123: not implemented on this device + "UNUSED", // 124: not implemented on this device + "USB_BUSEVENT", // 125: SOF, Suspend, Resume, Reset Bus Event Interrupts, CRC, Underflow, Overflow or Stall Error + "USB_TRNCOMPL", // 126: USB Transaction Complete +}; + +const char * const vtab_atxmega384c3[vts_atxmega384c3] = { // ATxmega384C3 + "RESET", // 0: Reset (various reasons) + "OSC_OSCF", // 1: Oscillator Failure NMI + "PORTC_INT0", // 2: External Interrupt 0 PORT C + "PORTC_INT1", // 3: External Interrupt 1 PORT C + "PORTR_INT0", // 4: External Interrupt 0 PORT R + "PORTR_INT1", // 5: External Interrupt 1 PORT R + "DMA_CH0", // 6: DMA Channel 0 + "DMA_CH1", // 7: DMA Channel 1 + "UNUSED", // 8: not implemented on this device + "UNUSED", // 9: not implemented on this device + "RTC_OVF", // 10: RTC Overflow + "RTC_COMP", // 11: RTC Compare + "TWIC_TWIP", // 12: 2-Wire Interface C Peripheral + "TWIC_TWIM", // 13: 2-Wire Interface C Controller + "TCC0_OVF/TCC2_LUNF", // 14: TC C0 Overflow/TC C2 Low Byte Underflow + "TCC0_ERR/TCC2_HUNF", // 15: TC C0 Error/TC C2 High Byte Underflow + "TCC0_CCA/TCC2_LCMPA", // 16: TC C0 Compare or Capture A/TC C2 Low Byte Compare A + "TCC0_CCB/TCC2_LCMPB", // 17: TC C0 Compare or Capture B/TC C2 Low Byte Compare B + "TCC0_CCC/TCC2_LCMPC", // 18: TC C0 Compare or Capture C/TC C2 Low Byte Compare C + "TCC0_CCD/TCC2_LCMPD", // 19: TC C0 Compare or Capture D/TC C2 Low Byte Compare D + "TCC1_OVF", // 20: TC C1 Overflow + "TCC1_ERR", // 21: TC C1 Error + "TCC1_CCA", // 22: TC C1 Compare or Capture A + "TCC1_CCB", // 23: TC C1 Compare or Capture B + "SPIC_INT", // 24: SPI C Interrupt + "USARTC0_RXC", // 25: USARTC 0 Reception Complete + "USARTC0_DRE", // 26: USARTC 0 Data Register Empty + "USARTC0_TXC", // 27: USARTC 0 Transmission Complete + "USARTC1_RXC", // 28: USARTC 1 Reception Complete + "USARTC1_DRE", // 29: USARTC 1 Data Register Empty + "USARTC1_TXC", // 30: USARTC 1 Transmission Complete + "AES_INT", // 31: AES Interrupt + "NVM_EE", // 32: NVM EEPROM + "NVM_SPM", // 33: NVM SPM + "PORTB_INT0", // 34: External Interrupt 0 PORT B + "PORTB_INT1", // 35: External Interrupt 1 PORT B + "UNUSED", // 36: not implemented on this device + "UNUSED", // 37: not implemented on this device + "UNUSED", // 38: not implemented on this device + "UNUSED", // 39: not implemented on this device + "UNUSED", // 40: not implemented on this device + "UNUSED", // 41: not implemented on this device + "UNUSED", // 42: not implemented on this device + "PORTE_INT0", // 43: External Interrupt 0 PORT E + "PORTE_INT1", // 44: External Interrupt 1 PORT E + "TWIE_TWIP", // 45: 2-Wire Interface E Peripheral + "TWIE_TWIM", // 46: 2-Wire Interface E Controller + "TCE0_OVF/TCE2_LUNF", // 47: TC E0 Overflow/TC E2 Low Byte Underflow + "TCE0_ERR/TCE2_HUNF", // 48: TC E0 Error/TC E2 High Byte Underflow + "TCE0_CCA/TCE2_LCMPA", // 49: TC E0 Compare or Capture A/TC E2 Low Byte Compare A + "TCE0_CCB/TCE2_LCMPB", // 50: TC E0 Compare or Capture B/TC E2 Low Byte Compare B + "TCE0_CCC/TCE2_LCMPC", // 51: TC E0 Compare or Capture C/TC E2 Low Byte Compare C + "TCE0_CCD/TCE2_LCMPD", // 52: TC E0 Compare or Capture D/TC E2 Low Byte Compare D + "UNUSED", // 53: not implemented on this device + "UNUSED", // 54: not implemented on this device + "UNUSED", // 55: not implemented on this device + "UNUSED", // 56: not implemented on this device + "UNUSED", // 57: not implemented on this device + "USARTE0_RXC", // 58: USARTE 0 Reception Complete + "USARTE0_DRE", // 59: USARTE 0 Data Register Empty + "USARTE0_TXC", // 60: USARTE 0 Transmission Complete + "UNUSED", // 61: not implemented on this device + "UNUSED", // 62: not implemented on this device + "UNUSED", // 63: not implemented on this device + "PORTD_INT0", // 64: External Interrupt 0 PORT D + "PORTD_INT1", // 65: External Interrupt 1 PORT D + "PORTA_INT0", // 66: External Interrupt 0 PORT A + "PORTA_INT1", // 67: External Interrupt 1 PORT A + "ACA_AC0", // 68: ACA AC 0 Interrupt + "ACA_AC1", // 69: ACA AC 1 Interrupt + "ACA_ACW", // 70: ACA AC Window Mode + "ADCA_CH0", // 71: ADCA Interrupt 0 + "UNUSED", // 72: not implemented on this device + "UNUSED", // 73: not implemented on this device + "UNUSED", // 74: not implemented on this device + "UNUSED", // 75: not implemented on this device + "UNUSED", // 76: not implemented on this device + "TCD0_OVF/TCD2_LUNF", // 77: TC D0 Overflow/TC D2 Low Byte Underflow + "TCD0_ERR/TCD2_HUNF", // 78: TC D0 Error/TC D2 High Byte Underflow + "TCD0_CCA/TCD2_LCMPA", // 79: TC D0 Compare or Capture A/TC D2 Low Byte Compare A + "TCD0_CCB/TCD2_LCMPB", // 80: TC D0 Compare or Capture B/TC D2 Low Byte Compare B + "TCD0_CCC/TCD2_LCMPC", // 81: TC D0 Compare or Capture C/TC D2 Low Byte Compare C + "TCD0_CCD/TCD2_LCMPD", // 82: TC D0 Compare or Capture D/TC D2 Low Byte Compare D + "UNUSED", // 83: not implemented on this device + "UNUSED", // 84: not implemented on this device + "UNUSED", // 85: not implemented on this device + "UNUSED", // 86: not implemented on this device + "SPID_INT", // 87: SPI D Interrupt + "USARTD0_RXC", // 88: USARTD 0 Reception Complete + "USARTD0_DRE", // 89: USARTD 0 Data Register Empty + "USARTD0_TXC", // 90: USARTD 0 Transmission Complete + "UNUSED", // 91: not implemented on this device + "UNUSED", // 92: not implemented on this device + "UNUSED", // 93: not implemented on this device + "UNUSED", // 94: not implemented on this device + "UNUSED", // 95: not implemented on this device + "UNUSED", // 96: not implemented on this device + "UNUSED", // 97: not implemented on this device + "UNUSED", // 98: not implemented on this device + "UNUSED", // 99: not implemented on this device + "UNUSED", // 100: not implemented on this device + "UNUSED", // 101: not implemented on this device + "UNUSED", // 102: not implemented on this device + "UNUSED", // 103: not implemented on this device + "PORTF_INT0", // 104: External Interrupt 0 PORT F + "PORTF_INT1", // 105: External Interrupt 1 PORT F + "UNUSED", // 106: not implemented on this device + "UNUSED", // 107: not implemented on this device + "TCF0_OVF/TCF2_LUNF", // 108: TC F0 Overflow/TC F2 Low Byte Underflow + "TCF0_ERR/TCF2_HUNF", // 109: TC F0 Error/TC F2 High Byte Underflow + "TCF0_CCA/TCF2_LCMPA", // 110: TC F0 Compare or Capture A/TC F2 Low Byte Compare A + "TCF0_CCB/TCF2_LCMPB", // 111: TC F0 Compare or Capture B/TC F2 Low Byte Compare B + "TCF0_CCC/TCF2_LCMPC", // 112: TC F0 Compare or Capture C/TC F2 Low Byte Compare C + "TCF0_CCD/TCF2_LCMPD", // 113: TC F0 Compare or Capture D/TC F2 Low Byte Compare D + "UNUSED", // 114: not implemented on this device + "UNUSED", // 115: not implemented on this device + "UNUSED", // 116: not implemented on this device + "UNUSED", // 117: not implemented on this device + "UNUSED", // 118: not implemented on this device + "UNUSED", // 119: not implemented on this device + "UNUSED", // 120: not implemented on this device + "UNUSED", // 121: not implemented on this device + "UNUSED", // 122: not implemented on this device + "UNUSED", // 123: not implemented on this device + "UNUSED", // 124: not implemented on this device + "USB_BUSEVENT", // 125: SOF, Suspend, Resume, Reset Bus Event Interrupts, CRC, Underflow, Overflow or Stall Error + "USB_TRNCOMPL", // 126: USB Transaction Complete +}; + +const char * const vtab_atxmega384d3[vts_atxmega384d3] = { // ATxmega384D3, ATxmega256D3, ATxmega192D3, ATxmega128D3, ATxmega64D3, ATxmega32D3 + "RESET", // 0: Reset (various reasons) + "OSC_OSCF", // 1: Oscillator Failure NMI + "PORTC_INT0", // 2: External Interrupt 0 PORT C + "PORTC_INT1", // 3: External Interrupt 1 PORT C + "PORTR_INT0", // 4: External Interrupt 0 PORT R + "PORTR_INT1", // 5: External Interrupt 1 PORT R + "UNUSED", // 6: not implemented on this device + "UNUSED", // 7: not implemented on this device + "UNUSED", // 8: not implemented on this device + "UNUSED", // 9: not implemented on this device + "RTC_OVF", // 10: RTC Overflow + "RTC_COMP", // 11: RTC Compare + "TWIC_TWIP", // 12: 2-Wire Interface C Peripheral + "TWIC_TWIM", // 13: 2-Wire Interface C Controller + "TCC0_OVF/TCC2_LUNF", // 14: TC C0 Overflow/TC C2 Low Byte Underflow + "TCC0_ERR/TCC2_HUNF", // 15: TC C0 Error/TC C2 High Byte Underflow + "TCC0_CCA/TCC2_LCMPA", // 16: TC C0 Compare or Capture A/TC C2 Low Byte Compare A + "TCC0_CCB/TCC2_LCMPB", // 17: TC C0 Compare or Capture B/TC C2 Low Byte Compare B + "TCC0_CCC/TCC2_LCMPC", // 18: TC C0 Compare or Capture C/TC C2 Low Byte Compare C + "TCC0_CCD/TCC2_LCMPD", // 19: TC C0 Compare or Capture D/TC C2 Low Byte Compare D + "TCC1_OVF", // 20: TC C1 Overflow + "TCC1_ERR", // 21: TC C1 Error + "TCC1_CCA", // 22: TC C1 Compare or Capture A + "TCC1_CCB", // 23: TC C1 Compare or Capture B + "SPIC_INT", // 24: SPI C Interrupt + "USARTC0_RXC", // 25: USARTC 0 Reception Complete + "USARTC0_DRE", // 26: USARTC 0 Data Register Empty + "USARTC0_TXC", // 27: USARTC 0 Transmission Complete + "UNUSED", // 28: not implemented on this device + "UNUSED", // 29: not implemented on this device + "UNUSED", // 30: not implemented on this device + "UNUSED", // 31: not implemented on this device + "NVM_EE", // 32: NVM EEPROM + "NVM_SPM", // 33: NVM SPM + "PORTB_INT0", // 34: External Interrupt 0 PORT B + "PORTB_INT1", // 35: External Interrupt 1 PORT B + "UNUSED", // 36: not implemented on this device + "UNUSED", // 37: not implemented on this device + "UNUSED", // 38: not implemented on this device + "UNUSED", // 39: not implemented on this device + "UNUSED", // 40: not implemented on this device + "UNUSED", // 41: not implemented on this device + "UNUSED", // 42: not implemented on this device + "PORTE_INT0", // 43: External Interrupt 0 PORT E + "PORTE_INT1", // 44: External Interrupt 1 PORT E + "TWIE_TWIP", // 45: 2-Wire Interface E Peripheral + "TWIE_TWIM", // 46: 2-Wire Interface E Controller + "TCE0_OVF/TCE2_LUNF", // 47: TC E0 Overflow/TC E2 Low Byte Underflow + "TCE0_ERR/TCE2_HUNF", // 48: TC E0 Error/TC E2 High Byte Underflow + "TCE0_CCA/TCE2_LCMPA", // 49: TC E0 Compare or Capture A/TC E2 Low Byte Compare A + "TCE0_CCB/TCE2_LCMPB", // 50: TC E0 Compare or Capture B/TC E2 Low Byte Compare B + "TCE0_CCC/TCE2_LCMPC", // 51: TC E0 Compare or Capture C/TC E2 Low Byte Compare C + "TCE0_CCD/TCE2_LCMPD", // 52: TC E0 Compare or Capture D/TC E2 Low Byte Compare D + "UNUSED", // 53: not implemented on this device + "UNUSED", // 54: not implemented on this device + "UNUSED", // 55: not implemented on this device + "UNUSED", // 56: not implemented on this device + "UNUSED", // 57: not implemented on this device + "USARTE0_RXC", // 58: USARTE 0 Reception Complete + "USARTE0_DRE", // 59: USARTE 0 Data Register Empty + "USARTE0_TXC", // 60: USARTE 0 Transmission Complete + "UNUSED", // 61: not implemented on this device + "UNUSED", // 62: not implemented on this device + "UNUSED", // 63: not implemented on this device + "PORTD_INT0", // 64: External Interrupt 0 PORT D + "PORTD_INT1", // 65: External Interrupt 1 PORT D + "PORTA_INT0", // 66: External Interrupt 0 PORT A + "PORTA_INT1", // 67: External Interrupt 1 PORT A + "ACA_AC0", // 68: ACA AC 0 Interrupt + "ACA_AC1", // 69: ACA AC 1 Interrupt + "ACA_ACW", // 70: ACA AC Window Mode + "ADCA_CH0", // 71: ADCA Interrupt 0 + "UNUSED", // 72: not implemented on this device + "UNUSED", // 73: not implemented on this device + "UNUSED", // 74: not implemented on this device + "UNUSED", // 75: not implemented on this device + "UNUSED", // 76: not implemented on this device + "TCD0_OVF/TCD2_LUNF", // 77: TC D0 Overflow/TC D2 Low Byte Underflow + "TCD0_ERR/TCD2_HUNF", // 78: TC D0 Error/TC D2 High Byte Underflow + "TCD0_CCA/TCD2_LCMPA", // 79: TC D0 Compare or Capture A/TC D2 Low Byte Compare A + "TCD0_CCB/TCD2_LCMPB", // 80: TC D0 Compare or Capture B/TC D2 Low Byte Compare B + "TCD0_CCC/TCD2_LCMPC", // 81: TC D0 Compare or Capture C/TC D2 Low Byte Compare C + "TCD0_CCD/TCD2_LCMPD", // 82: TC D0 Compare or Capture D/TC D2 Low Byte Compare D + "UNUSED", // 83: not implemented on this device + "UNUSED", // 84: not implemented on this device + "UNUSED", // 85: not implemented on this device + "UNUSED", // 86: not implemented on this device + "SPID_INT", // 87: SPI D Interrupt + "USARTD0_RXC", // 88: USARTD 0 Reception Complete + "USARTD0_DRE", // 89: USARTD 0 Data Register Empty + "USARTD0_TXC", // 90: USARTD 0 Transmission Complete + "UNUSED", // 91: not implemented on this device + "UNUSED", // 92: not implemented on this device + "UNUSED", // 93: not implemented on this device + "UNUSED", // 94: not implemented on this device + "UNUSED", // 95: not implemented on this device + "UNUSED", // 96: not implemented on this device + "UNUSED", // 97: not implemented on this device + "UNUSED", // 98: not implemented on this device + "UNUSED", // 99: not implemented on this device + "UNUSED", // 100: not implemented on this device + "UNUSED", // 101: not implemented on this device + "UNUSED", // 102: not implemented on this device + "UNUSED", // 103: not implemented on this device + "PORTF_INT0", // 104: External Interrupt 0 PORT F + "PORTF_INT1", // 105: External Interrupt 1 PORT F + "UNUSED", // 106: not implemented on this device + "UNUSED", // 107: not implemented on this device + "TCF0_OVF/TCF2_LUNF", // 108: TC F0 Overflow/TC F2 Low Byte Underflow + "TCF0_ERR/TCF2_HUNF", // 109: TC F0 Error/TC F2 High Byte Underflow + "TCF0_CCA/TCF2_LCMPA", // 110: TC F0 Compare or Capture A/TC F2 Low Byte Compare A + "TCF0_CCB/TCF2_LCMPB", // 111: TC F0 Compare or Capture B/TC F2 Low Byte Compare B + "TCF0_CCC/TCF2_LCMPC", // 112: TC F0 Compare or Capture C/TC F2 Low Byte Compare C + "TCF0_CCD/TCF2_LCMPD", // 113: TC F0 Compare or Capture D/TC F2 Low Byte Compare D +}; + +const char * const vtab_attiny402[vts_attiny402] = { // ATtiny402, ATtiny202 + "RESET", // 0: Reset (various reasons) + "CRCSCAN_NMI", // 1: CRCSCAN Non-maskable Interrupt + "BOD_VLM", // 2: Brown-out Detector Voltage Level Monitor + "PORTA_PORT", // 3: Interrupt PORT A + "UNUSED", // 4: not implemented on this device + "UNUSED", // 5: not implemented on this device + "RTC_CNT", // 6: RTC Counter Interrupt + "RTC_PIT", // 7: RTC Periodic Interrupt Timer + "TCA0_LUNF/TCA0_OVF", // 8: TC A0 Low Underflow/TC A0 Overflow + "TCA0_HUNF", // 9: TC A0 High Underflow + "TCA0_CMP0/TCA0_LCMP0", // 10: TC A0 Compare 0/TC A0 Low Compare 0 + "TCA0_CMP1/TCA0_LCMP1", // 11: TC A0 Compare 1/TC A0 Low Compare 1 + "TCA0_CMP2/TCA0_LCMP2", // 12: TC A0 Compare 2/TC A0 Low Compare 2 + "TCB0_INT", // 13: TC B0 Interrupt + "UNUSED", // 14: not implemented on this device + "UNUSED", // 15: not implemented on this device + "AC0_AC", // 16: AC0 AC Interrupt + "ADC0_RESRDY", // 17: ADC 0 Result Ready + "ADC0_WCOMP", // 18: ADC 0 Window Comparator + "TWI0_TWIP", // 19: 2-Wire Interface 0 Peripheral + "TWI0_TWIM", // 20: 2-Wire Interface 0 Controller + "SPI0_INT", // 21: SPI 0 Interrupt + "USART0_RXC", // 22: USART 0 Receive Complete + "USART0_DRE", // 23: USART 0 Data Register Empty + "USART0_TXC", // 24: USART 0 Transmit Complete + "NVMCTRL_EE", // 25: NVM EEPROM +}; + +const char * const vtab_attiny404[vts_attiny404] = { // ATtiny404, ATtiny204 + "RESET", // 0: Reset (various reasons) + "CRCSCAN_NMI", // 1: CRCSCAN Non-maskable Interrupt + "BOD_VLM", // 2: Brown-out Detector Voltage Level Monitor + "PORTA_PORT", // 3: Interrupt PORT A + "PORTB_PORT", // 4: Interrupt PORT B + "UNUSED", // 5: not implemented on this device + "RTC_CNT", // 6: RTC Counter Interrupt + "RTC_PIT", // 7: RTC Periodic Interrupt Timer + "TCA0_LUNF/TCA0_OVF", // 8: TC A0 Low Underflow/TC A0 Overflow + "TCA0_HUNF", // 9: TC A0 High Underflow + "TCA0_CMP0/TCA0_LCMP0", // 10: TC A0 Compare 0/TC A0 Low Compare 0 + "TCA0_CMP1/TCA0_LCMP1", // 11: TC A0 Compare 1/TC A0 Low Compare 1 + "TCA0_CMP2/TCA0_LCMP2", // 12: TC A0 Compare 2/TC A0 Low Compare 2 + "TCB0_INT", // 13: TC B0 Interrupt + "UNUSED", // 14: not implemented on this device + "UNUSED", // 15: not implemented on this device + "AC0_AC", // 16: AC0 AC Interrupt + "ADC0_RESRDY", // 17: ADC 0 Result Ready + "ADC0_WCOMP", // 18: ADC 0 Window Comparator + "TWI0_TWIP", // 19: 2-Wire Interface 0 Peripheral + "TWI0_TWIM", // 20: 2-Wire Interface 0 Controller + "SPI0_INT", // 21: SPI 0 Interrupt + "USART0_RXC", // 22: USART 0 Receive Complete + "USART0_DRE", // 23: USART 0 Data Register Empty + "USART0_TXC", // 24: USART 0 Transmit Complete + "NVMCTRL_EE", // 25: NVM EEPROM +}; + +const char * const vtab_attiny406[vts_attiny406] = { // ATtiny406 + "RESET", // 0: Reset (various reasons) + "CRCSCAN_NMI", // 1: CRCSCAN Non-maskable Interrupt + "BOD_VLM", // 2: Brown-out Detector Voltage Level Monitor + "PORTA_PORT", // 3: Interrupt PORT A + "PORTB_PORT", // 4: Interrupt PORT B + "PORTC_PORT", // 5: Interrupt PORT C + "RTC_CNT", // 6: RTC Counter Interrupt + "RTC_PIT", // 7: RTC Periodic Interrupt Timer + "TCA0_LUNF/TCA0_OVF", // 8: TC A0 Low Underflow/TC A0 Overflow + "TCA0_HUNF", // 9: TC A0 High Underflow + "TCA0_CMP0/TCA0_LCMP0", // 10: TC A0 Compare 0/TC A0 Low Compare 0 + "TCA0_CMP1/TCA0_LCMP1", // 11: TC A0 Compare 1/TC A0 Low Compare 1 + "TCA0_CMP2/TCA0_LCMP2", // 12: TC A0 Compare 2/TC A0 Low Compare 2 + "TCB0_INT", // 13: TC B0 Interrupt + "UNUSED", // 14: not implemented on this device + "UNUSED", // 15: not implemented on this device + "AC0_AC", // 16: AC0 AC Interrupt + "ADC0_RESRDY", // 17: ADC 0 Result Ready + "ADC0_WCOMP", // 18: ADC 0 Window Comparator + "TWI0_TWIP", // 19: 2-Wire Interface 0 Peripheral + "TWI0_TWIM", // 20: 2-Wire Interface 0 Controller + "SPI0_INT", // 21: SPI 0 Interrupt + "USART0_RXC", // 22: USART 0 Receive Complete + "USART0_DRE", // 23: USART 0 Data Register Empty + "USART0_TXC", // 24: USART 0 Transmit Complete + "NVMCTRL_EE", // 25: NVM EEPROM +}; + +const char * const vtab_attiny412[vts_attiny412] = { // ATtiny412, ATtiny212 + "RESET", // 0: Reset (various reasons) + "CRCSCAN_NMI", // 1: CRCSCAN Non-maskable Interrupt + "BOD_VLM", // 2: Brown-out Detector Voltage Level Monitor + "PORTA_PORT", // 3: Interrupt PORT A + "UNUSED", // 4: not implemented on this device + "UNUSED", // 5: not implemented on this device + "RTC_CNT", // 6: RTC Counter Interrupt + "RTC_PIT", // 7: RTC Periodic Interrupt Timer + "TCA0_LUNF/TCA0_OVF", // 8: TC A0 Low Underflow/TC A0 Overflow + "TCA0_HUNF", // 9: TC A0 High Underflow + "TCA0_CMP0/TCA0_LCMP0", // 10: TC A0 Compare 0/TC A0 Low Compare 0 + "TCA0_CMP1/TCA0_LCMP1", // 11: TC A0 Compare 1/TC A0 Low Compare 1 + "TCA0_CMP2/TCA0_LCMP2", // 12: TC A0 Compare 2/TC A0 Low Compare 2 + "TCB0_INT", // 13: TC B0 Interrupt + "TCD0_OVF", // 14: TC D0 Overflow + "TCD0_TRIG", // 15: TC D0 Trigger + "AC0_AC", // 16: AC0 AC Interrupt + "ADC0_RESRDY", // 17: ADC 0 Result Ready + "ADC0_WCOMP", // 18: ADC 0 Window Comparator + "TWI0_TWIP", // 19: 2-Wire Interface 0 Peripheral + "TWI0_TWIM", // 20: 2-Wire Interface 0 Controller + "SPI0_INT", // 21: SPI 0 Interrupt + "USART0_RXC", // 22: USART 0 Receive Complete + "USART0_DRE", // 23: USART 0 Data Register Empty + "USART0_TXC", // 24: USART 0 Transmit Complete + "NVMCTRL_EE", // 25: NVM EEPROM +}; + +const char * const vtab_attiny814[vts_attiny814] = { // ATtiny814, ATtiny414, ATtiny214 + "RESET", // 0: Reset (various reasons) + "CRCSCAN_NMI", // 1: CRCSCAN Non-maskable Interrupt + "BOD_VLM", // 2: Brown-out Detector Voltage Level Monitor + "PORTA_PORT", // 3: Interrupt PORT A + "PORTB_PORT", // 4: Interrupt PORT B + "UNUSED", // 5: not implemented on this device + "RTC_CNT", // 6: RTC Counter Interrupt + "RTC_PIT", // 7: RTC Periodic Interrupt Timer + "TCA0_LUNF/TCA0_OVF", // 8: TC A0 Low Underflow/TC A0 Overflow + "TCA0_HUNF", // 9: TC A0 High Underflow + "TCA0_CMP0/TCA0_LCMP0", // 10: TC A0 Compare 0/TC A0 Low Compare 0 + "TCA0_CMP1/TCA0_LCMP1", // 11: TC A0 Compare 1/TC A0 Low Compare 1 + "TCA0_CMP2/TCA0_LCMP2", // 12: TC A0 Compare 2/TC A0 Low Compare 2 + "TCB0_INT", // 13: TC B0 Interrupt + "TCD0_OVF", // 14: TC D0 Overflow + "TCD0_TRIG", // 15: TC D0 Trigger + "AC0_AC", // 16: AC0 AC Interrupt + "ADC0_RESRDY", // 17: ADC 0 Result Ready + "ADC0_WCOMP", // 18: ADC 0 Window Comparator + "TWI0_TWIP", // 19: 2-Wire Interface 0 Peripheral + "TWI0_TWIM", // 20: 2-Wire Interface 0 Controller + "SPI0_INT", // 21: SPI 0 Interrupt + "USART0_RXC", // 22: USART 0 Receive Complete + "USART0_DRE", // 23: USART 0 Data Register Empty + "USART0_TXC", // 24: USART 0 Transmit Complete + "NVMCTRL_EE", // 25: NVM EEPROM +}; + +const char * const vtab_attiny817[vts_attiny817] = { // ATtiny817, ATtiny816, ATtiny417, ATtiny416auto, ATtiny416 + "RESET", // 0: Reset (various reasons) + "CRCSCAN_NMI", // 1: CRCSCAN Non-maskable Interrupt + "BOD_VLM", // 2: Brown-out Detector Voltage Level Monitor + "PORTA_PORT", // 3: Interrupt PORT A + "PORTB_PORT", // 4: Interrupt PORT B + "PORTC_PORT", // 5: Interrupt PORT C + "RTC_CNT", // 6: RTC Counter Interrupt + "RTC_PIT", // 7: RTC Periodic Interrupt Timer + "TCA0_LUNF/TCA0_OVF", // 8: TC A0 Low Underflow/TC A0 Overflow + "TCA0_HUNF", // 9: TC A0 High Underflow + "TCA0_CMP0/TCA0_LCMP0", // 10: TC A0 Compare 0/TC A0 Low Compare 0 + "TCA0_CMP1/TCA0_LCMP1", // 11: TC A0 Compare 1/TC A0 Low Compare 1 + "TCA0_CMP2/TCA0_LCMP2", // 12: TC A0 Compare 2/TC A0 Low Compare 2 + "TCB0_INT", // 13: TC B0 Interrupt + "TCD0_OVF", // 14: TC D0 Overflow + "TCD0_TRIG", // 15: TC D0 Trigger + "AC0_AC", // 16: AC0 AC Interrupt + "ADC0_RESRDY", // 17: ADC 0 Result Ready + "ADC0_WCOMP", // 18: ADC 0 Window Comparator + "TWI0_TWIP", // 19: 2-Wire Interface 0 Peripheral + "TWI0_TWIM", // 20: 2-Wire Interface 0 Controller + "SPI0_INT", // 21: SPI 0 Interrupt + "USART0_RXC", // 22: USART 0 Receive Complete + "USART0_DRE", // 23: USART 0 Data Register Empty + "USART0_TXC", // 24: USART 0 Transmit Complete + "NVMCTRL_EE", // 25: NVM EEPROM +}; + +const char * const vtab_attiny1607[vts_attiny1607] = { // ATtiny1607, ATtiny1606, ATtiny1604, ATtiny807, ATtiny806, ATtiny804 + "RESET", // 0: Reset (various reasons) + "CRCSCAN_NMI", // 1: CRCSCAN Non-maskable Interrupt + "BOD_VLM", // 2: Brown-out Detector Voltage Level Monitor + "PORTA_PORT", // 3: Interrupt PORT A + "PORTB_PORT", // 4: Interrupt PORT B + "PORTC_PORT", // 5: Interrupt PORT C + "RTC_CNT", // 6: RTC Counter Interrupt + "RTC_PIT", // 7: RTC Periodic Interrupt Timer + "TCA0_LUNF/TCA0_OVF", // 8: TC A0 Low Underflow/TC A0 Overflow + "TCA0_HUNF", // 9: TC A0 High Underflow + "TCA0_CMP0/TCA0_LCMP0", // 10: TC A0 Compare 0/TC A0 Low Compare 0 + "TCA0_CMP1/TCA0_LCMP1", // 11: TC A0 Compare 1/TC A0 Low Compare 1 + "TCA0_CMP2/TCA0_LCMP2", // 12: TC A0 Compare 2/TC A0 Low Compare 2 + "TCB0_INT", // 13: TC B0 Interrupt + "UNUSED", // 14: not implemented on this device + "UNUSED", // 15: not implemented on this device + "UNUSED", // 16: not implemented on this device + "AC0_AC", // 17: AC0 AC Interrupt + "UNUSED", // 18: not implemented on this device + "UNUSED", // 19: not implemented on this device + "ADC0_RESRDY", // 20: ADC 0 Result Ready + "ADC0_WCOMP", // 21: ADC 0 Window Comparator + "UNUSED", // 22: not implemented on this device + "UNUSED", // 23: not implemented on this device + "TWI0_TWIP", // 24: 2-Wire Interface 0 Peripheral + "TWI0_TWIM", // 25: 2-Wire Interface 0 Controller + "SPI0_INT", // 26: SPI 0 Interrupt + "USART0_RXC", // 27: USART 0 Receive Complete + "USART0_DRE", // 28: USART 0 Data Register Empty + "USART0_TXC", // 29: USART 0 Transmit Complete + "NVMCTRL_EE", // 30: NVM EEPROM +}; + +const char * const vtab_attiny1614[vts_attiny1614] = { // ATtiny1614 + "RESET", // 0: Reset (various reasons) + "CRCSCAN_NMI", // 1: CRCSCAN Non-maskable Interrupt + "BOD_VLM", // 2: Brown-out Detector Voltage Level Monitor + "PORTA_PORT", // 3: Interrupt PORT A + "PORTB_PORT", // 4: Interrupt PORT B + "UNUSED", // 5: not implemented on this device + "RTC_CNT", // 6: RTC Counter Interrupt + "RTC_PIT", // 7: RTC Periodic Interrupt Timer + "TCA0_LUNF/TCA0_OVF", // 8: TC A0 Low Underflow/TC A0 Overflow + "TCA0_HUNF", // 9: TC A0 High Underflow + "TCA0_CMP0/TCA0_LCMP0", // 10: TC A0 Compare 0/TC A0 Low Compare 0 + "TCA0_CMP1/TCA0_LCMP1", // 11: TC A0 Compare 1/TC A0 Low Compare 1 + "TCA0_CMP2/TCA0_LCMP2", // 12: TC A0 Compare 2/TC A0 Low Compare 2 + "TCB0_INT", // 13: TC B0 Interrupt + "TCB1_INT", // 14: TC B1 Interrupt + "TCD0_OVF", // 15: TC D0 Overflow + "TCD0_TRIG", // 16: TC D0 Trigger + "AC0_AC", // 17: AC0 AC Interrupt + "AC1_AC", // 18: AC1 AC Interrupt + "AC2_AC", // 19: AC2 AC Interrupt + "ADC0_RESRDY", // 20: ADC 0 Result Ready + "ADC0_WCOMP", // 21: ADC 0 Window Comparator + "ADC1_RESRDY", // 22: ADC 1 Result Ready + "ADC1_WCOMP", // 23: ADC 1 Window Comparator + "TWI0_TWIP", // 24: 2-Wire Interface 0 Peripheral + "TWI0_TWIM", // 25: 2-Wire Interface 0 Controller + "SPI0_INT", // 26: SPI 0 Interrupt + "USART0_RXC", // 27: USART 0 Receive Complete + "USART0_DRE", // 28: USART 0 Data Register Empty + "USART0_TXC", // 29: USART 0 Transmit Complete + "NVMCTRL_EE", // 30: NVM EEPROM +}; + +const char * const vtab_attiny3214[vts_attiny3214] = { // ATtiny3214 + "RESET", // 0: Reset (various reasons) + "CRCSCAN_NMI", // 1: CRCSCAN Non-maskable Interrupt + "BOD_VLM", // 2: Brown-out Detector Voltage Level Monitor + "PORTA_PORT", // 3: Interrupt PORT A + "PORTB_PORT", // 4: Interrupt PORT B + "PORTC_PORT", // 5: Interrupt PORT C + "RTC_CNT", // 6: RTC Counter Interrupt + "RTC_PIT", // 7: RTC Periodic Interrupt Timer + "TCA0_LUNF", // 8: TC A0 Low Underflow + "TCA0_HUNF", // 9: TC A0 High Underflow + "TCA0_CMP0", // 10: TC A0 Compare 0 + "TCA0_CMP1", // 11: TC A0 Compare 1 + "TCA0_CMP2", // 12: TC A0 Compare 2 + "TCB0_INT", // 13: TC B0 Interrupt + "TCB1_INT", // 14: TC B1 Interrupt + "TCD0_OVF", // 15: TC D0 Overflow + "TCD0_TRIG", // 16: TC D0 Trigger + "AC0_AC", // 17: AC0 AC Interrupt + "AC1_AC", // 18: AC1 AC Interrupt + "AC2_AC", // 19: AC2 AC Interrupt + "ADC0_RESRDY", // 20: ADC 0 Result Ready + "ADC0_WCOMP", // 21: ADC 0 Window Comparator + "ADC1_RESRDY", // 22: ADC 1 Result Ready + "ADC1_WCOMP", // 23: ADC 1 Window Comparator + "TWI0_TWIP", // 24: 2-Wire Interface 0 Peripheral + "TWI0_TWIM", // 25: 2-Wire Interface 0 Controller + "SPI0_INT", // 26: SPI 0 Interrupt + "USART0_RXC", // 27: USART 0 Receive Complete + "USART0_DRE", // 28: USART 0 Data Register Empty + "USART0_TXC", // 29: USART 0 Transmit Complete + "NVMCTRL_EE", // 30: NVM EEPROM +}; + +const char * const vtab_attiny3217[vts_attiny3217] = { // ATtiny3217, ATtiny3216, ATtiny1617, ATtiny1616 + "RESET", // 0: Reset (various reasons) + "CRCSCAN_NMI", // 1: CRCSCAN Non-maskable Interrupt + "BOD_VLM", // 2: Brown-out Detector Voltage Level Monitor + "PORTA_PORT", // 3: Interrupt PORT A + "PORTB_PORT", // 4: Interrupt PORT B + "PORTC_PORT", // 5: Interrupt PORT C + "RTC_CNT", // 6: RTC Counter Interrupt + "RTC_PIT", // 7: RTC Periodic Interrupt Timer + "TCA0_LUNF/TCA0_OVF", // 8: TC A0 Low Underflow/TC A0 Overflow + "TCA0_HUNF", // 9: TC A0 High Underflow + "TCA0_CMP0/TCA0_LCMP0", // 10: TC A0 Compare 0/TC A0 Low Compare 0 + "TCA0_CMP1/TCA0_LCMP1", // 11: TC A0 Compare 1/TC A0 Low Compare 1 + "TCA0_CMP2/TCA0_LCMP2", // 12: TC A0 Compare 2/TC A0 Low Compare 2 + "TCB0_INT", // 13: TC B0 Interrupt + "TCB1_INT", // 14: TC B1 Interrupt + "TCD0_OVF", // 15: TC D0 Overflow + "TCD0_TRIG", // 16: TC D0 Trigger + "AC0_AC", // 17: AC0 AC Interrupt + "AC1_AC", // 18: AC1 AC Interrupt + "AC2_AC", // 19: AC2 AC Interrupt + "ADC0_RESRDY", // 20: ADC 0 Result Ready + "ADC0_WCOMP", // 21: ADC 0 Window Comparator + "ADC1_RESRDY", // 22: ADC 1 Result Ready + "ADC1_WCOMP", // 23: ADC 1 Window Comparator + "TWI0_TWIP", // 24: 2-Wire Interface 0 Peripheral + "TWI0_TWIM", // 25: 2-Wire Interface 0 Controller + "SPI0_INT", // 26: SPI 0 Interrupt + "USART0_RXC", // 27: USART 0 Receive Complete + "USART0_DRE", // 28: USART 0 Data Register Empty + "USART0_TXC", // 29: USART 0 Transmit Complete + "NVMCTRL_EE", // 30: NVM EEPROM +}; + +const char * const vtab_attiny3227[vts_attiny3227] = { // ATtiny3227, ATtiny3226, ATtiny3224, ATtiny1627, ATtiny1626, ATtiny1624, ATtiny827, ATtiny826, ATtiny824, ATtiny427, ATtiny426, ATtiny424 + "RESET", // 0: Reset (various reasons) + "CRCSCAN_NMI", // 1: CRCSCAN Non-maskable Interrupt + "BOD_VLM", // 2: Brown-out Detector Voltage Level Monitor + "RTC_CNT", // 3: RTC Counter Interrupt + "RTC_PIT", // 4: RTC Periodic Interrupt Timer + "CCL_CCL", // 5: Configurable Custom Logic + "PORTA_PORT", // 6: Interrupt PORT A + "PORTB_PORT", // 7: Interrupt PORT B + "TCA0_LUNF/TCA0_OVF", // 8: TC A0 Low Underflow/TC A0 Overflow + "TCA0_HUNF", // 9: TC A0 High Underflow + "TCA0_CMP0/TCA0_LCMP0", // 10: TC A0 Compare 0/TC A0 Low Compare 0 + "TCA0_CMP1/TCA0_LCMP1", // 11: TC A0 Compare 1/TC A0 Low Compare 1 + "TCA0_CMP2/TCA0_LCMP2", // 12: TC A0 Compare 2/TC A0 Low Compare 2 + "TCB0_INT", // 13: TC B0 Interrupt + "TWI0_TWIP", // 14: 2-Wire Interface 0 Peripheral + "TWI0_TWIM", // 15: 2-Wire Interface 0 Controller + "SPI0_INT", // 16: SPI 0 Interrupt + "USART0_RXC", // 17: USART 0 Receive Complete + "USART0_DRE", // 18: USART 0 Data Register Empty + "USART0_TXC", // 19: USART 0 Transmit Complete + "AC0_AC", // 20: AC0 AC Interrupt + "ADC0_ERROR", // 21: ADC 0 Error + "ADC0_RESRDY", // 22: ADC 0 Result Ready + "ADC0_SAMPRDY", // 23: ADC 0 Sample Ready + "PORTC_PORT", // 24: Interrupt PORT C + "TCB1_INT", // 25: TC B1 Interrupt + "USART1_RXC", // 26: USART 1 Receive Complete + "USART1_DRE", // 27: USART 1 Data Register Empty + "USART1_TXC", // 28: USART 1 Transmit Complete + "NVMCTRL_EE", // 29: NVM EEPROM +}; + +const char * const vtab_atmega4808[vts_atmega4808] = { // ATmega4808, ATmega3208, ATmega1608, ATmega808 + "RESET", // 0: Reset (various reasons) + "CRCSCAN_NMI", // 1: CRCSCAN Non-maskable Interrupt + "BOD_VLM", // 2: Brown-out Detector Voltage Level Monitor + "RTC_CNT", // 3: RTC Counter Interrupt + "RTC_PIT", // 4: RTC Periodic Interrupt Timer + "CCL_CCL", // 5: Configurable Custom Logic + "PORTA_PORT", // 6: Interrupt PORT A + "TCA0_LUNF/TCA0_OVF", // 7: TC A0 Low Underflow/TC A0 Overflow + "TCA0_HUNF", // 8: TC A0 High Underflow + "TCA0_CMP0/TCA0_LCMP0", // 9: TC A0 Compare 0/TC A0 Low Compare 0 + "TCA0_CMP1/TCA0_LCMP1", // 10: TC A0 Compare 1/TC A0 Low Compare 1 + "TCA0_CMP2/TCA0_LCMP2", // 11: TC A0 Compare 2/TC A0 Low Compare 2 + "TCB0_INT", // 12: TC B0 Interrupt + "TCB1_INT", // 13: TC B1 Interrupt + "TWI0_TWIP", // 14: 2-Wire Interface 0 Peripheral + "TWI0_TWIM", // 15: 2-Wire Interface 0 Controller + "SPI0_INT", // 16: SPI 0 Interrupt + "USART0_RXC", // 17: USART 0 Receive Complete + "USART0_DRE", // 18: USART 0 Data Register Empty + "USART0_TXC", // 19: USART 0 Transmit Complete + "PORTD_PORT", // 20: Interrupt PORT D + "AC0_AC", // 21: AC0 AC Interrupt + "ADC0_RESRDY", // 22: ADC 0 Result Ready + "ADC0_WCOMP", // 23: ADC 0 Window Comparator + "PORTC_PORT", // 24: Interrupt PORT C + "TCB2_INT", // 25: TC B2 Interrupt + "USART1_RXC", // 26: USART 1 Receive Complete + "USART1_DRE", // 27: USART 1 Data Register Empty + "USART1_TXC", // 28: USART 1 Transmit Complete + "PORTF_PORT", // 29: Interrupt PORT F + "NVMCTRL_EE", // 30: NVM EEPROM + "USART2_RXC", // 31: USART 2 Receive Complete + "USART2_DRE", // 32: USART 2 Data Register Empty + "USART2_TXC", // 33: USART 2 Transmit Complete + "PORTB_PORT", // 34: Interrupt PORT B + "PORTE_PORT", // 35: Interrupt PORT E +}; + +const char * const vtab_atmega4809[vts_atmega4809] = { // ATmega4809, ATmega3209, ATmega1609, ATmega809 + "RESET", // 0: Reset (various reasons) + "CRCSCAN_NMI", // 1: CRCSCAN Non-maskable Interrupt + "BOD_VLM", // 2: Brown-out Detector Voltage Level Monitor + "RTC_CNT", // 3: RTC Counter Interrupt + "RTC_PIT", // 4: RTC Periodic Interrupt Timer + "CCL_CCL", // 5: Configurable Custom Logic + "PORTA_PORT", // 6: Interrupt PORT A + "TCA0_LUNF/TCA0_OVF", // 7: TC A0 Low Underflow/TC A0 Overflow + "TCA0_HUNF", // 8: TC A0 High Underflow + "TCA0_CMP0/TCA0_LCMP0", // 9: TC A0 Compare 0/TC A0 Low Compare 0 + "TCA0_CMP1/TCA0_LCMP1", // 10: TC A0 Compare 1/TC A0 Low Compare 1 + "TCA0_CMP2/TCA0_LCMP2", // 11: TC A0 Compare 2/TC A0 Low Compare 2 + "TCB0_INT", // 12: TC B0 Interrupt + "TCB1_INT", // 13: TC B1 Interrupt + "TWI0_TWIP", // 14: 2-Wire Interface 0 Peripheral + "TWI0_TWIM", // 15: 2-Wire Interface 0 Controller + "SPI0_INT", // 16: SPI 0 Interrupt + "USART0_RXC", // 17: USART 0 Receive Complete + "USART0_DRE", // 18: USART 0 Data Register Empty + "USART0_TXC", // 19: USART 0 Transmit Complete + "PORTD_PORT", // 20: Interrupt PORT D + "AC0_AC", // 21: AC0 AC Interrupt + "ADC0_RESRDY", // 22: ADC 0 Result Ready + "ADC0_WCOMP", // 23: ADC 0 Window Comparator + "PORTC_PORT", // 24: Interrupt PORT C + "TCB2_INT", // 25: TC B2 Interrupt + "USART1_RXC", // 26: USART 1 Receive Complete + "USART1_DRE", // 27: USART 1 Data Register Empty + "USART1_TXC", // 28: USART 1 Transmit Complete + "PORTF_PORT", // 29: Interrupt PORT F + "NVMCTRL_EE", // 30: NVM EEPROM + "USART2_RXC", // 31: USART 2 Receive Complete + "USART2_DRE", // 32: USART 2 Data Register Empty + "USART2_TXC", // 33: USART 2 Transmit Complete + "PORTB_PORT", // 34: Interrupt PORT B + "PORTE_PORT", // 35: Interrupt PORT E + "TCB3_INT", // 36: TC B3 Interrupt + "USART3_RXC", // 37: USART 3 Receive Complete + "USART3_DRE", // 38: USART 3 Data Register Empty + "USART3_TXC", // 39: USART 3 Transmit Complete +}; + +const char * const vtab_avr64dd32[vts_avr64dd32] = { // AVR64DD32, AVR64DD28, AVR64DD20, AVR64DD14, AVR32DD32, AVR32DD28, AVR32DD20, AVR32DD14, AVR16DD32, AVR16DD28, AVR16DD20, AVR16DD14 + "RESET", // 0: Reset (various reasons) + "CRCSCAN_NMI", // 1: CRCSCAN Non-maskable Interrupt + "BOD_VLM", // 2: Brown-out Detector Voltage Level Monitor + "CLKCTRL_CFD", // 3: Clock Failure Detection + "MVIO_MVIO", // 4: Multi-Voltage I/O + "RTC_CNT", // 5: RTC Counter Interrupt + "RTC_PIT", // 6: RTC Periodic Interrupt Timer + "CCL_CCL", // 7: Configurable Custom Logic + "PORTA_PORT", // 8: Interrupt PORT A + "TCA0_LUNF/TCA0_OVF", // 9: TC A0 Low Underflow/TC A0 Overflow + "TCA0_HUNF", // 10: TC A0 High Underflow + "TCA0_CMP0/TCA0_LCMP0", // 11: TC A0 Compare 0/TC A0 Low Compare 0 + "TCA0_CMP1/TCA0_LCMP1", // 12: TC A0 Compare 1/TC A0 Low Compare 1 + "TCA0_CMP2/TCA0_LCMP2", // 13: TC A0 Compare 2/TC A0 Low Compare 2 + "TCB0_INT", // 14: TC B0 Interrupt + "TCB1_INT", // 15: TC B1 Interrupt + "TCD0_OVF", // 16: TC D0 Overflow + "TCD0_TRIG", // 17: TC D0 Trigger + "TWI0_TWIP", // 18: 2-Wire Interface 0 Peripheral + "TWI0_TWIM", // 19: 2-Wire Interface 0 Controller + "SPI0_INT", // 20: SPI 0 Interrupt + "USART0_RXC", // 21: USART 0 Receive Complete + "USART0_DRE", // 22: USART 0 Data Register Empty + "USART0_TXC", // 23: USART 0 Transmit Complete + "PORTD_PORT", // 24: Interrupt PORT D + "AC0_AC", // 25: AC0 AC Interrupt + "ADC0_RESRDY", // 26: ADC 0 Result Ready + "ADC0_WCMP", // 27: ADC 0 Window Comparator + "ZCD3_ZCD", // 28: Zero Cross Detect 3 + "PORTC_PORT", // 29: Interrupt PORT C + "TCB2_INT", // 30: TC B2 Interrupt + "USART1_RXC", // 31: USART 1 Receive Complete + "USART1_DRE", // 32: USART 1 Data Register Empty + "USART1_TXC", // 33: USART 1 Transmit Complete + "PORTF_PORT", // 34: Interrupt PORT F + "NVMCTRL_EE", // 35: NVM EEPROM +}; + +const char * const vtab_avr64ea32[vts_avr64ea32] = { // AVR64EA32, AVR64EA28 + "RESET", // 0: Reset (various reasons) + "CRCSCAN_NMI", // 1: CRCSCAN Non-maskable Interrupt + "BOD_VLM", // 2: Brown-out Detector Voltage Level Monitor + "CLKCTRL_CFD", // 3: Clock Failure Detection + "RTC_CNT", // 4: RTC Counter Interrupt + "RTC_PIT", // 5: RTC Periodic Interrupt Timer + "CCL_CCL", // 6: Configurable Custom Logic + "PORTA_PORT", // 7: Interrupt PORT A + "TCA0_LUNF/TCA0_OVF", // 8: TC A0 Low Underflow/TC A0 Overflow + "TCA0_HUNF", // 9: TC A0 High Underflow + "TCA0_CMP0/TCA0_LCMP0", // 10: TC A0 Compare 0/TC A0 Low Compare 0 + "TCA0_CMP1/TCA0_LCMP1", // 11: TC A0 Compare 1/TC A0 Low Compare 1 + "TCA0_CMP2/TCA0_LCMP2", // 12: TC A0 Compare 2/TC A0 Low Compare 2 + "TCB0_INT", // 13: TC B0 Interrupt + "TCB1_INT", // 14: TC B1 Interrupt + "TWI0_TWIP", // 15: 2-Wire Interface 0 Peripheral + "TWI0_TWIM", // 16: 2-Wire Interface 0 Controller + "SPI0_INT", // 17: SPI 0 Interrupt + "USART0_RXC", // 18: USART 0 Receive Complete + "USART0_DRE", // 19: USART 0 Data Register Empty + "USART0_TXC", // 20: USART 0 Transmit Complete + "PORTD_PORT", // 21: Interrupt PORT D + "AC0_AC", // 22: AC0 AC Interrupt + "ADC0_ERROR", // 23: ADC 0 Error + "ADC0_RESRDY", // 24: ADC 0 Result Ready + "ADC0_SAMPRDY", // 25: ADC 0 Sample Ready + "AC1_AC", // 26: AC1 AC Interrupt + "PORTC_PORT", // 27: Interrupt PORT C + "TCB2_INT", // 28: TC B2 Interrupt + "USART1_RXC", // 29: USART 1 Receive Complete + "USART1_DRE", // 30: USART 1 Data Register Empty + "USART1_TXC", // 31: USART 1 Transmit Complete + "PORTF_PORT", // 32: Interrupt PORT F + "NVMCTRL_EEREADY/NVMCTRL_FLREADY/NVMCTRL_NVMREADY", // 33: NVM EEPROM Ready/NVM Flash Ready/NVM Ready + "USART2_RXC", // 34: USART 2 Receive Complete + "USART2_DRE", // 35: USART 2 Data Register Empty + "USART2_TXC", // 36: USART 2 Transmit Complete +}; + +const char * const vtab_avr64ea48[vts_avr64ea48] = { // AVR64EA48 + "RESET", // 0: Reset (various reasons) + "CRCSCAN_NMI", // 1: CRCSCAN Non-maskable Interrupt + "BOD_VLM", // 2: Brown-out Detector Voltage Level Monitor + "CLKCTRL_CFD", // 3: Clock Failure Detection + "RTC_CNT", // 4: RTC Counter Interrupt + "RTC_PIT", // 5: RTC Periodic Interrupt Timer + "CCL_CCL", // 6: Configurable Custom Logic + "PORTA_PORT", // 7: Interrupt PORT A + "TCA0_LUNF/TCA0_OVF", // 8: TC A0 Low Underflow/TC A0 Overflow + "TCA0_HUNF", // 9: TC A0 High Underflow + "TCA0_CMP0/TCA0_LCMP0", // 10: TC A0 Compare 0/TC A0 Low Compare 0 + "TCA0_CMP1/TCA0_LCMP1", // 11: TC A0 Compare 1/TC A0 Low Compare 1 + "TCA0_CMP2/TCA0_LCMP2", // 12: TC A0 Compare 2/TC A0 Low Compare 2 + "TCB0_INT", // 13: TC B0 Interrupt + "TCB1_INT", // 14: TC B1 Interrupt + "TWI0_TWIP", // 15: 2-Wire Interface 0 Peripheral + "TWI0_TWIM", // 16: 2-Wire Interface 0 Controller + "SPI0_INT", // 17: SPI 0 Interrupt + "USART0_RXC", // 18: USART 0 Receive Complete + "USART0_DRE", // 19: USART 0 Data Register Empty + "USART0_TXC", // 20: USART 0 Transmit Complete + "PORTD_PORT", // 21: Interrupt PORT D + "AC0_AC", // 22: AC0 AC Interrupt + "ADC0_ERROR", // 23: ADC 0 Error + "ADC0_RESRDY", // 24: ADC 0 Result Ready + "ADC0_SAMPRDY", // 25: ADC 0 Sample Ready + "AC1_AC", // 26: AC1 AC Interrupt + "PORTC_PORT", // 27: Interrupt PORT C + "TCB2_INT", // 28: TC B2 Interrupt + "USART1_RXC", // 29: USART 1 Receive Complete + "USART1_DRE", // 30: USART 1 Data Register Empty + "USART1_TXC", // 31: USART 1 Transmit Complete + "PORTF_PORT", // 32: Interrupt PORT F + "NVMCTRL_EEREADY/NVMCTRL_FLREADY/NVMCTRL_NVMREADY", // 33: NVM EEPROM Ready/NVM Flash Ready/NVM Ready + "USART2_RXC", // 34: USART 2 Receive Complete + "USART2_DRE", // 35: USART 2 Data Register Empty + "USART2_TXC", // 36: USART 2 Transmit Complete + "TCB3_INT", // 37: TC B3 Interrupt + "TCA1_LUNF/TCA1_OVF", // 38: TC A1 Low Underflow/TC A1 Overflow + "TCA1_HUNF", // 39: TC A1 High Underflow + "TCA1_CMP0/TCA1_LCMP0", // 40: TC A1 Compare 0/TC A1 Low Compare 0 + "TCA1_CMP1/TCA1_LCMP1", // 41: TC A1 Compare 1/TC A1 Low Compare 1 + "TCA1_CMP2/TCA1_LCMP2", // 42: TC A1 Compare 2/TC A1 Low Compare 2 + "PORTE_PORT", // 43: Interrupt PORT E + "PORTB_PORT", // 44: Interrupt PORT B +}; + +const char * const vtab_avr128da28[vts_avr128da28] = { // AVR128DA28, AVR64DA28, AVR32DA28 + "RESET", // 0: Reset (various reasons) + "CRCSCAN_NMI", // 1: CRCSCAN Non-maskable Interrupt + "BOD_VLM", // 2: Brown-out Detector Voltage Level Monitor + "RTC_CNT", // 3: RTC Counter Interrupt + "RTC_PIT", // 4: RTC Periodic Interrupt Timer + "CCL_CCL", // 5: Configurable Custom Logic + "PORTA_PORT", // 6: Interrupt PORT A + "TCA0_LUNF/TCA0_OVF", // 7: TC A0 Low Underflow/TC A0 Overflow + "TCA0_HUNF", // 8: TC A0 High Underflow + "TCA0_CMP0/TCA0_LCMP0", // 9: TC A0 Compare 0/TC A0 Low Compare 0 + "TCA0_CMP1/TCA0_LCMP1", // 10: TC A0 Compare 1/TC A0 Low Compare 1 + "TCA0_CMP2/TCA0_LCMP2", // 11: TC A0 Compare 2/TC A0 Low Compare 2 + "TCB0_INT", // 12: TC B0 Interrupt + "TCB1_INT", // 13: TC B1 Interrupt + "TCD0_OVF", // 14: TC D0 Overflow + "TCD0_TRIG", // 15: TC D0 Trigger + "TWI0_TWIP", // 16: 2-Wire Interface 0 Peripheral + "TWI0_TWIM", // 17: 2-Wire Interface 0 Controller + "SPI0_INT", // 18: SPI 0 Interrupt + "USART0_RXC", // 19: USART 0 Receive Complete + "USART0_DRE", // 20: USART 0 Data Register Empty + "USART0_TXC", // 21: USART 0 Transmit Complete + "PORTD_PORT", // 22: Interrupt PORT D + "AC0_AC", // 23: AC0 AC Interrupt + "ADC0_RESRDY", // 24: ADC 0 Result Ready + "ADC0_WCMP", // 25: ADC 0 Window Comparator + "ZCD0_ZCD", // 26: Zero Cross Detect 0 + "PTC_PTC", // 27: PTC Interrupt + "AC1_AC", // 28: AC1 AC Interrupt + "PORTC_PORT", // 29: Interrupt PORT C + "TCB2_INT", // 30: TC B2 Interrupt + "USART1_RXC", // 31: USART 1 Receive Complete + "USART1_DRE", // 32: USART 1 Data Register Empty + "USART1_TXC", // 33: USART 1 Transmit Complete + "PORTF_PORT", // 34: Interrupt PORT F + "NVMCTRL_EE", // 35: NVM EEPROM + "SPI1_INT", // 36: SPI 1 Interrupt + "USART2_RXC", // 37: USART 2 Receive Complete + "USART2_DRE", // 38: USART 2 Data Register Empty + "USART2_TXC", // 39: USART 2 Transmit Complete + "AC2_AC", // 40: AC2 AC Interrupt +}; + +const char * const vtab_avr128db28[vts_avr128db28] = { // AVR128DB28, AVR64DB28, AVR32DB28 + "RESET", // 0: Reset (various reasons) + "CRCSCAN_NMI", // 1: CRCSCAN Non-maskable Interrupt + "BOD_VLM", // 2: Brown-out Detector Voltage Level Monitor + "CLKCTRL_CFD", // 3: Clock Failure Detection + "MVIO_MVIO", // 4: Multi-Voltage I/O + "RTC_CNT", // 5: RTC Counter Interrupt + "RTC_PIT", // 6: RTC Periodic Interrupt Timer + "CCL_CCL", // 7: Configurable Custom Logic + "PORTA_PORT", // 8: Interrupt PORT A + "TCA0_LUNF/TCA0_OVF", // 9: TC A0 Low Underflow/TC A0 Overflow + "TCA0_HUNF", // 10: TC A0 High Underflow + "TCA0_CMP0/TCA0_LCMP0", // 11: TC A0 Compare 0/TC A0 Low Compare 0 + "TCA0_CMP1/TCA0_LCMP1", // 12: TC A0 Compare 1/TC A0 Low Compare 1 + "TCA0_CMP2/TCA0_LCMP2", // 13: TC A0 Compare 2/TC A0 Low Compare 2 + "TCB0_INT", // 14: TC B0 Interrupt + "TCB1_INT", // 15: TC B1 Interrupt + "TCD0_OVF", // 16: TC D0 Overflow + "TCD0_TRIG", // 17: TC D0 Trigger + "TWI0_TWIP", // 18: 2-Wire Interface 0 Peripheral + "TWI0_TWIM", // 19: 2-Wire Interface 0 Controller + "SPI0_INT", // 20: SPI 0 Interrupt + "USART0_RXC", // 21: USART 0 Receive Complete + "USART0_DRE", // 22: USART 0 Data Register Empty + "USART0_TXC", // 23: USART 0 Transmit Complete + "PORTD_PORT", // 24: Interrupt PORT D + "AC0_AC", // 25: AC0 AC Interrupt + "ADC0_RESRDY", // 26: ADC 0 Result Ready + "ADC0_WCMP", // 27: ADC 0 Window Comparator + "ZCD0_ZCD", // 28: Zero Cross Detect 0 + "AC1_AC", // 29: AC1 AC Interrupt + "PORTC_PORT", // 30: Interrupt PORT C + "TCB2_INT", // 31: TC B2 Interrupt + "USART1_RXC", // 32: USART 1 Receive Complete + "USART1_DRE", // 33: USART 1 Data Register Empty + "USART1_TXC", // 34: USART 1 Transmit Complete + "PORTF_PORT", // 35: Interrupt PORT F + "NVMCTRL_EE", // 36: NVM EEPROM + "SPI1_INT", // 37: SPI 1 Interrupt + "USART2_RXC", // 38: USART 2 Receive Complete + "USART2_DRE", // 39: USART 2 Data Register Empty + "USART2_TXC", // 40: USART 2 Transmit Complete + "AC2_AC", // 41: AC2 AC Interrupt +}; + +const char * const vtab_avr128da32[vts_avr128da32] = { // AVR128DA32, AVR64DA32, AVR32DA32 + "RESET", // 0: Reset (various reasons) + "CRCSCAN_NMI", // 1: CRCSCAN Non-maskable Interrupt + "BOD_VLM", // 2: Brown-out Detector Voltage Level Monitor + "RTC_CNT", // 3: RTC Counter Interrupt + "RTC_PIT", // 4: RTC Periodic Interrupt Timer + "CCL_CCL", // 5: Configurable Custom Logic + "PORTA_PORT", // 6: Interrupt PORT A + "TCA0_LUNF/TCA0_OVF", // 7: TC A0 Low Underflow/TC A0 Overflow + "TCA0_HUNF", // 8: TC A0 High Underflow + "TCA0_CMP0/TCA0_LCMP0", // 9: TC A0 Compare 0/TC A0 Low Compare 0 + "TCA0_CMP1/TCA0_LCMP1", // 10: TC A0 Compare 1/TC A0 Low Compare 1 + "TCA0_CMP2/TCA0_LCMP2", // 11: TC A0 Compare 2/TC A0 Low Compare 2 + "TCB0_INT", // 12: TC B0 Interrupt + "TCB1_INT", // 13: TC B1 Interrupt + "TCD0_OVF", // 14: TC D0 Overflow + "TCD0_TRIG", // 15: TC D0 Trigger + "TWI0_TWIP", // 16: 2-Wire Interface 0 Peripheral + "TWI0_TWIM", // 17: 2-Wire Interface 0 Controller + "SPI0_INT", // 18: SPI 0 Interrupt + "USART0_RXC", // 19: USART 0 Receive Complete + "USART0_DRE", // 20: USART 0 Data Register Empty + "USART0_TXC", // 21: USART 0 Transmit Complete + "PORTD_PORT", // 22: Interrupt PORT D + "AC0_AC", // 23: AC0 AC Interrupt + "ADC0_RESRDY", // 24: ADC 0 Result Ready + "ADC0_WCMP", // 25: ADC 0 Window Comparator + "ZCD0_ZCD", // 26: Zero Cross Detect 0 + "PTC_PTC", // 27: PTC Interrupt + "AC1_AC", // 28: AC1 AC Interrupt + "PORTC_PORT", // 29: Interrupt PORT C + "TCB2_INT", // 30: TC B2 Interrupt + "USART1_RXC", // 31: USART 1 Receive Complete + "USART1_DRE", // 32: USART 1 Data Register Empty + "USART1_TXC", // 33: USART 1 Transmit Complete + "PORTF_PORT", // 34: Interrupt PORT F + "NVMCTRL_EE", // 35: NVM EEPROM + "SPI1_INT", // 36: SPI 1 Interrupt + "USART2_RXC", // 37: USART 2 Receive Complete + "USART2_DRE", // 38: USART 2 Data Register Empty + "USART2_TXC", // 39: USART 2 Transmit Complete + "AC2_AC", // 40: AC2 AC Interrupt + "UNUSED", // 41: not implemented on this device + "TWI1_TWIP", // 42: 2-Wire Interface 1 Peripheral + "TWI1_TWIM", // 43: 2-Wire Interface 1 Controller +}; + +const char * const vtab_avr128db32[vts_avr128db32] = { // AVR128DB32, AVR64DB32, AVR32DB32 + "RESET", // 0: Reset (various reasons) + "CRCSCAN_NMI", // 1: CRCSCAN Non-maskable Interrupt + "BOD_VLM", // 2: Brown-out Detector Voltage Level Monitor + "CLKCTRL_CFD", // 3: Clock Failure Detection + "MVIO_MVIO", // 4: Multi-Voltage I/O + "RTC_CNT", // 5: RTC Counter Interrupt + "RTC_PIT", // 6: RTC Periodic Interrupt Timer + "CCL_CCL", // 7: Configurable Custom Logic + "PORTA_PORT", // 8: Interrupt PORT A + "TCA0_LUNF/TCA0_OVF", // 9: TC A0 Low Underflow/TC A0 Overflow + "TCA0_HUNF", // 10: TC A0 High Underflow + "TCA0_CMP0/TCA0_LCMP0", // 11: TC A0 Compare 0/TC A0 Low Compare 0 + "TCA0_CMP1/TCA0_LCMP1", // 12: TC A0 Compare 1/TC A0 Low Compare 1 + "TCA0_CMP2/TCA0_LCMP2", // 13: TC A0 Compare 2/TC A0 Low Compare 2 + "TCB0_INT", // 14: TC B0 Interrupt + "TCB1_INT", // 15: TC B1 Interrupt + "TCD0_OVF", // 16: TC D0 Overflow + "TCD0_TRIG", // 17: TC D0 Trigger + "TWI0_TWIP", // 18: 2-Wire Interface 0 Peripheral + "TWI0_TWIM", // 19: 2-Wire Interface 0 Controller + "SPI0_INT", // 20: SPI 0 Interrupt + "USART0_RXC", // 21: USART 0 Receive Complete + "USART0_DRE", // 22: USART 0 Data Register Empty + "USART0_TXC", // 23: USART 0 Transmit Complete + "PORTD_PORT", // 24: Interrupt PORT D + "AC0_AC", // 25: AC0 AC Interrupt + "ADC0_RESRDY", // 26: ADC 0 Result Ready + "ADC0_WCMP", // 27: ADC 0 Window Comparator + "ZCD0_ZCD", // 28: Zero Cross Detect 0 + "AC1_AC", // 29: AC1 AC Interrupt + "PORTC_PORT", // 30: Interrupt PORT C + "TCB2_INT", // 31: TC B2 Interrupt + "USART1_RXC", // 32: USART 1 Receive Complete + "USART1_DRE", // 33: USART 1 Data Register Empty + "USART1_TXC", // 34: USART 1 Transmit Complete + "PORTF_PORT", // 35: Interrupt PORT F + "NVMCTRL_EE", // 36: NVM EEPROM + "SPI1_INT", // 37: SPI 1 Interrupt + "USART2_RXC", // 38: USART 2 Receive Complete + "USART2_DRE", // 39: USART 2 Data Register Empty + "USART2_TXC", // 40: USART 2 Transmit Complete + "AC2_AC", // 41: AC2 AC Interrupt + "TWI1_TWIP", // 42: 2-Wire Interface 1 Peripheral + "TWI1_TWIM", // 43: 2-Wire Interface 1 Controller +}; + +const char * const vtab_avr128da48[vts_avr128da48] = { // AVR128DA48, AVR64DA48, AVR32DA48 + "RESET", // 0: Reset (various reasons) + "CRCSCAN_NMI", // 1: CRCSCAN Non-maskable Interrupt + "BOD_VLM", // 2: Brown-out Detector Voltage Level Monitor + "RTC_CNT", // 3: RTC Counter Interrupt + "RTC_PIT", // 4: RTC Periodic Interrupt Timer + "CCL_CCL", // 5: Configurable Custom Logic + "PORTA_PORT", // 6: Interrupt PORT A + "TCA0_LUNF/TCA0_OVF", // 7: TC A0 Low Underflow/TC A0 Overflow + "TCA0_HUNF", // 8: TC A0 High Underflow + "TCA0_CMP0/TCA0_LCMP0", // 9: TC A0 Compare 0/TC A0 Low Compare 0 + "TCA0_CMP1/TCA0_LCMP1", // 10: TC A0 Compare 1/TC A0 Low Compare 1 + "TCA0_CMP2/TCA0_LCMP2", // 11: TC A0 Compare 2/TC A0 Low Compare 2 + "TCB0_INT", // 12: TC B0 Interrupt + "TCB1_INT", // 13: TC B1 Interrupt + "TCD0_OVF", // 14: TC D0 Overflow + "TCD0_TRIG", // 15: TC D0 Trigger + "TWI0_TWIP", // 16: 2-Wire Interface 0 Peripheral + "TWI0_TWIM", // 17: 2-Wire Interface 0 Controller + "SPI0_INT", // 18: SPI 0 Interrupt + "USART0_RXC", // 19: USART 0 Receive Complete + "USART0_DRE", // 20: USART 0 Data Register Empty + "USART0_TXC", // 21: USART 0 Transmit Complete + "PORTD_PORT", // 22: Interrupt PORT D + "AC0_AC", // 23: AC0 AC Interrupt + "ADC0_RESRDY", // 24: ADC 0 Result Ready + "ADC0_WCMP", // 25: ADC 0 Window Comparator + "ZCD0_ZCD", // 26: Zero Cross Detect 0 + "PTC_PTC", // 27: PTC Interrupt + "AC1_AC", // 28: AC1 AC Interrupt + "PORTC_PORT", // 29: Interrupt PORT C + "TCB2_INT", // 30: TC B2 Interrupt + "USART1_RXC", // 31: USART 1 Receive Complete + "USART1_DRE", // 32: USART 1 Data Register Empty + "USART1_TXC", // 33: USART 1 Transmit Complete + "PORTF_PORT", // 34: Interrupt PORT F + "NVMCTRL_EE", // 35: NVM EEPROM + "SPI1_INT", // 36: SPI 1 Interrupt + "USART2_RXC", // 37: USART 2 Receive Complete + "USART2_DRE", // 38: USART 2 Data Register Empty + "USART2_TXC", // 39: USART 2 Transmit Complete + "AC2_AC", // 40: AC2 AC Interrupt + "TCB3_INT", // 41: TC B3 Interrupt + "TWI1_TWIP", // 42: 2-Wire Interface 1 Peripheral + "TWI1_TWIM", // 43: 2-Wire Interface 1 Controller + "PORTB_PORT", // 44: Interrupt PORT B + "PORTE_PORT", // 45: Interrupt PORT E + "TCA1_LUNF/TCA1_OVF", // 46: TC A1 Low Underflow/TC A1 Overflow + "TCA1_HUNF", // 47: TC A1 High Underflow + "TCA1_CMP0/TCA1_LCMP0", // 48: TC A1 Compare 0/TC A1 Low Compare 0 + "TCA1_CMP1/TCA1_LCMP1", // 49: TC A1 Compare 1/TC A1 Low Compare 1 + "TCA1_CMP2/TCA1_LCMP2", // 50: TC A1 Compare 2/TC A1 Low Compare 2 + "ZCD1_ZCD", // 51: Zero Cross Detect 1 + "USART3_RXC", // 52: USART 3 Receive Complete + "USART3_DRE", // 53: USART 3 Data Register Empty + "USART3_TXC", // 54: USART 3 Transmit Complete + "USART4_RXC", // 55: USART 4 Receive Complete + "USART4_DRE", // 56: USART 4 Data Register Empty + "USART4_TXC", // 57: USART 4 Transmit Complete +}; + +const char * const vtab_avr128db48[vts_avr128db48] = { // AVR128DB48, AVR64DB48, AVR32DB48 + "RESET", // 0: Reset (various reasons) + "CRCSCAN_NMI", // 1: CRCSCAN Non-maskable Interrupt + "BOD_VLM", // 2: Brown-out Detector Voltage Level Monitor + "CLKCTRL_CFD", // 3: Clock Failure Detection + "MVIO_MVIO", // 4: Multi-Voltage I/O + "RTC_CNT", // 5: RTC Counter Interrupt + "RTC_PIT", // 6: RTC Periodic Interrupt Timer + "CCL_CCL", // 7: Configurable Custom Logic + "PORTA_PORT", // 8: Interrupt PORT A + "TCA0_LUNF/TCA0_OVF", // 9: TC A0 Low Underflow/TC A0 Overflow + "TCA0_HUNF", // 10: TC A0 High Underflow + "TCA0_CMP0/TCA0_LCMP0", // 11: TC A0 Compare 0/TC A0 Low Compare 0 + "TCA0_CMP1/TCA0_LCMP1", // 12: TC A0 Compare 1/TC A0 Low Compare 1 + "TCA0_CMP2/TCA0_LCMP2", // 13: TC A0 Compare 2/TC A0 Low Compare 2 + "TCB0_INT", // 14: TC B0 Interrupt + "TCB1_INT", // 15: TC B1 Interrupt + "TCD0_OVF", // 16: TC D0 Overflow + "TCD0_TRIG", // 17: TC D0 Trigger + "TWI0_TWIP", // 18: 2-Wire Interface 0 Peripheral + "TWI0_TWIM", // 19: 2-Wire Interface 0 Controller + "SPI0_INT", // 20: SPI 0 Interrupt + "USART0_RXC", // 21: USART 0 Receive Complete + "USART0_DRE", // 22: USART 0 Data Register Empty + "USART0_TXC", // 23: USART 0 Transmit Complete + "PORTD_PORT", // 24: Interrupt PORT D + "AC0_AC", // 25: AC0 AC Interrupt + "ADC0_RESRDY", // 26: ADC 0 Result Ready + "ADC0_WCMP", // 27: ADC 0 Window Comparator + "ZCD0_ZCD", // 28: Zero Cross Detect 0 + "AC1_AC", // 29: AC1 AC Interrupt + "PORTC_PORT", // 30: Interrupt PORT C + "TCB2_INT", // 31: TC B2 Interrupt + "USART1_RXC", // 32: USART 1 Receive Complete + "USART1_DRE", // 33: USART 1 Data Register Empty + "USART1_TXC", // 34: USART 1 Transmit Complete + "PORTF_PORT", // 35: Interrupt PORT F + "NVMCTRL_EE", // 36: NVM EEPROM + "SPI1_INT", // 37: SPI 1 Interrupt + "USART2_RXC", // 38: USART 2 Receive Complete + "USART2_DRE", // 39: USART 2 Data Register Empty + "USART2_TXC", // 40: USART 2 Transmit Complete + "AC2_AC", // 41: AC2 AC Interrupt + "TWI1_TWIP", // 42: 2-Wire Interface 1 Peripheral + "TWI1_TWIM", // 43: 2-Wire Interface 1 Controller + "TCB3_INT", // 44: TC B3 Interrupt + "PORTB_PORT", // 45: Interrupt PORT B + "PORTE_PORT", // 46: Interrupt PORT E + "TCA1_LUNF/TCA1_OVF", // 47: TC A1 Low Underflow/TC A1 Overflow + "TCA1_HUNF", // 48: TC A1 High Underflow + "TCA1_CMP0/TCA1_LCMP0", // 49: TC A1 Compare 0/TC A1 Low Compare 0 + "TCA1_CMP1/TCA1_LCMP1", // 50: TC A1 Compare 1/TC A1 Low Compare 1 + "TCA1_CMP2/TCA1_LCMP2", // 51: TC A1 Compare 2/TC A1 Low Compare 2 + "ZCD1_ZCD", // 52: Zero Cross Detect 1 + "USART3_RXC", // 53: USART 3 Receive Complete + "USART3_DRE", // 54: USART 3 Data Register Empty + "USART3_TXC", // 55: USART 3 Transmit Complete + "USART4_RXC", // 56: USART 4 Receive Complete + "USART4_DRE", // 57: USART 4 Data Register Empty + "USART4_TXC", // 58: USART 4 Transmit Complete + "UNUSED", // 59: not implemented on this device + "ZCD2_ZCD", // 60: Zero Cross Detect 2 +}; + +const char * const vtab_avr128da64[vts_avr128da64] = { // AVR128DA64, AVR64DA64 + "RESET", // 0: Reset (various reasons) + "CRCSCAN_NMI", // 1: CRCSCAN Non-maskable Interrupt + "BOD_VLM", // 2: Brown-out Detector Voltage Level Monitor + "RTC_CNT", // 3: RTC Counter Interrupt + "RTC_PIT", // 4: RTC Periodic Interrupt Timer + "CCL_CCL", // 5: Configurable Custom Logic + "PORTA_PORT", // 6: Interrupt PORT A + "TCA0_LUNF/TCA0_OVF", // 7: TC A0 Low Underflow/TC A0 Overflow + "TCA0_HUNF", // 8: TC A0 High Underflow + "TCA0_CMP0/TCA0_LCMP0", // 9: TC A0 Compare 0/TC A0 Low Compare 0 + "TCA0_CMP1/TCA0_LCMP1", // 10: TC A0 Compare 1/TC A0 Low Compare 1 + "TCA0_CMP2/TCA0_LCMP2", // 11: TC A0 Compare 2/TC A0 Low Compare 2 + "TCB0_INT", // 12: TC B0 Interrupt + "TCB1_INT", // 13: TC B1 Interrupt + "TCD0_OVF", // 14: TC D0 Overflow + "TCD0_TRIG", // 15: TC D0 Trigger + "TWI0_TWIP", // 16: 2-Wire Interface 0 Peripheral + "TWI0_TWIM", // 17: 2-Wire Interface 0 Controller + "SPI0_INT", // 18: SPI 0 Interrupt + "USART0_RXC", // 19: USART 0 Receive Complete + "USART0_DRE", // 20: USART 0 Data Register Empty + "USART0_TXC", // 21: USART 0 Transmit Complete + "PORTD_PORT", // 22: Interrupt PORT D + "AC0_AC", // 23: AC0 AC Interrupt + "ADC0_RESRDY", // 24: ADC 0 Result Ready + "ADC0_WCMP", // 25: ADC 0 Window Comparator + "ZCD0_ZCD", // 26: Zero Cross Detect 0 + "PTC_PTC", // 27: PTC Interrupt + "AC1_AC", // 28: AC1 AC Interrupt + "PORTC_PORT", // 29: Interrupt PORT C + "TCB2_INT", // 30: TC B2 Interrupt + "USART1_RXC", // 31: USART 1 Receive Complete + "USART1_DRE", // 32: USART 1 Data Register Empty + "USART1_TXC", // 33: USART 1 Transmit Complete + "PORTF_PORT", // 34: Interrupt PORT F + "NVMCTRL_EE", // 35: NVM EEPROM + "SPI1_INT", // 36: SPI 1 Interrupt + "USART2_RXC", // 37: USART 2 Receive Complete + "USART2_DRE", // 38: USART 2 Data Register Empty + "USART2_TXC", // 39: USART 2 Transmit Complete + "AC2_AC", // 40: AC2 AC Interrupt + "TCB3_INT", // 41: TC B3 Interrupt + "TWI1_TWIP", // 42: 2-Wire Interface 1 Peripheral + "TWI1_TWIM", // 43: 2-Wire Interface 1 Controller + "PORTB_PORT", // 44: Interrupt PORT B + "PORTE_PORT", // 45: Interrupt PORT E + "TCA1_LUNF/TCA1_OVF", // 46: TC A1 Low Underflow/TC A1 Overflow + "TCA1_HUNF", // 47: TC A1 High Underflow + "TCA1_CMP0/TCA1_LCMP0", // 48: TC A1 Compare 0/TC A1 Low Compare 0 + "TCA1_CMP1/TCA1_LCMP1", // 49: TC A1 Compare 1/TC A1 Low Compare 1 + "TCA1_CMP2/TCA1_LCMP2", // 50: TC A1 Compare 2/TC A1 Low Compare 2 + "ZCD1_ZCD", // 51: Zero Cross Detect 1 + "USART3_RXC", // 52: USART 3 Receive Complete + "USART3_DRE", // 53: USART 3 Data Register Empty + "USART3_TXC", // 54: USART 3 Transmit Complete + "USART4_RXC", // 55: USART 4 Receive Complete + "USART4_DRE", // 56: USART 4 Data Register Empty + "USART4_TXC", // 57: USART 4 Transmit Complete + "PORTG_PORT", // 58: Interrupt PORT G + "ZCD2_ZCD", // 59: Zero Cross Detect 2 + "TCB4_INT", // 60: TC B4 Interrupt + "USART5_RXC", // 61: USART 5 Receive Complete + "USART5_DRE", // 62: USART 5 Data Register Empty + "USART5_TXC", // 63: USART 5 Transmit Complete +}; + +const char * const vtab_avr128db64[vts_avr128db64] = { // AVR128DB64, AVR64DB64 + "RESET", // 0: Reset (various reasons) + "CRCSCAN_NMI", // 1: CRCSCAN Non-maskable Interrupt + "BOD_VLM", // 2: Brown-out Detector Voltage Level Monitor + "CLKCTRL_CFD", // 3: Clock Failure Detection + "MVIO_MVIO", // 4: Multi-Voltage I/O + "RTC_CNT", // 5: RTC Counter Interrupt + "RTC_PIT", // 6: RTC Periodic Interrupt Timer + "CCL_CCL", // 7: Configurable Custom Logic + "PORTA_PORT", // 8: Interrupt PORT A + "TCA0_LUNF/TCA0_OVF", // 9: TC A0 Low Underflow/TC A0 Overflow + "TCA0_HUNF", // 10: TC A0 High Underflow + "TCA0_CMP0/TCA0_LCMP0", // 11: TC A0 Compare 0/TC A0 Low Compare 0 + "TCA0_CMP1/TCA0_LCMP1", // 12: TC A0 Compare 1/TC A0 Low Compare 1 + "TCA0_CMP2/TCA0_LCMP2", // 13: TC A0 Compare 2/TC A0 Low Compare 2 + "TCB0_INT", // 14: TC B0 Interrupt + "TCB1_INT", // 15: TC B1 Interrupt + "TCD0_OVF", // 16: TC D0 Overflow + "TCD0_TRIG", // 17: TC D0 Trigger + "TWI0_TWIP", // 18: 2-Wire Interface 0 Peripheral + "TWI0_TWIM", // 19: 2-Wire Interface 0 Controller + "SPI0_INT", // 20: SPI 0 Interrupt + "USART0_RXC", // 21: USART 0 Receive Complete + "USART0_DRE", // 22: USART 0 Data Register Empty + "USART0_TXC", // 23: USART 0 Transmit Complete + "PORTD_PORT", // 24: Interrupt PORT D + "AC0_AC", // 25: AC0 AC Interrupt + "ADC0_RESRDY", // 26: ADC 0 Result Ready + "ADC0_WCMP", // 27: ADC 0 Window Comparator + "ZCD0_ZCD", // 28: Zero Cross Detect 0 + "AC1_AC", // 29: AC1 AC Interrupt + "PORTC_PORT", // 30: Interrupt PORT C + "TCB2_INT", // 31: TC B2 Interrupt + "USART1_RXC", // 32: USART 1 Receive Complete + "USART1_DRE", // 33: USART 1 Data Register Empty + "USART1_TXC", // 34: USART 1 Transmit Complete + "PORTF_PORT", // 35: Interrupt PORT F + "NVMCTRL_EE", // 36: NVM EEPROM + "SPI1_INT", // 37: SPI 1 Interrupt + "USART2_RXC", // 38: USART 2 Receive Complete + "USART2_DRE", // 39: USART 2 Data Register Empty + "USART2_TXC", // 40: USART 2 Transmit Complete + "AC2_AC", // 41: AC2 AC Interrupt + "TWI1_TWIP", // 42: 2-Wire Interface 1 Peripheral + "TWI1_TWIM", // 43: 2-Wire Interface 1 Controller + "TCB3_INT", // 44: TC B3 Interrupt + "PORTB_PORT", // 45: Interrupt PORT B + "PORTE_PORT", // 46: Interrupt PORT E + "TCA1_LUNF/TCA1_OVF", // 47: TC A1 Low Underflow/TC A1 Overflow + "TCA1_HUNF", // 48: TC A1 High Underflow + "TCA1_CMP0/TCA1_LCMP0", // 49: TC A1 Compare 0/TC A1 Low Compare 0 + "TCA1_CMP1/TCA1_LCMP1", // 50: TC A1 Compare 1/TC A1 Low Compare 1 + "TCA1_CMP2/TCA1_LCMP2", // 51: TC A1 Compare 2/TC A1 Low Compare 2 + "ZCD1_ZCD", // 52: Zero Cross Detect 1 + "USART3_RXC", // 53: USART 3 Receive Complete + "USART3_DRE", // 54: USART 3 Data Register Empty + "USART3_TXC", // 55: USART 3 Transmit Complete + "USART4_RXC", // 56: USART 4 Receive Complete + "USART4_DRE", // 57: USART 4 Data Register Empty + "USART4_TXC", // 58: USART 4 Transmit Complete + "PORTG_PORT", // 59: Interrupt PORT G + "ZCD2_ZCD", // 60: Zero Cross Detect 2 + "TCB4_INT", // 61: TC B4 Interrupt + "USART5_RXC", // 62: USART 5 Receive Complete + "USART5_DRE", // 63: USART 5 Data Register Empty + "USART5_TXC", // 64: USART 5 Transmit Complete +}; + diff --git a/src/avrintel.h b/src/avrintel.h new file mode 100644 index 00000000..63aca3bf --- /dev/null +++ b/src/avrintel.h @@ -0,0 +1,1477 @@ +/* + * Do not edit: automatically generated by mkavrintel.pl + * + * avrintel.h + * + * Atmel AVR8L, AVR8, XMEGA and AVR8X family description of interrupts and more + * + * published under GNU General Public License, version 3 (GPL-3.0) + * meta-author Stefan Rueger + * + * v 1.1 + * 02.01.2023 + * + */ + +#ifndef AVRINTEL_H +#define AVRINTEL_H + +#include "libavrdude.h" + +typedef struct { // Value of -1 typically means unknown + const char *name; // Name of part + uint16_t mcuid; // ID of MCU in 0..2039 + uint8_t avrarch; // F_AVR8L, F_AVR8, F_XMEGA or F_AVR8X + uint8_t sigs[3]; // Signature bytes + int32_t flashoffset; // Flash offset + int32_t flashsize; // Flash size + int16_t pagesize; // Flash page size + int8_t nboots; // Number of supported boot sectors + int16_t bootsize; // Size of (smallest) boot sector + int32_t eepromoffset; // EEPROM offset + int32_t eepromsize; // EEPROM size + int32_t eeprompagesize; // EEPROM page size + int32_t sramstart; // SRAM offset + int32_t sramsize; // SRAM size + int8_t nfuses; // Number of fuse bytes + int8_t nlocks; // Number of lock bytes + uint8_t ninterrupts; // Number of vectors in interrupt vector table + const char * const *isrtable; // Interrupt vector table vector names +} uPcore_t; + +#define F_AVR8L 1 // TPI programming, ATtiny(4|5|9|10|20|40|102|104) +#define F_AVR8 2 // ISP programming with SPI, "classic" AVRs +#define F_XMEGA 4 // PDI programming, ATxmega family +#define F_AVR8X 8 // UPDI programming, newer 8-bit MCUs + +#define UB_N_MCU 2040 // mcuid is in 0..2039 + +// MCU id: running number in arbitrary order; once assigned never change for backward compatibility +#define id_attiny4 0u +#define id_attiny5 1u +#define id_attiny9 2u +#define id_attiny10 3u +#define id_attiny20 4u +#define id_attiny40 5u +#define id_attiny102 6u +#define id_attiny104 7u +#define id_attiny11 8u +#define id_attiny12 9u +#define id_attiny13 10u +#define id_attiny13a 11u +#define id_attiny15 12u +#define id_attiny22 13u +#define id_attiny24 14u +#define id_attiny24a 15u +#define id_attiny25 16u +#define id_attiny26 17u +#define id_attiny28 18u +#define id_attiny43u 19u +#define id_attiny44 20u +#define id_attiny44a 21u +#define id_attiny45 22u +#define id_attiny48 23u +#define id_attiny84 24u +#define id_attiny84a 25u +#define id_attiny85 26u +#define id_attiny87 27u +#define id_attiny88 28u +#define id_attiny167 29u +#define id_attiny261 30u +#define id_attiny261a 31u +#define id_attiny441 32u +#define id_attiny461 33u +#define id_attiny461a 34u +#define id_attiny828 35u +#define id_attiny828r 36u +#define id_attiny841 37u +#define id_attiny861 38u +#define id_attiny861a 39u +#define id_attiny1634 40u +#define id_attiny1634r 41u +#define id_attiny2313 42u +#define id_attiny2313a 43u +#define id_attiny4313 44u +#define id_atmega8 45u +#define id_atmega8a 46u +#define id_atmega8hva 47u +#define id_atmega8u2 48u +#define id_atmega16 49u +#define id_atmega16a 50u +#define id_atmega16hva 51u +#define id_atmega16hvb 52u +#define id_atmega16hvbrevb 53u +#define id_atmega16m1 54u +#define id_atmega16hva2 55u +#define id_atmega16u2 56u +#define id_atmega16u4 57u +#define id_atmega32 58u +#define id_atmega32a 59u +#define id_atmega32hvb 60u +#define id_atmega32hvbrevb 61u +#define id_atmega32c1 62u +#define id_atmega32m1 63u +#define id_atmega32u2 64u +#define id_atmega32u4 65u +#define id_atmega32u6 66u +#define id_atmega48 67u +#define id_atmega48a 68u +#define id_atmega48p 69u +#define id_atmega48pa 70u +#define id_atmega48pb 71u +#define id_atmega64 72u +#define id_atmega64a 73u +#define id_atmega64hve 74u +#define id_atmega64c1 75u +#define id_atmega64m1 76u +#define id_atmega64hve2 77u +#define id_atmega64rfr2 78u +#define id_atmega88 79u +#define id_atmega88a 80u +#define id_atmega88p 81u +#define id_atmega88pa 82u +#define id_atmega88pb 83u +#define id_atmega103 84u +#define id_atmega128 85u +#define id_atmega128a 86u +#define id_atmega128rfa1 87u +#define id_atmega128rfr2 88u +#define id_atmega161 89u +#define id_atmega162 90u +#define id_atmega163 91u +#define id_atmega164a 92u +#define id_atmega164p 93u +#define id_atmega164pa 94u +#define id_atmega165 95u +#define id_atmega165a 96u +#define id_atmega165p 97u +#define id_atmega165pa 98u +#define id_atmega168 99u +#define id_atmega168a 100u +#define id_atmega168p 101u +#define id_atmega168pa 102u +#define id_atmega168pb 103u +#define id_atmega169 104u +#define id_atmega169a 105u +#define id_atmega169p 106u +#define id_atmega169pa 107u +#define id_atmega256rfr2 108u +#define id_atmega323 109u +#define id_atmega324a 110u +#define id_atmega324p 111u +#define id_atmega324pa 112u +#define id_atmega324pb 113u +#define id_atmega325 114u +#define id_atmega325a 115u +#define id_atmega325p 116u +#define id_atmega325pa 117u +#define id_atmega328 118u +#define id_atmega328p 119u +#define id_atmega328pb 120u +#define id_atmega329 121u +#define id_atmega329a 122u +#define id_atmega329p 123u +#define id_atmega329pa 124u +#define id_atmega406 125u +#define id_atmega640 126u +#define id_atmega644 127u +#define id_atmega644a 128u +#define id_atmega644p 129u +#define id_atmega644pa 130u +#define id_atmega644rfr2 131u +#define id_atmega645 132u +#define id_atmega645a 133u +#define id_atmega645p 134u +#define id_atmega649 135u +#define id_atmega649a 136u +#define id_atmega649p 137u +#define id_atmega1280 138u +#define id_atmega1281 139u +#define id_atmega1284 140u +#define id_atmega1284p 141u +#define id_atmega1284rfr2 142u +#define id_atmega2560 143u +#define id_atmega2561 144u +#define id_atmega2564rfr2 145u +#define id_atmega3250 146u +#define id_atmega3250a 147u +#define id_atmega3250p 148u +#define id_atmega3250pa 149u +#define id_atmega3290 150u +#define id_atmega3290a 151u +#define id_atmega3290p 152u +#define id_atmega3290pa 153u +#define id_atmega6450 154u +#define id_atmega6450a 155u +#define id_atmega6450p 156u +#define id_atmega6490 157u +#define id_atmega6490a 158u +#define id_atmega6490p 159u +#define id_atmega8515 160u +#define id_atmega8535 161u +#define id_at43usb320 162u +#define id_at43usb355 163u +#define id_at76c711 164u +#define id_at86rf401 165u +#define id_at90pwm1 166u +#define id_at90pwm2 167u +#define id_at90pwm2b 168u +#define id_at90pwm3 169u +#define id_at90pwm3b 170u +#define id_at90can32 171u +#define id_at90can64 172u +#define id_at90pwm81 173u +#define id_at90usb82 174u +#define id_at90scr100 175u +#define id_at90can128 176u +#define id_at90pwm161 177u +#define id_at90usb162 178u +#define id_at90pwm216 179u +#define id_at90pwm316 180u +#define id_at90usb646 181u +#define id_at90usb647 182u +#define id_at90s1200 183u +#define id_at90usb1286 184u +#define id_at90usb1287 185u +#define id_at90s2313 186u +#define id_at90s2323 187u +#define id_at90s2333 188u +#define id_at90s2343 189u +#define id_at90s4414 190u +#define id_at90s4433 191u +#define id_at90s4434 192u +#define id_at90s8515 193u +#define id_at90c8534 194u +#define id_at90s8535 195u +#define id_at94k 196u +#define id_ata5272 197u +#define id_ata5505 198u +#define id_ata5700m322 199u +#define id_ata5702m322 200u +#define id_ata5781 201u +#define id_ata5782 202u +#define id_ata5783 203u +#define id_ata5787 204u +#define id_ata5790 205u +#define id_ata5790n 206u +#define id_ata5791 207u +#define id_ata5795 208u +#define id_ata5831 209u +#define id_ata5832 210u +#define id_ata5833 211u +#define id_ata5835 212u +#define id_ata6285 213u +#define id_ata6286 214u +#define id_ata6289 215u +#define id_ata6612c 216u +#define id_ata6613c 217u +#define id_ata6614q 218u +#define id_ata6616c 219u +#define id_ata6617c 220u +#define id_ata8210 221u +#define id_ata8215 222u +#define id_ata8510 223u +#define id_ata8515 224u +#define id_ata664251 225u +#define id_m3000 226u +#define id_lgt8f88p 227u +#define id_lgt8f168p 228u +#define id_lgt8f328p 229u +#define id_atxmega8e5 230u +#define id_atxmega16a4 231u +#define id_atxmega16a4u 232u +#define id_atxmega16c4 233u +#define id_atxmega16d4 234u +#define id_atxmega16e5 235u +#define id_atxmega32c3 236u +#define id_atxmega32d3 237u +#define id_atxmega32a4 238u +#define id_atxmega32a4u 239u +#define id_atxmega32c4 240u +#define id_atxmega32d4 241u +#define id_atxmega32e5 242u +#define id_atxmega64a1 243u +#define id_atxmega64a1u 244u +#define id_atxmega64b1 245u +#define id_atxmega64a3 246u +#define id_atxmega64a3u 247u +#define id_atxmega64b3 248u +#define id_atxmega64c3 249u +#define id_atxmega64d3 250u +#define id_atxmega64a4 251u +#define id_atxmega64a4u 252u +#define id_atxmega64d4 253u +#define id_atxmega128a1 254u +#define id_atxmega128a1revd 255u +#define id_atxmega128a1u 256u +#define id_atxmega128b1 257u +#define id_atxmega128a3 258u +#define id_atxmega128a3u 259u +#define id_atxmega128b3 260u +#define id_atxmega128c3 261u +#define id_atxmega128d3 262u +#define id_atxmega128a4 263u +#define id_atxmega128a4u 264u +#define id_atxmega128d4 265u +#define id_atxmega192a1 266u +#define id_atxmega192a3 267u +#define id_atxmega192a3u 268u +#define id_atxmega192c3 269u +#define id_atxmega192d3 270u +#define id_atxmega256a1 271u +#define id_atxmega256a3 272u +#define id_atxmega256a3b 273u +#define id_atxmega256a3bu 274u +#define id_atxmega256a3u 275u +#define id_atxmega256c3 276u +#define id_atxmega256d3 277u +#define id_atxmega384c3 278u +#define id_atxmega384d3 279u +#define id_attiny202 280u +#define id_attiny204 281u +#define id_attiny212 282u +#define id_attiny214 283u +#define id_attiny402 284u +#define id_attiny404 285u +#define id_attiny406 286u +#define id_attiny412 287u +#define id_attiny414 288u +#define id_attiny416 289u +#define id_attiny416auto 290u +#define id_attiny417 291u +#define id_attiny424 292u +#define id_attiny426 293u +#define id_attiny427 294u +#define id_attiny804 295u +#define id_attiny806 296u +#define id_attiny807 297u +#define id_attiny814 298u +#define id_attiny816 299u +#define id_attiny817 300u +#define id_attiny824 301u +#define id_attiny826 302u +#define id_attiny827 303u +#define id_attiny1604 304u +#define id_attiny1606 305u +#define id_attiny1607 306u +#define id_attiny1614 307u +#define id_attiny1616 308u +#define id_attiny1617 309u +#define id_attiny1624 310u +#define id_attiny1626 311u +#define id_attiny1627 312u +#define id_attiny3214 313u +#define id_attiny3216 314u +#define id_attiny3217 315u +#define id_attiny3224 316u +#define id_attiny3226 317u +#define id_attiny3227 318u +#define id_atmega808 319u +#define id_atmega809 320u +#define id_atmega1608 321u +#define id_atmega1609 322u +#define id_atmega3208 323u +#define id_atmega3209 324u +#define id_atmega4808 325u +#define id_atmega4809 326u +#define id_avr8ea28 327u +#define id_avr8ea32 328u +#define id_avr16dd14 329u +#define id_avr16dd20 330u +#define id_avr16dd28 331u +#define id_avr16ea28 332u +#define id_avr16dd32 333u +#define id_avr16ea32 334u +#define id_avr16ea48 335u +#define id_avr32dd14 336u +#define id_avr32dd20 337u +#define id_avr32da28 338u +#define id_avr32db28 339u +#define id_avr32dd28 340u +#define id_avr32ea28 341u +#define id_avr32da32 342u +#define id_avr32db32 343u +#define id_avr32dd32 344u +#define id_avr32ea32 345u +#define id_avr32da48 346u +#define id_avr32db48 347u +#define id_avr32ea48 348u +#define id_avr64dd14 349u +#define id_avr64dd20 350u +#define id_avr64da28 351u +#define id_avr64db28 352u +#define id_avr64dd28 353u +#define id_avr64ea28 354u +#define id_avr64da32 355u +#define id_avr64db32 356u +#define id_avr64dd32 357u +#define id_avr64ea32 358u +#define id_avr64da48 359u +#define id_avr64db48 360u +#define id_avr64ea48 361u +#define id_avr64da64 362u +#define id_avr64db64 363u +#define id_avr128da28 364u +#define id_avr128db28 365u +#define id_avr128da32 366u +#define id_avr128db32 367u +#define id_avr128da48 368u +#define id_avr128db48 369u +#define id_avr128da64 370u +#define id_avr128db64 371u + +// Interrupt vector table sizes (number of vectors) +#define vts_attiny4 10 +#define vts_attiny5 11 +#define vts_attiny9 10 +#define vts_attiny10 11 +#define vts_attiny20 17 +#define vts_attiny40 18 +#define vts_attiny102 16 +#define vts_attiny104 16 +#define vts_attiny11 5 +#define vts_attiny12 6 +#define vts_attiny13 10 +#define vts_attiny13a 10 +#define vts_attiny15 9 +#define vts_attiny22 3 +#define vts_attiny24 17 +#define vts_attiny24a 17 +#define vts_attiny25 15 +#define vts_attiny26 12 +#define vts_attiny28 6 +#define vts_attiny43u 16 +#define vts_attiny44 17 +#define vts_attiny44a 17 +#define vts_attiny45 15 +#define vts_attiny48 20 +#define vts_attiny84 17 +#define vts_attiny84a 17 +#define vts_attiny85 15 +#define vts_attiny87 20 +#define vts_attiny88 20 +#define vts_attiny167 20 +#define vts_attiny261 19 +#define vts_attiny261a 19 +#define vts_attiny441 30 +#define vts_attiny461 19 +#define vts_attiny461a 19 +#define vts_attiny828 26 +#define vts_attiny841 30 +#define vts_attiny861 19 +#define vts_attiny861a 19 +#define vts_attiny1634 28 +#define vts_attiny2313 19 +#define vts_attiny2313a 21 +#define vts_attiny4313 21 +#define vts_atmega8 19 +#define vts_atmega8a 19 +#define vts_atmega8hva 21 +#define vts_atmega8u2 29 +#define vts_atmega16 21 +#define vts_atmega16a 21 +#define vts_atmega16hva 21 +#define vts_atmega16hvb 29 +#define vts_atmega16hvbrevb 29 +#define vts_atmega16m1 31 +#define vts_atmega16hva2 22 +#define vts_atmega16u2 29 +#define vts_atmega16u4 43 +#define vts_atmega32 21 +#define vts_atmega32a 21 +#define vts_atmega32hvb 29 +#define vts_atmega32hvbrevb 29 +#define vts_atmega32c1 31 +#define vts_atmega32m1 31 +#define vts_atmega32u2 29 +#define vts_atmega32u4 43 +#define vts_atmega32u6 38 +#define vts_atmega48 26 +#define vts_atmega48a 26 +#define vts_atmega48p 26 +#define vts_atmega48pa 26 +#define vts_atmega48pb 27 +#define vts_atmega64 35 +#define vts_atmega64a 35 +#define vts_atmega64hve 25 +#define vts_atmega64c1 31 +#define vts_atmega64m1 31 +#define vts_atmega64hve2 25 +#define vts_atmega64rfr2 77 +#define vts_atmega88 26 +#define vts_atmega88a 26 +#define vts_atmega88p 26 +#define vts_atmega88pa 26 +#define vts_atmega88pb 27 +#define vts_atmega103 24 +#define vts_atmega128 35 +#define vts_atmega128a 35 +#define vts_atmega128rfa1 72 +#define vts_atmega128rfr2 77 +#define vts_atmega161 21 +#define vts_atmega162 28 +#define vts_atmega163 18 +#define vts_atmega164a 31 +#define vts_atmega164p 31 +#define vts_atmega164pa 31 +#define vts_atmega165 22 +#define vts_atmega165a 22 +#define vts_atmega165p 22 +#define vts_atmega165pa 22 +#define vts_atmega168 26 +#define vts_atmega168a 26 +#define vts_atmega168p 26 +#define vts_atmega168pa 26 +#define vts_atmega168pb 27 +#define vts_atmega169 23 +#define vts_atmega169a 23 +#define vts_atmega169p 23 +#define vts_atmega169pa 23 +#define vts_atmega256rfr2 77 +#define vts_atmega323 21 +#define vts_atmega324a 31 +#define vts_atmega324p 31 +#define vts_atmega324pa 31 +#define vts_atmega324pb 51 +#define vts_atmega325 22 +#define vts_atmega325a 22 +#define vts_atmega325p 22 +#define vts_atmega325pa 22 +#define vts_atmega328 26 +#define vts_atmega328p 26 +#define vts_atmega328pb 45 +#define vts_atmega329 23 +#define vts_atmega329a 23 +#define vts_atmega329p 23 +#define vts_atmega329pa 23 +#define vts_atmega406 23 +#define vts_atmega640 57 +#define vts_atmega644 28 +#define vts_atmega644a 31 +#define vts_atmega644p 31 +#define vts_atmega644pa 31 +#define vts_atmega644rfr2 77 +#define vts_atmega645 22 +#define vts_atmega645a 22 +#define vts_atmega645p 22 +#define vts_atmega649 23 +#define vts_atmega649a 23 +#define vts_atmega649p 23 +#define vts_atmega1280 57 +#define vts_atmega1281 57 +#define vts_atmega1284 35 +#define vts_atmega1284p 35 +#define vts_atmega1284rfr2 77 +#define vts_atmega2560 57 +#define vts_atmega2561 57 +#define vts_atmega2564rfr2 77 +#define vts_atmega3250 25 +#define vts_atmega3250a 25 +#define vts_atmega3250p 25 +#define vts_atmega3250pa 25 +#define vts_atmega3290 25 +#define vts_atmega3290a 25 +#define vts_atmega3290p 25 +#define vts_atmega3290pa 25 +#define vts_atmega6450 25 +#define vts_atmega6450a 25 +#define vts_atmega6450p 25 +#define vts_atmega6490 25 +#define vts_atmega6490a 25 +#define vts_atmega6490p 25 +#define vts_atmega8515 17 +#define vts_atmega8535 21 +#define vts_at86rf401 3 +#define vts_at90pwm1 32 +#define vts_at90pwm2 32 +#define vts_at90pwm2b 32 +#define vts_at90pwm3 32 +#define vts_at90pwm3b 32 +#define vts_at90can32 37 +#define vts_at90can64 37 +#define vts_at90pwm81 20 +#define vts_at90usb82 29 +#define vts_at90scr100 38 +#define vts_at90can128 37 +#define vts_at90pwm161 20 +#define vts_at90usb162 29 +#define vts_at90pwm216 32 +#define vts_at90pwm316 32 +#define vts_at90usb646 38 +#define vts_at90usb647 38 +#define vts_at90s1200 4 +#define vts_at90usb1286 38 +#define vts_at90usb1287 38 +#define vts_at90s2313 11 +#define vts_at90s2323 3 +#define vts_at90s2333 14 +#define vts_at90s2343 3 +#define vts_at90s4414 13 +#define vts_at90s4433 14 +#define vts_at90s4434 17 +#define vts_at90s8515 13 +#define vts_at90s8535 17 +#define vts_ata5272 37 +#define vts_ata5505 20 +#define vts_ata5700m322 51 +#define vts_ata5702m322 51 +#define vts_ata5781 42 +#define vts_ata5782 42 +#define vts_ata5783 42 +#define vts_ata5787 44 +#define vts_ata5790 30 +#define vts_ata5790n 31 +#define vts_ata5791 31 +#define vts_ata5795 23 +#define vts_ata5831 42 +#define vts_ata5832 42 +#define vts_ata5833 42 +#define vts_ata5835 44 +#define vts_ata6285 27 +#define vts_ata6286 27 +#define vts_ata6289 27 +#define vts_ata6612c 26 +#define vts_ata6613c 26 +#define vts_ata6614q 26 +#define vts_ata6616c 20 +#define vts_ata6617c 20 +#define vts_ata8210 42 +#define vts_ata8215 42 +#define vts_ata8510 42 +#define vts_ata8515 42 +#define vts_ata664251 20 +#define vts_atxmega8e5 43 +#define vts_atxmega16a4 94 +#define vts_atxmega16a4u 127 +#define vts_atxmega16c4 127 +#define vts_atxmega16d4 91 +#define vts_atxmega16e5 43 +#define vts_atxmega32c3 127 +#define vts_atxmega32d3 114 +#define vts_atxmega32a4 94 +#define vts_atxmega32a4u 127 +#define vts_atxmega32c4 127 +#define vts_atxmega32d4 91 +#define vts_atxmega32e5 43 +#define vts_atxmega64a1 125 +#define vts_atxmega64a1u 127 +#define vts_atxmega64b1 81 +#define vts_atxmega64a3 122 +#define vts_atxmega64a3u 127 +#define vts_atxmega64b3 54 +#define vts_atxmega64c3 127 +#define vts_atxmega64d3 114 +#define vts_atxmega64a4u 127 +#define vts_atxmega64d4 91 +#define vts_atxmega128a1 125 +#define vts_atxmega128a1u 127 +#define vts_atxmega128b1 81 +#define vts_atxmega128a3 122 +#define vts_atxmega128a3u 127 +#define vts_atxmega128b3 54 +#define vts_atxmega128c3 127 +#define vts_atxmega128d3 114 +#define vts_atxmega128a4u 127 +#define vts_atxmega128d4 91 +#define vts_atxmega192a3 122 +#define vts_atxmega192a3u 127 +#define vts_atxmega192c3 127 +#define vts_atxmega192d3 114 +#define vts_atxmega256a3 122 +#define vts_atxmega256a3b 122 +#define vts_atxmega256a3bu 127 +#define vts_atxmega256a3u 127 +#define vts_atxmega256c3 127 +#define vts_atxmega256d3 114 +#define vts_atxmega384c3 127 +#define vts_atxmega384d3 114 +#define vts_attiny202 26 +#define vts_attiny204 26 +#define vts_attiny212 26 +#define vts_attiny214 26 +#define vts_attiny402 26 +#define vts_attiny404 26 +#define vts_attiny406 26 +#define vts_attiny412 26 +#define vts_attiny414 26 +#define vts_attiny416 26 +#define vts_attiny416auto 26 +#define vts_attiny417 26 +#define vts_attiny424 30 +#define vts_attiny426 30 +#define vts_attiny427 30 +#define vts_attiny804 31 +#define vts_attiny806 31 +#define vts_attiny807 31 +#define vts_attiny814 26 +#define vts_attiny816 26 +#define vts_attiny817 26 +#define vts_attiny824 30 +#define vts_attiny826 30 +#define vts_attiny827 30 +#define vts_attiny1604 31 +#define vts_attiny1606 31 +#define vts_attiny1607 31 +#define vts_attiny1614 31 +#define vts_attiny1616 31 +#define vts_attiny1617 31 +#define vts_attiny1624 30 +#define vts_attiny1626 30 +#define vts_attiny1627 30 +#define vts_attiny3214 31 +#define vts_attiny3216 31 +#define vts_attiny3217 31 +#define vts_attiny3224 30 +#define vts_attiny3226 30 +#define vts_attiny3227 30 +#define vts_atmega808 36 +#define vts_atmega809 40 +#define vts_atmega1608 36 +#define vts_atmega1609 40 +#define vts_atmega3208 36 +#define vts_atmega3209 40 +#define vts_atmega4808 36 +#define vts_atmega4809 40 +#define vts_avr16dd14 36 +#define vts_avr16dd20 36 +#define vts_avr16dd28 36 +#define vts_avr16dd32 36 +#define vts_avr32dd14 36 +#define vts_avr32dd20 36 +#define vts_avr32da28 41 +#define vts_avr32db28 42 +#define vts_avr32dd28 36 +#define vts_avr32da32 44 +#define vts_avr32db32 44 +#define vts_avr32dd32 36 +#define vts_avr32da48 58 +#define vts_avr32db48 61 +#define vts_avr64dd14 36 +#define vts_avr64dd20 36 +#define vts_avr64da28 41 +#define vts_avr64db28 42 +#define vts_avr64dd28 36 +#define vts_avr64ea28 37 +#define vts_avr64da32 44 +#define vts_avr64db32 44 +#define vts_avr64dd32 36 +#define vts_avr64ea32 37 +#define vts_avr64da48 58 +#define vts_avr64db48 61 +#define vts_avr64ea48 45 +#define vts_avr64da64 64 +#define vts_avr64db64 65 +#define vts_avr128da28 41 +#define vts_avr128db28 42 +#define vts_avr128da32 44 +#define vts_avr128db32 44 +#define vts_avr128da48 58 +#define vts_avr128db48 61 +#define vts_avr128da64 64 +#define vts_avr128db64 65 + +// Suggested vector bootloader interrupt: first unused vector or slot just above vector table +#define vbu_attiny4 10 +#define vbu_attiny5 11 +#define vbu_attiny9 10 +#define vbu_attiny10 11 +#define vbu_attiny20 17 +#define vbu_attiny40 18 +#define vbu_attiny102 16 +#define vbu_attiny104 16 +#define vbu_attiny11 5 +#define vbu_attiny12 6 +#define vbu_attiny13 10 +#define vbu_attiny13a 10 +#define vbu_attiny15 9 +#define vbu_attiny22 3 +#define vbu_attiny24 17 +#define vbu_attiny24a 17 +#define vbu_attiny25 15 +#define vbu_attiny26 12 +#define vbu_attiny28 6 +#define vbu_attiny43u 16 +#define vbu_attiny44 17 +#define vbu_attiny44a 17 +#define vbu_attiny45 15 +#define vbu_attiny48 20 +#define vbu_attiny84 17 +#define vbu_attiny84a 17 +#define vbu_attiny85 15 +#define vbu_attiny87 20 +#define vbu_attiny88 20 +#define vbu_attiny167 20 +#define vbu_attiny261 19 +#define vbu_attiny261a 19 +#define vbu_attiny441 30 +#define vbu_attiny461 19 +#define vbu_attiny461a 19 +#define vbu_attiny828 26 +#define vbu_attiny841 30 +#define vbu_attiny861 19 +#define vbu_attiny861a 19 +#define vbu_attiny1634 28 +#define vbu_attiny2313 19 +#define vbu_attiny2313a 21 +#define vbu_attiny4313 21 +#define vbu_atmega8 19 +#define vbu_atmega8a 19 +#define vbu_atmega8hva 21 +#define vbu_atmega8u2 29 +#define vbu_atmega16 21 +#define vbu_atmega16a 21 +#define vbu_atmega16hva 21 +#define vbu_atmega16hvb 29 +#define vbu_atmega16hvbrevb 29 +#define vbu_atmega16m1 31 +#define vbu_atmega16hva2 22 +#define vbu_atmega16u2 29 +#define vbu_atmega16u4 43 +#define vbu_atmega32 21 +#define vbu_atmega32a 21 +#define vbu_atmega32hvb 29 +#define vbu_atmega32hvbrevb 29 +#define vbu_atmega32c1 31 +#define vbu_atmega32m1 31 +#define vbu_atmega32u2 29 +#define vbu_atmega32u4 43 +#define vbu_atmega32u6 38 +#define vbu_atmega48 26 +#define vbu_atmega48a 26 +#define vbu_atmega48p 26 +#define vbu_atmega48pa 26 +#define vbu_atmega48pb 27 +#define vbu_atmega64 35 +#define vbu_atmega64a 35 +#define vbu_atmega64hve 25 +#define vbu_atmega64c1 31 +#define vbu_atmega64m1 31 +#define vbu_atmega64hve2 25 +#define vbu_atmega64rfr2 77 +#define vbu_atmega88 26 +#define vbu_atmega88a 26 +#define vbu_atmega88p 26 +#define vbu_atmega88pa 26 +#define vbu_atmega88pb 27 +#define vbu_atmega103 24 +#define vbu_atmega128 35 +#define vbu_atmega128a 35 +#define vbu_atmega128rfa1 72 +#define vbu_atmega128rfr2 77 +#define vbu_atmega161 21 +#define vbu_atmega162 28 +#define vbu_atmega163 18 +#define vbu_atmega164a 31 +#define vbu_atmega164p 31 +#define vbu_atmega164pa 31 +#define vbu_atmega165 22 +#define vbu_atmega165a 22 +#define vbu_atmega165p 22 +#define vbu_atmega165pa 22 +#define vbu_atmega168 26 +#define vbu_atmega168a 26 +#define vbu_atmega168p 26 +#define vbu_atmega168pa 26 +#define vbu_atmega168pb 27 +#define vbu_atmega169 23 +#define vbu_atmega169a 23 +#define vbu_atmega169p 23 +#define vbu_atmega169pa 23 +#define vbu_atmega256rfr2 77 +#define vbu_atmega323 21 +#define vbu_atmega324a 31 +#define vbu_atmega324p 31 +#define vbu_atmega324pa 31 +#define vbu_atmega324pb 51 +#define vbu_atmega325 22 +#define vbu_atmega325a 22 +#define vbu_atmega325p 22 +#define vbu_atmega325pa 22 +#define vbu_atmega328 26 +#define vbu_atmega328p 26 +#define vbu_atmega328pb 45 +#define vbu_atmega329 23 +#define vbu_atmega329a 23 +#define vbu_atmega329p 23 +#define vbu_atmega329pa 23 +#define vbu_atmega406 23 +#define vbu_atmega640 57 +#define vbu_atmega644 28 +#define vbu_atmega644a 31 +#define vbu_atmega644p 31 +#define vbu_atmega644pa 31 +#define vbu_atmega644rfr2 77 +#define vbu_atmega645 22 +#define vbu_atmega645a 22 +#define vbu_atmega645p 22 +#define vbu_atmega649 23 +#define vbu_atmega649a 23 +#define vbu_atmega649p 23 +#define vbu_atmega1280 57 +#define vbu_atmega1281 57 +#define vbu_atmega1284 35 +#define vbu_atmega1284p 35 +#define vbu_atmega1284rfr2 77 +#define vbu_atmega2560 57 +#define vbu_atmega2561 57 +#define vbu_atmega2564rfr2 77 +#define vbu_atmega3250 25 +#define vbu_atmega3250a 25 +#define vbu_atmega3250p 25 +#define vbu_atmega3250pa 25 +#define vbu_atmega3290 25 +#define vbu_atmega3290a 25 +#define vbu_atmega3290p 25 +#define vbu_atmega3290pa 25 +#define vbu_atmega6450 25 +#define vbu_atmega6450a 25 +#define vbu_atmega6450p 25 +#define vbu_atmega6490 25 +#define vbu_atmega6490a 25 +#define vbu_atmega6490p 25 +#define vbu_atmega8515 17 +#define vbu_atmega8535 21 +#define vbu_at86rf401 3 +#define vbu_at90pwm1 32 +#define vbu_at90pwm2 14 +#define vbu_at90pwm2b 32 +#define vbu_at90pwm3 32 +#define vbu_at90pwm3b 32 +#define vbu_at90can32 37 +#define vbu_at90can64 37 +#define vbu_at90pwm81 20 +#define vbu_at90usb82 29 +#define vbu_at90scr100 38 +#define vbu_at90can128 37 +#define vbu_at90pwm161 20 +#define vbu_at90usb162 29 +#define vbu_at90pwm216 32 +#define vbu_at90pwm316 32 +#define vbu_at90usb646 38 +#define vbu_at90usb647 38 +#define vbu_at90s1200 4 +#define vbu_at90usb1286 38 +#define vbu_at90usb1287 38 +#define vbu_at90s2313 11 +#define vbu_at90s2323 3 +#define vbu_at90s2333 14 +#define vbu_at90s2343 3 +#define vbu_at90s4414 13 +#define vbu_at90s4433 14 +#define vbu_at90s4434 17 +#define vbu_at90s8515 13 +#define vbu_at90s8535 17 +#define vbu_ata5272 17 +#define vbu_ata5505 20 +#define vbu_ata5700m322 51 +#define vbu_ata5702m322 51 +#define vbu_ata5781 42 +#define vbu_ata5782 42 +#define vbu_ata5783 42 +#define vbu_ata5787 44 +#define vbu_ata5790 30 +#define vbu_ata5790n 31 +#define vbu_ata5791 31 +#define vbu_ata5795 23 +#define vbu_ata5831 42 +#define vbu_ata5832 42 +#define vbu_ata5833 42 +#define vbu_ata5835 44 +#define vbu_ata6285 27 +#define vbu_ata6286 27 +#define vbu_ata6289 27 +#define vbu_ata6612c 26 +#define vbu_ata6613c 26 +#define vbu_ata6614q 26 +#define vbu_ata6616c 20 +#define vbu_ata6617c 20 +#define vbu_ata8210 42 +#define vbu_ata8215 42 +#define vbu_ata8510 42 +#define vbu_ata8515 42 +#define vbu_ata664251 20 +#define vbu_atxmega8e5 43 +#define vbu_atxmega16a4 36 +#define vbu_atxmega16a4u 36 +#define vbu_atxmega16c4 6 +#define vbu_atxmega16d4 6 +#define vbu_atxmega16e5 43 +#define vbu_atxmega32c3 6 +#define vbu_atxmega32d3 6 +#define vbu_atxmega32a4 36 +#define vbu_atxmega32a4u 36 +#define vbu_atxmega32c4 6 +#define vbu_atxmega32d4 6 +#define vbu_atxmega32e5 43 +#define vbu_atxmega64a1 102 +#define vbu_atxmega64a1u 102 +#define vbu_atxmega64b1 8 +#define vbu_atxmega64a3 75 +#define vbu_atxmega64a3u 75 +#define vbu_atxmega64b3 8 +#define vbu_atxmega64c3 6 +#define vbu_atxmega64d3 6 +#define vbu_atxmega64a4u 36 +#define vbu_atxmega64d4 6 +#define vbu_atxmega128a1 102 +#define vbu_atxmega128a1u 102 +#define vbu_atxmega128b1 8 +#define vbu_atxmega128a3 75 +#define vbu_atxmega128a3u 75 +#define vbu_atxmega128b3 8 +#define vbu_atxmega128c3 6 +#define vbu_atxmega128d3 6 +#define vbu_atxmega128a4u 36 +#define vbu_atxmega128d4 6 +#define vbu_atxmega192a3 75 +#define vbu_atxmega192a3u 75 +#define vbu_atxmega192c3 6 +#define vbu_atxmega192d3 6 +#define vbu_atxmega256a3 75 +#define vbu_atxmega256a3b 57 +#define vbu_atxmega256a3bu 57 +#define vbu_atxmega256a3u 75 +#define vbu_atxmega256c3 6 +#define vbu_atxmega256d3 6 +#define vbu_atxmega384c3 8 +#define vbu_atxmega384d3 6 +#define vbu_attiny202 4 +#define vbu_attiny204 5 +#define vbu_attiny212 4 +#define vbu_attiny214 5 +#define vbu_attiny402 4 +#define vbu_attiny404 5 +#define vbu_attiny406 14 +#define vbu_attiny412 4 +#define vbu_attiny414 5 +#define vbu_attiny416 26 +#define vbu_attiny416auto 26 +#define vbu_attiny417 26 +#define vbu_attiny424 30 +#define vbu_attiny426 30 +#define vbu_attiny427 30 +#define vbu_attiny804 14 +#define vbu_attiny806 14 +#define vbu_attiny807 14 +#define vbu_attiny814 5 +#define vbu_attiny816 26 +#define vbu_attiny817 26 +#define vbu_attiny824 30 +#define vbu_attiny826 30 +#define vbu_attiny827 30 +#define vbu_attiny1604 14 +#define vbu_attiny1606 14 +#define vbu_attiny1607 14 +#define vbu_attiny1614 5 +#define vbu_attiny1616 31 +#define vbu_attiny1617 31 +#define vbu_attiny1624 30 +#define vbu_attiny1626 30 +#define vbu_attiny1627 30 +#define vbu_attiny3214 31 +#define vbu_attiny3216 31 +#define vbu_attiny3217 31 +#define vbu_attiny3224 30 +#define vbu_attiny3226 30 +#define vbu_attiny3227 30 +#define vbu_atmega808 36 +#define vbu_atmega809 40 +#define vbu_atmega1608 36 +#define vbu_atmega1609 40 +#define vbu_atmega3208 36 +#define vbu_atmega3209 40 +#define vbu_atmega4808 36 +#define vbu_atmega4809 40 +#define vbu_avr16dd14 36 +#define vbu_avr16dd20 36 +#define vbu_avr16dd28 36 +#define vbu_avr16dd32 36 +#define vbu_avr32dd14 36 +#define vbu_avr32dd20 36 +#define vbu_avr32da28 41 +#define vbu_avr32db28 42 +#define vbu_avr32dd28 36 +#define vbu_avr32da32 41 +#define vbu_avr32db32 44 +#define vbu_avr32dd32 36 +#define vbu_avr32da48 58 +#define vbu_avr32db48 59 +#define vbu_avr64dd14 36 +#define vbu_avr64dd20 36 +#define vbu_avr64da28 41 +#define vbu_avr64db28 42 +#define vbu_avr64dd28 36 +#define vbu_avr64ea28 37 +#define vbu_avr64da32 41 +#define vbu_avr64db32 44 +#define vbu_avr64dd32 36 +#define vbu_avr64ea32 37 +#define vbu_avr64da48 58 +#define vbu_avr64db48 59 +#define vbu_avr64ea48 45 +#define vbu_avr64da64 64 +#define vbu_avr64db64 65 +#define vbu_avr128da28 41 +#define vbu_avr128db28 42 +#define vbu_avr128da32 41 +#define vbu_avr128db32 44 +#define vbu_avr128da48 58 +#define vbu_avr128db48 59 +#define vbu_avr128da64 64 +#define vbu_avr128db64 65 + +// Aliases for parts with the same vector table +#define vtab_attiny4 vtab_attiny9 +#define vtab_attiny5 vtab_attiny10 +#define vtab_attiny102 vtab_attiny104 +#define vtab_attiny13 vtab_attiny13a +#define vtab_attiny24 vtab_attiny84a +#define vtab_attiny24a vtab_attiny84a +#define vtab_attiny25 vtab_attiny85 +#define vtab_attiny44 vtab_attiny84a +#define vtab_attiny44a vtab_attiny84a +#define vtab_attiny45 vtab_attiny85 +#define vtab_attiny48 vtab_attiny88 +#define vtab_attiny84 vtab_attiny84a +#define vtab_attiny87 vtab_attiny167 +#define vtab_attiny261 vtab_attiny861a +#define vtab_attiny261a vtab_attiny861a +#define vtab_attiny441 vtab_attiny841 +#define vtab_attiny461 vtab_attiny861a +#define vtab_attiny461a vtab_attiny861a +#define vtab_attiny861 vtab_attiny861a +#define vtab_attiny2313a vtab_attiny4313 +#define vtab_atmega8 vtab_atmega8a +#define vtab_atmega8hva vtab_atmega16hva +#define vtab_atmega8u2 vtab_atmega32u2 +#define vtab_atmega16 vtab_atmega16a +#define vtab_atmega16hvb vtab_atmega32hvbrevb +#define vtab_atmega16hvbrevb vtab_atmega32hvbrevb +#define vtab_atmega16m1 vtab_atmega64m1 +#define vtab_atmega16u2 vtab_atmega32u2 +#define vtab_atmega16u4 vtab_atmega32u4 +#define vtab_atmega32 vtab_atmega323 +#define vtab_atmega32a vtab_atmega323 +#define vtab_atmega32hvb vtab_atmega32hvbrevb +#define vtab_atmega32c1 vtab_atmega64m1 +#define vtab_atmega32m1 vtab_atmega64m1 +#define vtab_atmega48 vtab_atmega328p +#define vtab_atmega48a vtab_atmega328p +#define vtab_atmega48p vtab_atmega328p +#define vtab_atmega48pa vtab_atmega328p +#define vtab_atmega48pb vtab_atmega168pb +#define vtab_atmega64 vtab_atmega128a +#define vtab_atmega64a vtab_atmega128a +#define vtab_atmega64hve vtab_atmega64hve2 +#define vtab_atmega64c1 vtab_atmega64m1 +#define vtab_atmega64rfr2 vtab_atmega2564rfr2 +#define vtab_atmega88 vtab_atmega328p +#define vtab_atmega88a vtab_atmega328p +#define vtab_atmega88p vtab_atmega328p +#define vtab_atmega88pa vtab_atmega328p +#define vtab_atmega88pb vtab_atmega168pb +#define vtab_atmega128 vtab_atmega128a +#define vtab_atmega128rfr2 vtab_atmega2564rfr2 +#define vtab_atmega164a vtab_atmega644pa +#define vtab_atmega164p vtab_atmega644pa +#define vtab_atmega164pa vtab_atmega644pa +#define vtab_atmega165 vtab_atmega645p +#define vtab_atmega165a vtab_atmega645p +#define vtab_atmega165p vtab_atmega645p +#define vtab_atmega165pa vtab_atmega645p +#define vtab_atmega168 vtab_atmega328 +#define vtab_atmega168a vtab_atmega328p +#define vtab_atmega168p vtab_atmega328p +#define vtab_atmega168pa vtab_atmega328p +#define vtab_atmega169 vtab_atmega649p +#define vtab_atmega169a vtab_atmega649p +#define vtab_atmega169p vtab_atmega649p +#define vtab_atmega169pa vtab_atmega649p +#define vtab_atmega256rfr2 vtab_atmega2564rfr2 +#define vtab_atmega324a vtab_atmega644pa +#define vtab_atmega324p vtab_atmega644pa +#define vtab_atmega324pa vtab_atmega644pa +#define vtab_atmega325 vtab_atmega645p +#define vtab_atmega325a vtab_atmega645p +#define vtab_atmega325p vtab_atmega645p +#define vtab_atmega325pa vtab_atmega645p +#define vtab_atmega329 vtab_atmega649p +#define vtab_atmega329a vtab_atmega649p +#define vtab_atmega329p vtab_atmega649p +#define vtab_atmega329pa vtab_atmega649p +#define vtab_atmega640 vtab_atmega2561 +#define vtab_atmega644a vtab_atmega644pa +#define vtab_atmega644p vtab_atmega644pa +#define vtab_atmega644rfr2 vtab_atmega2564rfr2 +#define vtab_atmega645 vtab_atmega645p +#define vtab_atmega645a vtab_atmega645p +#define vtab_atmega649 vtab_atmega649p +#define vtab_atmega649a vtab_atmega649p +#define vtab_atmega1280 vtab_atmega2561 +#define vtab_atmega1281 vtab_atmega2561 +#define vtab_atmega1284 vtab_atmega1284p +#define vtab_atmega1284rfr2 vtab_atmega2564rfr2 +#define vtab_atmega2560 vtab_atmega2561 +#define vtab_atmega3250 vtab_atmega6450p +#define vtab_atmega3250a vtab_atmega6450p +#define vtab_atmega3250p vtab_atmega6450p +#define vtab_atmega3250pa vtab_atmega6450p +#define vtab_atmega3290 vtab_atmega6490p +#define vtab_atmega3290a vtab_atmega6490p +#define vtab_atmega3290p vtab_atmega6490p +#define vtab_atmega3290pa vtab_atmega6490p +#define vtab_atmega6450 vtab_atmega6450p +#define vtab_atmega6450a vtab_atmega6450p +#define vtab_atmega6490 vtab_atmega6490p +#define vtab_atmega6490a vtab_atmega6490p +#define vtab_at90pwm1 vtab_at90pwm316 +#define vtab_at90pwm2b vtab_at90pwm3b +#define vtab_at90pwm3 vtab_at90pwm3b +#define vtab_at90can32 vtab_at90can128 +#define vtab_at90can64 vtab_at90can128 +#define vtab_at90pwm81 vtab_at90pwm161 +#define vtab_at90usb82 vtab_atmega32u2 +#define vtab_at90usb162 vtab_atmega32u2 +#define vtab_at90pwm216 vtab_at90pwm316 +#define vtab_at90usb646 vtab_atmega32u6 +#define vtab_at90usb647 vtab_atmega32u6 +#define vtab_at90usb1286 vtab_atmega32u6 +#define vtab_at90usb1287 vtab_atmega32u6 +#define vtab_at90s2323 vtab_attiny22 +#define vtab_at90s2333 vtab_at90s4433 +#define vtab_at90s2343 vtab_attiny22 +#define vtab_at90s4414 vtab_at90s8515 +#define vtab_at90s4434 vtab_at90s8535 +#define vtab_ata5505 vtab_attiny167 +#define vtab_ata5700m322 vtab_ata5702m322 +#define vtab_ata5781 vtab_ata8515 +#define vtab_ata5782 vtab_ata8515 +#define vtab_ata5783 vtab_ata8515 +#define vtab_ata5787 vtab_ata5835 +#define vtab_ata5790n vtab_ata5791 +#define vtab_ata5831 vtab_ata8515 +#define vtab_ata5832 vtab_ata8515 +#define vtab_ata5833 vtab_ata8515 +#define vtab_ata6285 vtab_ata6289 +#define vtab_ata6286 vtab_ata6289 +#define vtab_ata6612c vtab_atmega328p +#define vtab_ata6613c vtab_atmega328p +#define vtab_ata6614q vtab_atmega328p +#define vtab_ata6616c vtab_attiny167 +#define vtab_ata6617c vtab_attiny167 +#define vtab_ata8210 vtab_ata8515 +#define vtab_ata8215 vtab_ata8515 +#define vtab_ata8510 vtab_ata8515 +#define vtab_ata664251 vtab_attiny167 +#define vtab_atxmega8e5 vtab_atxmega32e5 +#define vtab_atxmega16a4 vtab_atxmega32a4 +#define vtab_atxmega16a4u vtab_atxmega128a4u +#define vtab_atxmega16c4 vtab_atxmega32c4 +#define vtab_atxmega16d4 vtab_atxmega32d4 +#define vtab_atxmega16e5 vtab_atxmega32e5 +#define vtab_atxmega32c3 vtab_atxmega256c3 +#define vtab_atxmega32d3 vtab_atxmega384d3 +#define vtab_atxmega32a4u vtab_atxmega128a4u +#define vtab_atxmega64a1 vtab_atxmega128a1 +#define vtab_atxmega64a1u vtab_atxmega128a1u +#define vtab_atxmega64b1 vtab_atxmega128b1 +#define vtab_atxmega64a3 vtab_atxmega256a3 +#define vtab_atxmega64a3u vtab_atxmega256a3u +#define vtab_atxmega64b3 vtab_atxmega128b3 +#define vtab_atxmega64c3 vtab_atxmega256c3 +#define vtab_atxmega64d3 vtab_atxmega384d3 +#define vtab_atxmega64a4u vtab_atxmega128a4u +#define vtab_atxmega64d4 vtab_atxmega128d4 +#define vtab_atxmega128a3 vtab_atxmega256a3 +#define vtab_atxmega128a3u vtab_atxmega256a3u +#define vtab_atxmega128c3 vtab_atxmega256c3 +#define vtab_atxmega128d3 vtab_atxmega384d3 +#define vtab_atxmega192a3 vtab_atxmega256a3 +#define vtab_atxmega192a3u vtab_atxmega256a3u +#define vtab_atxmega192c3 vtab_atxmega256c3 +#define vtab_atxmega192d3 vtab_atxmega384d3 +#define vtab_atxmega256d3 vtab_atxmega384d3 +#define vtab_attiny202 vtab_attiny402 +#define vtab_attiny204 vtab_attiny404 +#define vtab_attiny212 vtab_attiny412 +#define vtab_attiny214 vtab_attiny814 +#define vtab_attiny414 vtab_attiny814 +#define vtab_attiny416 vtab_attiny817 +#define vtab_attiny416auto vtab_attiny817 +#define vtab_attiny417 vtab_attiny817 +#define vtab_attiny424 vtab_attiny3227 +#define vtab_attiny426 vtab_attiny3227 +#define vtab_attiny427 vtab_attiny3227 +#define vtab_attiny804 vtab_attiny1607 +#define vtab_attiny806 vtab_attiny1607 +#define vtab_attiny807 vtab_attiny1607 +#define vtab_attiny816 vtab_attiny817 +#define vtab_attiny824 vtab_attiny3227 +#define vtab_attiny826 vtab_attiny3227 +#define vtab_attiny827 vtab_attiny3227 +#define vtab_attiny1604 vtab_attiny1607 +#define vtab_attiny1606 vtab_attiny1607 +#define vtab_attiny1616 vtab_attiny3217 +#define vtab_attiny1617 vtab_attiny3217 +#define vtab_attiny1624 vtab_attiny3227 +#define vtab_attiny1626 vtab_attiny3227 +#define vtab_attiny1627 vtab_attiny3227 +#define vtab_attiny3216 vtab_attiny3217 +#define vtab_attiny3224 vtab_attiny3227 +#define vtab_attiny3226 vtab_attiny3227 +#define vtab_atmega808 vtab_atmega4808 +#define vtab_atmega809 vtab_atmega4809 +#define vtab_atmega1608 vtab_atmega4808 +#define vtab_atmega1609 vtab_atmega4809 +#define vtab_atmega3208 vtab_atmega4808 +#define vtab_atmega3209 vtab_atmega4809 +#define vtab_avr16dd14 vtab_avr64dd32 +#define vtab_avr16dd20 vtab_avr64dd32 +#define vtab_avr16dd28 vtab_avr64dd32 +#define vtab_avr16dd32 vtab_avr64dd32 +#define vtab_avr32dd14 vtab_avr64dd32 +#define vtab_avr32dd20 vtab_avr64dd32 +#define vtab_avr32da28 vtab_avr128da28 +#define vtab_avr32db28 vtab_avr128db28 +#define vtab_avr32dd28 vtab_avr64dd32 +#define vtab_avr32da32 vtab_avr128da32 +#define vtab_avr32db32 vtab_avr128db32 +#define vtab_avr32dd32 vtab_avr64dd32 +#define vtab_avr32da48 vtab_avr128da48 +#define vtab_avr32db48 vtab_avr128db48 +#define vtab_avr64dd14 vtab_avr64dd32 +#define vtab_avr64dd20 vtab_avr64dd32 +#define vtab_avr64da28 vtab_avr128da28 +#define vtab_avr64db28 vtab_avr128db28 +#define vtab_avr64dd28 vtab_avr64dd32 +#define vtab_avr64ea28 vtab_avr64ea32 +#define vtab_avr64da32 vtab_avr128da32 +#define vtab_avr64db32 vtab_avr128db32 +#define vtab_avr64da48 vtab_avr128da48 +#define vtab_avr64db48 vtab_avr128db48 +#define vtab_avr64da64 vtab_avr128da64 +#define vtab_avr64db64 vtab_avr128db64 + +// Interrupt vector table interrupt names +extern const char * const vtab_attiny9[10]; // ATtiny9, ATtiny4 +extern const char * const vtab_attiny10[11]; // ATtiny10, ATtiny5 +extern const char * const vtab_attiny20[17]; // ATtiny20 +extern const char * const vtab_attiny40[18]; // ATtiny40 +extern const char * const vtab_attiny104[16]; // ATtiny104, ATtiny102 +extern const char * const vtab_attiny11[5]; // ATtiny11 +extern const char * const vtab_attiny12[6]; // ATtiny12 +extern const char * const vtab_attiny13a[10]; // ATtiny13A, ATtiny13 +extern const char * const vtab_attiny15[9]; // ATtiny15 +extern const char * const vtab_attiny22[3]; // ATtiny22, AT90S2343, AT90S2323 +extern const char * const vtab_attiny26[12]; // ATtiny26 +extern const char * const vtab_attiny28[6]; // ATtiny28 +extern const char * const vtab_attiny43u[16]; // ATtiny43U +extern const char * const vtab_attiny84a[17]; // ATtiny84A, ATtiny84, ATtiny44A, ATtiny44, ATtiny24A, ATtiny24 +extern const char * const vtab_attiny85[15]; // ATtiny85, ATtiny45, ATtiny25 +extern const char * const vtab_attiny88[20]; // ATtiny88, ATtiny48 +extern const char * const vtab_attiny167[20]; // ATtiny167, ATtiny87, ATA664251, ATA6617C, ATA6616C, ATA5505 +extern const char * const vtab_attiny828[26]; // ATtiny828 +extern const char * const vtab_attiny841[30]; // ATtiny841, ATtiny441 +extern const char * const vtab_attiny861a[19]; // ATtiny861A, ATtiny861, ATtiny461A, ATtiny461, ATtiny261A, ATtiny261 +extern const char * const vtab_attiny1634[28]; // ATtiny1634 +extern const char * const vtab_attiny2313[19]; // ATtiny2313 +extern const char * const vtab_attiny4313[21]; // ATtiny4313, ATtiny2313A +extern const char * const vtab_atmega8a[19]; // ATmega8A, ATmega8 +extern const char * const vtab_atmega16a[21]; // ATmega16A, ATmega16 +extern const char * const vtab_atmega16hva[21]; // ATmega16HVA, ATmega8HVA +extern const char * const vtab_atmega16hva2[22]; // ATmega16HVA2 +extern const char * const vtab_atmega32hvbrevb[29]; // ATmega32HVBrevB, ATmega32HVB, ATmega16HVBrevB, ATmega16HVB +extern const char * const vtab_atmega32u2[29]; // ATmega32U2, ATmega16U2, ATmega8U2, AT90USB162, AT90USB82 +extern const char * const vtab_atmega32u4[43]; // ATmega32U4, ATmega16U4 +extern const char * const vtab_atmega32u6[38]; // ATmega32U6, AT90USB1287, AT90USB1286, AT90USB647, AT90USB646 +extern const char * const vtab_atmega64m1[31]; // ATmega64M1, ATmega64C1, ATmega32M1, ATmega32C1, ATmega16M1 +extern const char * const vtab_atmega64hve2[25]; // ATmega64HVE2, ATmega64HVE +extern const char * const vtab_atmega103[24]; // ATmega103 +extern const char * const vtab_atmega128a[35]; // ATmega128A, ATmega128, ATmega64A, ATmega64 +extern const char * const vtab_atmega128rfa1[72]; // ATmega128RFA1 +extern const char * const vtab_atmega161[21]; // ATmega161 +extern const char * const vtab_atmega162[28]; // ATmega162 +extern const char * const vtab_atmega163[18]; // ATmega163 +extern const char * const vtab_atmega168pb[27]; // ATmega168PB, ATmega88PB, ATmega48PB +extern const char * const vtab_atmega323[21]; // ATmega323, ATmega32A, ATmega32 +extern const char * const vtab_atmega324pb[51]; // ATmega324PB +extern const char * const vtab_atmega328[26]; // ATmega328, ATmega168 +extern const char * const vtab_atmega328p[26]; // ATmega328P, ATmega168PA, ATmega168P, ATmega168A, ATmega88PA, ATmega88P, ATmega88A, ATmega88, ATmega48PA, ATmega48P, ATmega48A, ATmega48, ATA6614Q, ATA6613C, ATA6612C +extern const char * const vtab_atmega328pb[45]; // ATmega328PB +extern const char * const vtab_atmega406[23]; // ATmega406 +extern const char * const vtab_atmega644[28]; // ATmega644 +extern const char * const vtab_atmega644pa[31]; // ATmega644PA, ATmega644P, ATmega644A, ATmega324PA, ATmega324P, ATmega324A, ATmega164PA, ATmega164P, ATmega164A +extern const char * const vtab_atmega645p[22]; // ATmega645P, ATmega645A, ATmega645, ATmega325PA, ATmega325P, ATmega325A, ATmega325, ATmega165PA, ATmega165P, ATmega165A, ATmega165 +extern const char * const vtab_atmega649p[23]; // ATmega649P, ATmega649A, ATmega649, ATmega329PA, ATmega329P, ATmega329A, ATmega329, ATmega169PA, ATmega169P, ATmega169A, ATmega169 +extern const char * const vtab_atmega1284p[35]; // ATmega1284P, ATmega1284 +extern const char * const vtab_atmega2561[57]; // ATmega2561, ATmega2560, ATmega1281, ATmega1280, ATmega640 +extern const char * const vtab_atmega2564rfr2[77]; // ATmega2564RFR2, ATmega1284RFR2, ATmega644RFR2, ATmega256RFR2, ATmega128RFR2, ATmega64RFR2 +extern const char * const vtab_atmega6450p[25]; // ATmega6450P, ATmega6450A, ATmega6450, ATmega3250PA, ATmega3250P, ATmega3250A, ATmega3250 +extern const char * const vtab_atmega6490p[25]; // ATmega6490P, ATmega6490A, ATmega6490, ATmega3290PA, ATmega3290P, ATmega3290A, ATmega3290 +extern const char * const vtab_atmega8515[17]; // ATmega8515 +extern const char * const vtab_atmega8535[21]; // ATmega8535 +extern const char * const vtab_at86rf401[3]; // AT86RF401 +extern const char * const vtab_at90pwm2[32]; // AT90PWM2 +extern const char * const vtab_at90pwm3b[32]; // AT90PWM3B, AT90PWM3, AT90PWM2B +extern const char * const vtab_at90scr100[38]; // AT90SCR100 +extern const char * const vtab_at90can128[37]; // AT90CAN128, AT90CAN64, AT90CAN32 +extern const char * const vtab_at90pwm161[20]; // AT90PWM161, AT90PWM81 +extern const char * const vtab_at90pwm316[32]; // AT90PWM316, AT90PWM216, AT90PWM1 +extern const char * const vtab_at90s1200[4]; // AT90S1200 +extern const char * const vtab_at90s2313[11]; // AT90S2313 +extern const char * const vtab_at90s4433[14]; // AT90S4433, AT90S2333 +extern const char * const vtab_at90s8515[13]; // AT90S8515, AT90S4414 +extern const char * const vtab_at90s8535[17]; // AT90S8535, AT90S4434 +extern const char * const vtab_ata5272[37]; // ATA5272 +extern const char * const vtab_ata5702m322[51]; // ATA5702M322, ATA5700M322 +extern const char * const vtab_ata5790[30]; // ATA5790 +extern const char * const vtab_ata5791[31]; // ATA5791, ATA5790N +extern const char * const vtab_ata5795[23]; // ATA5795 +extern const char * const vtab_ata5835[44]; // ATA5835, ATA5787 +extern const char * const vtab_ata6289[27]; // ATA6289, ATA6286, ATA6285 +extern const char * const vtab_ata8515[42]; // ATA8515, ATA8510, ATA8215, ATA8210, ATA5833, ATA5832, ATA5831, ATA5783, ATA5782, ATA5781 +extern const char * const vtab_atxmega32a4[94]; // ATxmega32A4, ATxmega16A4 +extern const char * const vtab_atxmega32c4[127]; // ATxmega32C4, ATxmega16C4 +extern const char * const vtab_atxmega32d4[91]; // ATxmega32D4, ATxmega16D4 +extern const char * const vtab_atxmega32e5[43]; // ATxmega32E5, ATxmega16E5, ATxmega8E5 +extern const char * const vtab_atxmega128a1[125]; // ATxmega128A1, ATxmega64A1 +extern const char * const vtab_atxmega128a1u[127]; // ATxmega128A1U, ATxmega64A1U +extern const char * const vtab_atxmega128b1[81]; // ATxmega128B1, ATxmega64B1 +extern const char * const vtab_atxmega128b3[54]; // ATxmega128B3, ATxmega64B3 +extern const char * const vtab_atxmega128a4u[127]; // ATxmega128A4U, ATxmega64A4U, ATxmega32A4U, ATxmega16A4U +extern const char * const vtab_atxmega128d4[91]; // ATxmega128D4, ATxmega64D4 +extern const char * const vtab_atxmega256a3[122]; // ATxmega256A3, ATxmega192A3, ATxmega128A3, ATxmega64A3 +extern const char * const vtab_atxmega256a3b[122]; // ATxmega256A3B +extern const char * const vtab_atxmega256a3bu[127]; // ATxmega256A3BU +extern const char * const vtab_atxmega256a3u[127]; // ATxmega256A3U, ATxmega192A3U, ATxmega128A3U, ATxmega64A3U +extern const char * const vtab_atxmega256c3[127]; // ATxmega256C3, ATxmega192C3, ATxmega128C3, ATxmega64C3, ATxmega32C3 +extern const char * const vtab_atxmega384c3[127]; // ATxmega384C3 +extern const char * const vtab_atxmega384d3[114]; // ATxmega384D3, ATxmega256D3, ATxmega192D3, ATxmega128D3, ATxmega64D3, ATxmega32D3 +extern const char * const vtab_attiny402[26]; // ATtiny402, ATtiny202 +extern const char * const vtab_attiny404[26]; // ATtiny404, ATtiny204 +extern const char * const vtab_attiny406[26]; // ATtiny406 +extern const char * const vtab_attiny412[26]; // ATtiny412, ATtiny212 +extern const char * const vtab_attiny814[26]; // ATtiny814, ATtiny414, ATtiny214 +extern const char * const vtab_attiny817[26]; // ATtiny817, ATtiny816, ATtiny417, ATtiny416auto, ATtiny416 +extern const char * const vtab_attiny1607[31]; // ATtiny1607, ATtiny1606, ATtiny1604, ATtiny807, ATtiny806, ATtiny804 +extern const char * const vtab_attiny1614[31]; // ATtiny1614 +extern const char * const vtab_attiny3214[31]; // ATtiny3214 +extern const char * const vtab_attiny3217[31]; // ATtiny3217, ATtiny3216, ATtiny1617, ATtiny1616 +extern const char * const vtab_attiny3227[30]; // ATtiny3227, ATtiny3226, ATtiny3224, ATtiny1627, ATtiny1626, ATtiny1624, ATtiny827, ATtiny826, ATtiny824, ATtiny427, ATtiny426, ATtiny424 +extern const char * const vtab_atmega4808[36]; // ATmega4808, ATmega3208, ATmega1608, ATmega808 +extern const char * const vtab_atmega4809[40]; // ATmega4809, ATmega3209, ATmega1609, ATmega809 +extern const char * const vtab_avr64dd32[36]; // AVR64DD32, AVR64DD28, AVR64DD20, AVR64DD14, AVR32DD32, AVR32DD28, AVR32DD20, AVR32DD14, AVR16DD32, AVR16DD28, AVR16DD20, AVR16DD14 +extern const char * const vtab_avr64ea32[37]; // AVR64EA32, AVR64EA28 +extern const char * const vtab_avr64ea48[45]; // AVR64EA48 +extern const char * const vtab_avr128da28[41]; // AVR128DA28, AVR64DA28, AVR32DA28 +extern const char * const vtab_avr128db28[42]; // AVR128DB28, AVR64DB28, AVR32DB28 +extern const char * const vtab_avr128da32[44]; // AVR128DA32, AVR64DA32, AVR32DA32 +extern const char * const vtab_avr128db32[44]; // AVR128DB32, AVR64DB32, AVR32DB32 +extern const char * const vtab_avr128da48[58]; // AVR128DA48, AVR64DA48, AVR32DA48 +extern const char * const vtab_avr128db48[61]; // AVR128DB48, AVR64DB48, AVR32DB48 +extern const char * const vtab_avr128da64[64]; // AVR128DA64, AVR64DA64 +extern const char * const vtab_avr128db64[65]; // AVR128DB64, AVR64DB64 + +extern const uPcore_t uP_table[372]; + +#endif diff --git a/src/avrpart.c b/src/avrpart.c index dc6def44..ac4b8ece 100644 --- a/src/avrpart.c +++ b/src/avrpart.c @@ -1,4 +1,3 @@ - /* * avrdude - A Downloader/Uploader for AVR device programmers * Copyright (C) 2000-2004 Brian S. Dean @@ -31,62 +30,55 @@ *** Elementary functions dealing with OPCODE structures ***/ -OPCODE * avr_new_opcode(void) -{ - OPCODE * m; - - m = (OPCODE *)malloc(sizeof(*m)); - if (m == NULL) { - avrdude_message(MSG_INFO, "avr_new_opcode(): out of memory\n"); - exit(1); - } - - memset(m, 0, sizeof(*m)); - - return m; +OPCODE *avr_new_opcode(void) { + return (OPCODE *) cfg_malloc("avr_new_opcode()", sizeof(OPCODE)); } -static OPCODE * avr_dup_opcode(OPCODE * op) -{ - OPCODE * m; - - /* this makes life easier */ - if (op == NULL) { +static OPCODE *avr_dup_opcode(const OPCODE *op) { + if(op == NULL) // Caller wants NULL if op == NULL return NULL; - } - - m = (OPCODE *)malloc(sizeof(*m)); - if (m == NULL) { - avrdude_message(MSG_INFO, "avr_dup_opcode(): out of memory\n"); - exit(1); - } + OPCODE *m = (OPCODE *) cfg_malloc("avr_dup_opcode()", sizeof(*m)); memcpy(m, op, sizeof(*m)); return m; } -void avr_free_opcode(OPCODE * op) -{ - free(op); +void avr_free_opcode(OPCODE *op) { + if(op) + free(op); } + +// returns position 0..31 of highest bit set or INT_MIN if no bit is set +int intlog2(unsigned int n) { + int ret; + + if(!n) + return INT_MIN; + + for(ret = 0; n >>= 1; ret++) + continue; + + return ret; +} + + /* * avr_set_bits() * * Set instruction bits in the specified command based on the opcode. */ -int avr_set_bits(OPCODE * op, unsigned char * cmd) -{ +int avr_set_bits(const OPCODE *op, unsigned char *cmd) { int i, j, bit; unsigned char mask; for (i=0; i<32; i++) { - if (op->bit[i].type == AVR_CMDBIT_VALUE) { + if (op->bit[i].type == AVR_CMDBIT_VALUE || op->bit[i].type == AVR_CMDBIT_IGNORE) { j = 3 - i / 8; bit = i % 8; mask = 1 << bit; - if (op->bit[i].value) + if (op->bit[i].value && op->bit[i].type == AVR_CMDBIT_VALUE) cmd[j] = cmd[j] | mask; else cmd[j] = cmd[j] & ~mask; @@ -103,8 +95,7 @@ int avr_set_bits(OPCODE * op, unsigned char * cmd) * Set address bits in the specified command based on the opcode, and * the address. */ -int avr_set_addr(OPCODE * op, unsigned char * cmd, unsigned long addr) -{ +int avr_set_addr(const OPCODE *op, unsigned char *cmd, unsigned long addr) { int i, j, bit; unsigned long value; unsigned char mask; @@ -126,14 +117,108 @@ int avr_set_addr(OPCODE * op, unsigned char * cmd, unsigned long addr) } +/* + * avr_set_addr_mem() + * + * Set address bits in the specified command based on the memory, opcode and + * address; addr must be a word address for flash or, for all other memories, + * a byte address; returns 0 on success and -1 on error (no memory or no + * opcode) or, if positive, bn+1 where bn is bit number of the highest + * necessary bit that the opcode does not provide. + */ +int avr_set_addr_mem(const AVRMEM *mem, int opnum, unsigned char *cmd, unsigned long addr) { + int ret, isflash, lo, hi, memsize, pagesize; + OPCODE *op; + + if(!mem) + return -1; + + if(!(op = mem->op[opnum])) + return -1; + + isflash = !strcmp(mem->desc, "flash"); // ISP parts have only one flash-like memory + memsize = mem->size >> isflash; // word addresses for flash + pagesize = mem->page_size >> isflash; + + // compute range lo..hi of needed address bits + switch(opnum) { + case AVR_OP_READ: + case AVR_OP_WRITE: + case AVR_OP_READ_LO: + case AVR_OP_READ_HI: + case AVR_OP_WRITE_LO: + case AVR_OP_WRITE_HI: + lo = 0; + hi = intlog2(memsize-1); // memsize = 1 implies no addr bit is needed + break; + + case AVR_OP_LOADPAGE_LO: + case AVR_OP_LOADPAGE_HI: + lo = 0; + hi = intlog2(pagesize-1); + break; + + case AVR_OP_LOAD_EXT_ADDR: + lo = 16; + hi = intlog2(memsize-1); + break; + + case AVR_OP_WRITEPAGE: + lo = intlog2(pagesize); + hi = intlog2(memsize-1); + break; + + case AVR_OP_CHIP_ERASE: + case AVR_OP_PGM_ENABLE: + default: + lo = 0; + hi = -1; + break; + } + + // Unless it's load extended address, ISP chips only deal with 16 bit addresses + if(opnum != AVR_OP_LOAD_EXT_ADDR && hi > 15) + hi = 15; + + unsigned char avail[32]; + memset(avail, 0, sizeof avail); + + for(int i=0; i<32; i++) { + if(op->bit[i].type == AVR_CMDBIT_ADDRESS) { + int bitno, j, bit; + unsigned char mask; + + bitno = op->bit[i].bitno & 31; + j = 3 - i / 8; + bit = i % 8; + mask = 1 << bit; + avail[bitno] = 1; + + // 'a' bit with number outside bit range [lo, hi] is set to 0 + if (bitno >= lo && bitno <= hi? (addr >> bitno) & 1: 0) + cmd[j] = cmd[j] | mask; + else + cmd[j] = cmd[j] & ~mask; + } + } + + ret = 0; + if(lo >= 0 && hi < 32 && lo <= hi) + for(int bn=lo; bn <= hi; bn++) + if(!avail[bn]) // necessary bit bn misses in opcode + ret = bn+1; + + return ret; +} + + /* * avr_set_input() * * Set input data bits in the specified command based on the opcode, * and the data byte. */ -int avr_set_input(OPCODE * op, unsigned char * cmd, unsigned char data) -{ +int avr_set_input(const OPCODE *op, unsigned char *cmd, unsigned char data) { int i, j, bit; unsigned char value; unsigned char mask; @@ -158,11 +243,10 @@ int avr_set_input(OPCODE * op, unsigned char * cmd, unsigned char data) /* * avr_get_output() * - * Retreive output data bits from the command results based on the + * Retrieve output data bits from the command results based on the * opcode data. */ -int avr_get_output(OPCODE * op, unsigned char * res, unsigned char * data) -{ +int avr_get_output(const OPCODE *op, const unsigned char *res, unsigned char *data) { int i, j, bit; unsigned char value; unsigned char mask; @@ -191,8 +275,7 @@ int avr_get_output(OPCODE * op, unsigned char * res, unsigned char * data) * Calculate the byte number of the output data based on the * opcode data. */ -int avr_get_output_index(OPCODE * op) -{ +int avr_get_output_index(const OPCODE *op) { int i, j; for (i=0; i<32; i++) { @@ -239,39 +322,21 @@ static char * bittype(int type) } - /*** *** Elementary functions dealing with AVRMEM structures ***/ -AVRMEM * avr_new_memtype(void) -{ - AVRMEM * m; - - m = (AVRMEM *)malloc(sizeof(*m)); - if (m == NULL) { - avrdude_message(MSG_INFO, "avr_new_memtype(): out of memory\n"); - exit(1); - } - - memset(m, 0, sizeof(*m)); +AVRMEM *avr_new_memtype(void) { + AVRMEM *m = (AVRMEM *) cfg_malloc("avr_new_memtype()", sizeof(*m)); + m->desc = cache_string(""); m->page_size = 1; // ensure not 0 return m; } -AVRMEM_ALIAS * avr_new_memalias(void) -{ - AVRMEM_ALIAS * m; - - m = (AVRMEM_ALIAS *)malloc(sizeof(*m)); - if (m == NULL) { - avrdude_message(MSG_INFO, "avr_new_memalias(): out of memory\n"); - exit(1); - } - - memset(m, 0, sizeof(*m)); - +AVRMEM_ALIAS *avr_new_memalias(void) { + AVRMEM_ALIAS *m = (AVRMEM_ALIAS *) cfg_malloc("avr_new_memalias()", sizeof*m); + m->desc = cache_string(""); return m; } @@ -280,222 +345,168 @@ AVRMEM_ALIAS * avr_new_memalias(void) * Allocate and initialize memory buffers for each of the device's * defined memory regions. */ -int avr_initmem(AVRPART * p) -{ - LNODEID ln; - AVRMEM * m; +int avr_initmem(const AVRPART *p) { + if(p == NULL || p->mem == NULL) + return -1; - for (ln=lfirst(p->mem); ln; ln=lnext(ln)) { - m = ldata(ln); - m->buf = (unsigned char *) malloc(m->size); - if (m->buf == NULL) { - avrdude_message(MSG_INFO, "%s: can't alloc buffer for %s size of %d bytes\n", - progname, m->desc, m->size); - return -1; - } - m->tags = (unsigned char *) malloc(m->size); - if (m->tags == NULL) { - avrdude_message(MSG_INFO, "%s: can't alloc buffer for %s size of %d bytes\n", - progname, m->desc, m->size); - return -1; - } + for (LNODEID ln=lfirst(p->mem); ln; ln=lnext(ln)) { + AVRMEM *m = ldata(ln); + m->buf = (unsigned char *) cfg_malloc("avr_initmem()", m->size); + m->tags = (unsigned char *) cfg_malloc("avr_initmem()", m->size); } return 0; } -AVRMEM * avr_dup_mem(AVRMEM * m) -{ - AVRMEM * n; - int i; +AVRMEM *avr_dup_mem(const AVRMEM *m) { + AVRMEM *n = avr_new_memtype(); - n = avr_new_memtype(); + if(m) { + *n = *m; - *n = *m; - - if (m->buf != NULL) { - n->buf = (unsigned char *)malloc(n->size); - if (n->buf == NULL) { - avrdude_message(MSG_INFO, "avr_dup_mem(): out of memory (memsize=%d)\n", - n->size); - exit(1); + if(m->buf) { + n->buf = (unsigned char *) cfg_malloc("avr_dup_mem()", n->size); + memcpy(n->buf, m->buf, n->size); } - memcpy(n->buf, m->buf, n->size); - } - if (m->tags != NULL) { - n->tags = (unsigned char *)malloc(n->size); - if (n->tags == NULL) { - avrdude_message(MSG_INFO, "avr_dup_mem(): out of memory (memsize=%d)\n", - n->size); - exit(1); + if(m->tags) { + n->tags = (unsigned char *) cfg_malloc("avr_dup_mem()", n->size); + memcpy(n->tags, m->tags, n->size); } - memcpy(n->tags, m->tags, n->size); - } - for (i = 0; i < AVR_OP_MAX; i++) { - n->op[i] = avr_dup_opcode(n->op[i]); + for(int i = 0; i < AVR_OP_MAX; i++) + n->op[i] = avr_dup_opcode(n->op[i]); } return n; } -AVRMEM_ALIAS * avr_dup_memalias(AVRMEM_ALIAS * m) -{ - AVRMEM_ALIAS * n; +AVRMEM_ALIAS *avr_dup_memalias(const AVRMEM_ALIAS *m) { + AVRMEM_ALIAS *n = avr_new_memalias(); - n = avr_new_memalias(); - - *n = *m; + if(m) + *n = *m; return n; } -void avr_free_mem(AVRMEM * m) -{ - int i; - if (m->buf != NULL) { - free(m->buf); - m->buf = NULL; - } - if (m->tags != NULL) { - free(m->tags); - m->tags = NULL; - } - for(i=0;iop)/sizeof(m->op[0]);i++) - { - if (m->op[i] != NULL) - { - avr_free_opcode(m->op[i]); - m->op[i] = NULL; - } - } - free(m); -} +void avr_free_mem(AVRMEM * m) { + if(m == NULL) + return; -void avr_free_memalias(AVRMEM_ALIAS * m) -{ + if(m->buf) { + free(m->buf); + m->buf = NULL; + } + if(m->tags) { + free(m->tags); + m->tags = NULL; + } + for(size_t i=0; iop)/sizeof(m->op[0]); i++) { + if(m->op[i]) { + avr_free_opcode(m->op[i]); + m->op[i] = NULL; + } + } free(m); } -AVRMEM_ALIAS * avr_locate_memalias(AVRPART * p, char * desc) -{ +void avr_free_memalias(AVRMEM_ALIAS *m) { + if(m) + free(m); +} + +AVRMEM_ALIAS *avr_locate_memalias(const AVRPART *p, const char *desc) { AVRMEM_ALIAS * m, * match; LNODEID ln; int matches; - int l; + size_t l; + + if(!p || !desc || !p->mem_alias) + return NULL; l = strlen(desc); matches = 0; match = NULL; for (ln=lfirst(p->mem_alias); ln; ln=lnext(ln)) { m = ldata(ln); - if (strncmp(desc, m->desc, l) == 0) { + if(l && strncmp(m->desc, desc, l) == 0) { // Partial initial match match = m; matches++; + if(m->desc[l] == 0) // Exact match; return straight away + return m; } } - if (matches == 1) - return match; - - return NULL; + return matches == 1? match: NULL; } -AVRMEM * avr_locate_mem_noalias(AVRPART * p, char * desc) -{ +AVRMEM *avr_locate_mem_noalias(const AVRPART *p, const char *desc) { AVRMEM * m, * match; LNODEID ln; int matches; - int l; + size_t l; + + if(!p || !desc || !p->mem) + return NULL; l = strlen(desc); matches = 0; match = NULL; for (ln=lfirst(p->mem); ln; ln=lnext(ln)) { m = ldata(ln); - if (strncmp(desc, m->desc, l) == 0) { + if(l && strncmp(m->desc, desc, l) == 0) { // Partial initial match match = m; matches++; + if(m->desc[l] == 0) // Exact match; return straight away + return m; } } - if (matches == 1) - return match; - - return NULL; + return matches == 1? match: NULL; } -AVRMEM * avr_locate_mem(AVRPART * p, char * desc) -{ - AVRMEM * m, * match; - AVRMEM_ALIAS * alias; - LNODEID ln; - int matches; - int l; +AVRMEM *avr_locate_mem(const AVRPART *p, const char *desc) { + AVRMEM *m = avr_locate_mem_noalias(p, desc); - l = strlen(desc); - matches = 0; - match = NULL; - for (ln=lfirst(p->mem); ln; ln=lnext(ln)) { - m = ldata(ln); - if (strncmp(desc, m->desc, l) == 0) { - match = m; - matches++; + if(m) + return m; + + // Not yet found: look for matching alias name + AVRMEM_ALIAS *a = avr_locate_memalias(p, desc); + return a? a->aliased_mem: NULL; +} + +AVRMEM_ALIAS *avr_find_memalias(const AVRPART *p, const AVRMEM *m_orig) { + if(p && p->mem_alias && m_orig) + for(LNODEID ln=lfirst(p->mem_alias); ln; ln=lnext(ln)) { + AVRMEM_ALIAS *m = ldata(ln); + if(m->aliased_mem == m_orig) + return m; } - } - - if (matches == 1) - return match; - - /* not yet found: look for matching alias name */ - alias = avr_locate_memalias(p, desc); - if (alias != NULL) - return alias->aliased_mem; - - return NULL; -} - -AVRMEM_ALIAS * avr_find_memalias(AVRPART * p, AVRMEM * m_orig) -{ - AVRMEM_ALIAS * m; - LNODEID ln; - - for (ln=lfirst(p->mem_alias); ln; ln=lnext(ln)) { - m = ldata(ln); - if (m->aliased_mem == m_orig) - return m; - } return NULL; } -void avr_mem_display(const char * prefix, FILE * f, AVRMEM * m, AVRPART * p, - int type, int verbose) -{ - static unsigned int prev_mem_offset, prev_mem_size; +void avr_mem_display(const char *prefix, FILE *f, const AVRMEM *m, + const AVRPART *p, int verbose) { + static unsigned int prev_mem_offset; + static int prev_mem_size; int i, j; char * optr; - if (m == NULL) { + if (m == NULL || verbose > 2) { fprintf(f, "%s Block Poll Page Polled\n" "%sMemory Type Alias Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack\n" "%s----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------\n", prefix, prefix, prefix); } - else { - if (verbose > 2) { - fprintf(f, - "%s Block Poll Page Polled\n" - "%sMemory Type Alias Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack\n" - "%s----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------\n", - prefix, prefix, prefix); - } + if (m != NULL) { // Only print memory section if the previous section printed isn't identical if(prev_mem_offset != m->offset || prev_mem_size != m->size || (strcmp(p->family_id, "") == 0)) { prev_mem_offset = m->offset; @@ -503,7 +514,7 @@ void avr_mem_display(const char * prefix, FILE * f, AVRMEM * m, AVRPART * p, AVRMEM_ALIAS *ap = avr_find_memalias(p, m); /* Show alias if the current and the next memory section has the same offset and size, we're not out of band and a family_id is present */ - char * mem_desc_alias = ap? ap->desc: ""; + const char *mem_desc_alias = ap? ap->desc: ""; fprintf(f, "%s%-11s %-8s %4d %5d %5d %4d %-6s %6d %4d %6d %5d %5d 0x%02x 0x%02x\n", prefix, @@ -520,7 +531,7 @@ void avr_mem_display(const char * prefix, FILE * f, AVRMEM * m, AVRPART * p, m->readback[1]); } if (verbose > 4) { - avrdude_message(MSG_TRACE2, "%s Memory Ops:\n" + msg_trace2("%s Memory Ops:\n" "%s Oeration Inst Bit Bit Type Bitno Value\n" "%s ----------- -------- -------- ----- -----\n", prefix, prefix, prefix); @@ -545,78 +556,69 @@ void avr_mem_display(const char * prefix, FILE * f, AVRMEM * m, AVRPART * p, } - /* * Elementary functions dealing with AVRPART structures */ - -AVRPART * avr_new_part(void) -{ - AVRPART * p; - - p = (AVRPART *)malloc(sizeof(AVRPART)); - if (p == NULL) { - avrdude_message(MSG_INFO, "new_part(): out of memory\n"); - exit(1); - } +AVRPART *avr_new_part(void) { + AVRPART *p = (AVRPART *) cfg_malloc("avr_new_part()", sizeof(AVRPART)); + const char *nulp = cache_string(""); memset(p, 0, sizeof(*p)); - p->id[0] = 0; - p->desc[0] = 0; + // Initialise const char * and LISTID entities + p->desc = nulp; + p->id = nulp; + p->parent_id = nulp; + p->family_id = nulp; + p->config_file = nulp; + p->mem = lcreat(NULL, 0); + p->mem_alias = lcreat(NULL, 0); + + // Default values + p->mcuid = -1; + p->hvupdi_variant = -1; + p->autobaud_sync = 0x30; // STK_GET_SYNC + memset(p->signature, 0xFF, 3); p->reset_disposition = RESET_DEDICATED; p->retry_pulse = PIN_AVR_SCK; p->flags = AVRPART_SERIALOK | AVRPART_PARALLELOK | AVRPART_ENABLEPAGEPROGRAMMING; - p->config_file[0] = 0; - p->lineno = 0; - memset(p->signature, 0xFF, 3); p->ctl_stack_type = CTL_STACK_NONE; p->ocdrev = -1; - - p->mem = lcreat(NULL, 0); - p->mem_alias = lcreat(NULL, 0); + p->lineno = 0; return p; } -AVRPART * avr_dup_part(AVRPART * d) -{ - AVRPART * p; - LISTID save, save2; - LNODEID ln, ln2; - int i; +AVRPART *avr_dup_part(const AVRPART *d) { + AVRPART *p = avr_new_part(); - p = avr_new_part(); - save = p->mem; - save2 = p->mem_alias; + if(d) { + *p = *d; - *p = *d; + // Duplicate the memory and alias chains + p->mem = lcreat(NULL, 0); + p->mem_alias = lcreat(NULL, 0); - p->mem = save; - p->mem_alias = save2; - - for (ln=lfirst(d->mem); ln; ln=lnext(ln)) { - AVRMEM *m = ldata(ln); - AVRMEM *m2 = avr_dup_mem(m); - ladd(p->mem, m2); - // see if there is any alias for it - for (ln2=lfirst(d->mem_alias); ln2; ln2=lnext(ln2)) { - AVRMEM_ALIAS *a = ldata(ln2); - if (a->aliased_mem == m) { - // yes, duplicate it - AVRMEM_ALIAS *a2 = avr_dup_memalias(a); - // ... adjust the pointer ... - a2->aliased_mem = m2; - // ... and add to new list - ladd(p->mem_alias, a2); + for(LNODEID ln=lfirst(d->mem); ln; ln=lnext(ln)) { + AVRMEM *m = ldata(ln); + AVRMEM *m2 = avr_dup_mem(m); + ladd(p->mem, m2); + // See if there is any alias for it + for(LNODEID ln2=lfirst(d->mem_alias); ln2; ln2=lnext(ln2)) { + AVRMEM_ALIAS *a = ldata(ln2); + if (a->aliased_mem == m) { + // Yes, duplicate it, adjust the pointer and add to new list + AVRMEM_ALIAS *a2 = avr_dup_memalias(a); + a2->aliased_mem = m2; + ladd(p->mem_alias, a2); + } } } - } - for (i = 0; i < AVR_OP_MAX; i++) { - p->op[i] = avr_dup_opcode(p->op[i]); + for(int i = 0; i < AVR_OP_MAX; i++) + p->op[i] = avr_dup_opcode(p->op[i]); } return p; @@ -624,74 +626,59 @@ AVRPART * avr_dup_part(AVRPART * d) void avr_free_part(AVRPART * d) { -int i; - ldestroy_cb(d->mem, (void(*)(void *))avr_free_mem); - d->mem = NULL; - ldestroy_cb(d->mem_alias, (void(*)(void *))avr_free_memalias); - d->mem_alias = NULL; - for(i=0;iop)/sizeof(d->op[0]);i++) - { - if (d->op[i] != NULL) - { - avr_free_opcode(d->op[i]); - d->op[i] = NULL; - } + ldestroy_cb(d->mem, (void(*)(void *))avr_free_mem); + d->mem = NULL; + ldestroy_cb(d->mem_alias, (void(*)(void *))avr_free_memalias); + d->mem_alias = NULL; + /* do not free d->parent_id and d->config_file */ + for(size_t i=0; iop)/sizeof(d->op[0]); i++) { + if (d->op[i] != NULL) { + avr_free_opcode(d->op[i]); + d->op[i] = NULL; } - free(d); + } + free(d); } -AVRPART * locate_part(LISTID parts, char * partdesc) -{ - LNODEID ln1; +AVRPART *locate_part(const LISTID parts, const char *partdesc) { AVRPART * p = NULL; - int found; + int found = 0; - found = 0; + if(!parts || !partdesc) + return NULL; - for (ln1=lfirst(parts); ln1 && !found; ln1=lnext(ln1)) { + for (LNODEID ln1=lfirst(parts); ln1 && !found; ln1=lnext(ln1)) { p = ldata(ln1); if ((strcasecmp(partdesc, p->id) == 0) || (strcasecmp(partdesc, p->desc) == 0)) found = 1; } - if (found) - return p; - - return NULL; + return found? p: NULL; } -AVRPART * locate_part_by_avr910_devcode(LISTID parts, int devcode) -{ - LNODEID ln1; - AVRPART * p = NULL; - - for (ln1=lfirst(parts); ln1; ln1=lnext(ln1)) { - p = ldata(ln1); - if (p->avr910_devcode == devcode) - return p; - } - - return NULL; -} - -AVRPART * locate_part_by_signature(LISTID parts, unsigned char * sig, - int sigsize) -{ - LNODEID ln1; - AVRPART * p = NULL; - int i; - - if (sigsize == 3) { - for (ln1=lfirst(parts); ln1; ln1=lnext(ln1)) { - p = ldata(ln1); - for (i=0; i<3; i++) - if (p->signature[i] != sig[i]) - break; - if (i == 3) +AVRPART *locate_part_by_avr910_devcode(const LISTID parts, int devcode) { + if(parts) + for (LNODEID ln1=lfirst(parts); ln1; ln1=lnext(ln1)) { + AVRPART * p = ldata(ln1); + if (p->avr910_devcode == devcode) + return p; + } + + return NULL; +} + +AVRPART *locate_part_by_signature(const LISTID parts, unsigned char *sig, int sigsize) { + if(parts && sigsize == 3) + for(LNODEID ln1=lfirst(parts); ln1; ln1=lnext(ln1)) { + AVRPART *p = ldata(ln1); + int i; + for(i=0; i<3; i++) + if(p->signature[i] != sig[i]) + break; + if(i == 3) return p; } - } return NULL; } @@ -720,12 +707,11 @@ void walk_avrparts(LISTID avrparts, walk_avrparts_cb cb, void *cookie) /* * Compare function to sort the list of programmers */ -static int sort_avrparts_compare(AVRPART * p1,AVRPART * p2) -{ - if(p1 == NULL || p2 == NULL) { +static int sort_avrparts_compare(const AVRPART *p1, const AVRPART *p2) { + if(p1 == NULL || p1->desc == NULL || p2 == NULL || p2->desc == NULL) return 0; - } - return strncasecmp(p1->desc,p2->desc,AVR_DESCLEN); + + return strcasecmp(p1->desc, p2->desc); } /* @@ -747,9 +733,7 @@ static char * reset_disp_str(int r) } -void avr_display(FILE * f, AVRPART * p, const char * prefix, int verbose) -{ - int i; +void avr_display(FILE *f, const AVRPART *p, const char *prefix, int verbose) { char * buf; const char * px; LNODEID ln; @@ -784,25 +768,248 @@ void avr_display(FILE * f, AVRPART * p, const char * prefix, int verbose) fprintf( f, "%sMemory Detail :\n\n", prefix); px = prefix; - i = strlen(prefix) + 5; - buf = (char *)malloc(i); - if (buf == NULL) { - /* ugh, this is not important enough to bail, just ignore it */ - } - else { - strcpy(buf, prefix); - strcat(buf, " "); - px = buf; - } + buf = (char *) cfg_malloc("avr_display()", strlen(prefix) + 5); + strcpy(buf, prefix); + strcat(buf, " "); + px = buf; + + if (verbose <= 2) + avr_mem_display(px, f, NULL, p, verbose); - if (verbose <= 2) { - avr_mem_display(px, f, NULL, p, 0, verbose); - } for (ln=lfirst(p->mem); ln; ln=lnext(ln)) { m = ldata(ln); - avr_mem_display(px, f, m, p, i, verbose); + avr_mem_display(px, f, m, p, verbose); } if (buf) free(buf); } + + +char cmdbitchar(CMDBIT cb) { + switch(cb.type) { + case AVR_CMDBIT_IGNORE: + return 'x'; + case AVR_CMDBIT_VALUE: + return cb.value? '1': '0'; + case AVR_CMDBIT_ADDRESS: + return 'a'; + case AVR_CMDBIT_INPUT: + return 'i'; + case AVR_CMDBIT_OUTPUT: + return 'o'; + default: + return '?'; + } +} + + +char *cmdbitstr(CMDBIT cb) { + char space[32]; + + *space = cmdbitchar(cb); + if(*space == 'a') + sprintf(space+1, "%d", cb.bitno); + else + space[1] = 0; + + return cfg_strdup("cmdbitstr()", space); +} + + +const char *opcodename(int opnum) { + switch(opnum) { + case AVR_OP_READ: + return "read"; + case AVR_OP_WRITE: + return "write"; + case AVR_OP_READ_LO: + return "read_lo"; + case AVR_OP_READ_HI: + return "read_hi"; + case AVR_OP_WRITE_LO: + return "write_lo"; + case AVR_OP_WRITE_HI: + return "write_hi"; + case AVR_OP_LOADPAGE_LO: + return "loadpage_lo"; + case AVR_OP_LOADPAGE_HI: + return "loadpage_hi"; + case AVR_OP_LOAD_EXT_ADDR: + return "load_ext_addr"; + case AVR_OP_WRITEPAGE: + return "writepage"; + case AVR_OP_CHIP_ERASE: + return "chip_erase"; + case AVR_OP_PGM_ENABLE: + return "pgm_enable"; + default: + return "???"; + } +} + + +// Unique string representation of an opcode +char *opcode2str(const OPCODE *op, int opnum, int detailed) { + char cb, space[1024], *sp = space; + int compact = 1; + + if(!op) + return cfg_strdup("opcode2str()", "NULL"); + + // Can the opcode be printed in a compact way? Only if address bits are systematic. + for(int i=31; i >= 0; i--) + if(op->bit[i].type == AVR_CMDBIT_ADDRESS) + if(i<8 || i>23 || op->bit[i].bitno != (opnum == AVR_OP_LOAD_EXT_ADDR? i+8: i-8)) + compact = 0; + + if(detailed) + *sp++ = '"'; + + for(int i=31; i >= 0; i--) { + *sp++ = cb = cmdbitchar(op->bit[i]); + if(compact) { + if(i && i%8 == 0) + *sp++ = '-', *sp++ = '-'; + else if(i && i%4 == 0) + *sp++ = '.'; + } else { + if(cb == 'a') { + sprintf(sp, "%d", op->bit[i].bitno); + sp += strlen(sp); + } + if(i) { + if(detailed) + *sp++ = ' '; + if(i%8 == 0) + *sp++ = ' '; + } + } + } + if(detailed) + *sp++ = '"'; + *sp = 0; + + return cfg_strdup("opcode2str()", space); +} + + +/* + * Match STRING against the partname pattern PATTERN, returning 1 if it + * matches, 0 if not. NOTE: part_match() is a modified old copy of !fnmatch() + * from the GNU C Library (published under GLP v2). Used for portability. + */ + +inline static int fold(int c) { + return (c >= 'A' && c <= 'Z')? c+('a'-'A'): c; +} + +int part_match(const char *pattern, const char *string) { + unsigned char c; + const char *p = pattern, *n = string; + + if(!*n) // AVRDUDE specialty: empty string never matches + return 0; + + while((c = fold(*p++))) { + switch(c) { + case '?': + if(*n == 0) + return 0; + break; + + case '\\': + c = fold(*p++); + if(fold(*n) != c) + return 0; + break; + + case '*': + for(c = *p++; c == '?' || c == '*'; c = *p++) + if(c == '?' && *n++ == 0) + return 0; + + if(c == 0) + return 1; + + { + unsigned char c1 = fold(c == '\\'? *p : c); // This char + + for(--p; *n; ++n) // Recursively check reminder of string for * + if((c == '[' || fold(*n) == c1) && part_match(p, n) == 1) + return 1; + return 0; + } + + case '[': + { + int negate; + + if(*n == 0) + return 0; + + negate = (*p == '!' || *p == '^'); + if(negate) + ++p; + + c = *p++; + for(;;) { + unsigned char cstart = c, cend = c; + + if(c == '\\') + cstart = cend = *p++; + + cstart = cend = fold(cstart); + + if(c == 0) // [ (unterminated) + return 0; + + c = *p++; + c = fold(c); + + if(c == '-' && *p != ']') { + cend = *p++; + if(cend == '\\') + cend = *p++; + if(cend == 0) + return 0; + cend = fold(cend); + + c = *p++; + } + + if(fold(*n) >= cstart && fold(*n) <= cend) + goto matched; + + if(c == ']') + break; + } + if(!negate) + return 0; + break; + + matched:; + while(c != ']') { // Skip the rest of the [...] that already matched + + if(c == 0) // [... (unterminated) + return 0; + + c = *p++; + if(c == '\\') // XXX 1003.2d11 is unclear if this is right + ++p; + } + if(negate) + return 0; + } + break; + + default: + if(c != fold(*n)) + return 0; + } + + ++n; + } + + return *n == 0; +} diff --git a/src/bitbang.c b/src/bitbang.c index 592ca124..1e017407 100644 --- a/src/bitbang.c +++ b/src/bitbang.c @@ -76,8 +76,7 @@ static void bitbang_calibrate_delay(void) if (QueryPerformanceFrequency(&freq)) { has_perfcount = 1; - avrdude_message(MSG_NOTICE2, "%s: Using performance counter for bitbang delays\n", - progname); + pmsg_notice2("using performance counter for bitbang delays\n"); } else { @@ -90,16 +89,14 @@ static void bitbang_calibrate_delay(void) * auto-calibration figures seen on various Unix systems on * comparable hardware. */ - avrdude_message(MSG_NOTICE2, "%s: Using guessed per-microsecond delay count for bitbang delays\n", - progname); + pmsg_notice2("using guessed per-microsecond delay count for bitbang delays\n"); delay_decrement = 100; } #else /* !WIN32 */ struct itimerval itv; volatile int i; - avrdude_message(MSG_NOTICE2, "%s: Calibrating delay loop...", - progname); + pmsg_notice2("calibrating delay loop ..."); i = 0; done = 0; saved_alarmhandler = signal(SIGALRM, alarmhandler); @@ -125,7 +122,7 @@ static void bitbang_calibrate_delay(void) * Calculate back from 100 ms to 1 us. */ delay_decrement = -i / 100000; - avrdude_message(MSG_NOTICE2, " calibrated to %d cycles per us\n", + msg_notice2(" calibrated to %d cycles per us\n", delay_decrement); #endif /* WIN32 */ } @@ -163,8 +160,7 @@ void bitbang_delay(unsigned int us) /* * transmit and receive a byte of data to/from the AVR device */ -static unsigned char bitbang_txrx(PROGRAMMER * pgm, unsigned char byte) -{ +static unsigned char bitbang_txrx(const PROGRAMMER *pgm, unsigned char byte) { int i; unsigned char r, b, rbyte; @@ -176,9 +172,9 @@ static unsigned char bitbang_txrx(PROGRAMMER * pgm, unsigned char byte) * one pgm->setpin()-call resp. par clrpin()-call, then * - SCK is high for 2T * - SCK is low for 2T - * - MOSI setuptime is 1T - * - MOSI holdtime is 3T - * - SCK low to MISO read is 2T to 3T + * - SDO setuptime is 1T + * - SDO holdtime is 3T + * - SCK low to SDI read is 2T to 3T * So we are within programming specs (expect for AT90S1200), * if and only if T>t_CLCL (t_CLCL=clock period of target system). * @@ -190,7 +186,7 @@ static unsigned char bitbang_txrx(PROGRAMMER * pgm, unsigned char byte) b = (byte >> i) & 0x01; /* set the data input line as desired */ - pgm->setpin(pgm, PIN_AVR_MOSI, b); + pgm->setpin(pgm, PIN_AVR_SDO, b); pgm->setpin(pgm, PIN_AVR_SCK, 1); @@ -198,7 +194,7 @@ static unsigned char bitbang_txrx(PROGRAMMER * pgm, unsigned char byte) * read the result bit (it is either valid from a previous falling * edge or it is ignored in the current context) */ - r = pgm->getpin(pgm, PIN_AVR_MISO); + r = pgm->getpin(pgm, PIN_AVR_SDI); pgm->setpin(pgm, PIN_AVR_SCK, 0); @@ -208,25 +204,23 @@ static unsigned char bitbang_txrx(PROGRAMMER * pgm, unsigned char byte) return rbyte; } -static int bitbang_tpi_clk(PROGRAMMER * pgm) -{ +static int bitbang_tpi_clk(const PROGRAMMER *pgm) { unsigned char r = 0; pgm->setpin(pgm, PIN_AVR_SCK, 1); - r = pgm->getpin(pgm, PIN_AVR_MISO); + r = pgm->getpin(pgm, PIN_AVR_SDI); pgm->setpin(pgm, PIN_AVR_SCK, 0); return r; } -void bitbang_tpi_tx(PROGRAMMER * pgm, unsigned char byte) -{ +void bitbang_tpi_tx(const PROGRAMMER *pgm, unsigned char byte) { int i; unsigned char b, parity; /* start bit */ - pgm->setpin(pgm, PIN_AVR_MOSI, 0); + pgm->setpin(pgm, PIN_AVR_SDO, 0); bitbang_tpi_clk(pgm); parity = 0; @@ -235,27 +229,26 @@ void bitbang_tpi_tx(PROGRAMMER * pgm, unsigned char byte) parity ^= b; /* set the data input line as desired */ - pgm->setpin(pgm, PIN_AVR_MOSI, b); + pgm->setpin(pgm, PIN_AVR_SDO, b); bitbang_tpi_clk(pgm); } /* parity bit */ - pgm->setpin(pgm, PIN_AVR_MOSI, parity); + pgm->setpin(pgm, PIN_AVR_SDO, parity); bitbang_tpi_clk(pgm); /* 2 stop bits */ - pgm->setpin(pgm, PIN_AVR_MOSI, 1); + pgm->setpin(pgm, PIN_AVR_SDO, 1); bitbang_tpi_clk(pgm); bitbang_tpi_clk(pgm); } -int bitbang_tpi_rx(PROGRAMMER * pgm) -{ +int bitbang_tpi_rx(const PROGRAMMER *pgm) { int i; unsigned char b, rbyte, parity; /* make sure pin is on for "pullup" */ - pgm->setpin(pgm, PIN_AVR_MOSI, 1); + pgm->setpin(pgm, PIN_AVR_SDO, 1); /* wait for start bit (up to 10 bits) */ b = 1; @@ -265,7 +258,7 @@ int bitbang_tpi_rx(PROGRAMMER * pgm) break; } if (b != 0) { - avrdude_message(MSG_INFO, "bitbang_tpi_rx: start bit not received correctly\n"); + pmsg_error("start bit not received correctly\n"); return -1; } @@ -280,7 +273,7 @@ int bitbang_tpi_rx(PROGRAMMER * pgm) /* parity bit */ if (bitbang_tpi_clk(pgm) != parity) { - avrdude_message(MSG_INFO, "bitbang_tpi_rx: parity bit is wrong\n"); + pmsg_error("parity bit is wrong\n"); return -1; } @@ -289,33 +282,29 @@ int bitbang_tpi_rx(PROGRAMMER * pgm) b &= bitbang_tpi_clk(pgm); b &= bitbang_tpi_clk(pgm); if (b != 1) { - avrdude_message(MSG_INFO, "bitbang_tpi_rx: stop bits not received correctly\n"); + pmsg_error("stop bits not received correctly\n"); return -1; } return rbyte; } -int bitbang_rdy_led(PROGRAMMER * pgm, int value) -{ +int bitbang_rdy_led(const PROGRAMMER *pgm, int value) { pgm->setpin(pgm, PIN_LED_RDY, !value); return 0; } -int bitbang_err_led(PROGRAMMER * pgm, int value) -{ +int bitbang_err_led(const PROGRAMMER *pgm, int value) { pgm->setpin(pgm, PIN_LED_ERR, !value); return 0; } -int bitbang_pgm_led(PROGRAMMER * pgm, int value) -{ +int bitbang_pgm_led(const PROGRAMMER *pgm, int value) { pgm->setpin(pgm, PIN_LED_PGM, !value); return 0; } -int bitbang_vfy_led(PROGRAMMER * pgm, int value) -{ +int bitbang_vfy_led(const PROGRAMMER *pgm, int value) { pgm->setpin(pgm, PIN_LED_VFY, !value); return 0; } @@ -325,7 +314,7 @@ int bitbang_vfy_led(PROGRAMMER * pgm, int value) * transmit an AVR device command and return the results; 'cmd' and * 'res' must point to at least a 4 byte data buffer */ -int bitbang_cmd(PROGRAMMER * pgm, const unsigned char *cmd, +int bitbang_cmd(const PROGRAMMER *pgm, const unsigned char *cmd, unsigned char *res) { int i; @@ -336,21 +325,21 @@ int bitbang_cmd(PROGRAMMER * pgm, const unsigned char *cmd, if(verbose >= 2) { - avrdude_message(MSG_NOTICE2, "bitbang_cmd(): [ "); + msg_notice2("bitbang_cmd(): [ "); for(i = 0; i < 4; i++) - avrdude_message(MSG_NOTICE2, "%02X ", cmd[i]); - avrdude_message(MSG_NOTICE2, "] [ "); + msg_notice2("%02X ", cmd[i]); + msg_notice2("] [ "); for(i = 0; i < 4; i++) { - avrdude_message(MSG_NOTICE2, "%02X ", res[i]); + msg_notice2("%02X ", res[i]); } - avrdude_message(MSG_NOTICE2, "]\n"); + msg_notice2("]\n"); } return 0; } -int bitbang_cmd_tpi(PROGRAMMER * pgm, const unsigned char *cmd, +int bitbang_cmd_tpi(const PROGRAMMER *pgm, const unsigned char *cmd, int cmd_len, unsigned char *res, int res_len) { int i, r; @@ -371,15 +360,15 @@ int bitbang_cmd_tpi(PROGRAMMER * pgm, const unsigned char *cmd, if(verbose >= 2) { - avrdude_message(MSG_NOTICE2, "bitbang_cmd_tpi(): [ "); + msg_notice2("bitbang_cmd_tpi(): [ "); for(i = 0; i < cmd_len; i++) - avrdude_message(MSG_NOTICE2, "%02X ", cmd[i]); - avrdude_message(MSG_NOTICE2, "] [ "); + msg_notice2("%02X ", cmd[i]); + msg_notice2("] [ "); for(i = 0; i < res_len; i++) { - avrdude_message(MSG_NOTICE2, "%02X ", res[i]); + msg_notice2("%02X ", res[i]); } - avrdude_message(MSG_NOTICE2, "]\n"); + msg_notice2("]\n"); } pgm->pgm_led(pgm, OFF); @@ -392,7 +381,7 @@ int bitbang_cmd_tpi(PROGRAMMER * pgm, const unsigned char *cmd, * transmit bytes via SPI and return the results; 'cmd' and * 'res' must point to data buffers */ -int bitbang_spi(PROGRAMMER * pgm, const unsigned char *cmd, +int bitbang_spi(const PROGRAMMER *pgm, const unsigned char *cmd, unsigned char *res, int count) { int i; @@ -407,15 +396,15 @@ int bitbang_spi(PROGRAMMER * pgm, const unsigned char *cmd, if(verbose >= 2) { - avrdude_message(MSG_NOTICE2, "bitbang_cmd(): [ "); + msg_notice2("bitbang_cmd(): [ "); for(i = 0; i < count; i++) - avrdude_message(MSG_NOTICE2, "%02X ", cmd[i]); - avrdude_message(MSG_NOTICE2, "] [ "); + msg_notice2("%02X ", cmd[i]); + msg_notice2("] [ "); for(i = 0; i < count; i++) { - avrdude_message(MSG_NOTICE2, "%02X ", res[i]); + msg_notice2("%02X ", res[i]); } - avrdude_message(MSG_NOTICE2, "]\n"); + msg_notice2("]\n"); } return 0; @@ -425,13 +414,12 @@ int bitbang_spi(PROGRAMMER * pgm, const unsigned char *cmd, /* * issue the 'chip erase' command to the AVR device */ -int bitbang_chip_erase(PROGRAMMER * pgm, AVRPART * p) -{ +int bitbang_chip_erase(const PROGRAMMER *pgm, const AVRPART *p) { unsigned char cmd[4]; unsigned char res[4]; AVRMEM *mem; - if (p->flags & AVRPART_HAS_TPI) { + if (p->prog_modes & PM_TPI) { pgm->pgm_led(pgm, ON); while (avr_tpi_poll_nvmbsy(pgm)); @@ -443,8 +431,7 @@ int bitbang_chip_erase(PROGRAMMER * pgm, AVRPART * p) /* Set Pointer Register */ mem = avr_locate_mem(p, "flash"); if (mem == NULL) { - avrdude_message(MSG_INFO, "No flash memory to erase for part %s\n", - p->desc); + pmsg_error("no flash memory to erase for part %s\n", p->desc); return -1; } bitbang_tpi_tx(pgm, TPI_CMD_SSTPR | 0); @@ -464,8 +451,7 @@ int bitbang_chip_erase(PROGRAMMER * pgm, AVRPART * p) } if (p->op[AVR_OP_CHIP_ERASE] == NULL) { - avrdude_message(MSG_INFO, "chip erase instruction not defined for part \"%s\"\n", - p->desc); + pmsg_error("chip erase instruction not defined for part %s\n", p->desc); return -1; } @@ -486,13 +472,12 @@ int bitbang_chip_erase(PROGRAMMER * pgm, AVRPART * p) /* * issue the 'program enable' command to the AVR device */ -int bitbang_program_enable(PROGRAMMER * pgm, AVRPART * p) -{ +int bitbang_program_enable(const PROGRAMMER *pgm, const AVRPART *p) { unsigned char cmd[4]; unsigned char res[4]; int i; - if (p->flags & AVRPART_HAS_TPI) { + if (p->prog_modes & PM_TPI) { /* enable NVM programming */ bitbang_tpi_tx(pgm, TPI_CMD_SKEY); for (i = sizeof(tpi_skey) - 1; i >= 0; i--) @@ -505,8 +490,7 @@ int bitbang_program_enable(PROGRAMMER * pgm, AVRPART * p) } if (p->op[AVR_OP_PGM_ENABLE] == NULL) { - avrdude_message(MSG_INFO, "program enable instruction not defined for part \"%s\"\n", - p->desc); + pmsg_error("program enable instruction not defined for part %s\n", p->desc); return -1; } @@ -523,8 +507,7 @@ int bitbang_program_enable(PROGRAMMER * pgm, AVRPART * p) /* * initialize the AVR device and prepare it to accept commands */ -int bitbang_initialize(PROGRAMMER * pgm, AVRPART * p) -{ +int bitbang_initialize(const PROGRAMMER *pgm, const AVRPART *p) { int rc; int tries; int i; @@ -534,12 +517,11 @@ int bitbang_initialize(PROGRAMMER * pgm, AVRPART * p) pgm->powerup(pgm); usleep(20000); - /* TPIDATA is a single line, so MISO & MOSI should be connected */ - if (p->flags & AVRPART_HAS_TPI) { + /* TPIDATA is a single line, so SDI & SDO should be connected */ + if (p->prog_modes & PM_TPI) { /* make sure cmd_tpi() is defined */ if (pgm->cmd_tpi == NULL) { - avrdude_message(MSG_INFO, "%s: Error: %s programmer does not support TPI\n", - progname, pgm->type); + pmsg_error("%s programmer does not support TPI\n", pgm->type); return -1; } @@ -550,29 +532,29 @@ int bitbang_initialize(PROGRAMMER * pgm, AVRPART * p) /* RESET must be LOW in case the existing code is driving the TPI pins: */ pgm->setpin(pgm, PIN_AVR_RESET, 0); - avrdude_message(MSG_NOTICE2, "doing MOSI-MISO link check\n"); + msg_notice2("doing SDO-SDI link check\n"); - pgm->setpin(pgm, PIN_AVR_MOSI, 0); - if (pgm->getpin(pgm, PIN_AVR_MISO) != 0) { - avrdude_message(MSG_INFO, "MOSI->MISO 0 failed\n"); + pgm->setpin(pgm, PIN_AVR_SDO, 0); + if (pgm->getpin(pgm, PIN_AVR_SDI) != 0) { + pmsg_error("SDO->SDI 0 failed\n"); return -1; } - pgm->setpin(pgm, PIN_AVR_MOSI, 1); - if (pgm->getpin(pgm, PIN_AVR_MISO) != 1) { - avrdude_message(MSG_INFO, "MOSI->MISO 1 failed\n"); + pgm->setpin(pgm, PIN_AVR_SDO, 1); + if (pgm->getpin(pgm, PIN_AVR_SDI) != 1) { + pmsg_error("SDO->SDI 1 failed\n"); return -1; } - avrdude_message(MSG_NOTICE2, "MOSI-MISO link present\n"); + msg_notice2("SDO-SDI link present\n"); } pgm->setpin(pgm, PIN_AVR_SCK, 0); pgm->setpin(pgm, PIN_AVR_RESET, 0); usleep(20000); - if (p->flags & AVRPART_HAS_TPI) { + if (p->prog_modes & PM_TPI) { /* keep TPIDATA high for 16 clock cycles */ - pgm->setpin(pgm, PIN_AVR_MOSI, 1); + pgm->setpin(pgm, PIN_AVR_SDO, 1); for (i = 0; i < 16; i++) pgm->highpulsepin(pgm, PIN_AVR_SCK); @@ -584,7 +566,7 @@ int bitbang_initialize(PROGRAMMER * pgm, AVRPART * p) bitbang_tpi_tx(pgm, TPI_CMD_SLDCS | TPI_REG_TPIIR); rc = bitbang_tpi_rx(pgm); if (rc != 0x80) { - avrdude_message(MSG_INFO, "TPIIR not correct\n"); + pmsg_error("TPIIR not correct\n"); return -1; } } else { @@ -618,7 +600,7 @@ int bitbang_initialize(PROGRAMMER * pgm, AVRPART * p) * can't sync with the device, maybe it's not attached? */ if (rc) { - avrdude_message(MSG_INFO, "%s: AVR device not responding\n", progname); + pmsg_error("AVR device not responding\n"); return -1; } } @@ -626,11 +608,14 @@ int bitbang_initialize(PROGRAMMER * pgm, AVRPART * p) return 0; } -static int verify_pin_assigned(PROGRAMMER * pgm, int pin, char * desc) -{ - if (pgm->pinno[pin] == 0) { - avrdude_message(MSG_INFO, "%s: error: no pin has been assigned for %s\n", - progname, desc); +static int verify_pin_assigned(const PROGRAMMER *pgm, int pinfunc, char *desc) { + if(pinfunc < 0 || pinfunc >= N_PINS) { + pmsg_error("invalid pin function number %d\n", pinfunc); + return -1; + } + + if ((pgm->pinno[pinfunc] & PIN_MASK) > PIN_MAX) { + pmsg_error("no pin has been assigned for %s\n", desc); return -1; } return 0; @@ -640,21 +625,19 @@ static int verify_pin_assigned(PROGRAMMER * pgm, int pin, char * desc) /* * Verify all prerequisites for a bit-bang programmer are present. */ -int bitbang_check_prerequisites(PROGRAMMER *pgm) -{ +int bitbang_check_prerequisites(const PROGRAMMER *pgm) { if (verify_pin_assigned(pgm, PIN_AVR_RESET, "AVR RESET") < 0) return -1; if (verify_pin_assigned(pgm, PIN_AVR_SCK, "AVR SCK") < 0) return -1; - if (verify_pin_assigned(pgm, PIN_AVR_MISO, "AVR MISO") < 0) + if (verify_pin_assigned(pgm, PIN_AVR_SDI, "AVR SDI") < 0) return -1; - if (verify_pin_assigned(pgm, PIN_AVR_MOSI, "AVR MOSI") < 0) + if (verify_pin_assigned(pgm, PIN_AVR_SDO, "AVR SDO") < 0) return -1; if (pgm->cmd == NULL) { - avrdude_message(MSG_INFO, "%s: error: no cmd() method defined for bitbang programmer\n", - progname); + pmsg_error("no cmd() method defined for bitbang programmer\n"); return -1; } return 0; diff --git a/src/bitbang.h b/src/bitbang.h index b0131314..f837c1e5 100644 --- a/src/bitbang.h +++ b/src/bitbang.h @@ -31,25 +31,25 @@ int bitbang_getpin(int fd, int pin); int bitbang_highpulsepin(int fd, int pin); void bitbang_delay(unsigned int us); -int bitbang_check_prerequisites(PROGRAMMER *pgm); +int bitbang_check_prerequisites(const PROGRAMMER *pgm); -int bitbang_rdy_led (PROGRAMMER * pgm, int value); -int bitbang_err_led (PROGRAMMER * pgm, int value); -int bitbang_pgm_led (PROGRAMMER * pgm, int value); -int bitbang_vfy_led (PROGRAMMER * pgm, int value); -int bitbang_cmd (PROGRAMMER * pgm, const unsigned char *cmd, +int bitbang_rdy_led (const PROGRAMMER *pgm, int value); +int bitbang_err_led (const PROGRAMMER *pgm, int value); +int bitbang_pgm_led (const PROGRAMMER *pgm, int value); +int bitbang_vfy_led (const PROGRAMMER *pgm, int value); +int bitbang_cmd (const PROGRAMMER *pgm, const unsigned char *cmd, unsigned char *res); -int bitbang_cmd_tpi (PROGRAMMER * pgm, const unsigned char *cmd, +int bitbang_cmd_tpi (const PROGRAMMER *pgm, const unsigned char *cmd, int cmd_len, unsigned char *res, int res_len); -int bitbang_spi (PROGRAMMER * pgm, const unsigned char *cmd, +int bitbang_spi (const PROGRAMMER *pgm, const unsigned char *cmd, unsigned char *res, int count); -int bitbang_chip_erase (PROGRAMMER * pgm, AVRPART * p); -int bitbang_program_enable (PROGRAMMER * pgm, AVRPART * p); -void bitbang_powerup (PROGRAMMER * pgm); -void bitbang_powerdown (PROGRAMMER * pgm); -int bitbang_initialize (PROGRAMMER * pgm, AVRPART * p); -void bitbang_disable (PROGRAMMER * pgm); -void bitbang_enable (PROGRAMMER * pgm); +int bitbang_chip_erase (const PROGRAMMER *pgm, const AVRPART *p); +int bitbang_program_enable (const PROGRAMMER *pgm, const AVRPART *p); +void bitbang_powerup (const PROGRAMMER *pgm); +void bitbang_powerdown (const PROGRAMMER *pgm); +int bitbang_initialize (const PROGRAMMER *pgm, const AVRPART *p); +void bitbang_disable (const PROGRAMMER *pgm); +void bitbang_enable (PROGRAMMER *pgm, const AVRPART *p); #ifdef __cplusplus } diff --git a/src/buspirate.c b/src/buspirate.c index 36848179..94750328 100644 --- a/src/buspirate.c +++ b/src/buspirate.c @@ -25,8 +25,8 @@ * GND <-> GND * +5V <-> Vcc * CS <-> RESET - * MOSI <-> MOSI - * MISO <-> MISO + * SDO <-> SDO + * SDI <-> SDI * SCL/CLK <-> SCK * ( AUX <-> XTAL1 ) * @@ -76,68 +76,66 @@ struct pdata unsigned char pin_dir; /* Last written pin direction for bitbang mode */ unsigned char pin_val; /* Last written pin values for bitbang mode */ int unread_bytes; /* How many bytes we expected, but ignored */ + int flag; }; #define PDATA(pgm) ((struct pdata *)(pgm->cookie)) /* ====== Feature checks ====== */ static inline int -buspirate_uses_ascii(struct programmer_t *pgm) -{ - return (pgm->flag & BP_FLAG_XPARM_FORCE_ASCII); +buspirate_uses_ascii(const PROGRAMMER *pgm) { + return (PDATA(pgm)->flag & BP_FLAG_XPARM_FORCE_ASCII); } /* ====== Serial talker functions - binmode ====== */ -static void dump_mem(const int msglvl, const unsigned char *buf, size_t len) +static void dump_mem(const unsigned char *buf, size_t len) { size_t i; for (i = 0; ifd, data, len); return rc; } -static int buspirate_recv_bin(struct programmer_t *pgm, unsigned char *buf, size_t len) -{ +static int buspirate_recv_bin(const PROGRAMMER *pgm, unsigned char *buf, size_t len) { int rc; rc = serial_recv(&pgm->fd, buf, len); if (rc < 0) return EOF; - avrdude_message(MSG_DEBUG, "%s: buspirate_recv_bin():\n", progname); - dump_mem(MSG_DEBUG, buf, len); + pmsg_debug("buspirate_recv_bin():\n"); + dump_mem(buf, len); return len; } -static int buspirate_expect_bin(struct programmer_t *pgm, +static int buspirate_expect_bin(const PROGRAMMER *pgm, unsigned char *send_data, size_t send_len, unsigned char *expect_data, size_t expect_len) { unsigned char *recv_buf = alloca(expect_len); - if ((pgm->flag & BP_FLAG_IN_BINMODE) == 0) { - avrdude_message(MSG_INFO, "BusPirate: Internal error: buspirate_send_bin() called from ascii mode\n"); + if ((PDATA(pgm)->flag & BP_FLAG_IN_BINMODE) == 0) { + pmsg_error("called from ascii mode\n"); return -1; } @@ -148,7 +146,7 @@ static int buspirate_expect_bin(struct programmer_t *pgm, return 1; } -static int buspirate_expect_bin_byte(struct programmer_t *pgm, +static int buspirate_expect_bin_byte(const PROGRAMMER *pgm, unsigned char send_byte, unsigned char expect_byte) { return buspirate_expect_bin(pgm, &send_byte, 1, &expect_byte, 1); @@ -156,13 +154,12 @@ static int buspirate_expect_bin_byte(struct programmer_t *pgm, /* ====== Serial talker functions - ascii mode ====== */ -static int buspirate_getc(struct programmer_t *pgm) -{ +static int buspirate_getc(const PROGRAMMER *pgm) { int rc; unsigned char ch = 0; - if (pgm->flag & BP_FLAG_IN_BINMODE) { - avrdude_message(MSG_INFO, "BusPirate: Internal error: buspirate_getc() called from binmode\n"); + if (PDATA(pgm)->flag & BP_FLAG_IN_BINMODE) { + pmsg_error("called from binmode\n"); return EOF; } @@ -172,8 +169,7 @@ static int buspirate_getc(struct programmer_t *pgm) return ch; } -static char *buspirate_readline_noexit(struct programmer_t *pgm, char *buf, size_t len) -{ +static char *buspirate_readline_noexit(const PROGRAMMER *pgm, char *buf, size_t len) { char *buf_p; int c; long orig_serial_recv_timeout = serial_recv_timeout; @@ -201,36 +197,31 @@ static char *buspirate_readline_noexit(struct programmer_t *pgm, char *buf, size serial_recv_timeout = PDATA(pgm)->serial_recv_timeout; } serial_recv_timeout = orig_serial_recv_timeout; - avrdude_message(MSG_DEBUG, "%s: buspirate_readline(): %s%s", - progname, buf, - buf[strlen(buf) - 1] == '\n' ? "" : "\n"); + pmsg_debug("buspirate_readline(): %s%s", buf, *buf && buf[strlen(buf)-1] == '\n'? "": "\n"); if (! buf[0]) return NULL; return buf; } -static char *buspirate_readline(struct programmer_t *pgm, char *buf, size_t len) -{ +static char *buspirate_readline(const PROGRAMMER *pgm, char *buf, size_t len) { char *ret; ret = buspirate_readline_noexit(pgm, buf, len); if (! ret) { - avrdude_message(MSG_INFO, "%s: buspirate_readline(): programmer is not responding\n", - progname); + pmsg_error("programmer is not responding\n"); return NULL; } return ret; } -static int buspirate_send(struct programmer_t *pgm, const char *str) -{ +static int buspirate_send(const PROGRAMMER *pgm, const char *str) { int rc; const char * readline; - avrdude_message(MSG_DEBUG, "%s: buspirate_send(): %s", progname, str); + pmsg_debug("buspirate_send(): %s", str); - if (pgm->flag & BP_FLAG_IN_BINMODE) { - avrdude_message(MSG_INFO, "BusPirate: Internal error: buspirate_send() called from binmode\n"); + if (PDATA(pgm)->flag & BP_FLAG_IN_BINMODE) { + pmsg_error("called from binmode\n"); return -1; } @@ -256,7 +247,7 @@ static int buspirate_is_prompt(const char *str) return (str[strlen_str - 1] == '>' || str[strlen_str - 2] == '>'); } -static int buspirate_expect(struct programmer_t *pgm, char *send, +static int buspirate_expect(const PROGRAMMER *pgm, char *send, char *expect, int wait_for_prompt) { int got_it = 0; @@ -285,14 +276,12 @@ static int buspirate_expect(struct programmer_t *pgm, char *send, } /* ====== Do-nothing functions ====== */ -static void buspirate_dummy_6(struct programmer_t *pgm, const char *p) -{ +static void buspirate_dummy_6(const PROGRAMMER *pgm, const char *p) { } /* ====== Config / parameters handling functions ====== */ static int -buspirate_parseextparms(struct programmer_t *pgm, LISTID extparms) -{ +buspirate_parseextparms(const PROGRAMMER *pgm, const LISTID extparms) { LNODEID ln; const char *extended_param; char reset[10]; @@ -305,36 +294,35 @@ buspirate_parseextparms(struct programmer_t *pgm, LISTID extparms) for (ln = lfirst(extparms); ln; ln = lnext(ln)) { extended_param = ldata(ln); if (strcmp(extended_param, "ascii") == 0) { - pgm->flag |= BP_FLAG_XPARM_FORCE_ASCII; + PDATA(pgm)->flag |= BP_FLAG_XPARM_FORCE_ASCII; continue; } if (sscanf(extended_param, "spifreq=%u", &spifreq) == 1) { if (spifreq & (~0x07)) { - avrdude_message(MSG_INFO, "BusPirate: spifreq must be between 0 and 7.\n"); - avrdude_message(MSG_INFO, "BusPirate: see BusPirate manual for details.\n"); + pmsg_error("spifreq must be between 0 and 7\n"); + imsg_error("see BusPirate manual for details\n"); return -1; } - if (pgm->flag & BP_FLAG_XPARM_RAWFREQ) { - avrdude_message(MSG_INFO, "BusPirate: set either spifreq or rawfreq\n"); + if (PDATA(pgm)->flag & BP_FLAG_XPARM_RAWFREQ) { + pmsg_error("set either spifreq or rawfreq\n"); return -1; } - pgm->flag |= BP_FLAG_XPARM_SPIFREQ; + PDATA(pgm)->flag |= BP_FLAG_XPARM_SPIFREQ; PDATA(pgm)->spifreq = spifreq; continue; } if (sscanf(extended_param, "rawfreq=%u", &rawfreq) == 1) { if (rawfreq >= 4) { - avrdude_message(MSG_INFO, "BusPirate: rawfreq must be " - "between 0 and 3.\n"); + pmsg_error("rawfreq must be between 0 and 3\n"); return -1; } - if (pgm->flag & BP_FLAG_XPARM_SPIFREQ) { - avrdude_message(MSG_INFO, "BusPirate: set either spifreq or rawfreq\n"); + if (PDATA(pgm)->flag & BP_FLAG_XPARM_SPIFREQ) { + pmsg_error("set either spifreq or rawfreq\n"); return -1; } - pgm->flag |= BP_FLAG_XPARM_RAWFREQ; + PDATA(pgm)->flag |= BP_FLAG_XPARM_RAWFREQ; PDATA(pgm)->spifreq = rawfreq; continue; } @@ -342,12 +330,12 @@ buspirate_parseextparms(struct programmer_t *pgm, LISTID extparms) if (sscanf(extended_param, "cpufreq=%u", &cpufreq) == 1) { /* lower limit comes from 'cpufreq > 4 * spifreq', spifreq in ascii mode is 30kHz. */ if (cpufreq < 125 || cpufreq > 4000) { - avrdude_message(MSG_INFO, "BusPirate: cpufreq must be between 125 and 4000 kHz.\n"); - avrdude_message(MSG_INFO, "BusPirate: see BusPirate manual for details.\n"); + pmsg_error("cpufreq must be between 125 and 4000 kHz\n"); + imsg_error("see BusPirate manual for details\n"); return -1; } PDATA(pgm)->cpufreq = cpufreq; - pgm->flag |= BP_FLAG_XPARM_CPUFREQ; + PDATA(pgm)->flag |= BP_FLAG_XPARM_CPUFREQ; continue; } @@ -362,34 +350,34 @@ buspirate_parseextparms(struct programmer_t *pgm, LISTID extparms) else if (strcasecmp(resetpin, "aux2") == 0) PDATA(pgm)->reset |= BP_RESET_AUX2; else { - avrdude_message(MSG_INFO, "BusPirate: reset must be either CS or AUX.\n"); + pmsg_error("reset must be either CS or AUX\n"); return -1; } } - pgm->flag |= BP_FLAG_XPARM_RESET; + PDATA(pgm)->flag |= BP_FLAG_XPARM_RESET; continue; } if (strcmp(extended_param, "nopagedwrite") == 0) { - pgm->flag |= BP_FLAG_NOPAGEDWRITE; + PDATA(pgm)->flag |= BP_FLAG_NOPAGEDWRITE; continue; } if (strcmp(extended_param, "nopagedread") == 0) { - pgm->flag |= BP_FLAG_NOPAGEDREAD; + PDATA(pgm)->flag |= BP_FLAG_NOPAGEDREAD; continue; } if (sscanf(extended_param, "serial_recv_timeout=%d", &serial_recv_timeout) == 1) { if (serial_recv_timeout < 1) { - avrdude_message(MSG_INFO, "BusPirate: serial_recv_timeout must be greater 0.\n"); + pmsg_error("serial_recv_timeout must be greater 0\n"); return -1; } PDATA(pgm)->serial_recv_timeout = serial_recv_timeout; continue; } - avrdude_message(MSG_INFO, "BusPirate: do not understand extended param '%s'.\n", extended_param); + pmsg_error("do not understand extended param '%s'\n", extended_param); return -1; } @@ -397,20 +385,19 @@ buspirate_parseextparms(struct programmer_t *pgm, LISTID extparms) } static int -buspirate_verifyconfig(struct programmer_t *pgm) -{ +buspirate_verifyconfig(const PROGRAMMER *pgm) { /* Default reset pin is CS */ if (PDATA(pgm)->reset == 0x00) PDATA(pgm)->reset |= BP_RESET_CS; if ((PDATA(pgm)->reset != BP_RESET_CS) && buspirate_uses_ascii(pgm)) { - avrdude_message(MSG_INFO, "BusPirate: RESET pin other than CS is not supported in ASCII mode\n"); + pmsg_error("RESET pin other than CS is not supported in ASCII mode\n"); return -1; } - if ( ((pgm->flag & BP_FLAG_XPARM_SPIFREQ) || (pgm->flag & BP_FLAG_XPARM_RAWFREQ)) + if ( ((PDATA(pgm)->flag & BP_FLAG_XPARM_SPIFREQ) || (PDATA(pgm)->flag & BP_FLAG_XPARM_RAWFREQ)) && buspirate_uses_ascii(pgm)) { - avrdude_message(MSG_INFO, "BusPirate: SPI speed selection is not supported in ASCII mode\n"); + pmsg_error("SPI speed selection is not supported in ASCII mode\n"); return -1; } @@ -418,8 +405,7 @@ buspirate_verifyconfig(struct programmer_t *pgm) } /* ====== Programmer methods ======= */ -static int buspirate_open(struct programmer_t *pgm, char * port) -{ +static int buspirate_open(PROGRAMMER *pgm, const char *port) { union pinfo pinfo; /* BusPirate runs at 115200 by default */ if(pgm->baudrate == 0) @@ -438,30 +424,29 @@ static int buspirate_open(struct programmer_t *pgm, char * port) return 0; } -static void buspirate_close(struct programmer_t *pgm) +static void buspirate_close(PROGRAMMER *pgm) { serial_close(&pgm->fd); pgm->fd.ifd = -1; } -static void buspirate_reset_from_binmode(struct programmer_t *pgm) -{ +static void buspirate_reset_from_binmode(const PROGRAMMER *pgm) { unsigned char buf[10]; buf[0] = 0x00; /* BinMode: revert to raw bitbang mode */ buspirate_send_bin(pgm, buf, 1); buspirate_recv_bin(pgm, buf, 5); - if (pgm->flag & BP_FLAG_XPARM_CPUFREQ) { + if (PDATA(pgm)->flag & BP_FLAG_XPARM_CPUFREQ) { /* disable pwm */ if (buspirate_expect_bin_byte(pgm, 0x13, 0x01) != 1) { - avrdude_message(MSG_INFO, "%s: warning: did not get a response to stop PWM command.\n", progname); + pmsg_error("did not get a response to stop PWM command\n"); } } /* 0b0100wxyz - Configure peripherals w=power, x=pull-ups, y=AUX, z=CS * we want everything off -- 0b01000000 = 0x40 */ if (buspirate_expect_bin_byte(pgm, 0x40, 0x00) == 1) { - avrdude_message(MSG_INFO, "%s: warning: did not get a response to power off command.\n", progname); + pmsg_error("did not get a response to power off command\n"); } buf[0] = 0x0F; /* BinMode: reset */ @@ -474,7 +459,7 @@ static void buspirate_reset_from_binmode(struct programmer_t *pgm) rc = buspirate_recv_bin(pgm, buf, sizeof(buf) - 1); if (buspirate_is_prompt((const char*)buf)) { - pgm->flag &= ~BP_FLAG_IN_BINMODE; + PDATA(pgm)->flag &= ~BP_FLAG_IN_BINMODE; break; } if (rc == EOF) @@ -482,15 +467,15 @@ static void buspirate_reset_from_binmode(struct programmer_t *pgm) memset(buf, '\0', sizeof(buf)); } - if (pgm->flag & BP_FLAG_IN_BINMODE) { - avrdude_message(MSG_INFO, "BusPirate reset failed. You may need to powercycle it.\n"); + if (PDATA(pgm)->flag & BP_FLAG_IN_BINMODE) { + pmsg_error("reset failed; you may need to powercycle it\n"); return; } - avrdude_message(MSG_NOTICE, "BusPirate is back in the text mode\n"); + msg_notice("BusPirate is back in text mode\n"); } -static int buspirate_start_mode_bin(struct programmer_t *pgm) +static int buspirate_start_mode_bin(PROGRAMMER *pgm) { struct submode { const char *name; /* Name of mode for user messages */ @@ -499,13 +484,13 @@ static int buspirate_start_mode_bin(struct programmer_t *pgm) char config; /* Command to setup submode parameters */ } submode; - if (pgm->flag & BP_FLAG_XPARM_RAWFREQ) { + if (PDATA(pgm)->flag & BP_FLAG_XPARM_RAWFREQ) { submode.name = "Raw-wire"; submode.enter = 0x05; submode.entered_format = "RAW%1d"; submode.config = 0x8C; - pgm->flag |= BP_FLAG_NOPAGEDWRITE; - pgm->flag |= BP_FLAG_NOPAGEDREAD; + PDATA(pgm)->flag |= BP_FLAG_NOPAGEDWRITE; + PDATA(pgm)->flag |= BP_FLAG_NOPAGEDREAD; } else { submode.name = "SPI"; submode.enter = 0x01; @@ -528,24 +513,24 @@ static int buspirate_start_mode_bin(struct programmer_t *pgm) memset(buf, 0, sizeof(buf)); buspirate_recv_bin(pgm, buf, 5); if (sscanf((const char*)buf, "BBIO%1d", &PDATA(pgm)->binmode_version) != 1) { - avrdude_message(MSG_INFO, "Binary mode not confirmed: '%s'\n", buf); + pmsg_error("binary mode not confirmed: '%s'\n", buf); buspirate_reset_from_binmode(pgm); return -1; } - avrdude_message(MSG_NOTICE, "BusPirate binmode version: %d\n", + msg_notice("BusPirate binmode version: %d\n", PDATA(pgm)->binmode_version); - pgm->flag |= BP_FLAG_IN_BINMODE; + PDATA(pgm)->flag |= BP_FLAG_IN_BINMODE; - if (pgm->flag & BP_FLAG_XPARM_CPUFREQ) { + if (PDATA(pgm)->flag & BP_FLAG_XPARM_CPUFREQ) { unsigned short pwm_duty; unsigned short pwm_period; pwm_period = 16000/(PDATA(pgm)->cpufreq) - 1; // oscillator runs at 32MHz, we don't use a prescaler pwm_duty = pwm_period/2; // 50% duty cycle - avrdude_message(MSG_NOTICE, "Setting up PWM for cpufreq\n"); - avrdude_message(MSG_DEBUG, "PWM settings: Prescaler=1, Duty Cycle=%hd, Period=%hd\n", pwm_duty, pwm_period); + msg_notice("setting up PWM for cpufreq\n"); + msg_debug("PWM settings: Prescaler=1, Duty Cycle=%hd, Period=%hd\n", pwm_duty, pwm_period); buf[0] = 0x12; // pwm setup buf[1] = 0; // prescaler 1 @@ -557,7 +542,7 @@ static int buspirate_start_mode_bin(struct programmer_t *pgm) buspirate_recv_bin(pgm, buf, 1); if (buf[0] != 0x01) - avrdude_message(MSG_INFO, "cpufreq (PWM) setup failed\n"); + pmsg_error("cpufreq (PWM) setup failed\n"); } /* == Set protocol sub-mode of binary mode == */ @@ -566,16 +551,14 @@ static int buspirate_start_mode_bin(struct programmer_t *pgm) memset(buf, 0, sizeof(buf)); buspirate_recv_bin(pgm, buf, 4); if (sscanf((const char*)buf, submode.entered_format, &PDATA(pgm)->submode_version) != 1) { - avrdude_message(MSG_INFO, "%s mode not confirmed: '%s'\n", - submode.name, buf); + pmsg_error("%s mode not confirmed: '%s'\n", submode.name, buf); buspirate_reset_from_binmode(pgm); return -1; } - avrdude_message(MSG_NOTICE, "BusPirate %s version: %d\n", - submode.name, PDATA(pgm)->submode_version); - - if (pgm->flag & BP_FLAG_NOPAGEDWRITE) { - avrdude_message(MSG_NOTICE, "%s: Paged flash write disabled.\n", progname); + msg_notice("BusPirate %s version: %d\n", + submode.name, PDATA(pgm)->submode_version); + if (PDATA(pgm)->flag & BP_FLAG_NOPAGEDWRITE) { + pmsg_notice("paged flash write disabled\n"); pgm->paged_write = NULL; } else { /* Check for write-then-read without !CS/CS and disable paged_write if absent: */ @@ -583,21 +566,20 @@ static int buspirate_start_mode_bin(struct programmer_t *pgm) buspirate_send_bin(pgm, buf2, sizeof(buf2)); buspirate_recv_bin(pgm, buf, 1); if (buf[0] != 0x01) { - /* Disable paged write: */ - pgm->flag |= BP_FLAG_NOPAGEDWRITE; + PDATA(pgm)->flag |= BP_FLAG_NOPAGEDWRITE; pgm->paged_write = NULL; /* Return to SPI mode (0x00s have landed us back in binary bitbang mode): */ buf[0] = 0x1; buspirate_send_bin(pgm, buf, 1); - avrdude_message(MSG_NOTICE, "%s: Disabling paged flash write. (Need BusPirate firmware >=v5.10.)\n", progname); + pmsg_notice("disabling paged flash write (need BusPirate firmware >= v5.10)\n"); /* Flush serial buffer: */ serial_drain(&pgm->fd, 0); } else { - avrdude_message(MSG_INFO, "%s: Paged flash write enabled.\n", progname); + pmsg_info("paged flash write enabled\n"); } } @@ -617,8 +599,8 @@ static int buspirate_start_mode_bin(struct programmer_t *pgm) return -1; /* AVR Extended Commands - test for existence */ - if (pgm->flag & BP_FLAG_NOPAGEDREAD) { - avrdude_message(MSG_NOTICE, "%s: Paged flash read disabled.\n", progname); + if (PDATA(pgm)->flag & BP_FLAG_NOPAGEDREAD) { + pmsg_notice("paged flash read disabled\n"); pgm->paged_load = NULL; } else { int rv = buspirate_expect_bin_byte(pgm, 0x06, 0x01); @@ -630,10 +612,10 @@ static int buspirate_start_mode_bin(struct programmer_t *pgm) buspirate_send_bin(pgm, buf2, sizeof(buf2)); buspirate_recv_bin(pgm, buf, 3); ver = buf[1] << 8 | buf[2]; - avrdude_message(MSG_NOTICE, "AVR Extended Commands version %d\n", ver); + msg_notice("AVR Extended Commands version %d\n", ver); } else { - avrdude_message(MSG_NOTICE, "AVR Extended Commands not found.\n"); - pgm->flag |= BP_FLAG_NOPAGEDREAD; + msg_notice("AVR Extended Commands not found\n"); + PDATA(pgm)->flag |= BP_FLAG_NOPAGEDREAD; pgm->paged_load = NULL; } } @@ -641,8 +623,7 @@ static int buspirate_start_mode_bin(struct programmer_t *pgm) return 0; } -static int buspirate_start_spi_mode_ascii(struct programmer_t *pgm) -{ +static int buspirate_start_spi_mode_ascii(const PROGRAMMER *pgm) { int spi_cmd = -1; int cmd; char *rcvd; @@ -663,10 +644,8 @@ static int buspirate_start_spi_mode_ascii(struct programmer_t *pgm) break; } if (spi_cmd == -1) { - avrdude_message(MSG_INFO, "%s: SPI mode number not found. Does your BusPirate support SPI?\n", - progname); - avrdude_message(MSG_INFO, "%s: Try powercycling your BusPirate and try again.\n", - progname); + pmsg_error("SPI mode number not found; does your BusPirate support SPI?\n"); + imsg_error("try powercycling your BusPirate and try again\n"); return -1; } snprintf(buf, sizeof(buf), "%d\n", spi_cmd); @@ -686,7 +665,7 @@ static int buspirate_start_spi_mode_ascii(struct programmer_t *pgm) } if (buspirate_is_prompt(rcvd)) { if (strncmp(rcvd, "SPI>", 4) == 0) { - avrdude_message(MSG_INFO, "BusPirate is now configured for SPI\n"); + msg_info("BusPirate is now configured for SPI\n"); break; } /* Not yet 'SPI>' prompt */ @@ -700,8 +679,7 @@ static int buspirate_start_spi_mode_ascii(struct programmer_t *pgm) return 0; } -static void buspirate_enable(struct programmer_t *pgm) -{ +static void buspirate_enable(PROGRAMMER *pgm, const AVRPART *p) { static const char *reset_str = "#\n"; static const char *accept_str = "y\n"; char *rcvd; @@ -713,7 +691,7 @@ static void buspirate_enable(struct programmer_t *pgm) /* Attempt to start binary SPI mode unless explicitly told otherwise: */ if (!buspirate_uses_ascii(pgm)) { - avrdude_message(MSG_INFO, "Attempting to initiate BusPirate binary mode...\n"); + msg_info("attempting to initiate BusPirate binary mode ...\n"); /* Send two CRs to ensure we're not in a sub-menu of the UI if we're in ASCII mode: */ buspirate_send_bin(pgm, (const unsigned char*)"\n\n", 2); @@ -725,23 +703,23 @@ static void buspirate_enable(struct programmer_t *pgm) if (buspirate_start_mode_bin(pgm) >= 0) return; else - avrdude_message(MSG_INFO, "%s: Failed to start binary mode, falling back to ASCII...\n", progname); + pmsg_info("unable to start binary mode, falling back to ASCII ...\n"); } - avrdude_message(MSG_INFO, "Attempting to initiate BusPirate ASCII mode...\n"); + msg_info("attempting to initiate BusPirate ASCII mode ...\n"); /* Call buspirate_send_bin() instead of buspirate_send() * because we don't know if BP is in text or bin mode */ rc = buspirate_send_bin(pgm, (const unsigned char*)reset_str, strlen(reset_str)); if (rc) { - avrdude_message(MSG_INFO, "BusPirate is not responding. Serial port error: %d\n", rc); + pmsg_error("BusPirate is not responding; serial port error code %d\n", rc); return; } while(1) { rcvd = buspirate_readline_noexit(pgm, NULL, 0); if (! rcvd) { - avrdude_message(MSG_INFO, "%s: Fatal: Programmer is not responding.\n", progname); + pmsg_error("programmer is not responding\n"); return; } if (strncmp(rcvd, "Are you sure?", 13) == 0) { @@ -752,25 +730,24 @@ static void buspirate_enable(struct programmer_t *pgm) continue; } if (buspirate_is_prompt(rcvd)) { - avrdude_message(MSG_DEBUG, "**\n"); + msg_debug("**\n"); break; } if (print_banner) - avrdude_message(MSG_DEBUG, "** %s", rcvd); + msg_debug("** %s", rcvd); } - if (!(pgm->flag & BP_FLAG_IN_BINMODE)) { - avrdude_message(MSG_INFO, "BusPirate: using ASCII mode\n"); + if (!(PDATA(pgm)->flag & BP_FLAG_IN_BINMODE)) { + msg_info("using ASCII mode\n"); if (buspirate_start_spi_mode_ascii(pgm) < 0) { - avrdude_message(MSG_INFO, "%s: Failed to start ascii SPI mode\n", progname); + pmsg_error("unable to start ascii SPI mode\n"); return; } } } -static void buspirate_disable(struct programmer_t *pgm) -{ - if (pgm->flag & BP_FLAG_IN_BINMODE) { +static void buspirate_disable(const PROGRAMMER *pgm) { + if (PDATA(pgm)->flag & BP_FLAG_IN_BINMODE) { serial_recv_timeout = 100; buspirate_reset_from_binmode(pgm); } else { @@ -778,21 +755,19 @@ static void buspirate_disable(struct programmer_t *pgm) } } -static int buspirate_initialize(struct programmer_t *pgm, AVRPART * p) -{ +static int buspirate_initialize(const PROGRAMMER *pgm, const AVRPART *p) { pgm->powerup(pgm); return pgm->program_enable(pgm, p); } -static void buspirate_powerup(struct programmer_t *pgm) -{ - if (pgm->flag & BP_FLAG_IN_BINMODE) { +static void buspirate_powerup(const PROGRAMMER *pgm) { + if (PDATA(pgm)->flag & BP_FLAG_IN_BINMODE) { /* Powerup in BinMode is handled in binary mode init */ return; } else { if (buspirate_expect(pgm, "W\n", "POWER SUPPLIES ON", 1)) { - if (pgm->flag & BP_FLAG_XPARM_CPUFREQ) { + if (PDATA(pgm)->flag & BP_FLAG_XPARM_CPUFREQ) { char buf[25]; int ok = 0; snprintf(buf, sizeof(buf), "%d\n", PDATA(pgm)->cpufreq); @@ -804,36 +779,35 @@ static void buspirate_powerup(struct programmer_t *pgm) } } if(!ok) { - avrdude_message(MSG_INFO, "%s: warning: did not get a response to start PWM command.\n", progname); + pmsg_error("did not get a response to start PWM command\n"); } } return; } } - avrdude_message(MSG_INFO, "%s: warning: did not get a response to PowerUp command.\n", progname); - avrdude_message(MSG_INFO, "%s: warning: Trying to continue anyway...\n", progname); + pmsg_warning("did not get a response to PowerUp command\n"); + imsg_warning("trying to continue anyway ...\n"); } -static void buspirate_powerdown(struct programmer_t *pgm) -{ - if (pgm->flag & BP_FLAG_IN_BINMODE) { +static void buspirate_powerdown(const PROGRAMMER *pgm) { + if (PDATA(pgm)->flag & BP_FLAG_IN_BINMODE) { /* Powerdown in BinMode is handled in binary mode init */ return; } else { - if (pgm->flag & BP_FLAG_XPARM_CPUFREQ) { + if (PDATA(pgm)->flag & BP_FLAG_XPARM_CPUFREQ) { if (!buspirate_expect(pgm, "g\n", "PWM disabled", 1)) { - avrdude_message(MSG_INFO, "%s: warning: did not get a response to stop PWM command.\n", progname); + pmsg_error("did not get a response to stop PWM command\n"); } } if (buspirate_expect(pgm, "w\n", "POWER SUPPLIES OFF", 1)) return; } - avrdude_message(MSG_INFO, "%s: warning: did not get a response to PowerDown command.\n", progname); + pmsg_error("did not get a response to PowerDown command\n"); } -static int buspirate_cmd_bin(struct programmer_t *pgm, +static int buspirate_cmd_bin(const PROGRAMMER *pgm, const unsigned char *cmd, unsigned char *res) { @@ -851,7 +825,7 @@ static int buspirate_cmd_bin(struct programmer_t *pgm, return 0; } -static int buspirate_cmd_ascii(struct programmer_t *pgm, +static int buspirate_cmd_ascii(const PROGRAMMER *pgm, const unsigned char *cmd, unsigned char *res) { @@ -877,7 +851,7 @@ static int buspirate_cmd_ascii(struct programmer_t *pgm, } if (i != 4) { - avrdude_message(MSG_INFO, "%s: error: SPI has not read 4 bytes back\n", progname); + pmsg_error("SPI has not read 4 bytes back\n"); return -1; } @@ -888,34 +862,29 @@ static int buspirate_cmd_ascii(struct programmer_t *pgm, return 0; } -static int buspirate_cmd(struct programmer_t *pgm, +static int buspirate_cmd(const PROGRAMMER *pgm, const unsigned char *cmd, unsigned char *res) { - if (pgm->flag & BP_FLAG_IN_BINMODE) + if (PDATA(pgm)->flag & BP_FLAG_IN_BINMODE) return buspirate_cmd_bin(pgm, cmd, res); else return buspirate_cmd_ascii(pgm, cmd, res); } /* Paged load function which utilizes the AVR Extended Commands set */ -static int buspirate_paged_load( - PROGRAMMER *pgm, - AVRPART *p, - AVRMEM *m, - unsigned int page_size, - unsigned int address, - unsigned int n_bytes) -{ +static int buspirate_paged_load(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *m, + unsigned int page_size, unsigned int address, unsigned int n_bytes) { + unsigned char commandbuf[10]; unsigned char buf[275]; unsigned int addr = 0; - avrdude_message(MSG_NOTICE, "BusPirate: buspirate_paged_load(..,%s,%d,%d,%d)\n",m->desc,m->page_size,address,n_bytes); + msg_notice("buspirate_paged_load(..,%s,%d,%d,%d)\n",m->desc,m->page_size,address,n_bytes); - // This should never happen, but still... - if (pgm->flag & BP_FLAG_NOPAGEDREAD) { - avrdude_message(MSG_INFO, "BusPirate: buspirate_paged_load() called while in nopagedread mode!\n"); + // This should never happen, but still ... + if (PDATA(pgm)->flag & BP_FLAG_NOPAGEDREAD) { + pmsg_error("called while in nopagedread mode\n"); return -1; } @@ -945,7 +914,7 @@ static int buspirate_paged_load( buspirate_recv_bin(pgm, buf, 1); if (buf[0] != 0x01) { - avrdude_message(MSG_INFO, "BusPirate: Paged Read command returned zero.\n"); + pmsg_error("Paged Read command returned zero\n"); return -1; } @@ -956,13 +925,9 @@ static int buspirate_paged_load( return n_bytes; } /* Paged write function which utilizes the Bus Pirate's "Write then Read" binary SPI instruction */ -static int buspirate_paged_write(struct programmer_t *pgm, - AVRPART *p, - AVRMEM *m, - unsigned int page_size, - unsigned int base_addr, - unsigned int n_data_bytes) -{ +static int buspirate_paged_write(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *m, + unsigned int page_size, unsigned int base_addr, unsigned int n_data_bytes) { + int page, i; int addr = base_addr; int n_page_writes; @@ -970,12 +935,12 @@ static int buspirate_paged_write(struct programmer_t *pgm, unsigned char cmd_buf[4096] = {'\0'}; unsigned char send_byte, recv_byte; - if (!(pgm->flag & BP_FLAG_IN_BINMODE)) { + if (!(PDATA(pgm)->flag & BP_FLAG_IN_BINMODE)) { /* Return if we are not in binary mode. */ return -1; } - if (pgm->flag & BP_FLAG_NOPAGEDWRITE) { + if (PDATA(pgm)->flag & BP_FLAG_NOPAGEDWRITE) { /* Return if we've nominated not to use paged writes. */ return -1; } @@ -992,13 +957,11 @@ static int buspirate_paged_write(struct programmer_t *pgm, /* pre-check opcodes */ if (m->op[AVR_OP_LOADPAGE_LO] == NULL) { - avrdude_message(MSG_INFO, "%s failure: %s command not defined for %s\n", - progname, "AVR_OP_LOADPAGE_LO", p->desc); + pmsg_error("AVR_OP_LOADPAGE_LO command not defined for %s\n", p->desc); return -1; } if (m->op[AVR_OP_LOADPAGE_HI] == NULL) { - avrdude_message(MSG_INFO, "%s failure: %s command not defined for %s\n", - progname, "AVR_OP_LOADPAGE_HI", p->desc); + pmsg_error("AVR_OP_LOADPAGE_HI command not defined for %s\n", p->desc); return -1; } @@ -1058,7 +1021,7 @@ static int buspirate_paged_write(struct programmer_t *pgm, /* Check for write failure: */ if ((buspirate_recv_bin(pgm, &recv_byte, 1) == EOF) || (recv_byte != 0x01)) { - avrdude_message(MSG_INFO, "BusPirate: Fatal error: Write Then Read did not succeed.\n"); + pmsg_error("write then read did not succeed\n"); pgm->pgm_led(pgm, OFF); pgm->err_led(pgm, ON); return -1; @@ -1074,12 +1037,11 @@ static int buspirate_paged_write(struct programmer_t *pgm, return n_data_bytes; } -static int buspirate_program_enable(struct programmer_t *pgm, AVRPART * p) -{ +static int buspirate_program_enable(const PROGRAMMER *pgm, const AVRPART *p) { unsigned char cmd[4]; unsigned char res[4]; - if (pgm->flag & BP_FLAG_IN_BINMODE) { + if (PDATA(pgm)->flag & BP_FLAG_IN_BINMODE) { /* Clear configured reset pin(s): CS and/or AUX and/or AUX2 */ PDATA(pgm)->current_peripherals_config &= ~PDATA(pgm)->reset; if (buspirate_expect_bin_byte(pgm, PDATA(pgm)->current_peripherals_config, 0x01) < 0) @@ -1089,8 +1051,7 @@ static int buspirate_program_enable(struct programmer_t *pgm, AVRPART * p) buspirate_expect(pgm, "{\n", "CS ENABLED", 1); if (p->op[AVR_OP_PGM_ENABLE] == NULL) { - avrdude_message(MSG_INFO, "program enable instruction not defined for part \"%s\"\n", - p->desc); + pmsg_error("program enable instruction not defined for part %s\n", p->desc); return -1; } @@ -1104,14 +1065,12 @@ static int buspirate_program_enable(struct programmer_t *pgm, AVRPART * p) return 0; } -static int buspirate_chip_erase(struct programmer_t *pgm, AVRPART * p) -{ +static int buspirate_chip_erase(const PROGRAMMER *pgm, const AVRPART *p) { unsigned char cmd[4]; unsigned char res[4]; if (p->op[AVR_OP_CHIP_ERASE] == NULL) { - avrdude_message(MSG_INFO, "chip erase instruction not defined for part \"%s\"\n", - p->desc); + pmsg_error("chip erase instruction not defined for part %s\n", p->desc); return -1; } @@ -1130,25 +1089,23 @@ static int buspirate_chip_erase(struct programmer_t *pgm, AVRPART * p) } /* Interface - management */ -static void buspirate_setup(struct programmer_t *pgm) +static void buspirate_setup(PROGRAMMER *pgm) { /* Allocate private data */ if ((pgm->cookie = calloc(1, sizeof(struct pdata))) == 0) { - avrdude_message(MSG_INFO, "%s: buspirate_initpgm(): Out of memory allocating private data\n", - progname); + pmsg_error("out of memory allocating private data\n"); exit(1); } PDATA(pgm)->serial_recv_timeout = 100; } -static void buspirate_teardown(struct programmer_t *pgm) +static void buspirate_teardown(PROGRAMMER *pgm) { free(pgm->cookie); } const char buspirate_desc[] = "Using the Bus Pirate's SPI interface for programming"; -void buspirate_initpgm(struct programmer_t *pgm) -{ +void buspirate_initpgm(PROGRAMMER *pgm) { strcpy(pgm->type, "BusPirate"); pgm->display = buspirate_dummy_6; @@ -1181,14 +1138,13 @@ void buspirate_initpgm(struct programmer_t *pgm) /* Bitbang support */ -static void buspirate_bb_enable(struct programmer_t *pgm) -{ +static void buspirate_bb_enable(PROGRAMMER *pgm, const AVRPART *p) { unsigned char buf[20] = { '\0' }; if (bitbang_check_prerequisites(pgm) < 0) return; /* XXX should treat as error */ - avrdude_message(MSG_INFO, "Attempting to initiate BusPirate bitbang binary mode...\n"); + pmsg_error("attempting to initiate BusPirate bitbang binary mode ...\n"); /* Send two CRs to ensure we're not in a sub-menu of the UI if we're in ASCII mode: */ buspirate_send_bin(pgm, (const unsigned char*)"\n\n", 2); @@ -1203,22 +1159,21 @@ static void buspirate_bb_enable(struct programmer_t *pgm) memset(buf, 0, sizeof(buf)); buspirate_recv_bin(pgm, buf, 5); if (sscanf((char*)buf, "BBIO%1d", &PDATA(pgm)->binmode_version) != 1) { - avrdude_message(MSG_INFO, "Binary mode not confirmed: '%s'\n", buf); + pmsg_error("binary mode not confirmed: '%s'\n", buf); buspirate_reset_from_binmode(pgm); return; } - avrdude_message(MSG_INFO, "BusPirate binmode version: %d\n", - PDATA(pgm)->binmode_version); + msg_info("BusPirate binmode version: %d\n", PDATA(pgm)->binmode_version); - pgm->flag |= BP_FLAG_IN_BINMODE; + PDATA(pgm)->flag |= BP_FLAG_IN_BINMODE; /* Set pin directions and an initial pin status (all high) */ - PDATA(pgm)->pin_dir = 0x12; /* AUX, MISO input; everything else output */ + PDATA(pgm)->pin_dir = 0x12; /* AUX, SDI input; everything else output */ buf[0] = PDATA(pgm)->pin_dir | 0x40; buspirate_send_bin(pgm, buf, 1); buspirate_recv_bin(pgm, buf, 1); - PDATA(pgm)->pin_val = 0x3f; /* PULLUP, AUX, MOSI, CLK, MISO, CS high */ + PDATA(pgm)->pin_val = 0x3f; /* PULLUP, AUX, SDO, CLK, SDI, CS high */ buf[0] = PDATA(pgm)->pin_val | 0x80; buspirate_send_bin(pgm, buf, 1); buspirate_recv_bin(pgm, buf, 1); @@ -1231,21 +1186,24 @@ static void buspirate_bb_enable(struct programmer_t *pgm) Direction: 010xxxxx Input (1) or output (0): - AUX|MOSI|CLK|MISO|CS + AUX|SDO|CLK|SDI|CS Output value: 1xxxxxxx High (1) or low(0): - 1|POWER|PULLUP|AUX|MOSI|CLK|MISO|CS + 1|POWER|PULLUP|AUX|SDO|CLK|SDI|CS Both respond with a byte with current status: - 0|POWER|PULLUP|AUX|MOSI|CLK|MISO|CS + 0|POWER|PULLUP|AUX|SDO|CLK|SDI|CS */ -static int buspirate_bb_getpin(struct programmer_t *pgm, int pinfunc) -{ +static int buspirate_bb_getpin(const PROGRAMMER *pgm, int pinfunc) { unsigned char buf[10]; - int value = 0; - int pin = pgm->pinno[pinfunc]; + int pin, value = 0; + + if(pinfunc < 0 || pinfunc >= N_PINS) + return -1; + + pin = pgm->pinno[pinfunc]; if (pin & PIN_INVERSE) { pin &= PIN_MASK; @@ -1272,13 +1230,12 @@ static int buspirate_bb_getpin(struct programmer_t *pgm, int pinfunc) if (buf[0] & (1 << (pin - 1))) value ^= 1; - avrdude_message(MSG_DEBUG, "get pin %d = %d\n", pin, value); + msg_debug("get pin %d = %d\n", pin, value); return value; } -static int buspirate_bb_setpin_internal(struct programmer_t *pgm, int pin, int value) -{ +static int buspirate_bb_setpin_internal(const PROGRAMMER *pgm, int pin, int value) { unsigned char buf[10]; if (pin & PIN_INVERSE) { @@ -1289,7 +1246,7 @@ static int buspirate_bb_setpin_internal(struct programmer_t *pgm, int pin, int v if ((pin < 1 || pin > 5) && (pin != 7)) // 7 is POWER return -1; - avrdude_message(MSG_DEBUG, "set pin %d = %d\n", pin, value); + msg_debug("set pin %d = %d\n", pin, value); if (value) PDATA(pgm)->pin_val |= (1 << (pin - 1)); @@ -1307,14 +1264,15 @@ static int buspirate_bb_setpin_internal(struct programmer_t *pgm, int pin, int v return 0; } -static int buspirate_bb_setpin(struct programmer_t *pgm, int pinfunc, int value) -{ +static int buspirate_bb_setpin(const PROGRAMMER *pgm, int pinfunc, int value) { + if(pinfunc < 0 || pinfunc >= N_PINS) + return -1; + return buspirate_bb_setpin_internal(pgm, pgm->pinno[pinfunc], value); } -static int buspirate_bb_highpulsepin(struct programmer_t *pgm, int pinfunc) -{ +static int buspirate_bb_highpulsepin(const PROGRAMMER *pgm, int pinfunc) { int ret; ret = buspirate_bb_setpin(pgm, pinfunc, 1); if (ret < 0) @@ -1322,20 +1280,17 @@ static int buspirate_bb_highpulsepin(struct programmer_t *pgm, int pinfunc) return buspirate_bb_setpin(pgm, pinfunc, 0); } -static void buspirate_bb_powerup(struct programmer_t *pgm) -{ +static void buspirate_bb_powerup(const PROGRAMMER *pgm) { buspirate_bb_setpin_internal(pgm, 7, 1); } -static void buspirate_bb_powerdown(struct programmer_t *pgm) -{ +static void buspirate_bb_powerdown(const PROGRAMMER *pgm) { buspirate_bb_setpin_internal(pgm, 7, 0); } const char buspirate_bb_desc[] = "Using the Bus Pirate's bitbang interface for programming"; -void buspirate_bb_initpgm(struct programmer_t *pgm) -{ +void buspirate_bb_initpgm(PROGRAMMER *pgm) { strcpy(pgm->type, "BusPirate_BB"); pgm_fill_old_pins(pgm); // TODO to be removed if old pin data no longer needed diff --git a/src/buspirate.h b/src/buspirate.h index 835334a2..12a68a1a 100644 --- a/src/buspirate.h +++ b/src/buspirate.h @@ -26,7 +26,7 @@ extern const char buspirate_desc[]; extern const char buspirate_bb_desc[]; -void buspirate_initpgm (struct programmer_t *pgm); -void buspirate_bb_initpgm (struct programmer_t *pgm); +void buspirate_initpgm(PROGRAMMER *pgm); +void buspirate_bb_initpgm(PROGRAMMER *pgm); #endif diff --git a/src/butterfly.c b/src/butterfly.c index 1d5fafdf..98894ea7 100644 --- a/src/butterfly.c +++ b/src/butterfly.c @@ -63,8 +63,7 @@ struct pdata static void butterfly_setup(PROGRAMMER * pgm) { if ((pgm->cookie = malloc(sizeof(struct pdata))) == 0) { - avrdude_message(MSG_INFO, "%s: butterfly_setup(): Out of memory allocating private data\n", - progname); + pmsg_error("out of memory allocating private data\n"); exit(1); } memset(pgm->cookie, 0, sizeof(struct pdata)); @@ -75,72 +74,62 @@ static void butterfly_teardown(PROGRAMMER * pgm) free(pgm->cookie); } -static int butterfly_send(PROGRAMMER * pgm, char * buf, size_t len) -{ +static int butterfly_send(const PROGRAMMER *pgm, char *buf, size_t len) { return serial_send(&pgm->fd, (unsigned char *)buf, len); } -static int butterfly_recv(PROGRAMMER * pgm, char * buf, size_t len) -{ +static int butterfly_recv(const PROGRAMMER *pgm, char *buf, size_t len) { int rv; rv = serial_recv(&pgm->fd, (unsigned char *)buf, len); if (rv < 0) { - avrdude_message(MSG_INFO, "%s: butterfly_recv(): programmer is not responding\n", - progname); + pmsg_error("programmer is not responding\n"); return -1; } return 0; } -static int butterfly_drain(PROGRAMMER * pgm, int display) -{ +static int butterfly_drain(const PROGRAMMER *pgm, int display) { return serial_drain(&pgm->fd, display); } -static int butterfly_vfy_cmd_sent(PROGRAMMER * pgm, char * errmsg) -{ +static int butterfly_vfy_cmd_sent(const PROGRAMMER *pgm, char *errmsg) { char c; butterfly_recv(pgm, &c, 1); if (c != '\r') { - avrdude_message(MSG_INFO, "%s: error: programmer did not respond to command: %s\n", - progname, errmsg); + pmsg_error("programmer did not respond to command: %s\n", errmsg); return -1; } return 0; } -static int butterfly_rdy_led(PROGRAMMER * pgm, int value) -{ +static int butterfly_rdy_led(const PROGRAMMER *pgm, int value) { /* Do nothing. */ return 0; } -static int butterfly_err_led(PROGRAMMER * pgm, int value) -{ +static int butterfly_err_led(const PROGRAMMER *pgm, int value) { /* Do nothing. */ return 0; } -static int butterfly_pgm_led(PROGRAMMER * pgm, int value) -{ +static int butterfly_pgm_led(const PROGRAMMER *pgm, int value) { /* Do nothing. */ return 0; } -static int butterfly_vfy_led(PROGRAMMER * pgm, int value) -{ +static int butterfly_vfy_led(const PROGRAMMER *pgm, int value) { /* Do nothing. */ return 0; @@ -150,8 +139,7 @@ static int butterfly_vfy_led(PROGRAMMER * pgm, int value) /* * issue the 'chip erase' command to the butterfly board */ -static int butterfly_chip_erase(PROGRAMMER * pgm, AVRPART * p) -{ +static int butterfly_chip_erase(const PROGRAMMER *pgm, const AVRPART *p) { butterfly_send(pgm, "e", 1); if (butterfly_vfy_cmd_sent(pgm, "chip erase") < 0) return -1; @@ -160,15 +148,13 @@ static int butterfly_chip_erase(PROGRAMMER * pgm, AVRPART * p) } -static void butterfly_enter_prog_mode(PROGRAMMER * pgm) -{ +static void butterfly_enter_prog_mode(const PROGRAMMER *pgm) { butterfly_send(pgm, "P", 1); butterfly_vfy_cmd_sent(pgm, "enter prog mode"); } -static void butterfly_leave_prog_mode(PROGRAMMER * pgm) -{ +static void butterfly_leave_prog_mode(const PROGRAMMER *pgm) { butterfly_send(pgm, "L", 1); butterfly_vfy_cmd_sent(pgm, "leave prog mode"); } @@ -177,8 +163,7 @@ static void butterfly_leave_prog_mode(PROGRAMMER * pgm) /* * issue the 'program enable' command to the AVR device */ -static int butterfly_program_enable(PROGRAMMER * pgm, AVRPART * p) -{ +static int butterfly_program_enable(const PROGRAMMER *pgm, const AVRPART *p) { return -1; } @@ -186,8 +171,7 @@ static int butterfly_program_enable(PROGRAMMER * pgm, AVRPART * p) /* * apply power to the AVR processor */ -static void butterfly_powerup(PROGRAMMER * pgm) -{ +static void butterfly_powerup(const PROGRAMMER *pgm) { /* Do nothing. */ return; @@ -197,8 +181,7 @@ static void butterfly_powerup(PROGRAMMER * pgm) /* * remove power from the AVR processor */ -static void butterfly_powerdown(PROGRAMMER * pgm) -{ +static void butterfly_powerdown(const PROGRAMMER *pgm) { /* Do nothing. */ return; @@ -209,8 +192,7 @@ static void butterfly_powerdown(PROGRAMMER * pgm) /* * initialize the AVR device and prepare it to accept commands */ -static int butterfly_initialize(PROGRAMMER * pgm, AVRPART * p) -{ +static int butterfly_initialize(const PROGRAMMER *pgm, const AVRPART *p) { char id[8]; char sw[2]; char hw[2]; @@ -222,13 +204,13 @@ static int butterfly_initialize(PROGRAMMER * pgm, AVRPART * p) * Send some ESC to activate butterfly bootloader. This is not needed * for plain avr109 bootloaders but does not harm there either. */ - avrdude_message(MSG_INFO, "Connecting to programmer: "); + msg_notice("connecting to programmer: "); if (pgm->flag & IS_BUTTERFLY_MK) { char mk_reset_cmd[6] = {"#aR@S\r"}; unsigned char mk_timeout = 0; - putc('.', stderr); + msg_notice("."); butterfly_send(pgm, mk_reset_cmd, sizeof(mk_reset_cmd)); usleep(20000); @@ -240,13 +222,15 @@ static int butterfly_initialize(PROGRAMMER * pgm, AVRPART * p) c = 0xaa; usleep(80000); butterfly_send(pgm, &c, 1); - if (mk_timeout % 10 == 0) putc('.', stderr); + if (mk_timeout % 10 == 0) + msg_notice("."); } while (mk_timeout++ < 10); butterfly_recv(pgm, &c, 1); if ( c != 'M' && c != '?') { - avrdude_message(MSG_INFO, "\nConnection FAILED."); + msg_error("\n"); + pmsg_error("connection failed"); return -1; } else @@ -257,13 +241,13 @@ static int butterfly_initialize(PROGRAMMER * pgm, AVRPART * p) else { do { - putc('.', stderr); + msg_notice("."); butterfly_send(pgm, "\033", 1); butterfly_drain(pgm, 0); butterfly_send(pgm, "S", 1); butterfly_recv(pgm, &c, 1); if (c != '?') { - putc('\n', stderr); + msg_notice("\n"); /* * Got a useful response, continue getting the programmer * identifier. Programmer returns exactly 7 chars _without_ @@ -293,12 +277,12 @@ static int butterfly_initialize(PROGRAMMER * pgm, AVRPART * p) butterfly_send(pgm, "p", 1); butterfly_recv(pgm, &type, 1); - avrdude_message(MSG_INFO, "Found programmer: Id = \"%s\"; type = %c\n", id, type); - avrdude_message(MSG_INFO, " Software Version = %c.%c; ", sw[0], sw[1]); + msg_notice("Programmer id = %s; type = %c\n", id, type); + msg_notice("Software version = %c.%c; ", sw[0], sw[1]); if (hw[0]=='?') { - avrdude_message(MSG_INFO, "No Hardware Version given.\n"); + msg_notice("no hardware version given\n"); } else { - avrdude_message(MSG_INFO, "Hardware Version = %c.%c\n", hw[0], hw[1]); + msg_notice("Hardware version = %c.%c\n", hw[0], hw[1]); }; /* See if programmer supports autoincrement of address. */ @@ -306,28 +290,28 @@ static int butterfly_initialize(PROGRAMMER * pgm, AVRPART * p) butterfly_send(pgm, "a", 1); butterfly_recv(pgm, &PDATA(pgm)->has_auto_incr_addr, 1); if (PDATA(pgm)->has_auto_incr_addr == 'Y') - avrdude_message(MSG_INFO, "Programmer supports auto addr increment.\n"); + msg_notice("programmer supports auto addr increment\n"); /* Check support for buffered memory access, abort if not available */ butterfly_send(pgm, "b", 1); butterfly_recv(pgm, &c, 1); if (c != 'Y') { - avrdude_message(MSG_INFO, "%s: error: buffered memory access not supported. Maybe it isn't\n"\ - "a butterfly/AVR109 but a AVR910 device?\n", progname); + pmsg_notice("buffered memory access not supported; maybe it isn't\n"\ + "a butterfly/AVR109 but a AVR910 device?\n"); return -1; }; butterfly_recv(pgm, &c, 1); PDATA(pgm)->buffersize = (unsigned int)(unsigned char)c<<8; butterfly_recv(pgm, &c, 1); PDATA(pgm)->buffersize += (unsigned int)(unsigned char)c; - avrdude_message(MSG_INFO, "Programmer supports buffered memory access with buffersize=%i bytes.\n", + msg_notice("programmer supports buffered memory access with buffersize=%i bytes\n", PDATA(pgm)->buffersize); /* Get list of devices that the programmer supports. */ butterfly_send(pgm, "t", 1); - avrdude_message(MSG_INFO, "\nProgrammer supports the following devices:\n"); + msg_notice2("\nProgrammer supports the following devices:\n"); devtype_1st = 0; while (1) { butterfly_recv(pgm, &c, 1); @@ -336,9 +320,9 @@ static int butterfly_initialize(PROGRAMMER * pgm, AVRPART * p) if (c == 0) break; - avrdude_message(MSG_INFO, " Device code: 0x%02x\n", (unsigned int)(unsigned char)c); + msg_notice2(" Device code: 0x%02x\n", (unsigned int) (unsigned char) c); }; - avrdude_message(MSG_INFO, "\n"); + msg_notice2("\n"); /* Tell the programmer which part we selected. According to the AVR109 code, this is ignored by the bootloader. As @@ -355,9 +339,7 @@ static int butterfly_initialize(PROGRAMMER * pgm, AVRPART * p) if (butterfly_vfy_cmd_sent(pgm, "select device") < 0) return -1; - if (verbose) - avrdude_message(MSG_INFO, "%s: devcode selected: 0x%02x\n", - progname, (unsigned)buf[1]); + pmsg_notice("devcode selected: 0x%02x\n", (unsigned) buf[1]); butterfly_enter_prog_mode(pgm); butterfly_drain(pgm, 0); @@ -367,22 +349,19 @@ static int butterfly_initialize(PROGRAMMER * pgm, AVRPART * p) -static void butterfly_disable(PROGRAMMER * pgm) -{ +static void butterfly_disable(const PROGRAMMER *pgm) { butterfly_leave_prog_mode(pgm); return; } -static void butterfly_enable(PROGRAMMER * pgm) -{ +static void butterfly_enable(PROGRAMMER *pgm, const AVRPART *p) { return; } -static int butterfly_open(PROGRAMMER * pgm, char * port) -{ +static int butterfly_open(PROGRAMMER *pgm, const char *port) { union pinfo pinfo; strcpy(pgm->port, port); /* @@ -417,27 +396,36 @@ static void butterfly_close(PROGRAMMER * pgm) } -static void butterfly_display(PROGRAMMER * pgm, const char * p) -{ +static void butterfly_display(const PROGRAMMER *pgm, const char *p) { return; } -static void butterfly_set_addr(PROGRAMMER * pgm, unsigned long addr) -{ - char cmd[3]; +static void butterfly_set_addr(const PROGRAMMER *pgm, unsigned long addr) { + if( addr < 0x10000 ) { + char cmd[3]; - cmd[0] = 'A'; - cmd[1] = (addr >> 8) & 0xff; - cmd[2] = addr & 0xff; + cmd[0] = 'A'; + cmd[1] = (addr >> 8) & 0xff; + cmd[2] = addr & 0xff; - butterfly_send(pgm, cmd, sizeof(cmd)); - butterfly_vfy_cmd_sent(pgm, "set addr"); + butterfly_send(pgm, cmd, sizeof(cmd)); + butterfly_vfy_cmd_sent(pgm, "set addr"); + } else { + char cmd[4]; + + cmd[0] = 'H'; + cmd[1] = (addr >> 16) & 0xff; + cmd[2] = (addr >> 8) & 0xff; + cmd[3] = addr & 0xff; + + butterfly_send(pgm, cmd, sizeof(cmd)); + butterfly_vfy_cmd_sent(pgm, "set extaddr"); + } } -static void butterfly_set_extaddr(PROGRAMMER * pgm, unsigned long addr) -{ +static void butterfly_set_extaddr(const PROGRAMMER *pgm, unsigned long addr) { char cmd[4]; cmd[0] = 'H'; @@ -451,7 +439,7 @@ static void butterfly_set_extaddr(PROGRAMMER * pgm, unsigned long addr) -static int butterfly_write_byte(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m, +static int butterfly_write_byte(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *m, unsigned long addr, unsigned char value) { char cmd[6]; @@ -495,7 +483,7 @@ static int butterfly_write_byte(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m, } -static int butterfly_read_byte_flash(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m, +static int butterfly_read_byte_flash(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *m, unsigned long addr, unsigned char * value) { static int cached = 0; @@ -515,9 +503,13 @@ static int butterfly_read_byte_flash(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m, } else { butterfly_set_addr(pgm, addr >> 1); } - - butterfly_send(pgm, "g\000\002F", 4); - + // Defaults to flash read ('F') + char msg[4] = {'g', 0x00, 0x02, 'F'}; + if (strcmp(m->desc, "prodsig") == 0) + msg[3] = 'P'; + else if (strcmp(m->desc, "usersig") == 0) + msg[3] = 'U'; + butterfly_send(pgm, msg, 4); /* Read back the program mem word (MSB first) */ butterfly_recv(pgm, buf, sizeof(buf)); @@ -536,7 +528,7 @@ static int butterfly_read_byte_flash(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m, } -static int butterfly_read_byte_eeprom(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m, +static int butterfly_read_byte_eeprom(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *m, unsigned long addr, unsigned char * value) { butterfly_set_addr(pgm, addr); @@ -545,23 +537,14 @@ static int butterfly_read_byte_eeprom(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m, return 0; } -static int butterfly_page_erase(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m, unsigned int addr) -{ - if (strcmp(m->desc, "flash") == 0) - return -1; /* not supported */ - if (strcmp(m->desc, "eeprom") == 0) - return 0; /* nothing to do */ - avrdude_message(MSG_INFO, "%s: butterfly_page_erase() called on memory type \"%s\"\n", - progname, m->desc); - return -1; -} - -static int butterfly_read_byte(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m, +static int butterfly_read_byte(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *m, unsigned long addr, unsigned char * value) { char cmd; - if (strcmp(m->desc, "flash") == 0) { + if (strcmp(m->desc, "flash") == 0 || + strcmp(m->desc, "prodsig") == 0 || + strcmp(m->desc, "usersig") == 0) { return butterfly_read_byte_flash(pgm, p, m, addr, value); } @@ -592,7 +575,7 @@ static int butterfly_read_byte(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m, -static int butterfly_paged_write(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m, +static int butterfly_paged_write(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *m, unsigned int page_size, unsigned int addr, unsigned int n_bytes) { @@ -602,7 +585,9 @@ static int butterfly_paged_write(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m, int use_ext_addr = m->op[AVR_OP_LOAD_EXT_ADDR] != NULL; unsigned int wr_size = 2; - if (strcmp(m->desc, "flash") && strcmp(m->desc, "eeprom")) + if (strcmp(m->desc, "flash") && + strcmp(m->desc, "eeprom") && + strcmp(m->desc, "usersig")) return -2; if (m->desc[0] == 'e') @@ -647,7 +632,7 @@ static int butterfly_paged_write(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m, -static int butterfly_paged_load(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m, +static int butterfly_paged_load(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *m, unsigned int page_size, unsigned int addr, unsigned int n_bytes) { @@ -656,8 +641,10 @@ static int butterfly_paged_load(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m, int blocksize = PDATA(pgm)->buffersize; int use_ext_addr = m->op[AVR_OP_LOAD_EXT_ADDR] != NULL; - /* check parameter syntax: only "flash" or "eeprom" is allowed */ - if (strcmp(m->desc, "flash") && strcmp(m->desc, "eeprom")) + /* check parameter syntax: only "flash", "eeprom" or "usersig" is allowed */ + if (strcmp(m->desc, "flash") && + strcmp(m->desc, "eeprom") && + strcmp(m->desc, "usersig")) return -2; if (m->desc[0] == 'e') @@ -693,12 +680,11 @@ static int butterfly_paged_load(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m, /* Signature byte reads are always 3 bytes. */ -static int butterfly_read_sig_bytes(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m) -{ +static int butterfly_read_sig_bytes(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *m) { unsigned char tmp; if (m->size < 3) { - avrdude_message(MSG_INFO, "%s: memsize too small for sig byte read", progname); + pmsg_error("memsize too small for sig byte read"); return -1; } @@ -714,8 +700,7 @@ static int butterfly_read_sig_bytes(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m) const char butterfly_desc[] = "Atmel Butterfly evaluation board; Atmel AppNotes AVR109, AVR911"; -void butterfly_initpgm(PROGRAMMER * pgm) -{ +void butterfly_initpgm(PROGRAMMER *pgm) { strcpy(pgm->type, "butterfly"); /* @@ -742,7 +727,6 @@ void butterfly_initpgm(PROGRAMMER * pgm) * optional functions */ - pgm->page_erase = butterfly_page_erase; pgm->paged_write = butterfly_paged_write; pgm->paged_load = butterfly_paged_load; @@ -755,8 +739,7 @@ void butterfly_initpgm(PROGRAMMER * pgm) const char butterfly_mk_desc[] = "Mikrokopter.de Butterfly"; -void butterfly_mk_initpgm(PROGRAMMER * pgm) -{ +void butterfly_mk_initpgm(PROGRAMMER *pgm) { butterfly_initpgm(pgm); strcpy(pgm->type, "butterfly_mk"); pgm->flag = IS_BUTTERFLY_MK; diff --git a/src/butterfly.h b/src/butterfly.h index 6f6a54c8..2d4bfa64 100644 --- a/src/butterfly.h +++ b/src/butterfly.h @@ -27,8 +27,8 @@ extern "C" { extern const char butterfly_desc[]; extern const char butterfly_mk_desc[]; -void butterfly_initpgm (PROGRAMMER * pgm); -void butterfly_mk_initpgm (PROGRAMMER * pgm); +void butterfly_initpgm(PROGRAMMER *pgm); +void butterfly_mk_initpgm(PROGRAMMER *pgm); #ifdef __cplusplus } diff --git a/src/config.c b/src/config.c index 3d8a760e..9f5d9122 100644 --- a/src/config.c +++ b/src/config.c @@ -24,36 +24,65 @@ #include #include #include +#include #include +#include #include "avrdude.h" #include "libavrdude.h" #include "config.h" +#include "avrintel.h" #include "config_gram.h" -char default_programmer[MAX_STR_CONST]; -char default_parallel[PATH_MAX]; -char default_serial[PATH_MAX]; +const char *default_programmer; +const char *default_parallel; +const char *default_serial; +const char *default_spi; double default_bitclock; -char string_buf[MAX_STR_CONST]; -char *string_buf_ptr; - LISTID string_list; LISTID number_list; PROGRAMMER * current_prog; AVRPART * current_part; AVRMEM * current_mem; +int current_strct; LISTID part_list; LISTID programmers; bool is_alias; -int lineno; -const char * infile; +int cfg_lineno; +char * cfg_infile; extern char * yytext; +#define pgm_comp_desc(x, type) { #x, COMP_PROGRAMMER, offsetof(PROGRAMMER, x), sizeof(((PROGRAMMER *) NULL)->x), type } +#define part_comp_desc(x, type) { #x, COMP_AVRPART, offsetof(AVRPART, x), sizeof(((AVRPART *) NULL)->x), type } +#define mem_comp_desc(x, type) { #x, COMP_AVRMEM, offsetof(AVRMEM, x), sizeof(((AVRMEM *) NULL)->x), type } + +// Component description for config_gram.y, will be sorted appropriately on first use +Component_t avr_comp[] = { + // PROGRAMMER + pgm_comp_desc(prog_modes, COMP_INT), + + // AVRPART + part_comp_desc(prog_modes, COMP_INT), + part_comp_desc(mcuid, COMP_INT), + part_comp_desc(n_interrupts, COMP_INT), + part_comp_desc(n_page_erase, COMP_INT), + part_comp_desc(n_boot_sections, COMP_INT), + part_comp_desc(boot_section_size, COMP_INT), + part_comp_desc(autobaud_sync, COMP_CHAR), + part_comp_desc(idr, COMP_CHAR), + part_comp_desc(rampz, COMP_CHAR), + part_comp_desc(spmcr, COMP_CHAR), + part_comp_desc(eecr, COMP_CHAR), + part_comp_desc(eind, COMP_CHAR), + + // AVRMEM + mem_comp_desc(n_word_writes, COMP_INT), +}; + #define DEBUG 0 void cleanup_config(void) @@ -75,12 +104,42 @@ int init_config(void) programmers = lcreat(NULL, 0); is_alias = false; - lineno = 1; - infile = NULL; + cfg_lineno = 1; + cfg_infile = NULL; return 0; } +void *cfg_malloc(const char *funcname, size_t n) { + void *ret = malloc(n); + if(!ret) { + pmsg_error("out of memory in %s (needed %lu bytes)\n", funcname, (unsigned long) n); + exit(1); + } + memset(ret, 0, n); + return ret; +} + +void *cfg_realloc(const char *funcname, void *p, size_t n) { + void *ret; + + if(!(ret = p? realloc(p, n): calloc(1, n))) { + pmsg_error("out of memory in %s (needed %lu bytes)\n", funcname, (unsigned long) n); + exit(1); + } + + return ret; +} + + +char *cfg_strdup(const char *funcname, const char *s) { + char *ret = strdup(s); + if(!ret) { + pmsg_error("out of memory in %s\n", funcname); + exit(1); + } + return ret; +} int yywrap() @@ -98,7 +157,7 @@ int yyerror(char * errmsg, ...) va_start(args, errmsg); vsnprintf(message, sizeof(message), errmsg, args); - avrdude_message(MSG_INFO, "%s: error at %s:%d: %s\n", progname, infile, lineno, message); + pmsg_error("%s [%s:%d]\n", message, cfg_infile, cfg_lineno); va_end(args); @@ -115,7 +174,7 @@ int yywarning(char * errmsg, ...) va_start(args, errmsg); vsnprintf(message, sizeof(message), errmsg, args); - avrdude_message(MSG_INFO, "%s: warning at %s:%d: %s\n", progname, infile, lineno, message); + pmsg_warning("%s [%s:%d]\n", message, cfg_infile, cfg_lineno); va_end(args); @@ -123,20 +182,9 @@ int yywarning(char * errmsg, ...) } -TOKEN * new_token(int primary) -{ - TOKEN * tkn; - - tkn = (TOKEN *)malloc(sizeof(TOKEN)); - if (tkn == NULL) { - yyerror("new_token(): out of memory"); - return NULL; - } - - memset(tkn, 0, sizeof(TOKEN)); - +TOKEN * new_token(int primary) { + TOKEN * tkn = (TOKEN *) cfg_malloc("new_token()", sizeof(TOKEN)); tkn->primary = primary; - return tkn; } @@ -172,100 +220,98 @@ void free_tokens(int n, ...) -TOKEN * number(char * text) -{ - struct token_t * tkn; - - tkn = new_token(TKN_NUMBER); - if (tkn == NULL) { - return NULL; /* yyerror already called */ - } +TOKEN *new_number(const char *text) { + struct token_t *tkn = new_token(TKN_NUMBER); tkn->value.type = V_NUM; tkn->value.number = atoi(text); #if DEBUG - avrdude_message(MSG_INFO, "NUMBER(%d)\n", tkn->value.number); + msg_info("NUMBER(%d)\n", tkn->value.number); #endif return tkn; } -TOKEN * number_real(char * text) -{ - struct token_t * tkn; - - tkn = new_token(TKN_NUMBER); +TOKEN *new_number_real(const char *text) { + struct token_t * tkn = new_token(TKN_NUMBER); tkn->value.type = V_NUM_REAL; tkn->value.number_real = atof(text); #if DEBUG - avrdude_message(MSG_INFO, "NUMBER(%g)\n", tkn->value.number_real); + msg_info("NUMBER(%g)\n", tkn->value.number_real); #endif return tkn; } -TOKEN * hexnumber(char * text) -{ - struct token_t * tkn; +TOKEN *new_hexnumber(const char *text) { + struct token_t *tkn = new_token(TKN_NUMBER); char * e; - tkn = new_token(TKN_NUMBER); - if (tkn == NULL) { - return NULL; /* yyerror already called */ - } tkn->value.type = V_NUM; tkn->value.number = strtoul(text, &e, 16); if ((e == text) || (*e != 0)) { - yyerror("can't scan hex number \"%s\"", text); + yyerror("cannot scan hex number %s", text); free_token(tkn); return NULL; } #if DEBUG - avrdude_message(MSG_INFO, "HEXNUMBER(%g)\n", tkn->value.number); + msg_info("HEXNUMBER(%d)\n", tkn->value.number); #endif return tkn; } +TOKEN *new_constant(const char *con) { + struct token_t *tkn = new_token(TKN_NUMBER); + int assigned = 1; -TOKEN * string(char * text) -{ - struct token_t * tkn; - int len; + tkn->value.type = V_NUM; + tkn->value.number = + !strcmp("PM_SPM", con)? PM_SPM: + !strcmp("PM_TPI", con)? PM_TPI: + !strcmp("PM_ISP", con)? PM_ISP: + !strcmp("PM_PDI", con)? PM_PDI: + !strcmp("PM_UPDI", con)? PM_UPDI: + !strcmp("PM_HVSP", con)? PM_HVSP: + !strcmp("PM_HVPP", con)? PM_HVPP: + !strcmp("PM_debugWIRE", con)? PM_debugWIRE: + !strcmp("PM_JTAG", con)? PM_JTAG: + !strcmp("PM_JTAGmkI", con)? PM_JTAGmkI: + !strcmp("PM_XMEGAJTAG", con)? PM_XMEGAJTAG: + !strcmp("PM_AVR32JTAG", con)? PM_AVR32JTAG: + !strcmp("PM_aWire", con)? PM_aWire: + (assigned = 0); - tkn = new_token(TKN_STRING); - if (tkn == NULL) { - return NULL; /* yyerror already called */ - } - - len = strlen(text); - - tkn->value.type = V_STR; - tkn->value.string = (char *) malloc(len+1); - if (tkn->value.string == NULL) { - yyerror("string(): out of memory"); + if(!assigned) { + yyerror("can't identify constant %s", con); free_token(tkn); return NULL; } - strcpy(tkn->value.string, text); #if DEBUG - avrdude_message(MSG_INFO, "STRING(%s)\n", tkn->value.string); + msg_info("CONSTANT(%s=%d)\n", con, tkn->value.number); +#endif + + return tkn; +} + +TOKEN *new_string(const char *text) { + struct token_t *tkn = new_token(TKN_STRING); + tkn->value.type = V_STR; + tkn->value.string = cfg_strdup("new_string()", text); + +#if DEBUG + msg_info("STRING(%s)\n", tkn->value.string); #endif return tkn; } -TOKEN * keyword(int primary) -{ - struct token_t * tkn; - - tkn = new_token(primary); - - return tkn; +TOKEN *new_keyword(int primary) { + return new_token(primary); } @@ -274,50 +320,37 @@ void print_token(TOKEN * tkn) if (!tkn) return; - avrdude_message(MSG_INFO, "token = %d = ", tkn->primary); + msg_info("token = %d = ", tkn->primary); switch (tkn->value.type) { case V_NUM: - avrdude_message(MSG_INFO, "NUMBER, value=%d", tkn->value.number); + msg_info("NUMBER, value=%d", tkn->value.number); break; case V_NUM_REAL: - avrdude_message(MSG_INFO, "NUMBER, value=%g", tkn->value.number_real); + msg_info("NUMBER, value=%g", tkn->value.number_real); break; case V_STR: - avrdude_message(MSG_INFO, "STRING, value=%s", tkn->value.string); + msg_info("STRING, value=%s", tkn->value.string); break; default: - avrdude_message(MSG_INFO, ""); + msg_info(""); break; } - avrdude_message(MSG_INFO, "\n"); + msg_info("\n"); } void pyytext(void) { #if DEBUG - avrdude_message(MSG_INFO, "TOKEN: \"%s\"\n", yytext); + msg_info("TOKEN: %s\n", yytext); #endif } -char * dup_string(const char * str) -{ - char * s; - - s = strdup(str); - if (s == NULL) { - yyerror("dup_string(): out of memory"); - return NULL; - } - - return s; -} - #ifdef HAVE_YYLEX_DESTROY /* reset lexer and free any allocated memory */ extern int yylex_destroy(void); @@ -328,15 +361,20 @@ int read_config(const char * file) FILE * f; int r; - f = fopen(file, "r"); - if (f == NULL) { - avrdude_message(MSG_INFO, "%s: can't open config file \"%s\": %s\n", - progname, file, strerror(errno)); + if(!(cfg_infile = realpath(file, NULL))) { + pmsg_ext_error("cannot determine realpath() of config file %s: %s\n", file, strerror(errno)); return -1; } - lineno = 1; - infile = file; + f = fopen(cfg_infile, "r"); + if (f == NULL) { + pmsg_ext_error("cannot open config file %s: %s\n", cfg_infile, strerror(errno)); + free(cfg_infile); + cfg_infile = NULL; + return -1; + } + + cfg_lineno = 1; yyin = f; r = yyparse(); @@ -348,5 +386,513 @@ int read_config(const char * file) fclose(f); + if(cfg_infile) { + free(cfg_infile); + cfg_infile = NULL; + } + return r; } + + +// Adapted version of a neat empirical hash function from comp.lang.c by Daniel Bernstein +unsigned strhash(const char *str) { + unsigned c, hash = 5381, n = 0; + + while((c = (unsigned char) *str++) && n++ < 20) + hash = 33*hash ^ c; + + return hash; +} + + +static char **hstrings[1<<12]; + +// Return a copy of the argument as hashed string +const char *cache_string(const char *p) { + int h, k; + char **hs; + + if(!p) + p = "(NULL)"; + + h = strhash(p) % (sizeof hstrings/sizeof*hstrings); + if(!(hs=hstrings[h])) + hs = hstrings[h] = (char **) cfg_realloc("cache_string()", NULL, (16+1)*sizeof**hstrings); + + for(k=0; hs[k]; k++) + if(*p == *hs[k] && !strcmp(p, hs[k])) + return hs[k]; + + if(k && k%16 == 0) + hstrings[h] = (char **) cfg_realloc("cache_string()", hstrings[h], (k+16+1)*sizeof**hstrings); + + hstrings[h][k+1]=NULL; + + return hstrings[h][k] = cfg_strdup("cache_string()", p); +} + + +static LISTID cfg_comms; // A chain of comment lines +static LISTID cfg_prologue; // Comment lines at start of avrdude.conf +static char *lkw; // Last seen keyword +static int lkw_lineno; // Line number of that + +static LISTID cfg_strctcomms; // Passed on to config_gram.y +static LISTID cfg_pushedcomms; // Temporarily pushed main comments +static int cfg_pushed; // ... for memory sections + +COMMENT *locate_comment(const LISTID comments, const char *where, int rhs) { + if(comments) + for(LNODEID ln=lfirst(comments); ln; ln=lnext(ln)) { + COMMENT *n = ldata(ln); + if(n && rhs == n->rhs && n->kw && strcmp(where, n->kw) == 0) + return n; + } + + return NULL; +} + +static void addcomment(int rhs) { + if(lkw) { + COMMENT *node = cfg_malloc("addcomment()", sizeof(*node)); + node->rhs = rhs; + node->kw = cfg_strdup("addcomment()", lkw); + node->comms = cfg_comms; + cfg_comms = NULL; + if(!cfg_strctcomms) + cfg_strctcomms = lcreat(NULL, 0); + ladd(cfg_strctcomms, node); + } +} + +// Capture prologue during parsing (triggered by lexer.l) +void cfg_capture_prologue(void) { + cfg_prologue = cfg_comms; + cfg_comms = NULL; +} + +LISTID cfg_get_prologue(void) { + return cfg_prologue; +} + +// Captures comments during parsing +void capture_comment_str(const char *com, int lineno) { + if(!cfg_comms) + cfg_comms = lcreat(NULL, 0); + ladd(cfg_comms, cfg_strdup("capture_comment_str()", com)); + + // Last keyword lineno is the same as this comment's + if(lkw && lkw_lineno == lineno) + addcomment(1); // Register comms to show right of lkw = ...; +} + +// Capture assignments (keywords left of =) and associate comments to them +void capture_lvalue_kw(const char *kw, int lineno) { + if(!strcmp(kw, "memory")) { // Push part comments and start memory comments + if(!cfg_pushed) { // config_gram.y pops the part comments + cfg_pushed = 1; + cfg_pushedcomms = cfg_strctcomms; + cfg_strctcomms = NULL; + } + } + + if(!strcmp(kw, "programmer") || !strcmp(kw, "part") || !strcmp(kw, "memory")) + kw = "*"; // Show comment before programmer/part/memory + + if(lkw) + free(lkw); + lkw = cfg_strdup("capture_lvalue_kw()", kw); + lkw_lineno = lineno; + if(cfg_comms) // Accrued list of # one-line comments + addcomment(0); // Register comment to appear before lkw assignment +} + +// config_gram.y calls this once for each programmer/part/memory structure +LISTID cfg_move_comments(void) { + capture_lvalue_kw(";", -1); + + LISTID ret = cfg_strctcomms; + cfg_strctcomms = NULL; + return ret; +} + +// config_gram.y calls this after ingressing the memory structure +void cfg_pop_comms(void) { + if(cfg_pushed) { + cfg_pushed = 0; + cfg_strctcomms = cfg_pushedcomms; + } +} + +// Convert the next n hex digits of s to a hex number +static unsigned int tohex(const unsigned char *s, unsigned int n) { + int ret, c; + + ret = 0; + while(n--) { + ret *= 16; + c = *s++; + ret += c >= '0' && c <= '9'? c - '0': c >= 'a' && c <= 'f'? c - 'a' + 10: c - 'A' + 10; + } + + return ret; +} + +/* + * Create a utf-8 character sequence from a single unicode character. + * Permissive for some invalid unicode sequences but not for those with + * high bit set). Returns numbers of characters written (0-6). + */ +static int wc_to_utf8str(unsigned int wc, unsigned char *str) { + if(!(wc & ~0x7fu)) { + *str = (char) wc; + return 1; + } + if(!(wc & ~0x7ffu)) { + *str++ = (char) ((wc >> 6) | 0xc0); + *str++ = (char) ((wc & 0x3f) | 0x80); + return 2; + } + if(!(wc & ~0xffffu)) { + *str++ = (char) ((wc >> 12) | 0xe0); + *str++ = (char) (((wc >> 6) & 0x3f) | 0x80); + *str++ = (char) ((wc & 0x3f) | 0x80); + return 3; + } + if(!(wc & ~0x1fffffu)) { + *str++ = (char) ((wc >> 18) | 0xf0); + *str++ = (char) (((wc >> 12) & 0x3f) | 0x80); + *str++ = (char) (((wc >> 6) & 0x3f) | 0x80); + *str++ = (char) ((wc & 0x3f) | 0x80); + return 4; + } + if(!(wc & ~0x3ffffffu)) { + *str++ = (char) ((wc >> 24) | 0xf8); + *str++ = (char) (((wc >> 18) & 0x3f) | 0x80); + *str++ = (char) (((wc >> 12) & 0x3f) | 0x80); + *str++ = (char) (((wc >> 6) & 0x3f) | 0x80); + *str++ = (char) ((wc & 0x3f) | 0x80); + return 5; + } + if(!(wc & ~0x7fffffffu)) { + *str++ = (char) ((wc >> 30) | 0xfc); + *str++ = (char) (((wc >> 24) & 0x3f) | 0x80); + *str++ = (char) (((wc >> 18) & 0x3f) | 0x80); + *str++ = (char) (((wc >> 12) & 0x3f) | 0x80); + *str++ = (char) (((wc >> 6) & 0x3f) | 0x80); + *str++ = (char) ((wc & 0x3f) | 0x80); + return 6; + } + return 0; +} + +// Unescape C-style strings, destination d must hold enough space (and can be source s) +unsigned char *cfg_unescapeu(unsigned char *d, const unsigned char *s) { + unsigned char *ret = d; + int n, k; + + while(*s) { + switch (*s) { + case '\\': + switch (*++s) { + case '\n': // String continuation over new line +#if '\n' != '\r' + case '\r': +#endif + --d; + break; + case 'n': + *d = '\n'; + break; + case 't': + *d = '\t'; + break; + case 'a': + *d = '\a'; + break; + case 'b': + *d = '\b'; + break; + case 'e': // Non-standard ESC + *d = 27; + break; + case 'f': + *d = '\f'; + break; + case 'r': + *d = '\r'; + break; + case 'v': + *d = '\v'; + break; + case '?': + *d = '?'; + break; + case '`': + *d = '`'; + break; + case '"': + *d = '"'; + break; + case '\'': + *d = '\''; + break; + case '\\': + *d = '\\'; + break; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': // 1-3 octal digits + n = *s - '0'; + for(k = 0; k < 2 && s[1] >= '0' && s[1] <= '7'; k++) // Max 2 more octal characters + n *= 8, n += s[1] - '0', s++; + *d = n; + break; + case 'x': // Unlimited hex digits + for(k = 0; isxdigit(s[k + 1]); k++) + continue; + if(k > 0) { + *d = tohex(s + 1, k); + s += k; + } else { // No hex digits after \x? copy \x + *d++ = '\\'; + *d = 'x'; + } + break; + case 'u': // Exactly 4 hex digits and valid unicode + if(isxdigit(s[1]) && isxdigit(s[2]) && isxdigit(s[3]) && isxdigit(s[4]) && + (n = wc_to_utf8str(tohex(s+1, 4), d))) { + d += n - 1; + s += 4; + } else { // Invalid \u sequence? copy \u + *d++ = '\\'; + *d = 'u'; + } + break; + case 'U': // Exactly 6 hex digits and valid unicode + if(isxdigit(s[1]) && isxdigit(s[2]) && isxdigit(s[3]) && isxdigit(s[4]) && isxdigit(s[5]) && isxdigit(s[6]) && + (n = wc_to_utf8str(tohex(s+1, 6), d))) { + d += n - 1; + s += 6; + } else { // Invalid \U sequence? copy \U + *d++ = '\\'; + *d = 'U'; + } + break; + default: // Keep the escape sequence (C would warn and remove \) + *d++ = '\\'; + *d = *s; + } + break; + + default: // Not an escape sequence: just copy the character + *d = *s; + } + d++; + s++; + } + *d = *s; // Terminate + + return ret; +} + +// Unescape C-style strings, destination d must hold enough space (and can be source s) +char *cfg_unescape(char *d, const char *s) { + return (char *) cfg_unescapeu((unsigned char *) d, (const unsigned char *) s); +} + +// Return an escaped string that looks like a C-style input string incl quotes, memory is malloc'd +char *cfg_escape(const char *s) { + char buf[50*1024], *d = buf; + + *d++ = '"'; + for(; *s && d-buf < (long) sizeof buf-7; s++) { + switch(*s) { + case '\n': + *d++ = '\\'; *d++ = 'n'; + break; + case '\t': + *d++ = '\\'; *d++ = 't'; + break; + case '\a': + *d++ = '\\'; *d++ = 'a'; + break; + case '\b': + *d++ = '\\'; *d++ = 'b'; + break; + case '\f': + *d++ = '\\'; *d++ = 'f'; + break; +#if '\r' != '\n' + case '\r': + *d++ = '\\'; *d++ = 'r'; + break; +#endif + case '\v': + *d++ = '\\'; *d++ = 'v'; + break; + case '\"': + *d++ = '\\'; *d++ = '\"'; + break; + default: + if(*s == 0x7f || (*s >= 0 && *s < 32)) { + sprintf(d, "\\%03o", *s); + d += strlen(d); + } else + *d++ = *s; + } + } + *d++ = '"'; + *d = 0; + + return cfg_strdup("cfg_escape()", buf); +} + + +static int cmp_comp(const void *v1, const void *v2) { + const Component_t *c1 = v1, *c2 = v2; + int ret = strcmp(c1->name, c2->name); + + return ret? ret: c1->strct - c2->strct; +} + +Component_t *cfg_comp_search(const char *name, int strct) { + static int init; + Component_t key; + + if(!init++) + qsort(avr_comp, sizeof avr_comp/sizeof*avr_comp, sizeof(Component_t), cmp_comp); + + + key.name = name; + key.strct = strct; + return bsearch(&key, avr_comp, sizeof avr_comp/sizeof*avr_comp, sizeof(Component_t), cmp_comp); +} + + +const char *cfg_strct_name(int strct) { + switch(strct) { + case COMP_CONFIG_MAIN: return "avrdude.conf main"; + case COMP_AVRPART: return "AVRPART"; + case COMP_AVRMEM: return "AVRMEM"; + case COMP_PROGRAMMER: return "PROGRAMMER"; + } + return "unknown struct"; +} + +const char *cfg_v_type(int type) { + switch(type) { + case V_NONE: return "void"; + case V_NUM: return "number"; + case V_NUM_REAL: return "real"; + case V_STR: return "string"; + case V_COMPONENT: return "component"; + } + return "unknown v type"; +} + +const char *cfg_comp_type(int type) { + switch(type) { + case COMP_INT: return "number"; + case COMP_SHORT: return "short"; + case COMP_CHAR: return "char"; + case COMP_STRING: return "string"; + case COMP_CHAR_ARRAY: return "byte array"; + case COMP_INT_LISTID: return "number list"; + case COMP_STRING_LISTID: return "string list"; + case COMP_OPCODE: return "opcode"; + case COMP_PIN: return "pin"; + case COMP_PIN_LIST: return "pin list"; + } + return "unknown comp type"; +} + + +// Used by config_gram.y to assign a component in one of the relevant structures with a value +void cfg_assign(char *sp, int strct, Component_t *cp, VALUE *v) { + const char *str; + int num; + + switch(cp->type) { + case COMP_CHAR: + case COMP_SHORT: + case COMP_INT: + if(v->type != V_NUM) { + yywarning("%s in %s expects a %s but is assigned a %s", + cp->name, cfg_strct_name(strct), cfg_comp_type(cp->type), cfg_v_type(v->type)); + return; + } + // TODO: consider endianess (code currently assumes little endian) + num = v->number; + memcpy(sp+cp->offset, &num, cp->size); + break; + case COMP_STRING: + if(v->type != V_STR) { + yywarning("%s in %s expects a string but is assigned a %s", + cp->name, cfg_strct_name(strct), cfg_v_type(v->type)); + return; + } + str = cache_string(v->string); + memcpy(sp+cp->offset, &str, cp->size); + break; + // TODO: implement COMP_CHAR_ARRAY, COMP_INT_LISTID, COMP_STRING_LISTID, ... + default: + yywarning("%s in %s expects a %s but that is not implemented", + cp->name, cfg_strct_name(strct), cfg_comp_type(cp->type)); + } +} + +// Automatically assign an mcuid if known from avrintel.c table +void cfg_update_mcuid(AVRPART *part) { + // Don't assign an mcuid for template parts that has a space in desc + if(!part->desc || *part->desc == 0 || strchr(part->desc, ' ')) + return; + + // Don't assign an mcuid for template parts where id starts with "." + if(!part->id || !*part->id || *part->id == '.') + return; + + // Don't assign an mcuid for 32-bit AVR parts + if(part->prog_modes & PM_aWire) + return; + + // Find an entry that shares the same name, overwrite mcuid with known, existing mcuid + for(size_t i=0; i < sizeof uP_table/sizeof *uP_table; i++) { + if(strcasecmp(part->desc, uP_table[i].name) == 0) { + if(part->mcuid != (int) uP_table[i].mcuid) { + if(part->mcuid >= 0 && verbose >= MSG_DEBUG) + yywarning("overwriting mcuid of part %s to be %d", part->desc, uP_table[i].mcuid); + part->mcuid = uP_table[i].mcuid; + } + return; + } + } + + // None have the same name: an entry with part->mcuid might be an error + for(size_t i=0; i < sizeof uP_table/sizeof *uP_table; i++) + if(part->mcuid == (int) uP_table[i].mcuid) { + // Complain unless it can be considered a variant, eg, ATmega32L and ATmega32 + AVRMEM *flash = avr_locate_mem(part, "flash"); + if(flash) { + size_t l1 = strlen(part->desc), l2 = strlen(uP_table[i].name); + if(strncasecmp(part->desc, uP_table[i].name, l1 < l2? l1: l2) || + flash->size != uP_table[i].flashsize || + flash->page_size != uP_table[i].pagesize || + part->n_interrupts != (int8_t) uP_table[i].ninterrupts) + yywarning("mcuid %d is reserved for %s, use a free number >= %d", + part->mcuid, uP_table[i].name, sizeof uP_table/sizeof *uP_table); + } + return; + } + + // Range check + if(part->mcuid < 0 || part->mcuid >= UB_N_MCU) + yywarning("mcuid %d for %s is out of range [0..%d], use a free number >= %d", + part->mcuid, part->desc, UB_N_MCU-1, sizeof uP_table/sizeof *uP_table); +} diff --git a/src/config.h b/src/config.h index 914dda54..8bacda42 100644 --- a/src/config.h +++ b/src/config.h @@ -25,17 +25,61 @@ #include "libavrdude.h" +#if defined(WIN32) || defined(_MSC_VER) || defined(__MINGW32__) +#define realpath(N,R) _fullpath((R), (N), PATH_MAX) +#endif -#define MAX_STR_CONST 1024 -enum { V_NONE, V_NUM, V_NUM_REAL, V_STR }; +typedef struct { + char *kw; // Keyword near the comments + LISTID comms; // Chained list of comments + int rhs; // Comments to print rhs of keyword line +} COMMENT; + + +enum { // Which structures a component can occur in + COMP_CONFIG_MAIN, + COMP_PROGRAMMER, + COMP_AVRPART, + COMP_AVRMEM, +}; + +enum { // Component types in structure + COMP_INT, + COMP_SHORT, + COMP_CHAR, + COMP_STRING, + COMP_CHAR_ARRAY, // This and below are not yet implemented + COMP_INT_LISTID, + COMP_STRING_LISTID, + COMP_OPCODE, + COMP_PIN, // Pins may never be implemented + COMP_PIN_LIST +}; + +typedef struct { // Description of a component in a structure + const char *name; // Component name + int strct; // Structure, eg, COMP_AVRPART + int offset, size, type; // Location, size and type within structure +} Component_t; + + +enum { // Value types for VALUE struct + V_NONE, + V_NUM, + V_NUM_REAL, + V_STR, + V_COMPONENT, +}; + typedef struct value_t { int type; - /*union { TODO: use an anonymous union here ? */ + union { int number; double number_real; char * string; - /*};*/ + Component_t *comp; + }; } VALUE; @@ -50,8 +94,9 @@ extern FILE * yyin; extern PROGRAMMER * current_prog; extern AVRPART * current_part; extern AVRMEM * current_mem; -extern int lineno; -extern const char * infile; +extern int current_strct; +extern int cfg_lineno; +extern char * cfg_infile; extern LISTID string_list; extern LISTID number_list; extern bool is_alias; // current entry is alias @@ -62,40 +107,61 @@ extern bool is_alias; // current entry is alias #endif extern YYSTYPE yylval; -extern char string_buf[MAX_STR_CONST]; -extern char *string_buf_ptr; - #ifdef __cplusplus extern "C" { #endif int yyparse(void); -int yyerror(char * errmsg, ...); +int yyerror(char *errmsg, ...); -int yywarning(char * errmsg, ...); +int yywarning(char *errmsg, ...); -TOKEN * new_token(int primary); +TOKEN *new_token(int primary); -void free_token(TOKEN * tkn); +void free_token(TOKEN *tkn); void free_tokens(int n, ...); -TOKEN * number(char * text); +TOKEN *new_number(const char *text); -TOKEN * number_real(char * text); +TOKEN *new_number_real(const char *text); -TOKEN * hexnumber(char * text); +TOKEN *new_hexnumber(const char *text); -TOKEN * string(char * text); +TOKEN *new_constant(const char *text); -TOKEN * keyword(int primary); +TOKEN *new_string(const char *text); -void print_token(TOKEN * tkn); +TOKEN *new_keyword(int primary); + +void print_token(TOKEN *tkn); void pyytext(void); -char * dup_string(const char * str); +COMMENT *locate_comment(const LISTID comments, const char *where, int rhs); + +void cfg_capture_prologue(void); + +LISTID cfg_get_prologue(void); + +void capture_comment_str(const char *com, int lineno); + +void capture_lvalue_kw(const char *kw, int lineno); + +LISTID cfg_move_comments(void); + +void cfg_pop_comms(void); + +Component_t *cfg_comp_search(const char *name, int strct); + +const char *cfg_v_type(int type); + +const char *cfg_strct_name(int strct); + +void cfg_assign(char *sp, int strct, Component_t *cp, VALUE *v); + +void cfg_update_mcuid(AVRPART *part); #ifdef __cplusplus } diff --git a/src/config_gram.y b/src/config_gram.y index a8416162..9df42478 100644 --- a/src/config_gram.y +++ b/src/config_gram.y @@ -25,10 +25,12 @@ #include #include #include +#include #include "avrdude.h" #include "libavrdude.h" #include "config.h" +#include "developer_opts.h" #if defined(WIN32) #define strtok_r( _s, _sep, _lasts ) \ @@ -42,14 +44,17 @@ int yylex(void); int yyerror(char * errmsg, ...); int yywarning(char * errmsg, ...); -static int assign_pin(int pinno, TOKEN * v, int invert); +static int clear_pin(int pinfunc); +static int assign_pin(int pinfunc, TOKEN *v, int invert); static int assign_pin_list(int invert); static int which_opcode(TOKEN * opcode); -static int parse_cmdbits(OPCODE * op); +static int parse_cmdbits(OPCODE * op, int opnum); static int pin_name; %} +%token K_NULL; + %token K_READ %token K_WRITE %token K_READ_LO @@ -79,8 +84,11 @@ static int pin_name; %token K_DEFAULT_PARALLEL %token K_DEFAULT_PROGRAMMER %token K_DEFAULT_SERIAL +%token K_DEFAULT_SPI %token K_DESC %token K_FAMILY_ID +%token K_HVUPDI_SUPPORT +%token K_HVUPDI_VARIANT %token K_DEVICECODE %token K_STK500_DEVCODE %token K_AVR910_DEVCODE @@ -93,8 +101,8 @@ static int pin_name; %token K_MAX_WRITE_DELAY %token K_MCU_BASE %token K_MIN_WRITE_DELAY -%token K_MISO -%token K_MOSI +%token K_SDI +%token K_SDO %token K_NUM_PAGES %token K_NVM_BASE %token K_OCD_BASE @@ -109,12 +117,14 @@ static int pin_name; %token K_PSEUDO %token K_PWROFF_AFTER_WRITE %token K_RDYLED +%token K_READBACK %token K_READBACK_P1 %token K_READBACK_P2 %token K_READMEM %token K_RESET %token K_RETRY_PULSE %token K_SERIAL +%token K_SPI %token K_SCK %token K_SIGNATURE %token K_SIZE @@ -187,31 +197,34 @@ static int pin_name; %token K_HAS_PDI /* MCU has PDI i/f rather than ISP (ATxmega). */ %token K_HAS_UPDI /* MCU has UPDI i/f (AVR8X). */ %token K_HAS_TPI /* MCU has TPI i/f rather than ISP (ATtiny4/5/9/10). */ -%token K_IDR /* address of OCD register in IO space */ %token K_IS_AT90S1200 /* chip is an AT90S1200 (needs special treatment) */ %token K_IS_AVR32 /* chip is in the avr32 family */ -%token K_RAMPZ /* address of RAMPZ reg. in IO space */ -%token K_SPMCR /* address of SPMC[S]R in memory space */ -%token K_EECR /* address of EECR in memory space */ %token K_FLASH_INSTR /* flash instructions */ %token K_EEPROM_INSTR /* EEPROM instructions */ %token TKN_COMMA %token TKN_EQUAL %token TKN_SEMI -%token TKN_TILDE %token TKN_LEFT_PAREN %token TKN_RIGHT_PAREN %token TKN_NUMBER %token TKN_NUMBER_REAL %token TKN_STRING +%token TKN_COMPONENT + +%left OP_OR /* calculator operations */ +%left OP_XOR +%left OP_AND +%left OP_PLUS OP_MINUS +%left OP_TIMES OP_DIVIDE OP_MODULO +%right OP_TILDE UNARY %start configuration %% number_real : - TKN_NUMBER { + numexpr { $$ = $1; /* convert value to real */ $$->value.number_real = $$->value.number; @@ -220,6 +233,27 @@ number_real : TKN_NUMBER_REAL { $$ = $1; } +; + + +expr: numexpr | TKN_STRING; + +numexpr: + TKN_NUMBER | + numexpr OP_OR numexpr { $$ = $1; $$->value.number |= $3->value.number; } | + numexpr OP_XOR numexpr { $$ = $1; $$->value.number ^= $3->value.number; } | + numexpr OP_AND numexpr { $$ = $1; $$->value.number &= $3->value.number; } | + numexpr OP_PLUS numexpr { $$ = $1; $$->value.number += $3->value.number; } | + numexpr OP_MINUS numexpr { $$ = $1; $$->value.number -= $3->value.number; } | + numexpr OP_TIMES numexpr { $$ = $1; $$->value.number *= $3->value.number; } | + numexpr OP_DIVIDE numexpr { $$ = $1; $$->value.number /= $3->value.number; } | + numexpr OP_MODULO numexpr { $$ = $1; $$->value.number %= $3->value.number; } | + OP_PLUS numexpr %prec UNARY { $$ = $2; } | + OP_MINUS numexpr %prec UNARY { $$ = $2; $$->value.number = -$$->value.number; } | + OP_TILDE numexpr %prec UNARY { $$ = $2; $$->value.number = ~$$->value.number; } | + TKN_LEFT_PAREN numexpr TKN_RIGHT_PAREN { $$ = $2; } +; + configuration : /* empty */ | config @@ -237,20 +271,22 @@ def : part_def TKN_SEMI | K_DEFAULT_PROGRAMMER TKN_EQUAL TKN_STRING TKN_SEMI { - strncpy(default_programmer, $3->value.string, MAX_STR_CONST); - default_programmer[MAX_STR_CONST-1] = 0; + default_programmer = cache_string($3->value.string); free_token($3); } | K_DEFAULT_PARALLEL TKN_EQUAL TKN_STRING TKN_SEMI { - strncpy(default_parallel, $3->value.string, PATH_MAX); - default_parallel[PATH_MAX-1] = 0; + default_parallel = cache_string($3->value.string); free_token($3); } | K_DEFAULT_SERIAL TKN_EQUAL TKN_STRING TKN_SEMI { - strncpy(default_serial, $3->value.string, PATH_MAX); - default_serial[PATH_MAX-1] = 0; + default_serial = cache_string($3->value.string); + free_token($3); + } | + + K_DEFAULT_SPI TKN_EQUAL TKN_STRING TKN_SEMI { + default_spi = cache_string($3->value.string); free_token($3); } | @@ -278,18 +314,20 @@ prog_def : existing_prog = locate_programmer(programmers, id); if (existing_prog) { { /* temporarily set lineno to lineno of programmer start */ - int temp = lineno; lineno = current_prog->lineno; + int temp = cfg_lineno; cfg_lineno = current_prog->lineno; yywarning("programmer %s overwrites previous definition %s:%d.", id, existing_prog->config_file, existing_prog->lineno); - lineno = temp; + cfg_lineno = temp; } lrmv_d(programmers, existing_prog); pgm_free(existing_prog); } + current_prog->comments = cfg_move_comments(); LISTADD(programmers, current_prog); // pgm_fill_old_pins(current_prog); // TODO to be removed if old pin data no longer needed // pgm_display_generic(current_prog, id); current_prog = NULL; + current_strct = COMP_CONFIG_MAIN; } ; @@ -297,30 +335,23 @@ prog_def : prog_decl : K_PROGRAMMER { current_prog = pgm_new(); - if (current_prog == NULL) { - yyerror("could not create pgm instance"); - YYABORT; - } - strcpy(current_prog->config_file, infile); - current_prog->lineno = lineno; + current_prog->config_file = cache_string(cfg_infile); + current_prog->lineno = cfg_lineno; } | K_PROGRAMMER K_PARENT TKN_STRING { - struct programmer_t * pgm = locate_programmer(programmers, $3->value.string); + PROGRAMMER * pgm = locate_programmer(programmers, $3->value.string); if (pgm == NULL) { yyerror("parent programmer %s not found", $3->value.string); free_token($3); YYABORT; } current_prog = pgm_dup(pgm); - if (current_prog == NULL) { - yyerror("could not duplicate pgm instance"); - free_token($3); - YYABORT; - } - strcpy(current_prog->config_file, infile); - current_prog->lineno = lineno; + current_prog->parent_id = cache_string($3->value.string); + current_prog->comments = NULL; + current_prog->config_file = cache_string(cfg_infile); + current_prog->lineno = cfg_lineno; free_token($3); } ; @@ -338,49 +369,55 @@ part_def : YYABORT; } - /* - * perform some sanity checking, and compute the number of bits - * to shift a page for constructing the page address for - * page-addressed memories. - */ + cfg_update_mcuid(current_part); + + // Sanity checks for memory sizes and compute/override num_pages entry for (ln=lfirst(current_part->mem); ln; ln=lnext(ln)) { m = ldata(ln); if (m->paged) { - if (m->page_size == 0) { - yyerror("must specify page_size for paged memory"); + if (m->size <= 0) { + yyerror("must specify a positive size for paged memory %s", m->desc); YYABORT; } - if (m->num_pages == 0) { - yyerror("must specify num_pages for paged memory"); + if (m->page_size <= 0) { + yyerror("must specify a positive page size for paged memory %s", m->desc); YYABORT; } - if (m->size != m->page_size * m->num_pages) { - yyerror("page size (%u) * num_pages (%u) = " - "%u does not match memory size (%u)", - m->page_size, - m->num_pages, - m->page_size * m->num_pages, - m->size); + // Code base relies on page_size being a power of 2 in some places + if (m->page_size & (m->page_size - 1)) { + yyerror("page size must be a power of 2 for paged memory %s", m->desc); YYABORT; } + // Code base relies on size being a multiple of page_size + if (m->size % m->page_size) { + yyerror("size must be a multiple of page size for paged memory %s", m->desc); + YYABORT; + } + // Warn if num_pages was specified but is inconsistent with size and page size + if (m->num_pages && m->num_pages != m->size / m->page_size) + yywarning("overriding num_page to be %d for memory %s", m->size/m->page_size, m->desc); + m->num_pages = m->size / m->page_size; } } existing_part = locate_part(part_list, current_part->id); if (existing_part) { { /* temporarily set lineno to lineno of part start */ - int temp = lineno; lineno = current_part->lineno; + int temp = cfg_lineno; cfg_lineno = current_part->lineno; yywarning("part %s overwrites previous definition %s:%d.", current_part->id, existing_part->config_file, existing_part->lineno); - lineno = temp; + cfg_lineno = temp; } lrmv_d(part_list, existing_part); avr_free_part(existing_part); } + + current_part->comments = cfg_move_comments(); LISTADD(part_list, current_part); current_part = NULL; + current_strct = COMP_CONFIG_MAIN; } ; @@ -388,12 +425,8 @@ part_decl : K_PART { current_part = avr_new_part(); - if (current_part == NULL) { - yyerror("could not create part instance"); - YYABORT; - } - strcpy(current_part->config_file, infile); - current_part->lineno = lineno; + current_part->config_file = cache_string(cfg_infile); + current_part->lineno = cfg_lineno; } | K_PART K_PARENT TKN_STRING { @@ -405,13 +438,10 @@ part_decl : } current_part = avr_dup_part(parent_part); - if (current_part == NULL) { - yyerror("could not duplicate part instance"); - free_token($3); - YYABORT; - } - strcpy(current_part->config_file, infile); - current_part->lineno = lineno; + current_part->parent_id = cache_string($3->value.string); + current_part->comments = NULL; + current_part->config_file = cache_string(cfg_infile); + current_part->lineno = cfg_lineno; free_token($3); } @@ -424,8 +454,8 @@ string_list : num_list : - TKN_NUMBER { ladd(number_list, $1); } | - num_list TKN_COMMA TKN_NUMBER { ladd(number_list, $3); } + numexpr { ladd(number_list, $1); } | + num_list TKN_COMMA numexpr { ladd(number_list, $3); } ; prog_parms : @@ -434,27 +464,17 @@ prog_parms : ; prog_parm : + TKN_COMPONENT TKN_EQUAL expr { + cfg_assign((char *) current_prog, COMP_PROGRAMMER, $1->value.comp, &$3->value); + free_token($1); + } | K_ID TKN_EQUAL string_list { { - TOKEN * t; - char *s; - int do_yyabort = 0; while (lsize(string_list)) { - t = lrmv_n(string_list, 1); - if (!do_yyabort) { - s = dup_string(t->value.string); - if (s == NULL) { - do_yyabort = 1; - } else { - ladd(current_prog->id, s); - } - } - /* if do_yyabort == 1 just make the list empty */ + TOKEN *t = lrmv_n(string_list, 1); + ladd(current_prog->id, cfg_strdup("config_gram.y", t->value.string)); free_token(t); } - if (do_yyabort) { - YYABORT; - } } } | prog_parm_type @@ -466,16 +486,16 @@ prog_parm : prog_parm_conntype | K_DESC TKN_EQUAL TKN_STRING { - strncpy(current_prog->desc, $3->value.string, PGM_DESCLEN); - current_prog->desc[PGM_DESCLEN-1] = 0; + current_prog->desc = cache_string($3->value.string); free_token($3); } | - K_BAUDRATE TKN_EQUAL TKN_NUMBER { + K_BAUDRATE TKN_EQUAL numexpr { { current_prog->baudrate = $3->value.number; free_token($3); } - } + } | + prog_parm_updi ; prog_parm_type: @@ -507,18 +527,18 @@ prog_parm_conntype: prog_parm_conntype_id: K_PARALLEL { current_prog->conntype = CONNTYPE_PARALLEL; } | K_SERIAL { current_prog->conntype = CONNTYPE_SERIAL; } | - K_USB { current_prog->conntype = CONNTYPE_USB; } + K_USB { current_prog->conntype = CONNTYPE_USB; } | + K_SPI { current_prog->conntype = CONNTYPE_SPI; } ; prog_parm_usb: K_USBDEV TKN_EQUAL TKN_STRING { { - strncpy(current_prog->usbdev, $3->value.string, PGM_USBSTRINGLEN); - current_prog->usbdev[PGM_USBSTRINGLEN-1] = 0; + current_prog->usbdev = cache_string($3->value.string); free_token($3); } } | - K_USBVID TKN_EQUAL TKN_NUMBER { + K_USBVID TKN_EQUAL numexpr { { current_prog->usbvid = $3->value.number; free_token($3); @@ -527,50 +547,73 @@ prog_parm_usb: K_USBPID TKN_EQUAL usb_pid_list | K_USBSN TKN_EQUAL TKN_STRING { { - strncpy(current_prog->usbsn, $3->value.string, PGM_USBSTRINGLEN); - current_prog->usbsn[PGM_USBSTRINGLEN-1] = 0; + current_prog->usbsn = cache_string($3->value.string); free_token($3); } } | K_USBVENDOR TKN_EQUAL TKN_STRING { { - strncpy(current_prog->usbvendor, $3->value.string, PGM_USBSTRINGLEN); - current_prog->usbvendor[PGM_USBSTRINGLEN-1] = 0; + current_prog->usbvendor = cache_string($3->value.string); free_token($3); } } | K_USBPRODUCT TKN_EQUAL TKN_STRING { { - strncpy(current_prog->usbproduct, $3->value.string, PGM_USBSTRINGLEN); - current_prog->usbproduct[PGM_USBSTRINGLEN-1] = 0; + current_prog->usbproduct = cache_string($3->value.string); free_token($3); } } ; usb_pid_list: - TKN_NUMBER { + numexpr { { /* overwrite pids, so clear the existing entries */ - ldestroy_cb(current_prog->usbpid, free); + if(current_prog->usbpid) + ldestroy_cb(current_prog->usbpid, free); current_prog->usbpid = lcreat(NULL, 0); } { - int *ip = malloc(sizeof(int)); - if (ip) { - *ip = $1->value.number; - ladd(current_prog->usbpid, ip); - } + int *ip = cfg_malloc("usb_pid_list", sizeof(int)); + *ip = $1->value.number; + ladd(current_prog->usbpid, ip); free_token($1); } } | - usb_pid_list TKN_COMMA TKN_NUMBER { + usb_pid_list TKN_COMMA numexpr { { - int *ip = malloc(sizeof(int)); - if (ip) { - *ip = $3->value.number; - ladd(current_prog->usbpid, ip); - } + int *ip = cfg_malloc("usb_pid_list", sizeof(int)); + *ip = $3->value.number; + ladd(current_prog->usbpid, ip); + free_token($3); + } + } +; + +prog_parm_updi: + K_HVUPDI_SUPPORT TKN_EQUAL hvupdi_support_list +; + +hvupdi_support_list: + numexpr { + { + /* overwrite list entries, so clear the existing entries */ + if(current_prog->hvupdi_support) + ldestroy_cb(current_prog->hvupdi_support, free); + current_prog->hvupdi_support = lcreat(NULL, 0); + } + { + int *ip = cfg_malloc("hvupdi_support_list", sizeof(int)); + *ip = $1->value.number; + ladd(current_prog->hvupdi_support, ip); + free_token($1); + } + } | + hvupdi_support_list TKN_COMMA numexpr { + { + int *ip = cfg_malloc("hvupdi_support_list", sizeof(int)); + *ip = $3->value.number; + ladd(current_prog->hvupdi_support, ip); free_token($3); } } @@ -579,7 +622,7 @@ usb_pid_list: pin_number_non_empty: TKN_NUMBER { if(0 != assign_pin(pin_name, $1, 0)) YYABORT; } | - TKN_TILDE TKN_NUMBER { if(0 != assign_pin(pin_name, $2, 1)) YYABORT; } + OP_TILDE TKN_NUMBER { if(0 != assign_pin(pin_name, $2, 1)) YYABORT; } ; pin_number: @@ -591,7 +634,7 @@ pin_number: pin_list_element: pin_number_non_empty | - TKN_TILDE TKN_LEFT_PAREN num_list TKN_RIGHT_PAREN { if(0 != assign_pin_list(1)) YYABORT; } + OP_TILDE TKN_LEFT_PAREN num_list TKN_RIGHT_PAREN { if(0 != assign_pin_list(1)) YYABORT; } ; pin_list_non_empty: @@ -608,16 +651,16 @@ pin_list: ; prog_parm_pins: - K_VCC TKN_EQUAL {pin_name = PPI_AVR_VCC; } pin_list | - K_BUFF TKN_EQUAL {pin_name = PPI_AVR_BUFF; } pin_list | - K_RESET TKN_EQUAL {pin_name = PIN_AVR_RESET;} pin_number { free_token($1); } | - K_SCK TKN_EQUAL {pin_name = PIN_AVR_SCK; } pin_number { free_token($1); } | - K_MOSI TKN_EQUAL {pin_name = PIN_AVR_MOSI; } pin_number | - K_MISO TKN_EQUAL {pin_name = PIN_AVR_MISO; } pin_number | - K_ERRLED TKN_EQUAL {pin_name = PIN_LED_ERR; } pin_number | - K_RDYLED TKN_EQUAL {pin_name = PIN_LED_RDY; } pin_number | - K_PGMLED TKN_EQUAL {pin_name = PIN_LED_PGM; } pin_number | - K_VFYLED TKN_EQUAL {pin_name = PIN_LED_VFY; } pin_number + K_VCC TKN_EQUAL {pin_name = PPI_AVR_VCC; clear_pin(pin_name); } pin_list | + K_BUFF TKN_EQUAL {pin_name = PPI_AVR_BUFF; clear_pin(pin_name); } pin_list | + K_RESET TKN_EQUAL {pin_name = PIN_AVR_RESET; clear_pin(pin_name);} pin_number { free_token($1); } | + K_SCK TKN_EQUAL {pin_name = PIN_AVR_SCK; clear_pin(pin_name); } pin_number { free_token($1); } | + K_SDO TKN_EQUAL {pin_name = PIN_AVR_SDO; clear_pin(pin_name); } pin_number | + K_SDI TKN_EQUAL {pin_name = PIN_AVR_SDI; clear_pin(pin_name); } pin_number | + K_ERRLED TKN_EQUAL {pin_name = PIN_LED_ERR; clear_pin(pin_name); } pin_number | + K_RDYLED TKN_EQUAL {pin_name = PIN_LED_RDY; clear_pin(pin_name); } pin_number | + K_PGMLED TKN_EQUAL {pin_name = PIN_LED_PGM; clear_pin(pin_name); } pin_number | + K_VFYLED TKN_EQUAL {pin_name = PIN_LED_VFY; clear_pin(pin_name); } pin_number ; opcode : @@ -655,28 +698,35 @@ retry_lines : ; part_parm : + TKN_COMPONENT TKN_EQUAL expr { + cfg_assign((char *) current_part, COMP_AVRPART, $1->value.comp, &$3->value); + free_token($1); + } | K_ID TKN_EQUAL TKN_STRING { - strncpy(current_part->id, $3->value.string, AVR_IDLEN); - current_part->id[AVR_IDLEN-1] = 0; + current_part->id = cache_string($3->value.string); free_token($3); } | K_DESC TKN_EQUAL TKN_STRING { - strncpy(current_part->desc, $3->value.string, AVR_DESCLEN - 1); - current_part->desc[AVR_DESCLEN-1] = 0; + current_part->desc = cache_string($3->value.string); free_token($3); } | K_FAMILY_ID TKN_EQUAL TKN_STRING { - strncpy(current_part->family_id, $3->value.string, AVR_FAMILYIDLEN); - current_part->family_id[AVR_FAMILYIDLEN] = 0; + current_part->family_id = cache_string($3->value.string); free_token($3); } | - K_DEVICECODE TKN_EQUAL TKN_NUMBER { + K_HVUPDI_VARIANT TKN_EQUAL numexpr + { + current_part->hvupdi_variant = $3->value.number; + free_token($3); + } | + + K_DEVICECODE TKN_EQUAL numexpr { { yyerror("devicecode is deprecated, use " "stk500_devcode instead"); @@ -684,14 +734,14 @@ part_parm : } } | - K_STK500_DEVCODE TKN_EQUAL TKN_NUMBER { + K_STK500_DEVCODE TKN_EQUAL numexpr { { current_part->stk500_devcode = $3->value.number; free_token($3); } } | - K_AVR910_DEVCODE TKN_EQUAL TKN_NUMBER { + K_AVR910_DEVCODE TKN_EQUAL numexpr { { current_part->avr910_devcode = $3->value.number; free_token($3); @@ -709,7 +759,7 @@ part_parm : } } | - K_USBPID TKN_EQUAL TKN_NUMBER { + K_USBPID TKN_EQUAL numexpr { { current_part->usbpid = $3->value.number; free_token($3); @@ -747,6 +797,13 @@ part_parm : } } | + K_PP_CONTROLSTACK TKN_EQUAL K_NULL { + { + current_part->ctl_stack_type = CTL_STACK_NONE; + memset(current_part->controlstack, 0, CTL_STACK_SIZE); + } + } | + K_HVSP_CONTROLSTACK TKN_EQUAL num_list { { TOKEN * t; @@ -778,6 +835,13 @@ part_parm : } } | + K_HVSP_CONTROLSTACK TKN_EQUAL K_NULL { + { + current_part->ctl_stack_type = CTL_STACK_NONE; + memset(current_part->controlstack, 0, CTL_STACK_SIZE); + } + } | + K_FLASH_INSTR TKN_EQUAL num_list { { TOKEN * t; @@ -808,6 +872,12 @@ part_parm : } } | + K_FLASH_INSTR TKN_EQUAL K_NULL { + { + memset(current_part->flash_instr, 0, FLASH_INSTR_SIZE); + } + } | + K_EEPROM_INSTR TKN_EQUAL num_list { { TOKEN * t; @@ -838,19 +908,25 @@ part_parm : } } | - K_CHIP_ERASE_DELAY TKN_EQUAL TKN_NUMBER + K_EEPROM_INSTR TKN_EQUAL K_NULL { + { + memset(current_part->eeprom_instr, 0, EEPROM_INSTR_SIZE); + } + } | + + K_CHIP_ERASE_DELAY TKN_EQUAL numexpr { current_part->chip_erase_delay = $3->value.number; free_token($3); } | - K_PAGEL TKN_EQUAL TKN_NUMBER + K_PAGEL TKN_EQUAL numexpr { current_part->pagel = $3->value.number; free_token($3); } | - K_BS2 TKN_EQUAL TKN_NUMBER + K_BS2 TKN_EQUAL numexpr { current_part->bs2 = $3->value.number; free_token($3); @@ -866,169 +942,169 @@ part_parm : free_tokens(2, $1, $3); } | - K_TIMEOUT TKN_EQUAL TKN_NUMBER + K_TIMEOUT TKN_EQUAL numexpr { current_part->timeout = $3->value.number; free_token($3); } | - K_STABDELAY TKN_EQUAL TKN_NUMBER + K_STABDELAY TKN_EQUAL numexpr { current_part->stabdelay = $3->value.number; free_token($3); } | - K_CMDEXEDELAY TKN_EQUAL TKN_NUMBER + K_CMDEXEDELAY TKN_EQUAL numexpr { current_part->cmdexedelay = $3->value.number; free_token($3); } | - K_HVSPCMDEXEDELAY TKN_EQUAL TKN_NUMBER + K_HVSPCMDEXEDELAY TKN_EQUAL numexpr { current_part->hvspcmdexedelay = $3->value.number; free_token($3); } | - K_SYNCHLOOPS TKN_EQUAL TKN_NUMBER + K_SYNCHLOOPS TKN_EQUAL numexpr { current_part->synchloops = $3->value.number; free_token($3); } | - K_BYTEDELAY TKN_EQUAL TKN_NUMBER + K_BYTEDELAY TKN_EQUAL numexpr { current_part->bytedelay = $3->value.number; free_token($3); } | - K_POLLVALUE TKN_EQUAL TKN_NUMBER + K_POLLVALUE TKN_EQUAL numexpr { current_part->pollvalue = $3->value.number; free_token($3); } | - K_POLLINDEX TKN_EQUAL TKN_NUMBER + K_POLLINDEX TKN_EQUAL numexpr { current_part->pollindex = $3->value.number; free_token($3); } | - K_PREDELAY TKN_EQUAL TKN_NUMBER + K_PREDELAY TKN_EQUAL numexpr { current_part->predelay = $3->value.number; free_token($3); } | - K_POSTDELAY TKN_EQUAL TKN_NUMBER + K_POSTDELAY TKN_EQUAL numexpr { current_part->postdelay = $3->value.number; free_token($3); } | - K_POLLMETHOD TKN_EQUAL TKN_NUMBER + K_POLLMETHOD TKN_EQUAL numexpr { current_part->pollmethod = $3->value.number; free_token($3); } | - K_HVENTERSTABDELAY TKN_EQUAL TKN_NUMBER + K_HVENTERSTABDELAY TKN_EQUAL numexpr { current_part->hventerstabdelay = $3->value.number; free_token($3); } | - K_PROGMODEDELAY TKN_EQUAL TKN_NUMBER + K_PROGMODEDELAY TKN_EQUAL numexpr { current_part->progmodedelay = $3->value.number; free_token($3); } | - K_LATCHCYCLES TKN_EQUAL TKN_NUMBER + K_LATCHCYCLES TKN_EQUAL numexpr { current_part->latchcycles = $3->value.number; free_token($3); } | - K_TOGGLEVTG TKN_EQUAL TKN_NUMBER + K_TOGGLEVTG TKN_EQUAL numexpr { current_part->togglevtg = $3->value.number; free_token($3); } | - K_POWEROFFDELAY TKN_EQUAL TKN_NUMBER + K_POWEROFFDELAY TKN_EQUAL numexpr { current_part->poweroffdelay = $3->value.number; free_token($3); } | - K_RESETDELAYMS TKN_EQUAL TKN_NUMBER + K_RESETDELAYMS TKN_EQUAL numexpr { current_part->resetdelayms = $3->value.number; free_token($3); } | - K_RESETDELAYUS TKN_EQUAL TKN_NUMBER + K_RESETDELAYUS TKN_EQUAL numexpr { current_part->resetdelayus = $3->value.number; free_token($3); } | - K_HVLEAVESTABDELAY TKN_EQUAL TKN_NUMBER + K_HVLEAVESTABDELAY TKN_EQUAL numexpr { current_part->hvleavestabdelay = $3->value.number; free_token($3); } | - K_RESETDELAY TKN_EQUAL TKN_NUMBER + K_RESETDELAY TKN_EQUAL numexpr { current_part->resetdelay = $3->value.number; free_token($3); } | - K_CHIPERASEPULSEWIDTH TKN_EQUAL TKN_NUMBER + K_CHIPERASEPULSEWIDTH TKN_EQUAL numexpr { current_part->chiperasepulsewidth = $3->value.number; free_token($3); } | - K_CHIPERASEPOLLTIMEOUT TKN_EQUAL TKN_NUMBER + K_CHIPERASEPOLLTIMEOUT TKN_EQUAL numexpr { current_part->chiperasepolltimeout = $3->value.number; free_token($3); } | - K_CHIPERASETIME TKN_EQUAL TKN_NUMBER + K_CHIPERASETIME TKN_EQUAL numexpr { current_part->chiperasetime = $3->value.number; free_token($3); } | - K_PROGRAMFUSEPULSEWIDTH TKN_EQUAL TKN_NUMBER + K_PROGRAMFUSEPULSEWIDTH TKN_EQUAL numexpr { current_part->programfusepulsewidth = $3->value.number; free_token($3); } | - K_PROGRAMFUSEPOLLTIMEOUT TKN_EQUAL TKN_NUMBER + K_PROGRAMFUSEPOLLTIMEOUT TKN_EQUAL numexpr { current_part->programfusepolltimeout = $3->value.number; free_token($3); } | - K_PROGRAMLOCKPULSEWIDTH TKN_EQUAL TKN_NUMBER + K_PROGRAMLOCKPULSEWIDTH TKN_EQUAL numexpr { current_part->programlockpulsewidth = $3->value.number; free_token($3); } | - K_PROGRAMLOCKPOLLTIMEOUT TKN_EQUAL TKN_NUMBER + K_PROGRAMLOCKPOLLTIMEOUT TKN_EQUAL numexpr { current_part->programlockpolltimeout = $3->value.number; free_token($3); } | - K_SYNCHCYCLES TKN_EQUAL TKN_NUMBER + K_SYNCHCYCLES TKN_EQUAL numexpr { current_part->synchcycles = $3->value.number; free_token($3); @@ -1037,50 +1113,45 @@ part_parm : K_HAS_JTAG TKN_EQUAL yesno { if ($3->primary == K_YES) - current_part->flags |= AVRPART_HAS_JTAG; + current_part->prog_modes |= PM_JTAG; else if ($3->primary == K_NO) - current_part->flags &= ~AVRPART_HAS_JTAG; - + current_part->prog_modes &= ~(PM_JTAG | PM_JTAGmkI | PM_XMEGAJTAG | PM_AVR32JTAG); free_token($3); } | K_HAS_DW TKN_EQUAL yesno { if ($3->primary == K_YES) - current_part->flags |= AVRPART_HAS_DW; + current_part->prog_modes |= PM_debugWIRE; else if ($3->primary == K_NO) - current_part->flags &= ~AVRPART_HAS_DW; - + current_part->prog_modes &= ~PM_debugWIRE; free_token($3); } | K_HAS_PDI TKN_EQUAL yesno { if ($3->primary == K_YES) - current_part->flags |= AVRPART_HAS_PDI; + current_part->prog_modes |= PM_PDI; else if ($3->primary == K_NO) - current_part->flags &= ~AVRPART_HAS_PDI; - + current_part->prog_modes &= ~PM_PDI; free_token($3); } | K_HAS_UPDI TKN_EQUAL yesno { if ($3->primary == K_YES) - current_part->flags |= AVRPART_HAS_UPDI; + current_part->prog_modes |= PM_UPDI; else if ($3->primary == K_NO) - current_part->flags &= ~AVRPART_HAS_UPDI; - + current_part->prog_modes &= ~PM_UPDI; free_token($3); } | K_HAS_TPI TKN_EQUAL yesno { if ($3->primary == K_YES) - current_part->flags |= AVRPART_HAS_TPI; + current_part->prog_modes |= PM_TPI; else if ($3->primary == K_NO) - current_part->flags &= ~AVRPART_HAS_TPI; - + current_part->prog_modes &= ~PM_TPI; free_token($3); } | @@ -1097,10 +1168,9 @@ part_parm : K_IS_AVR32 TKN_EQUAL yesno { if ($3->primary == K_YES) - current_part->flags |= AVRPART_AVR32; + current_part->prog_modes |= PM_aWire; else if ($3->primary == K_NO) - current_part->flags &= ~AVRPART_AVR32; - + current_part->prog_modes &= ~PM_aWire; free_token($3); } | @@ -1124,49 +1194,25 @@ part_parm : free_token($3); } | - K_IDR TKN_EQUAL TKN_NUMBER - { - current_part->idr = $3->value.number; - free_token($3); - } | - - K_RAMPZ TKN_EQUAL TKN_NUMBER - { - current_part->rampz = $3->value.number; - free_token($3); - } | - - K_SPMCR TKN_EQUAL TKN_NUMBER - { - current_part->spmcr = $3->value.number; - free_token($3); - } | - - K_EECR TKN_EQUAL TKN_NUMBER - { - current_part->eecr = $3->value.number; - free_token($3); - } | - - K_MCU_BASE TKN_EQUAL TKN_NUMBER + K_MCU_BASE TKN_EQUAL numexpr { current_part->mcu_base = $3->value.number; free_token($3); } | - K_NVM_BASE TKN_EQUAL TKN_NUMBER + K_NVM_BASE TKN_EQUAL numexpr { current_part->nvm_base = $3->value.number; free_token($3); } | - K_OCD_BASE TKN_EQUAL TKN_NUMBER + K_OCD_BASE TKN_EQUAL numexpr { current_part->ocd_base = $3->value.number; free_token($3); } | - K_OCDREV TKN_EQUAL TKN_NUMBER + K_OCDREV TKN_EQUAL numexpr { current_part->ocdrev = $3->value.number; free_token($3); @@ -1216,44 +1262,52 @@ part_parm : } | -/* - K_EEPROM { current_mem = AVR_M_EEPROM; } - mem_specs | - - K_FLASH { current_mem = AVR_M_FLASH; } - mem_specs | -*/ - K_MEMORY TKN_STRING - { - current_mem = avr_new_memtype(); - if (current_mem == NULL) { - yyerror("could not create mem instance"); - free_token($2); - YYABORT; + { /* select memory for extension or create if not there */ + AVRMEM *mem = avr_locate_mem_noalias(current_part, $2->value.string); + if(!mem) { + mem = avr_new_memtype(); + mem->desc = cache_string($2->value.string); + ladd(current_part->mem, mem); } - strncpy(current_mem->desc, $2->value.string, AVR_MEMDESCLEN - 1); - current_mem->desc[AVR_MEMDESCLEN-1] = 0; + avr_add_mem_order($2->value.string); + current_mem = mem; free_token($2); } mem_specs - { - AVRMEM * existing_mem; + { + if (is_alias) { // alias mem has been already entered + lrmv_d(current_part->mem, current_mem); + avr_free_mem(current_mem); + is_alias = false; + } else { // check all opcodes re necessary address bits + unsigned char cmd[4] = { 0, 0, 0, 0, }; + int bn; - existing_mem = avr_locate_mem_noalias(current_part, current_mem->desc); + for(int i=0; iop[i]) { + if((bn = avr_set_addr_mem(current_mem, i, cmd, 0UL)) > 0) + yywarning("%s's %s %s misses a necessary address bit a%d", + current_part->desc, current_mem->desc, opcodename(i), bn-1); + } + current_mem->comments = cfg_move_comments(); + } + cfg_pop_comms(); + current_mem = NULL; + current_strct = COMP_AVRPART; + } | + K_MEMORY TKN_STRING TKN_EQUAL K_NULL + { + AVRMEM *existing_mem = avr_locate_mem_noalias(current_part, $2->value.string); if (existing_mem != NULL) { lrmv_d(current_part->mem, existing_mem); avr_free_mem(existing_mem); } - if (is_alias) { - avr_free_mem(current_mem); // alias mem has been already entered below - is_alias = false; - } else { - ladd(current_part->mem, current_mem); - } - current_mem = NULL; + free_token($2); + cfg_pop_comms(); + current_mem = NULL; + current_strct = COMP_AVRPART; } | - opcode TKN_EQUAL string_list { { int opnum; @@ -1262,18 +1316,27 @@ part_parm : opnum = which_opcode($1); if (opnum < 0) YYABORT; op = avr_new_opcode(); - if (op == NULL) { - yyerror("could not create opcode instance"); - free_token($1); + if(0 != parse_cmdbits(op, opnum)) YYABORT; - } - if(0 != parse_cmdbits(op)) YYABORT; if (current_part->op[opnum] != NULL) { /*yywarning("operation redefined");*/ avr_free_opcode(current_part->op[opnum]); } current_part->op[opnum] = op; + free_token($1); + } + } | + + opcode TKN_EQUAL K_NULL { + { + int opnum = which_opcode($1); + if(opnum < 0) + YYABORT; + if(current_part->op[opnum] != NULL) + avr_free_opcode(current_part->op[opnum]); + current_part->op[opnum] = NULL; + free_token($1); } } @@ -1293,50 +1356,53 @@ mem_specs : mem_spec : + TKN_COMPONENT TKN_EQUAL expr { + cfg_assign((char *) current_mem, COMP_AVRMEM, $1->value.comp, &$3->value); + free_token($1); + } | + K_PAGED TKN_EQUAL yesno { current_mem->paged = $3->primary == K_YES ? 1 : 0; free_token($3); } | - K_SIZE TKN_EQUAL TKN_NUMBER + K_SIZE TKN_EQUAL numexpr { current_mem->size = $3->value.number; free_token($3); } | - K_PAGE_SIZE TKN_EQUAL TKN_NUMBER + K_PAGE_SIZE TKN_EQUAL numexpr { int ps = $3->value.number; if (ps <= 0) - avrdude_message(MSG_INFO, - "%s, line %d: invalid page size %d, ignored\n", - infile, lineno, ps); + pmsg_warning("invalid page size %d, ignored [%s:%d]\n", ps, cfg_infile, cfg_lineno); else current_mem->page_size = ps; free_token($3); } | - K_NUM_PAGES TKN_EQUAL TKN_NUMBER + K_NUM_PAGES TKN_EQUAL numexpr { current_mem->num_pages = $3->value.number; free_token($3); } | - K_OFFSET TKN_EQUAL TKN_NUMBER + K_OFFSET TKN_EQUAL numexpr { current_mem->offset = $3->value.number; free_token($3); } | - K_MIN_WRITE_DELAY TKN_EQUAL TKN_NUMBER + K_MIN_WRITE_DELAY TKN_EQUAL numexpr { current_mem->min_write_delay = $3->value.number; free_token($3); } | - K_MAX_WRITE_DELAY TKN_EQUAL TKN_NUMBER + K_MAX_WRITE_DELAY TKN_EQUAL numexpr { current_mem->max_write_delay = $3->value.number; free_token($3); @@ -1348,44 +1414,52 @@ mem_spec : free_token($3); } | - K_READBACK_P1 TKN_EQUAL TKN_NUMBER + K_READBACK TKN_EQUAL TKN_NUMBER TKN_NUMBER + { + current_mem->readback[0] = $3->value.number; + current_mem->readback[1] = $4->value.number; + free_token($3); + free_token($4); + } | + + K_READBACK_P1 TKN_EQUAL numexpr { current_mem->readback[0] = $3->value.number; free_token($3); } | - K_READBACK_P2 TKN_EQUAL TKN_NUMBER + K_READBACK_P2 TKN_EQUAL numexpr { current_mem->readback[1] = $3->value.number; free_token($3); } | - K_MODE TKN_EQUAL TKN_NUMBER + K_MODE TKN_EQUAL numexpr { current_mem->mode = $3->value.number; free_token($3); } | - K_DELAY TKN_EQUAL TKN_NUMBER + K_DELAY TKN_EQUAL numexpr { current_mem->delay = $3->value.number; free_token($3); } | - K_BLOCKSIZE TKN_EQUAL TKN_NUMBER + K_BLOCKSIZE TKN_EQUAL numexpr { current_mem->blocksize = $3->value.number; free_token($3); } | - K_READSIZE TKN_EQUAL TKN_NUMBER + K_READSIZE TKN_EQUAL numexpr { current_mem->readsize = $3->value.number; free_token($3); } | - K_POLLINDEX TKN_EQUAL TKN_NUMBER + K_POLLINDEX TKN_EQUAL numexpr { current_mem->pollindex = $3->value.number; free_token($3); @@ -1400,18 +1474,27 @@ mem_spec : opnum = which_opcode($1); if (opnum < 0) YYABORT; op = avr_new_opcode(); - if (op == NULL) { - yyerror("could not create opcode instance"); - free_token($1); + if(0 != parse_cmdbits(op, opnum)) YYABORT; - } - if(0 != parse_cmdbits(op)) YYABORT; if (current_mem->op[opnum] != NULL) { /*yywarning("operation redefined");*/ avr_free_opcode(current_mem->op[opnum]); } current_mem->op[opnum] = op; + free_token($1); + } + } | + + opcode TKN_EQUAL K_NULL { + { + int opnum = which_opcode($1); + if(opnum < 0) + YYABORT; + if(current_mem->op[opnum] != NULL) + avr_free_opcode(current_mem->op[opnum]); + current_mem->op[opnum] = NULL; + free_token($1); } } @@ -1439,10 +1522,7 @@ mem_alias : is_alias = true; alias = avr_new_memalias(); - - // alias->desc and current_mem->desc have the same length - // definition, thus no need to check for length here - strcpy(alias->desc, current_mem->desc); + alias->desc = current_mem->desc; alias->aliased_mem = existing_mem; ladd(current_part->mem_alias, alias); @@ -1466,11 +1546,24 @@ static char * vtypestr(int type) #endif -static int assign_pin(int pinno, TOKEN * v, int invert) -{ - int value; +static int clear_pin(int pinfunc) { + if(pinfunc < 0 || pinfunc >= N_PINS) { + yyerror("pin function must be in the range [0, %d]", N_PINS-1); + return -1; + } - value = v->value.number; + pin_clear_all(&(current_prog->pin[pinfunc])); + + return 0; +} + +static int assign_pin(int pinfunc, TOKEN *v, int invert) { + if(pinfunc < 0 || pinfunc >= N_PINS) { + yyerror("pin function must be in the range [0, %d]", N_PINS-1); + return -1; + } + + int value = v->value.number; free_token(v); if ((value < PIN_MIN) || (value > PIN_MAX)) { @@ -1478,7 +1571,7 @@ static int assign_pin(int pinno, TOKEN * v, int invert) return -1; } - pin_set_value(&(current_prog->pin[pinno]), value, invert); + pin_set_value(&(current_prog->pin[pinfunc]), value, invert); return 0; } @@ -1489,7 +1582,12 @@ static int assign_pin_list(int invert) int pin; int rv = 0; - current_prog->pinno[pin_name] = 0; + if(pin_name < 0 || pin_name >= N_PINS) { + yyerror("pin_name should be in the range [0, %d]", N_PINS-1); + return -1; + } + + current_prog->pinno[pin_name] = NO_PIN; while (lsize(number_list)) { t = lrmv_n(number_list, 1); if (rv == 0) { @@ -1529,15 +1627,12 @@ static int which_opcode(TOKEN * opcode) } -static int parse_cmdbits(OPCODE * op) +static int parse_cmdbits(OPCODE * op, int opnum) { - TOKEN * t; + TOKEN *t; int bitno; - char ch; - char * e; - char * q; int len; - char * s, *brkt = NULL; + char *s, *brkt = NULL; int rv = 0; bitno = 32; @@ -1545,10 +1640,18 @@ static int parse_cmdbits(OPCODE * op) t = lrmv_n(string_list, 1); - s = strtok_r(t->value.string, " ", &brkt); + char *str = t->value.string; + // Compact alternative specification? (eg, "0100.0000--000x.xxxx--xxaa.aaaa--iiii.iiii") + char bit[2] = {0, 0}, *cc = str; + int compact = !strchr(str, ' ') && strlen(str) > 7; + + bit[0] = *cc++; + s = !compact? strtok_r(str, " ", &brkt): *bit? bit: NULL; while (rv == 0 && s != NULL) { - bitno--; + // Ignore visual grouping characters in compact mode + if(*s != '.' && *s != '-' && *s != '_' && *s !='/') + bitno--; if (bitno < 0) { yyerror("too many opcode bits for instruction"); rv = -1; @@ -1563,10 +1666,8 @@ static int parse_cmdbits(OPCODE * op) break; } - ch = s[0]; - if (len == 1) { - switch (ch) { + switch (*s) { case '1': op->bit[bitno].type = AVR_CMDBIT_VALUE; op->bit[bitno].value = 1; @@ -1585,7 +1686,10 @@ static int parse_cmdbits(OPCODE * op) case 'a': op->bit[bitno].type = AVR_CMDBIT_ADDRESS; op->bit[bitno].value = 0; - op->bit[bitno].bitno = 8*(bitno/8) + bitno % 8; + op->bit[bitno].bitno = bitno < 8 || bitno > 23? 0: + opnum == AVR_OP_LOAD_EXT_ADDR? bitno+8: bitno-8; /* correct bit number for lone 'a' */ + if(bitno < 8 || bitno > 23) + yywarning("address bits don't normally appear in Bytes 0 or 3 of SPI commands"); break; case 'i': op->bit[bitno].type = AVR_CMDBIT_INPUT; @@ -1597,37 +1701,60 @@ static int parse_cmdbits(OPCODE * op) op->bit[bitno].value = 0; op->bit[bitno].bitno = bitno % 8; break; + case '.': + case '-': + case '_': + case '/': + break; default : - yyerror("invalid bit specifier '%c'", ch); + yyerror("invalid bit specifier '%c'", *s); rv = -1; break; } } else { - if (ch == 'a') { - q = &s[1]; - op->bit[bitno].bitno = strtol(q, &e, 0); - if ((e == q)||(*e != 0)) { - yyerror("can't parse bit number from \"%s\"", q); - rv = -1; - break; + if (*s == 'a') { + int sb, bn; + char *e, *q; + + q = s+1; + errno = 0; + bn = strtol(q, &e, 0); // address line + if (e == q || *e != 0 || errno) { + yywarning("can't parse bit number from a%s", q); + bn = 0; } + + sb = opnum == AVR_OP_LOAD_EXT_ADDR? bitno+8: bitno-8; // should be this number + if(bitno < 8 || bitno > 23) + yywarning("address bits don't normally appear in Bytes 0 or 3 of SPI commands"); + else if((bn & 31) != sb) + yywarning("a%d would normally be expected to be a%d", bn, sb); + else if(bn < 0 || bn > 31) + yywarning("invalid address bit a%d, using a%d", bn, bn & 31); + + op->bit[bitno].bitno = bn & 31; + op->bit[bitno].type = AVR_CMDBIT_ADDRESS; op->bit[bitno].value = 0; } else { - yyerror("invalid bit specifier \"%s\"", s); + yyerror("invalid bit specifier %s", s); rv = -1; break; } } - s = strtok_r(NULL, " ", &brkt); + bit[0] = *cc++; + s = !compact? strtok_r(NULL, " ", &brkt): *bit? bit: NULL; } /* while */ free_token(t); } /* while */ + if(bitno > 0) + yywarning("too few opcode bits in instruction"); + return rv; } diff --git a/src/configure.ac b/src/configure.ac index ae60e3f1..b57af4a6 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -23,7 +23,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.60) -AC_INIT(avrdude, 7.0, avrdude-dev@nongnu.org) +AC_INIT(avrdude, 7.1-20230108, avrdude-dev@nongnu.org) AC_CANONICAL_BUILD AC_CANONICAL_HOST @@ -577,6 +577,12 @@ else echo "DON'T HAVE libhidapi" fi +if test x$have_readline = xyes; then + echo "DO HAVE libreadline" +else + echo "DON'T HAVE libreadline" +fi + if test x$have_pthread = xyes; then echo "DO HAVE pthread" else diff --git a/src/configure.cmake b/src/configure.cmake new file mode 100644 index 00000000..938c1752 --- /dev/null +++ b/src/configure.cmake @@ -0,0 +1,35 @@ +# +# configure.cmake - autoconf like multi-line configure +# Copyright (C) 2022 Marius Greuel +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +# Do a multi-line replace based on @