You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ChangeLog.md
+4-5Lines changed: 4 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,21 +3,20 @@ This page documents (nearly) all bugfixes and enhancements that produce visible
3
3
4
4
## Planned changes not yet implemented
5
5
These items are in addition to what was listed under changes already in release.
6
-
7
6
* Enhancement: Fix pinout diagrams for DD-series.
8
7
* Enhancement: We need pinout diagrams for EA-series too! Considering how bad I am at getting pinout diagrams, I guess I should start asking about DU-series diagrams too!
9
-
* Enhancement: AVRdude 7.2 should be out soon. That will be used in the first release after it is available.
10
-
* Bugfix: Make serialupdi work with EA.
8
+
* Enhancement: AVRdude 7.2 out.
9
+
* Bugfix: Make serialupdi work with EA, EB **CRITICAL**
11
10
* Enhancement: Implement sleep library
12
11
* Re-add SPI attach and detach.
13
12
* Ensure libraries in sync with megaTinyCore.
14
13
15
-
## Planned changes implemented in github
14
+
## 1.6.0
16
15
These are typically planned for release in a future version (usually the next one) as noted.
17
-
* Update - was not gods of C, it was a gang of rogue peripherals. After being held captive and tortured by WEX Luther and his cronies, core developer has escaped said malicious preipherals. While held captive, my computer and equipment were sabotaged by their henchmen. Particular care in restraining WEX Luther to be taken to ensure that end users do not face such attacks.
18
16
* Add support for not-yet-announced S class DA-series parts, which are identical but for having the new EB-series lockdown thingie. There are no changes needed.
19
17
* Support for the PTC peripheral on DA parts
20
18
19
+
21
20
### 1.5.11 (Emergency fix)
22
21
* At some point in the recent past, I must have angered the gods of C, and suddenly millis disabled stopped working - the system would hang (actually, with in-depth investigation, it was shown to be bootlooping - before it called init(), it was calling 0x0000 (a dirty reset) instead of eliding a weakly defined function with nothing in the body except a return, or with an empty body. Why was it doing this? And why only when millis was disabled?). millis disabled is a key piece of core functionality, necessitating an urgent fix. Moving the definitions into main.cpp resolved this issue. (#485)
23
22
* Critical PWM bug on DA and DB returned and made all TCA and TCD PWM fail to operate. (#473)
comparator::ref::vref_vrefa; // ExtrernaL voltage reference
162
-
```
163
-
164
-
#### Aliases accepted on both Dx/Ex and Tiny2
165
-
```c++
166
-
comparator::ref::vref_1v0; // Alias
167
-
comparator::ref::vref_2v0; // Alias
168
-
comparator::ref::vref_2V1; // Alias
169
-
comparator::ref::vref_2v5; // Alias
170
-
comparator::ref::vref_4v1; // Alias
169
+
comparator::ref::vref_1v0; // Alias of vref_1v024
170
+
comparator::ref::vref_2v0; // Alias of vref_2v048
171
+
comparator::ref::vref_2v1; // Alias of vref_2v048
172
+
comparator::ref::vref_2v5; // Alias of vref_2v500
173
+
comparator::ref::vref_4v1; // Alias of vref_4v096
171
174
```
172
175
173
176
#### Usage
@@ -178,13 +181,13 @@ Comparator.reference = comparator::ref::vref_4v096; // Use the internal 4.096V
178
181
#### Default state
179
182
`Comparator.reference` defaults to `comparator::ref::disable` if not specified in the user program.
180
183
181
-
### dacref
184
+
### dacref (not available on tinyAVR 0-series)
182
185
This property configures the DACREF value - this voltage can be selected as the input for the negative side of the comparator. This is essentially an 8-bit DAC that can only be used as the AC negative input. It is calculated as:
Or, in words, the the voltage from ACn.DACREF is that many 256th's of the reference voltage
187
-
*(it does not appear to be `ACn.DACREF + 1` 256'ths interestingly enough, which is what one would expect, and would be strictly speaking slightly better) -SK*
190
+
*(it does not appear to be `ACn.DACREF + 1` 256'ths, interestingly enough - which is what one would expect, and would be strictly speaking slightly better) -SK*
188
191
189
192
#### Usage
190
193
```c++
@@ -261,7 +264,7 @@ Comparator.output_swap = comparator::out::no_swap; // No pin swap for output
261
264
262
265
263
266
### output_initval
264
-
When the comparator is initialized, the pin is set to this state until the comparator has output available. To prevent a glitch during initialization, set this to what you expect it to initially output.
267
+
When the comparator is initialized, the pin is set to this state until the comparator has output available. To prevent a glitch during initialization, set this to what you expect it to initially output. Alternately, this can be
265
268
Accepted values:
266
269
```c++
267
270
comparator::out::init_low; // Output pin low after initialization
@@ -403,6 +406,117 @@ MyComparator.start(); // Enable the comparator
403
406
enterStandbySleep(); // enter standby sleep mode until the comparator interrupt fires, waking it up.
404
407
```
405
408
409
+
## Appendix: Pin chart ordered by AC number
410
+
411
+
PIN | Mega AC0 | DA/DB AC0 | DD AC0 | EA AC0 | EB AC0 | DA/DB AC1 | EA AC1 | EB AC1 | DA/DB AC2 |
This highights the consistent pin options for any given comparator across the DA-series and later parts, and shows that the mega0 the clear odd-part-out.
428
+
429
+
The tinyAVR pinout, of course, has little in common with the full-size parts:
*shouldn't LP_MODE/PROFILE and RUNSTBY be properties, and treated like everything else? Why **aren't** they? I would imagine that wanting to wake on the AC int would be one of the most common uses of that interrupt.
408
-
They certainly **want** to be properties and it would make the library more coherent. But it would come at a 4-8 bytes of flash (unsure if per comparator or total) and 1 or 2 bytes of ram per comparator, depending on implementation details. Probably wouldn't be popular with people on 212's, but that's a pretty small overhead considering the general level of bloat introduced by classy wrappers around peripherals like Logic, Comparator and Opamp). Maybe a new optional argument to start it in low power, low power - run standby, and run standby (correspondingly more options on DxCore of course). Because how often are you going to be changing the mode once you've turned it on? That's an odd use case (and in any case, the intuitive solution of calling start with a different argument to change it would behave as expected. By passing as the argument the value to be written to the CTRLA register it would have almost no overhead, too. -SK
444
+
*shouldn't LP_MODE/PROFILE and RUNSTBY be properties, and treated like everything else? Why **aren't** they? I would imagine that wanting to wake on the AC int would be one of the most common uses of that interrupt.*
445
+
446
+
*They certainly **want** to be properties and it would make the library more coherent. But it would come at a 4-8 bytes of flash (unsure if per comparator or total) and 1 or 2 bytes of ram per comparator, depending on implementation details. Probably wouldn't be popular with people on 212's, but that's a pretty small overhead considering the general level of bloat introduced by classy wrappers around peripherals like Logic, Comparator and Opamp).*
447
+
448
+
*But - I think Maybe a new optional argument to start it in low power, low power - run standby, and run standby (correspondingly more options on DxCore of course). Because how often are you going to be changing the mode once you've turned it on? That's an odd use case (and in any case, the intuitive solution of calling start with a different argument to change it would behave as expected. By passing as the argument the value to be written to the CTRLA register it would have almost no overhead, too. -SK*
| `comparator::pm::unchanged`| as before | as before | as before| The default option when called without argument - does not change the current setting. If not previously set, results in default configurationbelow.
454
+
| `comparator::pm::default` | 50 ns | 92 uA | No | Resets it to the default configuration.
455
+
| `comparator::pm::lp` | 150 ns | 45 uA | No | tinyAVR 0-series does not support low power mode.
456
+
| `comparator::pm::runstby` | 50 ns | 92 uA | Yes | Mind the current if entering standby with this.
457
+
| `comparator::pm::lp_stby` | 150 ns | 45 uA | Yes | Likely the most useful option after default. Current still more than an order of magnitude larger larger than expected standby sleep power consumption. tinyAVR 0-series not supported.
458
+
459
+
On tinyAVR, LP Mode also changes the hysteresis thresholds from 10/30/55 mV to 10/40/80 mV. No such effect is documented for other comparators.
| `comparator::pm::unchanged` | as before | as before | as before| The default option when called without argument - does not change the current setting. If not previously set, results in default configurationbelow.
465
+
| `comparator::pm::default` | 85 ns | 70 uA | No | Resets it to the default configuration.
466
+
| `comparator::pm::pmode0` | as above | as above | as above | Alias of to the default power mode.
467
+
| `comparator::pm::pmode1` | 235 ns | 17 uA | No | Resets it to the default configuration.
468
+
| `comparator::pm::pmode2` | 445 ns | 12 uA | No | Resets it to the default configuration.
469
+
| `comparator::pm::lp` | as above | as above | as above | Alias of power mode 2 without runstby
470
+
| `comparator::pm::runstby` | 85 ns | 70 uA | Yes | Power mode 1, run standby.
471
+
| `comparator::pm::pmode0_stby` | as above | as above | as above | Alias of the default power mode with runstby.
472
+
| `comparator::pm::pmode1_stby` | 235 ns | 17 uA | Yes | Power mode 1, run standby.
473
+
| `comparator::pm::pmode2_stby` | 445 ns | 12 uA | Yes | Power mode 2, run standby. Likely the most useful.
474
+
| `comparator::pm::lp_stby` | as above | as above | as above | Alias of power mode 2 with runstby
| `comparator::pm::unchanged` | as before | as before | as before| The default option when called without argument - does not change the current setting. If not previously set, results in default configurationbelow.
481
+
| `comparator::pm::default` | 50 ns | 150 uA | No | Resets it to the default configuration.
482
+
| `comparator::pm::pmode0` | as above | as above | as above | Alias of to the default power mode.
483
+
| `comparator::pm::pmode1` | 150 ns | 110 uA | No | Resets it to the default configuration.
484
+
| `comparator::pm::lp` | as above | as above | as above | Alias of power mode 1 without runstby
485
+
| `comparator::pm::runstby` | 50 ns | 150 uA | Yes | Power mode 1, run standby. Goddamn, what happened to the power consumption?!
486
+
| `comparator::pm::pmode0_stby` | as above | as above | as above | Alias of the default power mode with runstby.
487
+
| `comparator::pm::pmode1_stby` | 150 ns | 110 uA | Yes | Power mode 1, run standby. Power mode 1 is hardly an improvement. What happened to modes 2 and 3?!
488
+
| `comparator::pm::lp_stby` | as above | as above | as above | Alias of power mode 1 with runstby
489
+
490
+
491
+
After a
492
+
493
+
494
+
* AC_PWR_DEFAULT - No low power mode, no run in standby. 85ns response time. 0x00
495
+
* AC_PWR_PMODE1 - No run in standby, using low power mode. 235ns`*` response time. Saves 53uA. 0x08
496
+
* AC_PWR_PMODE2 - No run in standby, not using low power mode. 445ns`*` response time. Saves 58uA. 0x10
497
+
* AC_PWR_RUNSTBY - Run in standby, power mode 0. 0x80.
498
+
* AC_PWR_PMODE1STBY - Run in standby, power mode 1 150ns response time. Saves 53uA. 0x88
499
+
* AC_PWR_PMODE2STBY - Run in standby, power mode 2 150ns response time. Saves 58uA. 0x90
500
+
501
+
## Constants, Ex
502
+
* AC_PWR_DEFAULT - No low power mode, no run in standby. 50ns response time. 0x00
503
+
* AC_PWR_PMODE1 - No run in standby, using low power mode. 150ns response time. Saves 40uA. 0x08
504
+
* AC_PWR_RUNSTBY - Run in standby, power mode 0. 0x80.
505
+
* AC_PWR_PMODE1STBY - Run in standby, power mode 1 150ns response time. Saves 40uA. 0x88
506
+
507
+
Uh, yeah, the analog comparators have response times ot 50-445 ns, and use between 12 and 150 uA.
508
+
509
+
### Peripheral Power Consumption
510
+
511
+
Figures are as reported by manufacturer in datasheets for analog comparator as "typical" values.
512
+
513
+
Mode | TinyAVR 2 | AVR Dx | AVR Ex |
514
+
-----|-----------|--------|--------|
515
+
Base | 92 uA | 70 uA | 150 uA |
516
+
LP | 45 uA | - | - |
517
+
PM1 | - | 17 uA | 110 uA |
518
+
PM2 | - | 12 uA | n/s |
519
+
PM3 | - | Rsvd. | n/s |
520
+
521
+
522
+
Note that the overall device power while in power-down sleep is typically on the order of <0.1 uA in power down sleep, and <1 uA in standby sleep with the RTC running. Standby sleep with the RTC and an AC running in RUNSTBY in contrast is ~92 uA, or half that with LP mode. Users considering use of `RUNSTBY` should take heed of the power ramifications of this, and consider if there is a better way to achieve their goal. If that must be done, `LPMODE` is recommended.
0 commit comments