Skip to content

Commit d89367e

Browse files
committed
Get rid of deprecated warnings.
1 parent 8af05ec commit d89367e

6 files changed

Lines changed: 68 additions & 80 deletions

File tree

.github/workflows/check-library-properties.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525

2626
steps:
2727
- name: Checkout
28-
uses: actions/checkout@v4
28+
uses: actions/checkout@v6
2929

3030
- name: Install arduino-ci-script
3131
uses: per1234/install-arduino-ci-script-action@main

.github/workflows/check-links.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222

2323
steps:
2424
- name: Checkout
25-
uses: actions/checkout@v4
25+
uses: actions/checkout@v6
2626

2727
- name: Check links
2828
uses: gaurav-nelson/github-action-markdown-link-check@v1

.github/workflows/compile-examples-macros.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ jobs:
103103
- device-family: eb
104104
opti: opti
105105

106-
# Filter avaliable parts for DA DB DU
106+
# Filter available parts for DA DB DU
107107
# Things w/out xtals
108108
- device-family: da
109109
clocksource: crystal
@@ -152,7 +152,7 @@ jobs:
152152
pincount: 14
153153
flash-class: 64
154154

155-
# Filter avaliable parts for EA EB EC LA
155+
# Filter available parts for EA EB EC LA
156156
# Things we can't get yet
157157
- device-family: ec
158158
- device-family: la

.github/workflows/general-formatting-checks.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717

1818
steps:
1919
- name: Checkout repository
20-
uses: actions/checkout@v4
20+
uses: actions/checkout@v6
2121

2222
- name: Check for UTF-8 BOM file encoding
2323
run: find . -path './.git' -prune -or -type f -exec grep --files-with-matches --binary-files=without-match $'\xEF\xBB\xBF' '{}' \; -exec echo 'UTF-8 BOM encoding detected.' \; -exec false '{}' +
@@ -27,7 +27,7 @@ jobs:
2727

2828
steps:
2929
- name: Checkout repository
30-
uses: actions/checkout@v4
30+
uses: actions/checkout@v6
3131

3232
- name: Check for files starting with a blank line
3333
run: find . -path './.git' -prune -or \( -not -name '*.py' -and -not -name '*.log' -and -type f \) -print0 | xargs -0 -L1 bash -c 'head -1 "$0" | grep --binary-files=without-match --regexp="^$"; if [[ "$?" == "0" ]]; then echo "Blank line found at start of $0."; false; fi'
@@ -37,7 +37,7 @@ jobs:
3737

3838
steps:
3939
- name: Checkout repository
40-
uses: actions/checkout@v4
40+
uses: actions/checkout@v6
4141

4242
- name: Check for unnecessary use of true tabs
4343
run: find . -path './.git' -prune -or \( -not -name 'keywords.txt' -and -not -name 'Makefile' -and -not -name '*.py' -and -not -name '*.log' -and -not -name '.gitmodules' -and -type f \) -exec grep --with-filename --line-number --binary-files=without-match --regexp=$'\t' '{}' \; -exec echo 'Tab found.' \; -exec false '{}' +
@@ -47,7 +47,7 @@ jobs:
4747

4848
steps:
4949
- name: Checkout repository
50-
uses: actions/checkout@v4
50+
uses: actions/checkout@v6
5151

5252
- name: Check for trailing whitespace
5353
run: find . -path './.git' -prune -or \( -not -name '*.hex' -and -not -name '*.py' -and -not -name '*.log' -and -not -name '*.gif' -and -not -name '*.png' -and -type f \) -exec grep --with-filename --line-number --binary-files=without-match --regexp='[[:blank:]]$' '{}' \; -exec echo 'Trailing whitespace found.' \; -exec false '{}' +
@@ -57,7 +57,7 @@ jobs:
5757

5858
steps:
5959
- name: Checkout repository
60-
uses: actions/checkout@v4
60+
uses: actions/checkout@v6
6161

6262
- name: Check for non-Unix line endings
6363
run: find . -path './.git' -prune -or \( -not -name '*.hex' -and -type f \) -exec grep --files-with-matches --binary-files=without-match --regexp=$'\r$' '{}' \; -exec echo 'Non-Unix EOL detected.' \; -exec false '{}' +
@@ -67,7 +67,7 @@ jobs:
6767

