diff --git a/.github/workflows/check-links.yml b/.github/workflows/check-links.yml index 1134ee0c..cfeedd1a 100644 --- a/.github/workflows/check-links.yml +++ b/.github/workflows/check-links.yml @@ -10,9 +10,6 @@ on: paths: - ".github/workflows/check-links.yml" - "**.md" - schedule: - # Run every Tuesday at 8 AM UTC to catch breakage caused by changes to the linked sites. - - cron: "0 8 * * TUE" workflow_dispatch: repository_dispatch: diff --git a/.github/workflows/compile-examples-RTC.yml b/.github/workflows/compile-examples-RTC.yml new file mode 100644 index 00000000..0e52e3fe --- /dev/null +++ b/.github/workflows/compile-examples-RTC.yml @@ -0,0 +1,589 @@ +name: Compile Examples RTC + +on: + push: + branches: + - RTC-millis-timer + + # workflow_dispatch event allows the workflow to be triggered manually + # See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows#workflow_dispatch + workflow_dispatch: + # repository_dispatch event allows the workflow to be triggered via the GitHub API + # See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows#repository_dispatch + repository_dispatch: + +jobs: + compile-examples: + runs-on: ubuntu-latest + + env: + platform-name: DxCore:megaavr + + all-parts-sketch-paths: | + - megaavr/libraries/Comparator/examples/Hysteresis + - megaavr/libraries/Comparator/examples/Internal_reference + - megaavr/libraries/Comparator/examples/Interrupt + - megaavr/libraries/Comparator/examples/Simple_comparator + - megaavr/libraries/DxCore/examples/EnhancedIODemo + - megaavr/libraries/DxCore/examples/ModernRevSer + - megaavr/libraries/DxCore/examples/SAMPLENdemo + - megaavr/libraries/EEPROM/examples/eeprom_clear + - megaavr/libraries/EEPROM/examples/eeprom_crc + - megaavr/libraries/EEPROM/examples/eeprom_get + - megaavr/libraries/EEPROM/examples/eeprom_iteration + - megaavr/libraries/EEPROM/examples/eeprom_put + - megaavr/libraries/EEPROM/examples/eeprom_read + - megaavr/libraries/EEPROM/examples/eeprom_update + - megaavr/libraries/EEPROM/examples/eeprom_write + - megaavr/libraries/Logic/examples/Five_input_NOR + - megaavr/libraries/Logic/examples/Interrupt + - megaavr/libraries/Logic/examples/LatchNoSeq + - megaavr/libraries/Logic/examples/LatchNoSeqDx + - megaavr/libraries/Logic/examples/Three_input_AND + - megaavr/libraries/Logic/examples/Three_input_NAND + - megaavr/libraries/Logic/examples/Three_input_OR + - megaavr/libraries/Logic/examples/Oscillate + - megaavr/libraries/Logic/examples/Two_input_AND + - megaavr/libraries/Logic/examples/Two_input_NAND + - megaavr/libraries/Logic/examples/Two_input_OR + - megaavr/libraries/Servo/examples/Knob + - megaavr/libraries/Servo/examples/ServoMaxTest + - megaavr/libraries/Servo/examples/Sweep + - megaavr/libraries/Servo_DxCore/examples/Knob + - megaavr/libraries/Servo_DxCore/examples/ServoMaxTest + - megaavr/libraries/Servo_DxCore/examples/Sweep + - megaavr/libraries/SoftwareSerial/examples/SoftwareSerialExample + - megaavr/libraries/SoftwareSerial/examples/TwoPortReceive + - megaavr/libraries/SPI/examples/BarometricPressureSensor + - megaavr/libraries/SPI/examples/DigitalPotControl + - megaavr/libraries/tinyNeoPixel/examples/buttoncycler + - megaavr/libraries/tinyNeoPixel/examples/simple + - megaavr/libraries/tinyNeoPixel/examples/strandtest + - megaavr/libraries/tinyNeoPixel_Static/examples/buttoncycler + - megaavr/libraries/tinyNeoPixel_Static/examples/simple + - megaavr/libraries/tinyNeoPixel_Static/examples/strandtest + - megaavr/libraries/Wire/examples/digital_potentiometer + - megaavr/libraries/Wire/examples/master_read + - megaavr/libraries/Wire/examples/master_write + - megaavr/libraries/Wire/examples/pinswap_via_pins + - megaavr/libraries/Wire/examples/pinswap_via_swap + - megaavr/libraries/Wire/examples/SFRRanger_reader + - megaavr/libraries/Wire/examples/slave_read + - megaavr/libraries/Wire/examples/slave_write + - megaavr/libraries/Wire/examples/slave_secondary_address + - megaavr/libraries/Wire/examples/slave_address_mask + - megaavr/libraries/Wire/examples/master_multi_address_write + - megaavr/extras/ci/test-sketch/all/math_macros + - megaavr/extras/ci/test-sketch/all/test_analog + - megaavr/extras/ci/test-sketch/all/test_digital + - megaavr/extras/ci/test-sketch/all/test_tone + - megaavr/extras/ci/test-sketch/all/test_PWM + - megaavr/extras/ci/test-sketch/all/test_timekeeping + - megaavr/extras/ci/test-sketch/all/macros + avr-da-series-sketch-paths: | + - megaavr/extras/ci/test-sketch/da/dummysketch + - megaavr/libraries/ZCD/examples/Interrupt + - megaavr/libraries/ZCD/examples/Read_state + - megaavr/libraries/ZCD/examples/Simple_ZCD + - megaavr/libraries/PTC/examples/mutualcap + - megaavr/libraries/PTC/examples/mutualcap_low_power + - megaavr/libraries/PTC/examples/self_and_mutual_mix + - megaavr/libraries/PTC/examples/selfcap + - megaavr/libraries/PTC/examples/selfcap_other_nodes_shield + - megaavr/libraries/PTC/examples/selfcap_with_dedicated_shield + avr-db-series-sketch-paths: | + - megaavr/libraries/Opamp/examples/Inverting_amplifier + - megaavr/libraries/Opamp/examples/Inverting_amplifier_with_follower + - megaavr/libraries/Opamp/examples/Non_inverting_amplifier + - megaavr/libraries/Opamp/examples/Voltage_follower + - megaavr/libraries/ZCD/examples/Interrupt + - megaavr/libraries/ZCD/examples/Read_state + - megaavr/libraries/ZCD/examples/Simple_ZCD + - megaavr/extras/ci/test-sketch/db/dummysketch + too-hard-to-make-build-at-lowpin-false-sketch-paths: | + - megaavr/libraries/Logic/examples/Modulate + #avr-ea-series-sketch-paths: | + optiboot-and-appspm-da-sketch-paths: | + - megaavr/libraries/Flash/examples/FlashDemo + optiboot-and-appspm-db-sketch-paths: | + - megaavr/libraries/Flash/examples/FlashDemo + optiboot-and-appspm-dd-sketch-paths: | + - megaavr/libraries/Flash/examples/FlashDemo + not-on-tca0-millis-lowpin-false-sketch-paths: | + - megaavr/libraries/DxCore/examples/TCA0Demo + - megaavr/libraries/DxCore/examples/TCA0Demo2 + - megaavr/libraries/DxCore/examples/TCA0Demo3 + - megaavr/libraries/DxCore/examples/TCA0Demo4 + not-disabled-millis-sketch-paths: | + - megaavr/libraries/tinyNeoPixel/examples/RGBWstrandtest + - megaavr/libraries/Wire/examples/register_model + - megaavr/libraries/Wire/examples/register_model_master + #internal-osc-sketch-paths: | + both-twi-enabled-sketch-paths: | + - megaavr/libraries/Wire/examples/two_master_write + not-disabled-millis-or-unlocked-flmap-sketch-paths: | + - megaavr/libraries/DxCore/examples/PWMTest + strategy: + fail-fast: false + + matrix: + flash-class: + - 128 + - 64 + - 32 + - 16 + device-family: + - da + - db + - dd + - du + pincount: + - 64 + - 48 + - 32 + - 28 + - 20 + - 14 + clocksource: + - internal + - extclock + - crystal + int-osc: + - 20 + - 24 + overclock-osc: + - 16 + - 32 + - 48 + millis: + - rtc + - rtcxtal + - rtcxosc + + # Filter out these matrix combinations + + exclude: + - overclock-osc: 48 + # Things w/out xtals + - device-family: da + clocksource: crystal + # DA limits. No 8/16k flash, no 32k 64-pin. No 20/14 pin. + - device-family: da + flash-class: 32 + pincount: 64 + - device-family: da + flash-class: 16 + - device-family: da + pincount: 20 + - device-family: da + pincount: 14 + # DB limits. No 8/16k flash, no 32k 64-pin. No 20/14 pin. + - device-family: db + flash-class: 32 + pincount: 64 + - device-family: db + flash-class: 16 + - device-family: db + pincount: 20 + - device-family: db + pincount: 14 + # DD limits. No 128k/8k flash, no 64/48 pin. + - device-family: dd + flash-class: 128 + - device-family: dd + pincount: 64 + - device-family: dd + pincount: 48 + # DU limits. No 128k/8k flash, no 64/48 pin. No 64k 20/14pin. + - device-family: du + flash-class: 128 + - device-family: du + pincount: 64 + - device-family: du + pincount: 48 + - device-family: du + pincount: 20 + flash-class: 64 + - device-family: du + pincount: 14 + flash-class: 64 + - int-osc: 20 + device-family: da + - int-osc: 20 + device-family: db + - int-osc: 20 + device-family: dd + # ugly Dx/Ex hack. No 16 MHz DB xtal tests, DA ext 16 MHz, DD 16 MHz xtal. Ex @ 48 excluded further down. + - overclock-osc: 48 + clocksource: internal + - overclock-osc: 48 + device-family: dd + clocksource: crystal + - overclock-osc: 48 + device-family: db + clocksource: extclock + - overclock-osc: 48 + device-family: da + clocksource: extclock + - overclock-osc: 32 + device-family: db + clocksource: internal + - overclock-osc: 32 + device-family: db + clocksource: crystal + - overclock-osc: 32 + device-family: dd + clocksource: crystal + - overclock-osc: 32 + device-family: da + clocksource: extclock + - overclock-osc: 32 + device-family: dd + clocksource: extclock + - overclock-osc: 16 + device-family: da + clocksource: internal + - overclock-osc: 16 + device-family: dd + clocksource: internal + - overclock-osc: 16 + device-family: db + clocksource: crystal + - overclock-osc: 16 + device-family: db + clocksource: extclock + - overclock-osc: 16 + device-family: dd + clocksource: extclock + - overclock-osc: 48 + device-family: du + - overclock-osc: 32 + device-family: du + - device-family: du + pincount: 20 + int-osc: 20 + flash-class: 16 + - device-family: du + pincount: 32 + int-osc: 20 + flash-class: 16 + - device-family: du + pincount: 28 + int-osc: 24 + flash-class: 16 + - device-family: du + pincount: 14 + int-osc: 24 + flash-class: 16 + - device-family: du + pincount: 20 + int-osc: 20 + flash-class: 16 + - device-family: du + pincount: 20 + int-osc: 24 + flash-class: 32 + - device-family: du + pincount: 32 + int-osc: 24 + flash-class: 32 + - device-family: du + pincount: 28 + int-osc: 20 + flash-class: 32 + - device-family: du + pincount: 14 + int-osc: 20 + flash-class: 32 + - device-family: du + pincount: 20 + int-osc: 24 + flash-class: 32 + - device-family: du + pincount: 28 + clocksource: extclock + flash-class: 32 + - device-family: du + pincount: 32 + clocksource: crystal + flash-class: 32 + - device-family: du + pincount: 32 + clocksource: extclock + flash-class: 16 + - device-family: du + pincount: 28 + clocksource: crystal + flash-class: 16 + - device-family: du + pincount: 14 + clocksource: crystal + flash-class: 16 + - device-family: du + pincount: 20 + clocksource: extclock + flash-class: 16 + - device-family: du + pincount: 14 + clocksource: extclock + flash-class: 32 + - device-family: du + pincount: 20 + clocksource: crystal + flash-class: 32 + - device-family: du + pincount: 32 + clocksource: extclock + flash-class: 64 + - device-family: du + pincount: 28 + clocksource: crystal + flash-class: 64 + - device-family: dd + pincount: 32 + clocksource: internal + flash-class: 32 + - device-family: dd + pincount: 28 + clocksource: extclock + flash-class: 32 + - device-family: dd + pincount: 28 + clocksource: crystal + flash-class: 32 + - device-family: dd + pincount: 20 + clocksource: internal + flash-class: 32 + - device-family: dd + pincount: 20 + clocksource: crystal + flash-class: 32 + - device-family: dd + pincount: 14 + clocksource: extclock + flash-class: 32 + - device-family: dd + pincount: 32 + clocksource: extclock + flash-class: 16 + - device-family: dd + pincount: 28 + clocksource: crystal + flash-class: 16 + - device-family: dd + pincount: 28 + clocksource: internal + flash-class: 16 + - device-family: dd + pincount: 20 + clocksource: extclock + flash-class: 16 + - device-family: dd + pincount: 20 + clocksource: internal + flash-class: 16 + - device-family: dd + pincount: 14 + clocksource: crystal + flash-class: 16 + - device-family: da + pincount: 48 + clocksource: extclock + flash-class: 32 + - device-family: da + pincount: 32 + clocksource: internal + flash-class: 32 + - device-family: da + pincount: 28 + clocksource: extclock + flash-class: 32 + - device-family: da + pincount: 28 + clocksource: internal + flash-class: 64 + - device-family: da + pincount: 32 + clocksource: extclock + flash-class: 64 + - device-family: da + pincount: 48 + clocksource: internal + flash-class: 64 + - device-family: da + pincount: 64 + clocksource: extclock + flash-class: 64 + - device-family: da + pincount: 28 + clocksource: extclock + flash-class: 128 + - device-family: da + pincount: 32 + clocksource: internal + flash-class: 128 + - device-family: da + pincount: 48 + clocksource: extclock + flash-class: 128 + - device-family: da + pincount: 64 + clocksource: internal + flash-class: 128 + - device-family: db + pincount: 48 + clocksource: extclock + flash-class: 32 + - device-family: db + pincount: 32 + clocksource: crystal + flash-class: 32 + - device-family: db + pincount: 28 + clocksource: internal + flash-class: 32 + - device-family: db + pincount: 48 + clocksource: crystal + flash-class: 32 + - device-family: db + pincount: 32 + clocksource: internal + flash-class: 32 + - device-family: db + pincount: 28 + clocksource: extclock + flash-class: 32 + steps: + - name: Checkout repository + uses: actions/checkout@v6 + with: + ref: ${{ github.ref.name }} + + - name: check + run: | + pwd + echo github.ref.name ${{ github.ref_name }} + echo workflow ${{ github.workflow_ref }} + + # See: https://github.com/arduino/compile-sketches/README.md + + - name: Compile examples (rated max speed, nothing weird, RTC all modes) + uses: arduino/compile-sketches@main + with: + cli-version: 0.33.0 + fqbn: ${{ env.platform-name }}:avr${{ matrix.device-family }}:chip=avr${{ matrix.flash-class }}${{ matrix.device-family }}${{ matrix.pincount }},clock=${{matrix.int-osc}}${{ matrix.clocksource }},millis=${{ matrix.millis }},wiremode=mands,flmap=lockdefault + sketch-paths: | + # It's necessary to jump through some hoops to dynamically generate the env object keys to define the non-universal sketch paths + # https://docs.github.com/en/free-pro-team@latest/actions/reference/context-and-expression-syntax-for-github-actions#format + ${{ env.all-parts-sketch-paths }} + ${{ env[format('avr-{0}-series-sketch-paths', matrix.device-family)] }} + ${{ env[format('not-on-tca0-millis-lowpin-{0}-sketch-paths', matrix.pincount < 28)] }} + ${{ env.not-disabled-millis-sketch-paths}} + ${{ env.not-disabled-millis-or-unlocked-flmap-sketch-paths}} + ${{ env[format('too-hard-to-make-build-at-lowpin-{0}-sketch-paths', matrix.pincount < 20)] }} + platforms: | + # Install DxCore via Boards Manager for the toolchain + - source-url: http://drazzy.com/package_drazzy.com_index.json + name: ${{ env.platform-name }} + # Overwrite the DxCore release version with the platform from the local path + - source-path: megaavr + name: ${{ env.platform-name }} + libraries: | + # The sketches don't have any external library dependencies, so just define an empty array + - + verbose: false + enable-deltas-report: false + github-token: ${{ secrets.GITHUB_TOKEN }} + enable-warnings-report: false + sketches-report-path: sketches-reports + + - name: Compile examples (overclocked to the max, tcb1 millis, minimal printf, old attachInterrupt, full appspm) + uses: arduino/compile-sketches@main + with: + cli-version: 0.33.0 + fqbn: ${{ env.platform-name }}:avr${{ matrix.device-family }}:chip=avr${{ matrix.flash-class }}${{ matrix.device-family }}${{ matrix.pincount }},clock=${{ matrix.overclock-osc }}${{ matrix.clocksource }},millis=tcb1,printf=minimal,wiremode=mors,attach=oldversion,appspm=full,flmap=lockdefault + sketch-paths: | + # It's necessary to jump through some hoops to dynamically generate the env object keys to define the non-universal sketch paths + # https://docs.github.com/en/free-pro-team@latest/actions/reference/context-and-expression-syntax-for-github-actions#format + ${{ env.all-parts-sketch-paths }} + ${{ env[format('avr-{0}-series-sketch-paths', matrix.device-family)] }} + ${{ env[format('optiboot-and-appspm-{0}-sketch-paths', matrix.device-family)] }} + ${{ env[format('not-on-tca0-millis-lowpin-{0}-sketch-paths', matrix.pincount < 28)] }} + ${{ env.not-disabled-millis-sketch-paths}} + ${{ env.not-disabled-millis-or-unlocked-flmap-sketch-paths}} + ${{ env[format('too-hard-to-make-build-at-lowpin-{0}-sketch-paths', matrix.pincount < 20)] }} + platforms: | + # Install DxCore via Boards Manager for the toolchain + - source-url: http://drazzy.com/package_drazzy.com_index.json + name: ${{ env.platform-name }} + # Overwrite the DxCore release version with the platform from the local path + - source-path: megaavr + name: ${{ env.platform-name }} + libraries: | + # The sketches don't have any external library dependencies, so just define an empty array + - + verbose: false + enable-deltas-report: false + github-token: ${{ secrets.GITHUB_TOKEN }} + enable-warnings-report: false + sketches-report-path: sketches-reports + + - name: Compile examples (20 MHz, disable millis, sized appspm, flmap L0, wire mors) + uses: arduino/compile-sketches@main + with: + fqbn: ${{ env.platform-name }}:avr${{ matrix.device-family }}:chip=avr${{ matrix.flash-class }}${{ matrix.device-family }}${{ matrix.pincount }},clock=20${{ matrix.clocksource }},millis=disabled,appspm=24plus,wiremode=mors,flmap=locksection0 + sketch-paths: | + # It's necessary to jump through some hoops to dynamically generate the env object keys to define the non-universal sketch paths + # https://docs.github.com/en/free-pro-team@latest/actions/reference/context-and-expression-syntax-for-github-actions#format + ${{ env.all-parts-sketch-paths }} + ${{ env[format('avr-{0}-series-sketch-paths', matrix.device-family)] }} + ${{ env[format('optiboot-and-appspm-{0}-sketch-paths', matrix.device-family)] }} + ${{ env[format('not-on-tca0-millis-lowpin-{0}-sketch-paths', matrix.pincount < 28)] }} + ${{ env[format('too-hard-to-make-build-at-lowpin-{0}-sketch-paths', matrix.pincount < 20)] }} + platforms: | + # Install DxCore via Boards Manager for the toolchain + - source-url: http://drazzy.com/package_drazzy.com_index.json + name: ${{ env.platform-name }} + # Overwrite the DxCore release version with the platform from the local path + - source-path: megaavr + name: ${{ env.platform-name }} + libraries: | + # The sketches don't have any external library dependencies, so just define an empty array + - + verbose: false + enable-deltas-report: false + github-token: ${{ secrets.GITHUB_TOKEN }} + enable-warnings-report: false + sketches-report-path: sketches-reports + + - name: Compile examples (8 MHz, optiboot (if available), tca0 millis, full printf, and manual attachInterrupt) + if: matrix.device-family != 'ea' && matrix.device-family != 'eb' && matrix.device-family != 'du' + uses: arduino/compile-sketches@main + with: + cli-version: 0.33.0 + fqbn: ${{ env.platform-name }}:avr${{ matrix.device-family }}opti:chip=avr${{ matrix.flash-class }}${{ matrix.device-family }}${{ matrix.pincount }},clock=8${{ matrix.clocksource }},millis=tca0,printf=full,attach=manual,wiremode=mands,flmap=unlocked + sketch-paths: | + # It's necessary to jump through some hoops to dynamically generate the env object keys to define the non-universal sketch paths + # https://docs.github.com/en/free-pro-team@latest/actions/reference/context-and-expression-syntax-for-github-actions#format + ${{ env.all-parts-sketch-paths }} + ${{ env[format('avr-{0}-series-sketch-paths', matrix.device-family)] }} + ${{ env[format('optiboot-and-appspm-{0}-sketch-paths', matrix.device-family)] }} + ${{ env.not-disabled-millis-sketch-paths}} + ${{ env[format('too-hard-to-make-build-at-lowpin-{0}-sketch-paths', matrix.pincount < 20)] }} + platforms: | + # Install DxCore via Boards Manager for the toolchain + - source-url: http://drazzy.com/package_drazzy.com_index.json + name: ${{ env.platform-name }} + # Overwrite the DxCore release version with the platform from the local path + - source-path: megaavr + name: ${{ env.platform-name }} + libraries: | + # The sketches don't have any external library dependencies, so just define an empty array + - + verbose: false + enable-deltas-report: false + github-token: ${{ secrets.GITHUB_TOKEN }} + enable-warnings-report: false + sketches-report-path: sketches-reports diff --git a/megaavr/boards.txt b/megaavr/boards.txt index 1d2e67a3..5a805af3 100644 --- a/megaavr/boards.txt +++ b/megaavr/boards.txt @@ -93,7 +93,7 @@ menu.WDTwindow=WDT "window" (Bootload burn req'd) menu.eesave=Save EEPROM #menu.eesavedd=Save EEPROM (Bootload burn req'd) menu.resetpin=Reset pin function -#menu.resetupdipins=Reset and UPDI (Bootload burn req'd) +menu.resetupdipins=Reset and UPDI (Bootload burn req'd) menu.resetupdipinsopti=Reset and UPDI (Bootload burn req'd) menu.startuptime=Startup Time menu.startuptimeopti=Startup Time (Bootload burn req'd) @@ -131,10 +131,11 @@ avrdbopti.name=AVR DB-series (Optiboot) avrddopti.name=AVR DD-series (Optiboot) #avrduopti.name=AVR DU-series (Optiboot) #avrduusb.name=AVR DU-series with USB Bootloader TBD. -#avreaopti.name=AVR EA-series (Optiboot) -#avrebopti.name=AVR EB-series (Optiboot) +avreaopti.name=AVR EA-series (Optiboot) +avrebopti.name=AVR EB-series (Optiboot) #avrecopti.name=AVR EC-series (Optiboot) #avrlaopti.mame=AVR LA-series (Optiboot) + azduinoboard.name=Azduino Boards (Optiboot) ########################################################################## @@ -490,6 +491,12 @@ avrda.menu.millis.tcb3.build.millistimer=B3 avrda.menu.millis.tcb4.build.millistimer=B4 avrda.menu.millis.tca0.build.millistimer=A0 avrda.menu.millis.tca1.build.millistimer=A1 +avrda.menu.millis.rtc=RTC internal osc (no micros) +avrda.menu.millis.rtcxtal=RTC w/w32.768 kHz ext. xtal, no micros +avrda.menu.millis.rtcxosc=RTC w/w32.768 kHz ext. osc no micros +avrda.menu.millis.rtc.build.millistimer=RTC_OSC +avrda.menu.millis.rtcxtal.build.millistimer=RTC_XTAL +avrda.menu.millis.rtcxosc.build.millistimer=RTC_XOSC avrda.menu.millis.disabled.build.millistimer=NONE #----------------------------------------# @@ -981,6 +988,12 @@ avrdb.menu.millis.tcb3.build.millistimer=B3 avrdb.menu.millis.tcb4.build.millistimer=B4 avrdb.menu.millis.tca0.build.millistimer=A0 avrdb.menu.millis.tca1.build.millistimer=A1 +avrdb.menu.millis.rtc=RTC internal osc (no micros) +avrdb.menu.millis.rtcxtal=RTC w/w32.768 kHz ext. xtal, no micros +avrdb.menu.millis.rtcxosc=RTC w/w32.768 kHz ext. osc no micros +avrdb.menu.millis.rtc.build.millistimer=RTC_OSC +avrdb.menu.millis.rtcxtal.build.millistimer=RTC_XTAL +avrdb.menu.millis.rtcxosc.build.millistimer=RTC_XOSC avrdb.menu.millis.disabled.build.millistimer=NONE #----------------------------------------# @@ -1504,6 +1517,12 @@ avrdd.menu.millis.tcb0.build.millistimer=B0 avrdd.menu.millis.tcb1.build.millistimer=B1 avrdd.menu.millis.tcb2.build.millistimer=B2 avrdd.menu.millis.tca0.build.millistimer=A0 +avrdd.menu.millis.rtc=RTC internal osc (no micros) +avrdd.menu.millis.rtcxtal=RTC w/w32.768 kHz ext. xtal, no micros +avrdd.menu.millis.rtcxosc=RTC w/w32.768 kHz ext. osc no micros +avrdd.menu.millis.rtc.build.millistimer=RTC_OSC +avrdd.menu.millis.rtcxtal.build.millistimer=RTC_XTAL +avrdd.menu.millis.rtcxosc.build.millistimer=RTC_XOSC avrdd.menu.millis.disabled.build.millistimer=NONE #----------------------------------------# @@ -1899,6 +1918,12 @@ avrdu.menu.millis.tcbhighest.build.millistimer=B1 avrdu.menu.millis.tcb0.build.millistimer=B0 avrdu.menu.millis.tcb1.build.millistimer=B1 avrdu.menu.millis.tca0.build.millistimer=A0 +avrdu.menu.millis.rtc=RTC internal osc (no micros) +avrdu.menu.millis.rtcxtal=RTC w/w32.768 kHz ext. xtal, no micros +avrdu.menu.millis.rtcxosc=RTC w/w32.768 kHz ext. osc no micros +avrdu.menu.millis.rtc.build.millistimer=RTC_OSC +avrdu.menu.millis.rtcxtal.build.millistimer=RTC_XTAL +avrdu.menu.millis.rtcxosc.build.millistimer=RTC_XOSC avrdu.menu.millis.disabled.build.millistimer=NONE #----------------------------------------# @@ -2353,18 +2378,18 @@ avrea.menu.millis.tcb1=TCB1 avrea.menu.millis.tcb3=TCB3 avrea.menu.millis.tca0=TCA0 avrea.menu.millis.tca1=TCA1 -#avrea.menu.millis.rtc=RTC (no micros) -#avrea.menu.millis.rtcxtal=RTC w/w32.768 kHz ext. xtal, no micros -#avrea.menu.millis.rtcxosc=RTC w/w32.768 kHz ext. osc no micros +avrea.menu.millis.rtc=RTC internal osc (no micros) +avrea.menu.millis.rtcxtal=RTC w/w32.768 kHz ext. xtal, no micros +avrea.menu.millis.rtcxosc=RTC w/w32.768 kHz ext. osc no micros avrea.menu.millis.tcb0.build.millistimer=B0 avrea.menu.millis.tcb1.build.millistimer=B1 avrea.menu.millis.tcb2.build.millistimer=B2 avrea.menu.millis.tcb3.build.millistimer=B3 avrea.menu.millis.tca0.build.millistimer=A0 avrea.menu.millis.tca1.build.millistimer=A1 -#avrea.menu.millis.rtc.build.millistimer=RTC -#avrea.menu.millis.rtcxtal.build.millistimer=RTC_XTAL -#avrea.menu.millis.rtcxosc.build.millistimer=RTC_XOSC +avrea.menu.millis.rtc.build.millistimer=RTC_OSC +avrea.menu.millis.rtcxtal.build.millistimer=RTC_XTAL +avrea.menu.millis.rtcxosc.build.millistimer=RTC_XOSC avrea.menu.millis.disabled.build.millistimer=NONE #----------------------------------------# @@ -2810,16 +2835,16 @@ avreb.menu.millis.disabled=Disabled avreb.menu.millis.tcb0=TCB0 #avreb.menu.millis.tce0=TCE0 #avreb.menu.millis.tcf3=TCF0 -#avreb.menu.millis.rtc=RTC (no micros) -#avreb.menu.millis.rtcxtal=RTC w/w32.768 kHz ext. xtal, no micros -#avreb.menu.millis.rtcxosc=RTC w/w32.768 kHz ext. osc no micros +avreb.menu.millis.rtc=RTC (no micros) +avreb.menu.millis.rtcxtal=RTC w/w32.768 kHz ext. xtal, no micros +avreb.menu.millis.rtcxosc=RTC w/w32.768 kHz ext. osc no micros avreb.menu.millis.tcb0.build.millistimer=B0 avreb.menu.millis.tcb1.build.millistimer=B1 #avreb.menu.millis.tce0.build.millistimer=E0 #avreb.menu.millis.tcf0.build.millistimer=F0 -#avreb.menu.millis.rtc.build.millistimer=RTC -#avreb.menu.millis.rtcxtal.build.millistimer=RTC_XTAL -#avreb.menu.millis.rtcxosc.build.millistimer=RTC_XOSC +avreb.menu.millis.rtc.build.millistimer=RTC +avreb.menu.millis.rtcxtal.build.millistimer=RTC_XTAL +avreb.menu.millis.rtcxosc.build.millistimer=RTC_XOSC avreb.menu.millis.disabled.build.millistimer=NONE #----------------------------------------# @@ -3348,6 +3373,12 @@ avrdaopti.menu.millis.tcb3.build.millistimer=B3 avrdaopti.menu.millis.tcb4.build.millistimer=B4 avrdaopti.menu.millis.tca0.build.millistimer=A0 avrdaopti.menu.millis.tca1.build.millistimer=A1 +avrdaopti.menu.millis.rtc=RTC internal osc (no micros) +avrdaopti.menu.millis.rtcxtal=RTC w/w32.768 kHz ext. xtal, no micros +avrdaopti.menu.millis.rtcxosc=RTC w/w32.768 kHz ext. osc no micros +avrdaopti.menu.millis.rtc.build.millistimer=RTC_OSC +avrdaopti.menu.millis.rtcxtal.build.millistimer=RTC_XTAL +avrdaopti.menu.millis.rtcxosc.build.millistimer=RTC_XOSC avrdaopti.menu.millis.disabled.build.millistimer=NONE #----------------------------------------# @@ -3909,6 +3940,12 @@ avrdbopti.menu.millis.tcb3.build.millistimer=B3 avrdbopti.menu.millis.tcb4.build.millistimer=B4 avrdbopti.menu.millis.tca0.build.millistimer=A0 avrdbopti.menu.millis.tca1.build.millistimer=A1 +avrdbopti.menu.millis.rtc=RTC internal osc (no micros) +avrdbopti.menu.millis.rtcxtal=RTC w/w32.768 kHz ext. xtal, no micros +avrdbopti.menu.millis.rtcxosc=RTC w/w32.768 kHz ext. osc no micros +avrdbopti.menu.millis.rtc.build.millistimer=RTC_OSC +avrdbopti.menu.millis.rtcxtal.build.millistimer=RTC_XTAL +avrdbopti.menu.millis.rtcxosc.build.millistimer=RTC_XOSC avrdbopti.menu.millis.disabled.build.millistimer=NONE #----------------------------------------# @@ -4492,6 +4529,12 @@ avrddopti.menu.millis.tcb1.build.millistimer=B1 avrddopti.menu.millis.tcb2.build.millistimer=B2 avrddopti.menu.millis.tca0.build.millistimer=A0 #avrddopti.menu.millis.tcd0.build.millistimer=D0 +avrddopti.menu.millis.rtc=RTC internal osc (no micros) +avrddopti.menu.millis.rtcxtal=RTC w/w32.768 kHz ext. xtal, no micros +avrddopti.menu.millis.rtcxosc=RTC w/w32.768 kHz ext. osc no micros +avrddopti.menu.millis.rtc.build.millistimer=RTC_OSC +avrddopti.menu.millis.rtcxtal.build.millistimer=RTC_XTAL +avrddopti.menu.millis.rtcxosc.build.millistimer=RTC_XOSC avrddopti.menu.millis.disabled.build.millistimer=NONE #----------------------------------------# @@ -4682,8 +4725,463 @@ avrddopti.menu.flmap.locksection0.build.flmapabr=.fl0 # # # # # # ##### # # ### ### # ## # #______________________________________________________#_________________# -#avrea.bootloader.oschffrq=0 -#avrea.bootloader.OSCCFG=0b0000{bootloader.oschffrq}000 +avreaopti.build.board=avrea +avreaopti.build.core=dxcore +# The maximum size and data size attributes are overridden by the selected chip. If you are avoiding specifying that somehow, there is no hope of anything working, so don't do that. +# Each top-level entry supports at least a dozen parts with varying memory constraints. +avreaopti.build.f_cpu={build.speed}000000L +avreaopti.build.text_section_start=.text=0x200 +avreaopti.build.extra_flags= -DSERIAL_PORT_BOOT={bootloader.portname} -DSERIAL_PORT_BOOT_PORTMUX={bootloader.portswap} -DUSING_OPTIBOOT +avreaopti.build.export_merged_output=false +avreaopti.build.printf= +avreaopti.build.flmapopts= +avreaopti.build.millistimer=B2 + +#----------------------------------------# +# Bootloading parameters and fuses # +#________________________________________# +avreaopti.bootloader.tool=avrdude +avreaopti.bootloader.WDTCFG=0b{bootloader.wdtwindowbits}{bootloader.wdttimeoutbits} +# AVR Ex-series can only take either 0 (20 MHz) or 8 (16 MHz). overridden when 16 MHz used. +avreaopti.bootloader.oschffrq=0 +avreaopti.bootloader.OSCCFG=0b0000{bootloader.oschffrq}000 +avreaopti.bootloader.wdtwindowbits=0000 +avreaopti.bootloader.wdttimeotbits=0000 +avreaopti.bootloader.BODCFG=0b{bootloader.bodlevbits}{bootloader.bodmodebits} +avreaopti.bootloader.SYSCFG0=0b110{bootloader.updipinbit}{bootloader.resetpinbit}00{bootloader.eesavebit} +avreaopti.bootloader.CODESIZE=0x00 +avreaopti.bootloader.BOOTSIZE=0x02 +avreaopti.bootloader.avrdudestring= +avreaopti.bootloader.pymcuprogstring=-aerase +avreaopti.bootloader.avrdudefuse5="-Ufuse5:w:{bootloader.SYSCFG0}:m" +avreaopti.bootloader.supdidudefuse5=5:{bootloader.SYSCFG0} + +#----------------------------------------# +# Upload parameters for Optiboot # +#________________________________________# +avreaopti.upload.tool=avrdude +avreaopti.upload.protocol=arduino +avreaopti.upload.extra_params=-D +avreaopti.upload.speed=115200 +avreaopti.upload.prog_interlock="ERROR: Upload using programmer is not supported on optiboot boards" + +#----------------------------------------# +# Exported hex/lst/map names will # +# indicate selected options. These # +# are only to do that, nothing else # +#________________________________________# +avreaopti.build.mcupostfix= +avreaopti.build.printfabr= +avreaopti.build.flmapabr=.ful +avreaopti.build.attachabr= +avreaopti.build.wireabr= +##Not supported but still need empty string here. +avreaopti.build.appspmabr= + +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^# +# AVR-EA submenu options # +#____________________________________________# +# Chip (memory and pincount) # +#_______________________________________# +avreaopti.menu.chip.avr64ea28=AVR64EA28 +avreaopti.menu.chip.avr64ea28.build.mcu=avr64ea28 +avreaopti.menu.chip.avr64ea28.upload.maximum_size=65536 +avreaopti.menu.chip.avr64ea28.upload.maximum_data_size=8192 +avreaopti.menu.chip.avr64ea28.build.variant=28pin-easeries +avreaopti.menu.chip.avr64ea32=AVR64EA32 +avreaopti.menu.chip.avr64ea32.build.mcu=avr64ea32 +avreaopti.menu.chip.avr64ea32.upload.maximum_size=65536 +avreaopti.menu.chip.avr64ea32.upload.maximum_data_size=8192 +avreaopti.menu.chip.avr64ea32.build.variant=32pin-easeries +avreaopti.menu.chip.avr64ea48=AVR64EA48 +avreaopti.menu.chip.avr64ea48.build.mcu=avr64ea48 +avreaopti.menu.chip.avr64ea48.upload.maximum_size=65536 +avreaopti.menu.chip.avr64ea48.upload.maximum_data_size=8192 +avreaopti.menu.chip.avr64ea48.build.variant=48pin-easeries +avreaopti.menu.chip.avr32ea28=AVR32EA28 +avreaopti.menu.chip.avr32ea28.build.mcu=avr32ea28 +avreaopti.menu.chip.avr32ea28.upload.maximum_size=32768 +avreaopti.menu.chip.avr32ea28.upload.maximum_data_size=4096 +avreaopti.menu.chip.avr32ea28.build.variant=28pin-easeries +avreaopti.menu.chip.avr32ea32=AVR32EA32 +avreaopti.menu.chip.avr32ea32.build.mcu=avr32ea32 +avreaopti.menu.chip.avr32ea32.upload.maximum_size=32768 +avreaopti.menu.chip.avr32ea32.upload.maximum_data_size=4096 +avreaopti.menu.chip.avr32ea32.build.variant=32pin-easeries +avreaopti.menu.chip.avr32ea48=AVR32EA48 +avreaopti.menu.chip.avr32ea48.build.mcu=avr32ea48 +avreaopti.menu.chip.avr32ea48.upload.maximum_size=32768 +avreaopti.menu.chip.avr32ea48.upload.maximum_data_size=4096 +avreaopti.menu.chip.avr32ea48.build.variant=48pin-easeries +avreaopti.menu.chip.avr16ea28=AVR16EA28 +avreaopti.menu.chip.avr16ea28.build.mcu=avr16ea28 +avreaopti.menu.chip.avr16ea28.upload.maximum_size=16384 +avreaopti.menu.chip.avr16ea28.upload.maximum_data_size=2048 +avreaopti.menu.chip.avr16ea28.build.variant=28pin-easeries +avreaopti.menu.chip.avr16ea32=AVR16EA32 +avreaopti.menu.chip.avr16ea32.build.mcu=avr16ea32 +avreaopti.menu.chip.avr16ea32.upload.maximum_size=16384 +avreaopti.menu.chip.avr16ea32.upload.maximum_data_size=2048 +avreaopti.menu.chip.avr16ea32.build.variant=32pin-easeries +avreaopti.menu.chip.avr16ea48=AVR16EA48 +avreaopti.menu.chip.avr16ea48.build.mcu=avr16ea48 +avreaopti.menu.chip.avr16ea48.upload.maximum_size=16384 +avreaopti.menu.chip.avr16ea48.upload.maximum_data_size=2048 +avreaopti.menu.chip.avr16ea48.build.variant=48pin-easeries + +#----------------------------------------# +# Clock speed and source options # +#________________________________________# +avreaopti.menu.clock.20internal=20 MHz internal +avreaopti.menu.clock.20internal.build.speed=20 +avreaopti.menu.clock.20internal.build.clocksource=0 +avreaopti.menu.clock.16internal=16 MHz internal +avreaopti.menu.clock.16internal.build.speed=16 +avreaopti.menu.clock.16internal.build.clocksource=0 +avreaopti.menu.clock.16internal.bootloader.oschffrq=1 +avreaopti.menu.clock.10internal=10 MHz internal +avreaopti.menu.clock.10internal.build.speed=10 +avreaopti.menu.clock.10internal.build.clocksource=0 +avreaopti.menu.clock.8internal=8 MHz internal +avreaopti.menu.clock.8internal.build.speed=8 +avreaopti.menu.clock.8internal.build.clocksource=0 +avreaopti.menu.clock.8internal.bootloader.oschffrq=1 +avreaopti.menu.clock.5internal=5 MHz internal +avreaopti.menu.clock.5internal.build.speed=5 +avreaopti.menu.clock.5internal.build.clocksource=0 +avreaopti.menu.clock.4internal=4 MHz internal +avreaopti.menu.clock.4internal.build.speed=4 +avreaopti.menu.clock.4internal.build.clocksource=0 +avreaopti.menu.clock.4internal.bootloader.oschffrq=1 +avreaopti.menu.clock.1internal=1 MHz internal +avreaopti.menu.clock.1internal.build.speed=1 +avreaopti.menu.clock.1internal.build.clocksource=0 +avreaopti.menu.clock.1internal.bootloader.oschffrq=1 +avreaopti.menu.clock.20crystal=20 MHz crystal +avreaopti.menu.clock.20crystal.build.speed=20 +avreaopti.menu.clock.20crystal.build.clocksource=1 +avreaopti.menu.clock.16crystal=16 MHz crystal +avreaopti.menu.clock.16crystal.build.speed=16 +avreaopti.menu.clock.16crystal.build.clocksource=1 +avreaopti.menu.clock.12crystal=12 MHz crystal +avreaopti.menu.clock.12crystal.build.speed=12 +avreaopti.menu.clock.12crystal.build.clocksource=1 +avreaopti.menu.clock.8crystal=8 MHz crystal +avreaopti.menu.clock.8crystal.build.speed=8 +avreaopti.menu.clock.8crystal.build.clocksource=1 +avreaopti.menu.clock.20extclock=20 MHz ext. clock +avreaopti.menu.clock.20extclock.build.speed=20 +avreaopti.menu.clock.20extclock.build.clocksource=2 +avreaopti.menu.clock.16extclock=16 MHz ext. clock +avreaopti.menu.clock.16extclock.build.speed=16 +avreaopti.menu.clock.16extclock.build.clocksource=2 +avreaopti.menu.clock.12extclock=12 MHz ext. clock +avreaopti.menu.clock.12extclock.build.speed=12 +avreaopti.menu.clock.12extclock.build.clocksource=2 +avreaopti.menu.clock.8extclock=8 MHz ext. clock +avreaopti.menu.clock.8extclock.build.speed=8 +avreaopti.menu.clock.8extclock.build.clocksource=2 +avreaopti.menu.clock.24crystal=24 MHz crystal (overclocked) +avreaopti.menu.clock.24crystal.build.speed=24 +avreaopti.menu.clock.24crystal.build.clocksource=1 +avreaopti.menu.clock.25crystal=25 MHz crystal (overclocked) +avreaopti.menu.clock.25crystal.build.speed=25 +avreaopti.menu.clock.25crystal.build.clocksource=1 +avreaopti.menu.clock.27crystal=27 MHz crystal (overclocked) +avreaopti.menu.clock.27crystal.build.speed=27 +avreaopti.menu.clock.27crystal.build.clocksource=1 +avreaopti.menu.clock.28crystal=28 MHz crystal (overclocked) +avreaopti.menu.clock.28crystal.build.speed=28 +avreaopti.menu.clock.28crystal.build.clocksource=1 +avreaopti.menu.clock.30crystal=30 MHz crystal (way overclocked) +avreaopti.menu.clock.30crystal.build.speed=30 +avreaopti.menu.clock.30crystal.build.clocksource=1 +avreaopti.menu.clock.32crystal=32 MHz crystal (way overclocked) +avreaopti.menu.clock.32crystal.build.speed=32 +avreaopti.menu.clock.32crystal.build.clocksource=1 +#avreaopti.menu.clock.36crystal=36 MHz crystal (unlikely-to-work overclocked) +#avreaopti.menu.clock.36crystal.build.speed=36 +#avreaopti.menu.clock.36crystal.build.clocksource=1 +#avreaopti.menu.clock.40crystal=40 MHz crystal (unlikely-to-work overclocked) +#avreaopti.menu.clock.40crystal.build.speed=40 +#avreaopti.menu.clock.40crystal.build.clocksource=1 +avreaopti.menu.clock.24extclock=24 MHz ext. clock (overclocked) +avreaopti.menu.clock.24extclock.build.speed=24 +avreaopti.menu.clock.24extclock.build.clocksource=2 +avreaopti.menu.clock.25extclock=25 MHz ext. clock (overclocked) +avreaopti.menu.clock.25extclock.build.speed=25 +avreaopti.menu.clock.25extclock.build.clocksource=2 +avreaopti.menu.clock.27extclock=27 MHz ext. clock (overclocked) +avreaopti.menu.clock.27extclock.build.speed=27 +avreaopti.menu.clock.27extclock.build.clocksource=2 +avreaopti.menu.clock.28extclock=28 MHz ext. clock (overclocked) +avreaopti.menu.clock.28extclock.build.speed=28 +avreaopti.menu.clock.28extclock.build.clocksource=2 +avreaopti.menu.clock.30extclock=30 MHz ext. clock (wayoverclocked) +avreaopti.menu.clock.30extclock.build.speed=30 +avreaopti.menu.clock.30extclock.build.clocksource=2 +avreaopti.menu.clock.32extclock=32 MHz ext. clock (way overclocked) +avreaopti.menu.clock.32extclock.build.speed=32 +avreaopti.menu.clock.32extclock.build.clocksource=2 +#avreaopti.menu.clock.36extclock=36 MHz ext. clock (unlikely-to-work overclocked) +#avreaopti.menu.clock.36extclock.build.speed=36 +#avreaopti.menu.clock.36extclock.build.clocksource=2 +#avreaopti.menu.clock.40extclock=40 MHz ext. clock (unlikely-to-work overclocked) +#avreaopti.menu.clock.40extclock.build.speed=40 +#avreaopti.menu.clock.40extclock.build.clocksource=2 + +#----------------------------------------# +# BrownOut detection (BOD) option # +#________________________________________# +# Completely speculative # +# Assumes same as Dx-series # +#___________________________________# +avreaopti.menu.bodvoltage.1v75=1.75V (during programming only) +avreaopti.menu.bodvoltage.1v75.bootloader.bodlevbits=000 +avreaopti.menu.bodvoltage.1v9=1.9V +avreaopti.menu.bodvoltage.1v9.bootloader.bodlevbits=001 +avreaopti.menu.bodvoltage.2v6=2.60V +avreaopti.menu.bodvoltage.2v6.bootloader.bodlevbits=010 +avreaopti.menu.bodvoltage.4v3=4.3V +avreaopti.menu.bodvoltage.4v3.bootloader.bodlevbits=011 +avreaopti.menu.bodmode.disabled=Disabled/Disabled +avreaopti.menu.bodmode.enabled=Enabled/Enabled +avreaopti.menu.bodmode.ensampfast=Enabled/Sampled (128 Hz) +avreaopti.menu.bodmode.ensampslow=Enabled/Sampled (32 Hz) +avreaopti.menu.bodmode.sampledfast=Sampled/Sampled (128 Hz) +avreaopti.menu.bodmode.sampledslow=Sampled/Sampled (32 Hz) +avreaopti.menu.bodmode.sampdisfast=Sampled/Disabled (128 Hz) +avreaopti.menu.bodmode.sampdisslow=Sampled/Disabled (32 Hz) +avreaopti.menu.bodmode.endisholdwake=Enabled hold wakeup/Disabled +avreaopti.menu.bodmode.disabled.bootloader.BODCFG=0x00 +avreaopti.menu.bodmode.enabled.bootloader.bodmodebits=00101 +avreaopti.menu.bodmode.ensampfast.bootloader.bodmodebits=00110 +avreaopti.menu.bodmode.ensampslow.bootloader.bodmodebits=10110 +avreaopti.menu.bodmode.samplefast.bootloader.bodmodebits=01010 +avreaopti.menu.bodmode.sampleslow.bootloader.bodmodebits=11010 +avreaopti.menu.bodmode.sampdisfast.bootloader.bodmodebits=01000 +avreaopti.menu.bodmode.sampdisslow.bootloader.bodmodebits=11000 +avreaopti.menu.bodmode.endisholdwake.bootloader.bodmodebits=01100 + +#----------------------------------------# +# Retain EEPROM (EESAVE) # +#________________________________________# +avreaopti.menu.eesave.enable=EEPROM retained +avreaopti.menu.eesave.enable.bootloader.eesavebit=1 +avreaopti.menu.eesave.disable=EEPROM not retained +avreaopti.menu.eesave.disable.bootloader.eesavebit=0 + +#----------------------------------------# +# Reset pin as INPUT, UPDI as I/O # +#________________________________________# +avreaopti.menu.resetupdipins.resetupdi=PF6: Reset & PF7: UPDI (typical and recommended) +avreaopti.menu.resetupdipins.resetupdi.bootloader.resetpinbit=1 +avreaopti.menu.resetupdipins.resetupdi.bootloader.updipinbit=1 +avreaopti.menu.resetupdipins.inputupdi=PF6: Input & PF7: UPDI (no challenges) +avreaopti.menu.resetupdipins.inputupdi.bootloader.resetpinbit=0 +avreaopti.menu.resetupdipins.inputupdi.bootloader.updipinbit=1 +avreaopti.menu.resetupdipins.resetgpio=PF6: Reset & PF7: GPIO (Danger! HV required) +avreaopti.menu.resetupdipins.resetgpio.bootloader.resetpinbit=1 +avreaopti.menu.resetupdipins.resetgpio.bootloader.updipinbit=0 +avreaopti.menu.resetupdipins.inputgpio=PF6: Input & PF7: GPIO (Danger! HV required) +avreaopti.menu.resetupdipins.inputgpio.bootloader.resetpinbit=0 +avreaopti.menu.resetupdipins.inputgpio.bootloader.updipinbit=0 + +#----------------------------------------# +# millis/micros timing source # +#________________________________________# +avreaopti.menu.millis.tcb2=TCB2 (recommended) +avreaopti.menu.millis.disabled=Disabled +avreaopti.menu.millis.tcb0=TCB0 +avreaopti.menu.millis.tcb1=TCB1 +avreaopti.menu.millis.tcb3=TCB3 +avreaopti.menu.millis.tca0=TCA0 +avreaopti.menu.millis.tca1=TCA1 +avreaopti.menu.millis.rtc=RTC internal osc (no micros) +avreaopti.menu.millis.rtcxtal=RTC w/w32.768 kHz ext. xtal, no micros +avreaopti.menu.millis.rtcxosc=RTC w/w32.768 kHz ext. osc no micros +avreaopti.menu.millis.tcb0.build.millistimer=B0 +avreaopti.menu.millis.tcb1.build.millistimer=B1 +avreaopti.menu.millis.tcb2.build.millistimer=B2 +avreaopti.menu.millis.tcb3.build.millistimer=B3 +avreaopti.menu.millis.tca0.build.millistimer=A0 +avreaopti.menu.millis.tca1.build.millistimer=A1 +avreaopti.menu.millis.rtc.build.millistimer=RTC_OSC +avreaopti.menu.millis.rtcxtal.build.millistimer=RTC_XTAL +avreaopti.menu.millis.rtcxosc.build.millistimer=RTC_XOSC +avreaopti.menu.millis.disabled.build.millistimer=NONE + +#----------------------------------------# +# printf() version options # +#________________________________________# +avreaopti.menu.printf.default=Default, 1.5k flash, no floats +avreaopti.menu.printf.full=Full, 2.6k, prints floats +avreaopti.menu.printf.full.build.printf=-Wl,-u,vfprintf -lprintf_flt +avreaopti.menu.printf.full.build.printfabr=.pfF +avreaopti.menu.printf.minimal=Minimal, 1.1k flash used +avreaopti.menu.printf.minimal.build.printf=-Wl,-u,vfprintf -lprintf_min +avreaopti.menu.printf.minimal.build.printfabr=.pfM + +#----------------------------------------# +# OPTIMIZATION OPTIONS # +#________________________________________# +#avreaopti.menu.optimization.size=-Os (size) +#avreaopti.menu.optimization.sizegcse=-Os (size, no GCSE) +#avreaopti.menu.optimization.o3=-O3 (speed) +#avreaopti.menu.optimization.o3gcse=-O3 (speed, no GCSE) +#avreaopti.menu.optimization.size.build.optimizationlevel=-Os +#avreaopti.menu.optimization.sizegcse.build.optimizationlevel=-Os +#avreaopti.menu.optimization.o3.build.optimizationlevel=-O3 +#avreaopti.menu.optimization.o3gcse.build.optimizationlevel=-O3 +#avreaopti.menu.optimization.size.build.optabr=.Os +#avreaopti.menu.optimization.sizegcse.build.optabr=.Osng +#avreaopti.menu.optimization.o3.build.optabr=.O3 +#avreaopti.menu.optimization.o3gcse.build.optabr=.O3ng +#avreaopti.menu.optimization.sizegcse.build.gcse=-fno-gcse +#avreaopti.menu.optimization.o3gcse.build.gcse=-fno-gcse + + +#----------------------------------------# +# attachInterrupt Mode # +#________________________________________# +avreaopti.menu.attach.allenabled=On all pins, with new implementation. +avreaopti.menu.attach.allenabled.build.attachmode=-DCORE_ATTACH_ALL +avreaopti.menu.attach.manual=Only enabled ports. Please see documentation. +avreaopti.menu.attach.manual.build.attachmode=-DCORE_ATTACH_NONE +avreaopti.menu.attach.oldversion=Old version, may fix bugs. +avreaopti.menu.attach.oldversion.build.attachmode=-DCORE_ATTACH_OLD +avreaopti.menu.attach.manual.build.attachabr=.aMan +avreaopti.menu.attach.oldversion.build.attachabr=.aOld + +#----------------------------------------# +# Startup time options # +#________________________________________# +avreaopti.menu.startuptime.8=8ms +avreaopti.menu.startuptime.0=0ms +avreaopti.menu.startuptime.1=1ms +avreaopti.menu.startuptime.2=2ms +avreaopti.menu.startuptime.4=4ms +avreaopti.menu.startuptime.16=16ms +avreaopti.menu.startuptime.32=32ms +avreaopti.menu.startuptime.64=64ms +avreaopti.menu.startuptime.0.bootloader.SYSCFG1=0x00 +avreaopti.menu.startuptime.1.bootloader.SYSCFG1=0x01 +avreaopti.menu.startuptime.2.bootloader.SYSCFG1=0x02 +avreaopti.menu.startuptime.4.bootloader.SYSCFG1=0x03 +avreaopti.menu.startuptime.8.bootloader.SYSCFG1=0x04 +avreaopti.menu.startuptime.16.bootloader.SYSCFG1=0x05 +avreaopti.menu.startuptime.32.bootloader.SYSCFG1=0x06 +avreaopti.menu.startuptime.64.bootloader.SYSCFG1=0x07 + +#-------------------------------------# +# Wire Mode Selection # +# To enable TWI1 or master+slave mode # +#_____________________________________# +avreaopti.menu.wiremode.mors=1x Wire, Master or Slave +avreaopti.menu.wiremode.mors.build.wiremode=MORS_SINGLE +avreaopti.menu.wiremode.mors.build.wireabr=.wO +avreaopti.menu.wiremode.mands=1x Wire, Master and Slave +avreaopti.menu.wiremode.mands.build.wiremode=MANDS_SINGLE +avreaopti.menu.wiremode.mands.build.wireabr=.wA + +#-------------------------------------# +# SPM from app mode # +# To enable writing flash from app # +#_____________________________________# +avreaopti.menu.appspm.no=Disabled (SPM write from app is not yet supported) +avreaopti.menu.appspm.no.bootloader.appspm= +avreaopti.menu.appspm.no.bootloader.BOOTSIZE=0x00 +avreaopti.menu.appspm.no.build.appspmabr= +avreaopti.menu.appspm.full=These options don't work, +avreaopti.menu.appspm.full.bootloader.appspm= +avreaopti.menu.appspm.full.build.appspmabr=.spmINVALID +avreaopti.menu.appspm.full.bootloader.BOOTSIZE=0x00 +#avreaopti.menu.appspm.full=Anywhere after 0x0200 (warning: App allowed to overwrite itself) +#avreaopti.menu.appspm.full.bootloader.appspm=-DSPM_FROM_APP=-1 +#avreaopti.menu.appspm.full.build.appspmabr=.spmALL +#avreaopti.menu.appspm.8plus=Above 8k (meant for 16k parts) +#avreaopti.menu.appspm.8plus.bootloader.appspm=-DSPM_FROM_APP=32 +#avreaopti.menu.appspm.8plus.bootloader.CODESIZE=32 +#avreaopti.menu.appspm.12plus=Above 12k (meant for 16k parts) +#avreaopti.menu.appspm.12plus.bootloader.appspm=-DSPM_FROM_APP=48 +#avreaopti.menu.appspm.12plus.bootloader.CODESIZE=48 +#avreaopti.menu.appspm.14plus=Above 14k (meant for 16k parts) +#avreaopti.menu.appspm.14plus.bootloader.appspm=-DSPM_FROM_APP=56 +#avreaopti.menu.appspm.14plus.bootloader.CODESIZE=56 +#avreaopti.menu.appspm.16plus=Above 16k (AVR64/32 only, meant for 32k parts) +#avreaopti.menu.appspm.16plus.bootloader.appspm=-DSPM_FROM_APP=64 +#avreaopti.menu.appspm.16plus.bootloader.CODESIZE=64 +avreaopti.menu.appspm.24plus=but they have to be here for tests to run. +avreaopti.menu.appspm.24plus.bootloader.appspm= +#avreaopti.menu.appspm.24plus.bootloader.CODESIZE=96 +#avreaopti.menu.appspm.28plus=Above 28k (AVR64/32 only, meant for 32k parts) +#avreaopti.menu.appspm.28plus.bootloader.appspm=-DSPM_FROM_APP=112 +#avreaopti.menu.appspm.28plus.bootloader.CODESIZE=112 +#avreaopti.menu.appspm.32plus=Above 32k (AVR64 only) +#avreaopti.menu.appspm.32plus.bootloader.appspm=-DSPM_FROM_APP=128 +#avreaopti.menu.appspm.32plus.bootloader.CODESIZE=128 +#avreaopti.menu.appspm.48plus=Above 48k (AVR64 only) +#avreaopti.menu.appspm.48plus.bootloader.appspm=-DSPM_FROM_APP=192 +#avreaopti.menu.appspm.48plus.bootloader.CODESIZE=192 +#avreaopti.menu.appspm.56plus=Above 56k (AVR64 only) +#avreaopti.menu.appspm.56plus.bootloader.appspm=-DSPM_FROM_APP=224 +#avreaopti.menu.appspm.56plus.bootloader.CODESIZE=224 +#avreaopti.menu.appspm.60plus=Above 60k (AVR64 only) +#avreaopti.menu.appspm.60plus.bootloader.appspm=-DSPM_FROM_APP=240 +#avreaopti.menu.appspm.60plus.bootloader.CODESIZE=240 + +#----------------------------------------# +# WDT MODE # +#________________________________________# +avreaopti.menu.WDTtimeout.disabled=Disabled (recommended) +avreaopti.menu.WDTtimeout.8seconds=Window remains open for 8 Seconds +avreaopti.menu.WDTtimeout.4seconds=Window remains open for 4 Seconds +avreaopti.menu.WDTtimeout.2seconds=Window remains open for 2 Seconds +avreaopti.menu.WDTtimeout.1second=Window remains open for 1 Second +avreaopti.menu.WDTtimeout.500msec=Window remains open for 500 milliseconds +avreaopti.menu.WDTtimeout.250msec=Window remains open for 250 milliseconds +avreaopti.menu.WDTtimeout.125msec=Window remains open for 125 milliseconds +avreaopti.menu.WDTtimeout.63msec=Window remains open for 62.5 milliseconds +avreaopti.menu.WDTwindow.disabled=No delay before window "opens" +avreaopti.menu.WDTwindow.8seconds=8 Second before window "opens" +avreaopti.menu.WDTwindow.4seconds=4 Second before window "opens" +avreaopti.menu.WDTwindow.2seconds=2 Second before window "opens" +avreaopti.menu.WDTwindow.1second=1 Second before window "opens" +avreaopti.menu.WDTwindow.500msec=500 millisecond before window "opens" +avreaopti.menu.WDTwindow.250msec=250 millisecond before window "opens" +avreaopti.menu.WDTwindow.125msec=125 millisecond before window "opens" +avreaopti.menu.WDTwindow.63msec=62.5 millisecond before window "opens" +avreaopti.menu.WDTtimeout.disabled.bootloader.wdttimeoutbits=0000 +avreaopti.menu.WDTtimeout.8seconds.bootloader.wdttimeoutbits=1011 +avreaopti.menu.WDTtimeout.4seconds.bootloader.wdttimeoutbits=1010 +avreaopti.menu.WDTtimeout.2seconds.bootloader.wdttimeoutbits=1001 +avreaopti.menu.WDTtimeout.1second.bootloader.wdttimeoutbits=1000 +avreaopti.menu.WDTtimeout.500msec.bootloader.wdttimeoutbits=0111 +avreaopti.menu.WDTtimeout.250msec.bootloader.wdttimeoutbits=0110 +avreaopti.menu.WDTtimeout.125msec.bootloader.wdttimeoutbits=0101 +avreaopti.menu.WDTtimeout.63msec.bootloader.wdttimeoutbits=0100 +avreaopti.menu.WDTwindow.disabled.bootloader.wdtwindowbits=0000 +avreaopti.menu.WDTwindow.8seconds.bootloader.wdtwindowbits=1011 +avreaopti.menu.WDTwindow.4seconds.bootloader.wdtwindowbits=1010 +avreaopti.menu.WDTwindow.2seconds.bootloader.wdtwindowbits=1001 +avreaopti.menu.WDTwindow.1second.bootloader.wdtwindowbits=1000 +avreaopti.menu.WDTwindow.500msec.bootloader.wdtwindowbits=0111 +avreaopti.menu.WDTwindow.250msec.bootloader.wdtwindowbits=0110 +avreaopti.menu.WDTwindow.125msec.bootloader.wdtwindowbits=0101 +avreaopti.menu.WDTwindow.63msec.bootloader.wdtwindowbits=0100 + +#----------------------------------------# +# Flash Mapping options # +#________________________________________# +avreaopti.menu.flmap.lockdefault=Use last FLMAP section, lock FLMAP, provide PROGMEM_MAPPED +avreaopti.menu.flmap.unlocked=Start w/default, do not lock flmap. No PROGMEM_MAPPED. +avreaopti.menu.flmap.locksection0=Set FLMAP to section 0, lock FLMAP, provide PROGMEM_MAPPED +avreaopti.menu.flmap.lockdefault.build.flmapopts=-DLOCK_FLMAP -DFLMAPSECTION1 +avreaopti.menu.flmap.unlocked.build.flmapopts= +avreaopti.menu.flmap.locksection0.build.flmapopts=-DLOCK_FLMAP -DFLMAPSECTION0 +avreaopti.menu.flmap.lockdefault.build.flmapabr=.fld +avreaopti.menu.flmap.unlocked.build.flmapabr=.ful +avreaopti.menu.flmap.locksection0.build.flmapabr=.fl0 ########################################################################## @@ -4695,9 +5193,446 @@ avrddopti.menu.flmap.locksection0.build.flmapabr=.fl0 # # # # # # ##### #### ### ### # ## # #______________________________________________________#_________________# -#avreb.bootloader.oschffrq=0 -#avreb.bootloader.OSCCFG=0b0000{bootloader.oschffrq}000 -# Can probably be binary identical with EA's +avrebopti.upload.tool=avrdude +avrebopti.upload.prog_interlock= +avrebopti.build.board=avreb +avrebopti.build.core=dxcore +avrebopti.upload.maximum_size=0 +avrebopti.upload.maximum_data_size=0 +# The maximum size and data size attributes are overridden by the selected chip. If you are avoiding specifying that somehow, there is no hope of anything working, so don't do that. +# Each top-level entry supports at lebst a dozen parts with varying memory constraints. +avrebopti.build.f_cpu={build.speed}000000L +avrebopti.build.text_section_start=.text=0x200 +avrebopti.build.extra_flags= -DSERIAL_PORT_BOOT={bootloader.portname} -DSERIAL_PORT_BOOT_PORTMUX={bootloader.portswap} -DUSING_OPTIBOOT +avrebopti.build.export_merged_output=false +avrebopti.build.printf= +avrebopti.build.flmapopts= + +#----------------------------------------# +# Bootloading parameters and fuses # +#________________________________________# +avrebopti.bootloader.tool=avrdude +avrebopti.bootloader.WDTCFG=0b{bootloader.wdtwindowbits}{bootloader.wdttimeoutbits} +avrebopti.bootloader.oschffrq=0 +avrebopti.bootloader.OSCCFG=0b0000{bootloader.oschffrq}000 +avrebopti.bootloader.wdtwindowbits=0000 +avrebopti.bootloader.wdttimeotbits=0000 +avrebopti.bootloader.BODCFG=0b{bootloader.bodlevbits}{bootloader.bodmodebits} +avrebopti.bootloader.updipinbit=1 +avrebopti.bootloader.SYSCFG0=0b110{bootloader.updipinbit}{bootloader.resetpinbit}00{bootloader.eesavebit} +avrebopti.bootloader.CODESIZE=0x00 +avrebopti.bootloader.BOOTSIZE=0x02 +avrebopti.bootloader.avrdudestring=-Uflash:w:{bootloader.file}:i +avrebopti.bootloader.pymcuprogstring=-f "{bootloader.file}" -a write +avrebopti.bootloader.avrdudefuse5="-Ufuse5:w:{bootloader.SYSCFG0}:m" +avrebopti.bootloader.serupdifuse5=5:{bootloader.SYSCFG0} +#----------------------------------------# +# Upload and programming # +#________________________________________# +avrebopti.program.avrdudefuse5="-Ufuse5:w:{bootloader.SYSCFG0}:m" +avrebopti.program.serupdifuse5=5:{bootloader.SYSCFG0} +avrebopti.upload.tool=avrdude +avrebopti.upload.protocol=arduino +avrebopti.upload.extra_params=-D +avrebopti.upload.speed=115200 +avrebopti.upload.prog_interlock="ERROR: Upload using programmer is not supported on optiboot boards +avrebopti.upload.maximum_size=0 +avrebopti.upload.maximum_data_size=0 + +#----------------------------------------# +# Exported hex/lst/map names will # +# indicate selected options. These # +# are only to do that, nothing else # +#________________________________________# +avrebopti.build.mcupostfix=opti +avrebopti.build.printfabr= +avrebopti.build.flmapabr=.ful +avrebopti.build.attachabr= +avrebopti.build.wireabr= +##Not supported but still need empty string here. +avrebopti.build.appspmabr= + +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^# +# AVR-EB submenu options # +#____________________________________________# +# Chip (memory and pincount) # +#_______________________________________# +avrebopti.menu.chip.avr32eb14=AVR32EB14 +avrebopti.menu.chip.avr32eb14.build.mcu=avr32eb14 +avrebopti.menu.chip.avr32eb14.upload.maximum_size=32768 +avrebopti.menu.chip.avr32eb14.upload.maximum_data_size=3072 +avrebopti.menu.chip.avr32eb14.build.variant=14pin-ebseries +avrebopti.menu.chip.avr32eb20=AVR32EB20 +avrebopti.menu.chip.avr32eb20.build.mcu=avr32eb20 +avrebopti.menu.chip.avr32eb20.upload.maximum_size=32768 +avrebopti.menu.chip.avr32eb20.upload.maximum_data_size=3072 +avrebopti.menu.chip.avr32eb20.build.variant=20pin-ebseries +avrebopti.menu.chip.avr32eb28=AVR32EB28 +avrebopti.menu.chip.avr32eb28.build.mcu=avr32eb28 +avrebopti.menu.chip.avr32eb28.upload.maximum_size=32768 +avrebopti.menu.chip.avr32eb28.upload.maximum_data_size=3072 +avrebopti.menu.chip.avr32eb28.build.variant=28pin-ebseries +avrebopti.menu.chip.avr32eb32=AVR32EB32 +avrebopti.menu.chip.avr32eb32.build.mcu=avr32eb32 +avrebopti.menu.chip.avr32eb32.upload.maximum_size=32768 +avrebopti.menu.chip.avr32eb32.upload.maximum_data_size=3072 +avrebopti.menu.chip.avr32eb32.build.variant=32pin-ebseries +avrebopti.menu.chip.avr16eb14=AVR16EB14 +avrebopti.menu.chip.avr16eb14.build.mcu=avr16eb14 +avrebopti.menu.chip.avr16eb14.upload.maximum_size=16384 +avrebopti.menu.chip.avr16eb14.upload.maximum_data_size=2048 +avrebopti.menu.chip.avr16eb14.build.variant=14pin-ebseries +avrebopti.menu.chip.avr16eb20=AVR16EB20 +avrebopti.menu.chip.avr16eb20.build.mcu=avr16eb20 +avrebopti.menu.chip.avr16eb20.upload.maximum_size=16384 +avrebopti.menu.chip.avr16eb20.upload.maximum_data_size=2048 +avrebopti.menu.chip.avr16eb20.build.variant=20pin-ebseries +avrebopti.menu.chip.avr16eb28=AVR16EB28 +avrebopti.menu.chip.avr16eb28.build.mcu=avr16eb28 +avrebopti.menu.chip.avr16eb28.upload.maximum_size=16384 +avrebopti.menu.chip.avr16eb28.upload.maximum_data_size=2048 +avrebopti.menu.chip.avr16eb28.build.variant=28pin-ebseries +avrebopti.menu.chip.avr16eb32=AVR16EB32 +avrebopti.menu.chip.avr16eb32.build.mcu=avr16eb32 +avrebopti.menu.chip.avr16eb32.upload.maximum_size=16384 +avrebopti.menu.chip.avr16eb32.upload.maximum_data_size=2048 +avrebopti.menu.chip.avr16eb32.build.variant=32pin-ebseries + +#----------------------------------------# +# Clock speed and source options # +#________________________________________# +avrebopti.menu.clock.20internal=20 MHz internal +avrebopti.menu.clock.20internal.build.speed=20 +avrebopti.menu.clock.20internal.build.clocksource=0 +avrebopti.menu.clock.16internal=16 MHz internal +avrebopti.menu.clock.16internal.build.speed=16 +avrebopti.menu.clock.16internal.build.clocksource=0 +avrebopti.menu.clock.16internal.bootloader.oschffrq=1 +avrebopti.menu.clock.10internal=10 MHz internal +avrebopti.menu.clock.10internal.build.speed=10 +avrebopti.menu.clock.10internal.build.clocksource=0 +avrebopti.menu.clock.8internal=8 MHz internal +avrebopti.menu.clock.8internal.build.speed=8 +avrebopti.menu.clock.8internal.build.clocksource=0 +avrebopti.menu.clock.8internal.bootloader.oschffrq=1 +avrebopti.menu.clock.5internal=5 MHz internal +avrebopti.menu.clock.5internal.build.speed=5 +avrebopti.menu.clock.5internal.build.clocksource=0 +avrebopti.menu.clock.4internal=4 MHz internal +avrebopti.menu.clock.4internal.build.speed=4 +avrebopti.menu.clock.4internal.build.clocksource=0 +avrebopti.menu.clock.4internal.bootloader.oschffrq=1 +avrebopti.menu.clock.1internal=1 MHz internal +avrebopti.menu.clock.1internal.build.speed=1 +avrebopti.menu.clock.1internal.build.clocksource=0 +avrebopti.menu.clock.1internal.bootloader.oschffrq=1 +#avrebopti.menu.clock.20intpll=20 MHz int. w/80Mhz PLL +#avrebopti.menu.clock.20intpll.build.speed=20 +#avrebopti.menu.clock.20intpll.build.clocksource=6 +#avrebopti.menu.clock.16intpll=16 MHz int. w/64Mhz PLL +#avrebopti.menu.clock.16intpll.build.speed=16 +#avrebopti.menu.clock.16intpll.build.clocksource=6 +#avrebopti.menu.clock.16intpll.bootloader.oschffrq=1 +#avrebopti.menu.clock.10intpll=10 MHz int. w/40Mhz PLL +#avrebopti.menu.clock.10intpll.build.speed=10 +#avrebopti.menu.clock.10intpll.build.clocksource=6 +#avrebopti.menu.clock.8intpll=8 MHz int. w/32 Mhz PLL +#avrebopti.menu.clock.8intpll.build.speed=8 +#avrebopti.menu.clock.8intpll.build.clocksource=6 +#avrebopti.menu.clock.8intpll.bootloader.oschffrq=1 +#avrebopti.menu.clock.5intpll=5 MHz int. w/20Mhz PLL (??) +#avrebopti.menu.clock.5intpll.build.speed=5 +#avrebopti.menu.clock.5intpll.build.clocksource=6 +#avrebopti.menu.clock.4intpll=4 MHz int. w/16Mhz PLL (??) +#avrebopti.menu.clock.4intpll.build.speed=4 +#avrebopti.menu.clock.4intpll.build.clocksource=6 +#avrebopti.menu.clock.4intpll.bootloader.oschffrq=1 +#avrebopti.menu.clock.20extpll=20 MHz ext. clock w/80 Mhz PLL +#avrebopti.menu.clock.20extpll.build.speed=20 +#avrebopti.menu.clock.20extpll.build.clocksource=10 +avrebopti.menu.clock.20extclock=20 MHz ext. clock +avrebopti.menu.clock.20extclock.build.speed=20 +avrebopti.menu.clock.20extclock.build.clocksource=2 +#avrebopti.menu.clock.16extpll=16 MHz ext. clock w/64 Mhz PLL +#avrebopti.menu.clock.16extpll.build.speed=16 +#avrebopti.menu.clock.16extpll.build.clocksource=10 +avrebopti.menu.clock.16extclock=16 MHz ext. clock +avrebopti.menu.clock.16extclock.build.speed=16 +avrebopti.menu.clock.16extclock.build.clocksource=2 +#avrebopti.menu.clock.12extpll=12 MHz ext. clock w/48 Mhz PLL +#avrebopti.menu.clock.12extpll.build.speed=12 +#avrebopti.menu.clock.12extpll.build.clocksource=10 +avrebopti.menu.clock.12extclock=12 MHz ext. clock +avrebopti.menu.clock.12extclock.build.speed=12 +avrebopti.menu.clock.12extclock.build.clocksource=2 +avrebopti.menu.clock.10extclock=10 MHz ext. clock +avrebopti.menu.clock.10extclock.build.speed=0 +avrebopti.menu.clock.10extclock.build.clocksource=2 +#avrebopti.menu.clock.8extpll=8 MHz ext. clock w/32 Mhz PLL +#avrebopti.menu.clock.8extpll.build.speed=8 +#avrebopti.menu.clock.8extpll.build.clocksource=10 +avrebopti.menu.clock.8extclock=8 MHz ext. clock +avrebopti.menu.clock.8extclock.build.speed=8 +avrebopti.menu.clock.8extclock.build.clocksource=2 +avrebopti.menu.clock.32extclock=32 MHz ext. clock (unlikely-to-work overclocked) +avrebopti.menu.clock.32extclock.build.speed=32 +avrebopti.menu.clock.32extclock.build.clocksource=2 +#avrebopti.menu.clock.25extpll=25 MHz ext. clock w/100 Mhz PLL (overclocked) +#avrebopti.menu.clock.25extpll.build.speed=25 +#avrebopti.menu.clock.25extpll.build.clocksource=10 +avrebopti.menu.clock.25extclock=25 MHz ext. clock (overclocked) +avrebopti.menu.clock.25extclock.build.speed=25 +avrebopti.menu.clock.25extclock.build.clocksource=2 +#avrebopti.menu.clock.24extpll=24 MHz ext. clock w/96 Mhz PLL (overclocked) +#avrebopti.menu.clock.24extpll.build.speed=24 +#avrebopti.menu.clock.24extpll.build.clocksource=10 +avrebopti.menu.clock.24extclock=24 MHz ext. clock (overclocked) +avrebopti.menu.clock.24extclock.build.speed=24 +avrebopti.menu.clock.24extclock.build.clocksource=2 +#avrebopti.menu.clock.32extpll=32 MHz ext. clock w/128 Mhz PLL (unlikely-to-work overclocked) +#avrebopti.menu.clock.32extpll.build.speed=32 +#avrebopti.menu.clock.32extpll.build.clocksource=10 + +#----------------------------------------# +# BrownOut detection (BOD) option # +#________________________________________# +# Completely speculative # +# Assumes same as Dx-series # +#___________________________________# +avrebopti.menu.bodvoltage.1v75=1.75V (during programming only) +avrebopti.menu.bodvoltage.1v75.bootloader.bodlevbits=000 +avrebopti.menu.bodvoltage.1v9=1.9V +avrebopti.menu.bodvoltage.1v9.bootloader.bodlevbits=001 +avrebopti.menu.bodvoltage.2v6=2.60V +avrebopti.menu.bodvoltage.2v6.bootloader.bodlevbits=010 +avrebopti.menu.bodvoltage.4v3=4.3V +avrebopti.menu.bodvoltage.4v3.bootloader.bodlevbits=011 +avrebopti.menu.bodmode.disabled=Disabled/Disabled +avrebopti.menu.bodmode.enabled=Enabled/Enabled +avrebopti.menu.bodmode.ensampfast=Enabled/Sampled (128 Hz) +avrebopti.menu.bodmode.ensampslow=Enabled/Sampled (32 Hz) +avrebopti.menu.bodmode.sampledfast=Sampled/Sampled (128 Hz) +avrebopti.menu.bodmode.sampledslow=Sampled/Sampled (32 Hz) +avrebopti.menu.bodmode.sampdisfast=Sampled/Disabled (128 Hz) +avrebopti.menu.bodmode.sampdisslow=Sampled/Disabled (32 Hz) +avrebopti.menu.bodmode.endisholdwake=Enabled hold wakeup/Disabled +avrebopti.menu.bodmode.disabled.bootloader.BODCFG=0x00 +avrebopti.menu.bodmode.enabled.bootloader.bodmodebits=00101 +avrebopti.menu.bodmode.ensampfast.bootloader.bodmodebits=00110 +avrebopti.menu.bodmode.ensampslow.bootloader.bodmodebits=10110 +avrebopti.menu.bodmode.samplefast.bootloader.bodmodebits=01010 +avrebopti.menu.bodmode.sampleslow.bootloader.bodmodebits=11010 +avrebopti.menu.bodmode.sampdisfast.bootloader.bodmodebits=01000 +avrebopti.menu.bodmode.sampdisslow.bootloader.bodmodebits=11000 +avrebopti.menu.bodmode.endisholdwake.bootloader.bodmodebits=01100 + +#----------------------------------------# +# Retain EEPROM (EESAVE) # +#________________________________________# +avrebopti.menu.eesave.enableenable=EEPROM + BOOTROW retained +avrebopti.menu.eesave.enableenable.bootloader.eesavebit=1 +avrebopti.menu.eesave.enableenable.bootloader.browsavebit=1 +avrebopti.menu.eesave.enabledisable=EEPROM retained, BOOTROW not +avrebopti.menu.eesave.enabledisable.bootloader.eesavebit=1 +avrebopti.menu.eesave.enabledisable.bootloader.browsavebit=0 +avrebopti.menu.eesave.disableenable=BOOTROW retained, EEPROM not +avrebopti.menu.eesave.disableenable.bootloader.eesavebit=0 +avrebopti.menu.eesave.disableenable.bootloader.browsavebit=1 +avrebopti.menu.eesave.disabledisable=Neither retained +avrebopti.menu.eesave.disabledisable.bootloader.eesavebit=0 +avrebopti.menu.eesave.disabledisable.bootloader.browsavebit=0 + + +#----------------------------------------# +# Reset pin as input option # +#________________________________________# +avrebopti.menu.resetpin.reset=Hardware Reset (recommended) +avrebopti.menu.resetpin.reset.bootloader.resetpinbit=1 +avrebopti.menu.resetpin.input=Input (no output, ever) +avrebopti.menu.resetpin.input.bootloader.resetpinbit=0 + +#----------------------------------------# +# millis/micros timing source # +#________________________________________# +avrebopti.menu.millis.tcb1=TCB1 (recommended) +avrebopti.menu.millis.disabled=Disabled +avrebopti.menu.millis.tcb0=TCB0 +#avrebopti.menu.millis.tce0=TCE0 +#avrebopti.menu.millis.tcf3=TCF0 +avrebopti.menu.millis.tcb0.build.millistimer=B0 +avrebopti.menu.millis.tcb1.build.millistimer=B1 +#avrebopti.menu.millis.tce0.build.millistimer=E0 +#avrebopti.menu.millis.tcf0.build.millistimer=F0 +avreaopti.menu.millis.rtc=RTC internal osc (no micros) +avrebopti.menu.millis.rtcxtal=RTC w/w32.768 kHz ext. xtal, no micros +avrebopti.menu.millis.rtcxosc=RTC w/w32.768 kHz ext. osc no micros +avrebopti.menu.millis.rtc.build.millistimer=RTC_OSC +avrebopti.menu.millis.rtcxtal.build.millistimer=RTC_XTAL +avrebopti.menu.millis.rtcxosc.build.millistimer=RTC_XOSC +avrebopti.menu.millis.disabled.build.millistimer=NONE + +#----------------------------------------# +# printf() version options # +#________________________________________# +avrebopti.menu.printf.default=Default, 1.5k flash, no floats +avrebopti.menu.printf.full=Full, 2.6k, prints floats +avrebopti.menu.printf.full.build.printf=-Wl,-u,vfprintf -lprintf_flt +avrebopti.menu.printf.full.build.printfabr=.pfF +avrebopti.menu.printf.minimal=Minimal, 1.1k flash used +avrebopti.menu.printf.minimal.build.printf=-Wl,-u,vfprintf -lprintf_min +avrebopti.menu.printf.minimal.build.printfabr=.pfM + +#----------------------------------------# +# OPTIMIZATION OPTIONS # +#________________________________________# +#avrebopti.menu.optimization.size=-Os (size) +#avrebopti.menu.optimization.sizegcse=-Os (size, no GCSE) +#avrebopti.menu.optimization.o3=-O3 (speed) +#avrebopti.menu.optimization.o3gcse=-O3 (speed, no GCSE) +#avrebopti.menu.optimization.size.build.optimizationlevel=-Os +#avrebopti.menu.optimization.sizegcse.build.optimizationlevel=-Os +#avrebopti.menu.optimization.o3.build.optimizationlevel=-O3 +#avrebopti.menu.optimization.o3gcse.build.optimizationlevel=-O3 +#avrebopti.menu.optimization.size.build.optabr=.Os +#avrebopti.menu.optimization.sizegcse.build.optabr=.Osng +#avrebopti.menu.optimization.o3.build.optabr=.O3 +#avrebopti.menu.optimization.o3gcse.build.optabr=.O3ng +#avrebopti.menu.optimization.sizegcse.build.gcse=-fno-gcse +#avrebopti.menu.optimization.o3gcse.build.gcse=-fno-gcse + + +#----------------------------------------# +# attachInterrupt Mode # +#________________________________________# +avrebopti.menu.attach.allenabled=On all pins, with new implementation. +avrebopti.menu.attach.allenabled.build.attachmode=-DCORE_ATTACH_ALL +avrebopti.menu.attach.manual=Only enabled ports. Plebse see documentation. +avrebopti.menu.attach.manual.build.attachmode=-DCORE_ATTACH_NONE +avrebopti.menu.attach.oldversion=Old version, may fix bugs. +avrebopti.menu.attach.oldversion.build.attachmode=-DCORE_ATTACH_OLD +avrebopti.menu.attach.manual.build.attachabr=.aMan +avrebopti.menu.attach.oldversion.build.attachabr=.aOld + +#----------------------------------------# +# Startup time options # +#________________________________________# +avrebopti.menu.startuptime.8=8ms +avrebopti.menu.startuptime.0=0ms +avrebopti.menu.startuptime.1=1ms +avrebopti.menu.startuptime.2=2ms +avrebopti.menu.startuptime.4=4ms +avrebopti.menu.startuptime.16=16ms +avrebopti.menu.startuptime.32=32ms +avrebopti.menu.startuptime.64=64ms +avrebopti.menu.startuptime.0.bootloader.SYSCFG1=0x00 +avrebopti.menu.startuptime.1.bootloader.SYSCFG1=0x01 +avrebopti.menu.startuptime.2.bootloader.SYSCFG1=0x02 +avrebopti.menu.startuptime.4.bootloader.SYSCFG1=0x03 +avrebopti.menu.startuptime.8.bootloader.SYSCFG1=0x04 +avrebopti.menu.startuptime.16.bootloader.SYSCFG1=0x05 +avrebopti.menu.startuptime.32.bootloader.SYSCFG1=0x06 +avrebopti.menu.startuptime.64.bootloader.SYSCFG1=0x07 + +#-------------------------------------# +# Wire Mode Selection # +# To enable TWI1 or master+slave mode # +#_____________________________________# +avrebopti.menu.wiremode.mors=1x Wire, Master or Slave +avrebopti.menu.wiremode.mors.build.wiremode=MORS_SINGLE +avrebopti.menu.wiremode.mors.build.wireabr=.wO +avrebopti.menu.wiremode.mands=1x Wire, Master and Slave +avrebopti.menu.wiremode.mands.build.wiremode=MANDS_SINGLE +avrebopti.menu.wiremode.mands.build.wireabr=.wA + +#-------------------------------------# +# SPM from app mode # +# To enable writing flash from app # +#_____________________________________# +avrebopti.menu.appspm.no=Disabled (SPM write from app is not yet supported) +avrebopti.menu.appspm.no.bootloader.appspm= +avrebopti.menu.appspm.no.bootloader.BOOTSIZE=0x00 +avrebopti.menu.appspm.no.build.appspmabr= +avrebopti.menu.appspm.full= +avrebopti.menu.appspm.full.bootloader.appspm= +avrebopti.menu.appspm.full.build.appspmabr=.spmINVALID +avrebopti.menu.appspm.full.bootloader.BOOTSIZE=0x00 +#avrebopti.menu.appspm.full=Anywhere after 0x0200 (warning: App allowed to overwrite itself) +#avrebopti.menu.appspm.full.bootloader.appspm=-DSPM_FROM_APP=-1 +#avrebopti.menu.appspm.full.build.appspmabr=.spmALL +#avrebopti.menu.appspm.8plus=Above 8k (meant for 16k parts) +#avrebopti.menu.appspm.8plus.bootloader.appspm=-DSPM_FROM_APP=32 +#avrebopti.menu.appspm.8plus.bootloader.CODESIZE=32 +#avrebopti.menu.appspm.12plus=Above 12k (meant for 16k parts) +#avrebopti.menu.appspm.12plus.bootloader.appspm=-DSPM_FROM_APP=48 +#avrebopti.menu.appspm.12plus.bootloader.CODESIZE=48 +#avrebopti.menu.appspm.14plus=Above 14k (meant for 16k parts) +#avrebopti.menu.appspm.14plus.bootloader.appspm=-DSPM_FROM_APP=56 +#avrebopti.menu.appspm.14plus.bootloader.CODESIZE=56 +#avrebopti.menu.appspm.16plus=Above 16k (AVR64/32 only, meant for 32k parts) +#avrebopti.menu.appspm.16plus.bootloader.appspm=-DSPM_FROM_APP=64 +#avrebopti.menu.appspm.16plus.bootloader.CODESIZE=64 +#avrebopti.menu.appspm.24plus=Above 24k (AVR64/32 only, meant for 32k parts) +#avrebopti.menu.appspm.24plus.bootloader.appspm=-DSPM_FROM_APP=96 +#avrebopti.menu.appspm.24plus.bootloader.CODESIZE=96 +#avrebopti.menu.appspm.28plus=Above 28k (AVR64/32 only, meant for 32k parts) +#avrebopti.menu.appspm.28plus.bootloader.appspm=-DSPM_FROM_APP=112 +#avrebopti.menu.appspm.28plus.bootloader.CODESIZE=112 + +#----------------------------------------# +# WDT MODE # +#________________________________________# +avrebopti.menu.WDTtimeout.disabled=Disabled (recommended) +avrebopti.menu.WDTtimeout.8seconds=Window remains open for 8 Seconds +avrebopti.menu.WDTtimeout.4seconds=Window remains open for 4 Seconds +avrebopti.menu.WDTtimeout.2seconds=Window remains open for 2 Seconds +avrebopti.menu.WDTtimeout.1second=Window remains open for 1 Second +avrebopti.menu.WDTtimeout.500msec=Window remains open for 500 milliseconds +avrebopti.menu.WDTtimeout.250msec=Window remains open for 250 milliseconds +avrebopti.menu.WDTtimeout.125msec=Window remains open for 125 milliseconds +avrebopti.menu.WDTtimeout.63msec=Window remains open for 62.5 milliseconds +avrebopti.menu.WDTwindow.disabled=No delay before window "opens" +avrebopti.menu.WDTwindow.8seconds=8 Second before window "opens" +avrebopti.menu.WDTwindow.4seconds=4 Second before window "opens" +avrebopti.menu.WDTwindow.2seconds=2 Second before window "opens" +avrebopti.menu.WDTwindow.1second=1 Second before window "opens" +avrebopti.menu.WDTwindow.500msec=500 millisecond before window "opens" +avrebopti.menu.WDTwindow.250msec=250 millisecond before window "opens" +avrebopti.menu.WDTwindow.125msec=125 millisecond before window "opens" +avrebopti.menu.WDTwindow.63msec=62.5 millisecond before window "opens" +avrebopti.menu.WDTtimeout.disabled.bootloader.wdttimeoutbits=0000 +avrebopti.menu.WDTtimeout.8seconds.bootloader.wdttimeoutbits=1011 +avrebopti.menu.WDTtimeout.4seconds.bootloader.wdttimeoutbits=1010 +avrebopti.menu.WDTtimeout.2seconds.bootloader.wdttimeoutbits=1001 +avrebopti.menu.WDTtimeout.1second.bootloader.wdttimeoutbits=1000 +avrebopti.menu.WDTtimeout.500msec.bootloader.wdttimeoutbits=0111 +avrebopti.menu.WDTtimeout.250msec.bootloader.wdttimeoutbits=0110 +avrebopti.menu.WDTtimeout.125msec.bootloader.wdttimeoutbits=0101 +avrebopti.menu.WDTtimeout.63msec.bootloader.wdttimeoutbits=0100 +avrebopti.menu.WDTwindow.disabled.bootloader.wdtwindowbits=0000 +avrebopti.menu.WDTwindow.8seconds.bootloader.wdtwindowbits=1011 +avrebopti.menu.WDTwindow.4seconds.bootloader.wdtwindowbits=1010 +avrebopti.menu.WDTwindow.2seconds.bootloader.wdtwindowbits=1001 +avrebopti.menu.WDTwindow.1second.bootloader.wdtwindowbits=1000 +avrebopti.menu.WDTwindow.500msec.bootloader.wdtwindowbits=0111 +avrebopti.menu.WDTwindow.250msec.bootloader.wdtwindowbits=0110 +avrebopti.menu.WDTwindow.125msec.bootloader.wdtwindowbits=0101 +avrebopti.menu.WDTwindow.63msec.bootloader.wdtwindowbits=0100 + +#----------------------------------------# +# Flash Mapping options # +#________________________________________# +avrebopti.menu.flmap.lockdefault=Use last FLMAP section, lock FLMAP, provide PROGMEM_MAPPED +avrebopti.menu.flmap.unlocked=Start w/default, do not lock flmap. No PROGMEM_MAPPED. +avrebopti.menu.flmap.locksection0=Set FLMAP to section 0, lock FLMAP, provide PROGMEM_MAPPED +avrebopti.menu.flmap.lockdefault.build.flmapopts=-DLOCK_FLMAP -DFLMAPSECTION1 +avrebopti.menu.flmap.unlocked.build.flmapopts= +avrebopti.menu.flmap.locksection0.build.flmapopts=-DLOCK_FLMAP -DFLMAPSECTION0 +avrebopti.menu.flmap.lockdefault.build.flmapabr=.fld +avrebopti.menu.flmap.unlocked.build.flmapabr=.ful +avrebopti.menu.flmap.locksection0.build.flmapabr=.fl0 + + + ######################################################################################################## # # diff --git a/megaavr/cores/dxcore/core_parameters.h b/megaavr/cores/dxcore/core_parameters.h index 84986e4d..d6cf31f6 100644 --- a/megaavr/cores/dxcore/core_parameters.h +++ b/megaavr/cores/dxcore/core_parameters.h @@ -115,7 +115,7 @@ defined(MILLIS_USE_TIMERA1) || defined(MILLIS_USE_TIMERA2) || defined(MILLIS_USE_TIMERE0) || defined(MILLIS_USE_TIMERA0)) #error "MILLIS_USE_TIMERF0 and another timer are set as the millis timer. Specify one only. If this occurred on the Arduino IDE, please report it promptly." #endif -#if defined(MILLIS_USE_TIMERD0) || defined(MILLIS_USE_TIMERRTC) || defined(MILLIS_USE_TIMERRTC_XTAL) +#if defined(MILLIS_USE_TIMERD0) #error "A millis timer not supported on this core was passed. this should only be possible on third party IDEs. " #endif #if defined(UARTBAUD5V) || defined(UARTBAUD3V) diff --git a/megaavr/cores/dxcore/timers.h b/megaavr/cores/dxcore/timers.h index 49390bd9..f9057e5a 100644 --- a/megaavr/cores/dxcore/timers.h +++ b/megaavr/cores/dxcore/timers.h @@ -12,7 +12,7 @@ #ifdef MILLIS_USE_TIMERNONE #define DISABLE_MILLIS -#elif (defined(MILLIS_USE_TIMERRTC_XTAL) || defined(MILLIS_USE_TIMERRTC_XOSC)) +#elif (defined(MILLIS_USE_TIMERRTC_XTAL) || defined(MILLIS_USE_TIMERRTC_XOSC) || defined(MILLIS_USE_TIMERRTC_OSC)) #define MILLIS_USE_TIMERRTC #elif (defined(MILLIS_USE_TIMERA0) || defined(MILLIS_USE_TIMERA1)) #define MILLIS_USE_TCA diff --git a/megaavr/cores/dxcore/wiring.c b/megaavr/cores/dxcore/wiring.c index 094a604e..7e6291b9 100644 --- a/megaavr/cores/dxcore/wiring.c +++ b/megaavr/cores/dxcore/wiring.c @@ -37,7 +37,8 @@ void init_timers(); #error "CLOCK_SOURCE not defined. Must be 0 for internal, 1 for crystal, or 2 for external clock" #endif -#if !(defined(MILLIS_USE_TIMERNONE) || defined(MILLIS_USE_TIMERB0) || defined(MILLIS_USE_TIMERB1) || defined(MILLIS_USE_TIMERB2) || defined(MILLIS_USE_TIMERB3) || defined(MILLIS_USE_TIMERB4) || defined(MILLIS_USE_TIMERB5) || defined(MILLIS_USE_TIMERA0) || defined(MILLIS_USE_TIMERA1)) +#if !(defined(MILLIS_USE_TIMERNONE) || defined(MILLIS_USE_TIMERB0) || defined(MILLIS_USE_TIMERB1) || defined(MILLIS_USE_TIMERB2) || defined(MILLIS_USE_TIMERB3) || defined(MILLIS_USE_TIMERB4) || defined(MILLIS_USE_TIMERB5) || defined(MILLIS_USE_TIMERA0) || defined(MILLIS_USE_TIMERA1) \ + || defined(MILLIS_USE_TIMERRTC_XTAL) || defined(MILLIS_USE_TIMERRTC_XOSC) || defined(MILLIS_USE_TIMERRTC_OSC)) #error "wiring.c test of millis defines failed - no millis timer defined but millis enabled!" #endif @@ -121,6 +122,8 @@ void init_timers(); // Now for the ISRs. This gets a little bit more interesting now... #if defined (MILLIS_USE_TIMERRTC) + // a global to give others a chance to use the RTC CMP interrupt from sleep wakeup + uint8_t __rtc_intflags; ISR(MILLIS_VECTOR) { // if RTC is used as timer, we only increment the overflow count // Overflow count isn't used for TCB's @@ -128,6 +131,7 @@ void init_timers(); if (RTC.INTFLAGS & RTC_OVF_bm) { timingStruct.timer_overflow_count++; } + __rtc_intflags = RTC.INTFLAGS; RTC.INTFLAGS = RTC_OVF_bm | RTC_CMP_bm; // clear flag } #elif !defined(MILLIS_USE_TIMERNONE) @@ -393,7 +397,8 @@ void init_timers(); SREG = oldSREG; m = (m << 16); m += rtccount; - m = m - (m >> 5) + (m >> 7); + uint8_t round=( (m&0x3f) + ((m&0x7f)>>1) + 32)>>6; + m = m - (m >> 6) - (m >> 7) - round; // * 1000/1024 -> * ( 1 - 24/1024 ) -> * ( 1 - 1/64 - 1/128 ) /* the compiler is incorrigible - it cannot be convinced not to copy m twice, shifting one 7 times and the other 5 times * and wasting 35 clock cycles and several precious instruction words. * What you want is for it to make one copy of m, shift it right 5 places, subtract, then rightshift it 2 more. @@ -1782,20 +1787,26 @@ void __attribute__((weak)) init_millis() TCD0.CTRLC = 0x80; TCD0.INTCTRL = 0x01; // enable interrupt TCD0.CTRLA = TIMERD0_PRESCALER | 0x01; // set clock source and enable! - #elif defined(MILLIS_USE_TIMERRTC) - while(RTC.STATUS); // if RTC is currently busy, spin until it's not. - // to do: add support for RTC timer initialization - RTC.PER = 0xFFFF; - #ifdef MILLIS_USE_TIMERRTC_XTAL - _PROTECTED_WRITE(CLKCTRL.XOSC32KCTRLA,0x03); - RTC.CLKSEL = 2; // external crystal - #else - _PROTECTED_WRITE(CLKCTRL.OSC32KCTRLA,0x02); - // RTC.CLKSEL=0; this is the power on value - #endif - RTC.INTCTRL = 0x01; // enable overflow interrupt - RTC.CTRLA = (RTC_RUNSTDBY_bm|RTC_RTCEN_bm|RTC_PRESCALER_DIV32_gc);//fire it up, prescale by 32. - */ + */ + #elif defined(MILLIS_USE_TIMERRTC) + while(RTC.STATUS); // if RTC is currently busy, spin until it's not. + RTC.PER = 0xFFFF; + #if defined(MILLIS_USE_TIMERRTC_XTAL) + // crystal oscillator - startup can take up to 1000ms + _PROTECTED_WRITE(CLKCTRL.XOSC32KCTRLA,(CLKCTRL_RUNSTDBY_bm|CLKCTRL_CSUT_16K_gc|CLKCTRL_LPMODE_bm|CLKCTRL_ENABLE_bm)); + RTC.CLKSEL = 2; // RTC_CLKSEL_XOSC32K_gc or RTC_CLKSEL_XTAL32K_gc : external crystal + #elif defined(MILLIS_USE_TIMERRTC_XOSC) + // external clock input on pin xtal32k1 + _PROTECTED_WRITE(CLKCTRL.XOSC32KCTRLA,(CLKCTRL_RUNSTDBY_bm|CLKCTRL_SEL_bm|CLKCTRL_ENABLE_bm)); + RTC.CLKSEL = RTC_CLKSEL_EXTCLK_gc; // external clock input + #else + // internal 32 kHz oscillator + _PROTECTED_WRITE(CLKCTRL.OSC32KCTRLA,CLKCTRL_RUNSTDBY_bm); + // RTC.CLKSEL=RTC_CLKSEL_OSC32K_gc; 0: this is the power on value + #endif + RTC.INTCTRL = RTC_OVF_bm; // enable overflow interrupt + RTC.CTRLA = (RTC_RUNSTDBY_bm|RTC_RTCEN_bm|RTC_PRESCALER_DIV32_gc);//fire it up, prescale by 32. + //*/ #else // It's a type b timer - we have already errored out if that wasn't defined _timer->CCMP = TIME_TRACKING_TIMER_PERIOD; // Enable timer interrupt, but clear the rest of register @@ -1814,22 +1825,17 @@ void set_millis(__attribute__((unused))uint32_t newmillis) #if defined(MILLIS_USE_TIMERNONE) badCall("set_millis() is only valid with millis timekeeping enabled."); #else - /* + #if defined(MILLIS_USE_TIMERRTC) - // timer_overflow_count = newmillis >> 16; - // millis = 61/64(timer_overflow_count << 16 + RTC.CNT) + // millis = 1000/1024*(timer_overflow_count << 16 + RTC.CNT) uint8_t oldSREG = SREG; // save SREG - cli(); // interrupts off - uint16_t temp = (newmillis % 61) << 6; - newmillis = (newmillis / 61) << 6; - temp = temp / 61; - newmillis += temp; - timer_overflow_count = newmillis >> 16; + newmillis = ((newmillis/125)<<7) + (((newmillis%125)<<7)+62)/125; // *1024/1000 + cli(); // interrupts off + timingStruct.timer_overflow_count = newmillis >> 16; while(RTC.STATUS&RTC_CNTBUSY_bm); // wait if RTC busy RTC.CNT = newmillis & 0xFFFF; - SREG = oldSREG; // reemable oimterripts if we killed them, + SREG = oldSREG; // re-enable interrupts if we killed them, #else - */ /* farting around with micros via overflow count was ugly and buggy. * may implement again, better, in the future - but millis and micros * will get out of sync when you use set_millis @@ -1855,7 +1861,7 @@ void set_millis(__attribute__((unused))uint32_t newmillis) * -SK 2/4/23 */ timingStruct.timer_millis = newmillis; - //#endif + #endif #endif } diff --git a/megaavr/extras/ci/test-sketch/all/test_timekeeping/test_timekeeping.ino b/megaavr/extras/ci/test-sketch/all/test_timekeeping/test_timekeeping.ino index a7901a06..cafeb1f5 100644 --- a/megaavr/extras/ci/test-sketch/all/test_timekeeping/test_timekeeping.ino +++ b/megaavr/extras/ci/test-sketch/all/test_timekeeping/test_timekeeping.ino @@ -40,15 +40,17 @@ void compile_test_timekeeping() { set_millis(NOT_A_CONST_DWORD); uint32_t retval_millis = millis(); discard(retval_millis); - uint32_t retval_micros = micros(); - discard(retval_micros); - // pulsein with micros - uint32_t retval_pulseInLong = pulseInLong(NOT_A_CONST_BYTE, HIGH, NOT_A_CONST_DWORD); - discard(retval_pulseInLong); - retval_pulseInLong = pulseInLong(NOT_A_CONST_BYTE, LOW, NOT_A_CONST_DWORD); - discard(retval_pulseInLong); - retval_pulseInLong = pulseInLong(NOT_A_CONST_BYTE, NOT_A_CONST_BYTE, NOT_A_CONST_DWORD); - discard(retval_pulseInLong); + #ifndef MILLIS_USE_TIMERRTC + uint32_t retval_micros = micros(); + discard(retval_micros); + // pulsein with micros + uint32_t retval_pulseInLong = pulseInLong(NOT_A_CONST_BYTE, HIGH, NOT_A_CONST_DWORD); + discard(retval_pulseInLong); + retval_pulseInLong = pulseInLong(NOT_A_CONST_BYTE, LOW, NOT_A_CONST_DWORD); + discard(retval_pulseInLong); + retval_pulseInLong = pulseInLong(NOT_A_CONST_BYTE, NOT_A_CONST_BYTE, NOT_A_CONST_DWORD); + discard(retval_pulseInLong); + #endif #endif uint16_t retval_clockCyclesPerMicrosecond = clockCyclesPerMicrosecond(); discard(retval_clockCyclesPerMicrosecond); diff --git a/megaavr/libraries/Opamp/examples/Voltage_follower/Voltage_follower.ino b/megaavr/libraries/Opamp/examples/Voltage_follower/Voltage_follower.ino index 884e28e2..61ef07dc 100644 --- a/megaavr/libraries/Opamp/examples/Voltage_follower/Voltage_follower.ino +++ b/megaavr/libraries/Opamp/examples/Voltage_follower/Voltage_follower.ino @@ -1,4 +1,3 @@ - /***********************************************************************| | AVR-DB Opamp library | | |