6868
steps:
6969
- name: Checkout repository
70-
uses: actions/checkout@v4
70+
uses: actions/checkout@v6
7171

7272
- name: Check for blank lines at end of files
7373
run: find . -path './.git' -prune -or \( \(-not -name '*.py' -and -not -name 'ioavr*.h' -and -type f \) -print0 | xargs -0 -L1 bash -c 'tail -1 "$0" | grep --binary-files=without-match --regexp="^$"; if [[ "$?" == "0" ]]; then echo "Blank line found at end of $0."; false; fi'
@@ -77,7 +77,7 @@ jobs:
7777

7878
steps:
7979
- name: Checkout repository
80-
uses: actions/checkout@v4
80+
uses: actions/checkout@v6
8181

8282
- name: Check for files that don't end in a newline
8383
# https://stackoverflow.com/a/25686825
@@ -86,7 +86,7 @@ jobs:
8686
runs-on: ubuntu-latest
8787
steps:
8888
- name: Checkout Code
89-
uses: actions/checkout@v4
89+
uses: actions/checkout@v6
9090
with:
9191
# Full git history is needed to get a proper list of changed files within `super-linter`
9292
fetch-depth: 0
@@ -95,7 +95,7 @@ jobs:
9595
# Run Linter against code base #
9696
################################
9797
- name: Lint Code Base
98-
uses: github/super-linter@v4
98+
uses: github/super-linter@v6
9999
env:
100100
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
101101
VALIDATE_MARKDOWN: true

.github/workflows/spell-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919

2020
steps:
2121
- name: Checkout
22-
uses: actions/checkout@v4
22+
uses: actions/checkout@v6
2323

2424
# See: https://github.com/codespell-project/actions-codespell/blob/master/README.md
2525
- name: Spell check

megaavr/extras/Ref_Analog.md

Lines changed: 54 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -8,74 +8,62 @@ The ADC on the the Ex-series is even better - it is nearly the same ADC that the
88
**Be sure to disable to the ADC prior to putting the part to sleep if low power consumption is required!**
99

1010
## Vital Statistics
11-
| Part family | Min. Res. | Max. Res. | CLK Max | CLK used | Max Ovrsamp Res. | Extras
12-
|-------------|-----------|-----------|---------|----------|------------------|---
13-
| megaAVR 0 | 8-bit | 10-bit | 0.2-1.5 | 1-1.25MHz| 13-bit | (1) This is the last piece of text in this document known applicable to the mega0. We don't have a core for those nor do we plan one. Use MegaCoreX
14-
| tinyAVR 0/1 | 8-bit | 10-bit | 0.2-1.5 | 1-1.25MHz| 13-bit | (1), (2)
15-
| tinyAVR 1+ | 8-bit | 10-bit | 0.2-1.5 | 1-1.25MHz| 13-bit | (1), (3), two identical ADCs.
16-
| AVR DU | 8-bit | 10-bit | 0.125-2 | 1-1.4MHz | 13-bit | Single ended. Single ADC. Text makes references to ADC1, which does not exist - looks copied from SD. Or 1-series.
17-
| AVR SD | 8-bit | 2x 10-bit | 0.125-2 | n/a | 13-bit | Single ended, Dual ADC, looks like 2 copies of the one they gave the DU. Support **not** planned due to irrelevant niche features which impede normal development.
18-
| AVR DA | 10-bit | 12-bit | 0.125-2 | 1-1.4MHz | 15-bit | (5) "Differential" ADC
19-
| AVR DB | 10-bit | 12-bit | 0.125-2 | 1-1.4MHz | 15-bit | (5) "Differential" ADC
20-
| AVR DD | 10-bit | 12-bit | 0.125-2 | 1-1.4MHz | 15-bit | (5) "Differential" ADC more pins can be ADC pins.
21-
| tinyAVR 2 | 8-bit | 12-bit | 3/6 * | 2-2.5MHz | 17-bit | (6) True differential, 1-16x PGA
22-
| AVR EA | 8-bit | 12-bit | 2/6 * | 2-2.5MHz | 17-bit | (6) True differential, 1-16x PGA, sign chopping.
23-
| AVR EB | 8-bit | 12-bit | 2/6 * | 2-2.5MHz | 17-bit | (6) True differential, 1-16x PGA, sign chopping.
24-
| AVR EC | 8-bit?| 12-bit?| 2/6 ? | 2-2.5MHz | 17-bit | 100% speculation, but considering rumors of it's niche, this Ex looks likely to get the Ex ADC
25-
| AVR LA | 8-bit | 10-bit | 0.125-2 | 1-1.4MHz | 15-bit | It's getting the DU version, but they've extended accumulation to 1024 samples, and it's getting prescaler settings of /2 to /32, instead of the selection with less granularity between /2 and /64
26-
27-
`*` 6 MHz with external or Vdd reference, 3 MHz with internal.
28-
`**` - "After the USB natives were done with him, you could barely recognize him. They'd cut TCD clean out of his chest, torn off and roasted his MVIO for a villiage feast in honor of the 3.3v logic levels of USB data lines... and ah - removed two bits from his "analog-to-digital converter" *damn... I tried to tell him they weren't friendly, and that negotiations wouldn't go well.... but he just had to give peace a chance* "Well, to his credit, they do seem to have avoided an outright war with the USB natives" *But at what cost? Rsze their primitive hovels, execute the relevant designers and use a tried and true USB stack from any of the several lines of...!*
29-
"Remember what they did to the Atmellists! The u6 tried to go in and negotiate... They let the U4 out, the U2 - only after taking off his A/D converter, and the u6 himself... well... He was in no condition to go into production after that."
30-
*These uppity peripherals! We need to get tough*
31-
32-
Notes:
33-
1. This part has a very awkward set of reference voltages (4.3, 2.5, 1.1, 1.5, 0.55). For the ultra low reference voltage, use analogSetClock() to ensure that the clock speed is within the much lower sped'ed range of 65-200 kHz. You may also want to lower sample duration since that's what it's denominated in. All other parts have 1.024/2.048/4.096/2.5
34-
2. No external reference on 0-series and 1-series below 16k.
35-
3. 16k (1+series) parts are blessed with a number a boons. One of them is a second ADC. I think the intent was to provide a way to approximate having a differential ADC by triggering both at once (well, one of the intents, another one was because the ADC0 is taken over by the PTC if that is in use.
36-
5. The Dx "differential" is still limited to voltages below Vref. It's thus much like startig two ADCs simultaneously and subtracting the result, which is what I think it does
37-
6. This is a REAL differential ADC. Max V<sub>Ain</sub> = Vdd + .1 or .2V and for useful readings their difference must be smaller than VREF. The tiny2 has some mysterious tunables, proper tuning of which is unclear. Offset error is disappointingly high, which Microchip noticed and introduced sign chopping (and removed a mysterious tunable or two) in the EA series, which should help significantly.
38-
39-
The differential ADC on the Dx-series is disappointing.
40-
41-
42-
### Crystal Ball Gazing
43-
I predict a bright future for both the 10-bit ADC used in the DU and the 12-bit one used in the Ex.
44-
45-
I'm less optimistic for the DA/DB/DD, which I think was a stopgap to give something like a differential ADC before the Ex ADC was ready.
11+
12+
13+
14+
| Part family | Min. Res. | Max. Res. | CLK Max | CLK used |Ext| Max Ovrsamp Res. | Extras
15+
|-------------|-----------|-----------|---------|----------|---|------------------|---
16+
| megaAVR 0 | 8-bit | 10-bit | 0.2-1.5 | 1-1.25MHz| | 13-bit | (1) This is the last piece of text in this document known applicable to the mega0. We don't have a core for those nor do we plan one. Use MegaCoreX
17+
| tinyAVR 0/1 | 8-bit | 10-bit | 0.2-1.5 | 1-1.25MHz| | 13-bit | (1), (2)
18+
| tinyAVR 1+ | 8-bit | 2x 10-bit | 0.2-1.5 | 1-1.25MHz| X | 13-bit | (1), (3), two identical ADCs.
19+
| tinyAVR 2 | 8-bit | 12-bit | 2/6 | 2-2.5MHz | X | 17-bit | (6) True differential, 1-16x PGA
20+
| AVR DA | 10-bit | 12-bit | 0.125-2 | 1-1.4MHz | X | 15-bit | (5) "Differential" ADC
21+
| AVR DB | 10-bit | 12-bit | 0.125-2 | 1-1.4MHz | X | 15-bit | (5) "Differential" ADC
22+
| AVR DD | 10-bit | 12-bit | 0.125-2 | 1-1.4MHz | X | 15-bit | (5) "Differential" ADC more pins can be ADC pins.
23+
| AVR DU | 8-bit | 10-bit | 0.125-2 | 1-1.4MHz | X | 13-bit | One single-ended ADC. Contains references in datasheet to non-existent ADC1, implying crossfertilization with the SD-series, which has 2 ADCs of this design.
24+
| AVR EA | 8-bit | 12-bit | 2/6 | 2-2.5MHz | X | 17-bit | (6) True differential, 1-16x PGA, sign chopping.
25+
| AVR EB | 8-bit | 12-bit | 2/6 | 2-2.5MHz | X | 17-bit | (6) True differential, 1-16x PGA, sign chopping.
26+
| AVR EC | 8-bit | 12-bit | 2/6 | 2-2.5MHz | X | 17-bit | (6) Looks likely to be getting the good one from the EA-series.
27+
| AVR LA | 8-bit | 10-bit | 0.125-2 | 1-1.4MHz | X | 15-bit | A slight upgrade from the DU-version, with more prescaler granularity, downgrade from other Dx or Ex.
28+
| AVR SD | 8-bit | 2x 10-bit | 0.125-2 | n/a | X | 13-bit | Single ended, Dual ADC, looks like 2 copies of the one they gave the DU. These parts are not supported and no support is planned, wrong niche for us.
29+
30+
Ext = External Reference
31+
32+
33+
### Types of ADC
34+
There is one difference between how the parts with the new Ex-series ADC, and the Dx-series one.
35+
36+
On parts with true differential ADC (the Ex and 2-series), when making diffferential measurements, the analog voltage requirement is:
37+
```
38+
-0.1V <= Vin <= (Vdd + 0.1)
39+
```
40+
41+
On the parts without the new ADC, if they do have a differential mode, the analog voltage requirement is:
42+
43+
```
44+
0V <= Vin <= Vref <= (Vdd - 0.4)
45+
```
46+
47+
That means that a Dx-series measuring two voltages above 2.048 v differentially, even if they're very close to each other, can only use the 4.096v reference, because Vin must be below VRef. The accuracy is limited.
48+
49+
On an Ex-series, you don't need to use a VRef larger than the largest voltage being measured - so since you may be measuring a very small value (for example, across a current shunt). In the same situation, the Ex can use the 1.024v reference, getting 4 times finer resolution, **without even enabling the programmable gain amplifier**
50+
4651

4752
## Reference Voltages
48-
Analog reference voltage can be selected as usual using analogReference(). Supported reference voltages are listed below. The references available on the Dx and Ex parts are chosen from the same list as the tiny2's got to pick from, but somehow they wound up in a different order on these parts. You should never have to use the numbers (though that's all those constants are), unless your code loses track of what reference it has selected
49-
In some cases the voltage determines the maximum ADC clock speed. Call analogReference() before analogClockSpeed() to ensure that the analog clock speed is appropriate when any of these apply:
50-
* You are switching between internal and external/VDD reference on an Ex/2-series
51-
* You are using the half volt reference on the 0/1-series, or switching from that to another reference
52-
* You are on a Dx-series with an external reference of less than 1.8V
53-
54-
55-
| tinyAVR (0/1) | Voltage | Minimum Vdd | Number | Notes
56-
|-----------------------------------------|---------|-------------|--------|-------
57-
| `VDD` (default) | Vcc/Vdd | - | 16 |
58-
| `INTERNAL0V55` | 0.55 V | - | 0 | ADC clock needs to be 100kHz to 260 kHz to get accurate results
59-
| `INTERNAL1V1` | 1.10 V | - | 1 |
60-
| `INTERNAL2V5` | 2.50 V | - | 2 |
61-
| `INTERNAL4V3` | 4.30 V | - | 3 |
62-
| `INTERNAL1V5` | 1.50 V | - | 4 |
63-
| `EXTERNAL` | < VDD | - | 32 | 1+series only
64-
65-
| tinyAVR (2-series) or anything else | Voltage | Minimum Vdd | # tiny2| # Dx | # Ex | Notes
66-
|-----------------------------------------|---------|-------------|--------|---------|---------|------
67-
| `VDD` (default) | Vcc/Vdd | | 0 | 5 | 0 | Good to 6 MHz ADC clock on 2-series and Ex
68-
| `INTERNAL1V024` | 1.024 V | 2.5* V | 4 | 0 | 4 | 10-bit reading with 1.025 ref gives apx. 1 mv/ADC count
69-
| `INTERNAL2V048` | 2.048 V | 2.5 V | 5 | 1 | 5 | 12-bit reading with 2.048 ref gives apx. 0.5 mv/ADC count
70-
| `INTERNAL4V096` | 4.096 V | 4.55 V | 7 | 2 | 6 | 12-bit reading with 4.096 ref gives apx. 1 mv/ADC count
71-
| `INTERNAL2V500` | 2.500 V | 2.7 V | 6 | 3 | 7 |
72-
| `INTERNAL4V1` (alias of INTERNAL4V096) | 4.096 V | 4.55 V | 7 | 2 | 6 |
73-
| `EXTERNAL` (tiny2/Ex version) | < VDD | VREF +0.5V | 2 | - | 2 | External ref good to 6 MHz ADC clock on 2-series and Ex
74-
| `EXTERNAL` (Dx-series) | 1.0-1.8 | VREF +0.5V | - | 6 | | Dx: CLK_ADC =< 500 kHz
75-
| `EXTERNAL` (Dx-series) | 1.8-VDD | VREF +0.5V | - | 6 | | Dx: Normal limits apply (see this document for DxCore for details)
76-
77-
78-
You can test like `if(getAnalogReference()==INTERNAL2V500)`, but if you try to say, print them, you just get a number. That's what is shown in the last column: contains the numerical value of the constants representing these references. Don't use those, then nobody will understand your code - including yourself in two weeks. However, if you are printing the results of `getAnalogReference()` or `getDACReference()`, these are the numbers you will see.
53+
Analog reference voltage can be selected as usual using analogReference(). Supported reference voltages are listed below. The "Number" column is the *numeric value* of this constant, which - like named constants in general - is cryptic when seen by human eyes during debugging if not documented. Note that the numeric values **have changed in 1.6.2** in order to allow for the same constants to be used with both DACReference() and AnalogReference() - on the DA/DB/DD, this came for free because the bitfields were the same. On the Ex, the AC and DAC use the VREF ordering, and the ADC uses a totally different ordering. This was handled improperly prior to 1.6.2 for the EA (the EB and DU were not yet supported, and in any event it rarely matters for them.)
54+
55+
| Summary | Lowest min Vdd | Highest min Vdd | Availability
56+
|-----------------------------------------|---------|----------|---------------------------
57+
| `VDD` | Vdd | - | Universal
58+
| `INTERNAL1V024` | 1.0 V | 2.7 V | All modern AVRs since the megaAVR 0-series
59+
| `INTERNAL2V048` | 2.5 V | 2.7 V | All modern AVRs since the megaAVR 0-series
60+
| `INTERNAL4V096` | 4.55 V | 4.6 V | All modern AVRs since the megaAVR 0-series
61+
| `INTERNAL2V500` | 2.7 V | 3.0 V | All modern AVRs
62+
| `INTERNAL4V1` | - | - | Alias of `INTERNAL4V096`
63+
| `INTERNAL2V5` | - | - | Alias of `INTERNAL2V500`
64+
| `INTERNAL0V512` | TBD | TBD | New reference option on LA-series
65+
| `EXTERNAL` | complicated | . | External reference available on all parts barring the 0/1 tinyAVR (and classic AVRs)
66+
| `INTERNAL` on classic AVRs | vsried | varied | usually (but not always) 1.1V.
7967

8068
### Important notes regarding references
8169

0 commit comments

Comments
 (0)