Skip to content

Commit abea1c6

Browse files
committed
spelling
1 parent be20a95 commit abea1c6

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

ChangeLog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Changes listed here are checked in to GitHub ("master" branch unless specificall
2525
### Planned 2.6.11
2626
* Pending: New toolchain version.
2727
* Make wiring.c have the functions referred to in the doc.
28-
* Fix some of the constants for timers so that all timers can still get uniform codes specifying the portmux and (for non-TCA's) which pin within the mux it is, which matters forthe other core.
28+
* Fix some of the constants for timers so that all timers can still get uniform codes specifying the portmux and (for non-TCA's) which pin within the mux it is, which matters for the other core.
2929
* Documentation improvements.
3030
* Corrected bug sometimes encountered when using serial under atypical cases the causes of which remain mysterious), where it would complain about `__poll_dre_done`.
3131
* Correct bug with Comparator (#1236)

megaavr/cores/megatinycore/wiring.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1677,7 +1677,7 @@ void __attribute__((weak)) init_ADC0() {
16771677
* Users can turn it off if they care about power consumption while ADC is on
16781678
* and chip is awake, since these parts don't have the perverse ADC-left-on
16791679
* behavior of classic AVRs.
1680-
* ... Yes they do afterall. Fudge. Fixed on Ex though.
1680+
* ... Yes they do after all. Fudge. Fixed on Ex though.
16811681
*/
16821682
pADC->CTRLC = TIMEBASE_1US; // defined in Arduino.h.
16831683
pADC->PGACTRL = ADC_PGABIASSEL_3_4X_gc | ADC_ADCPGASAMPDUR_15CLK_gc;

megaavr/extras/Ref_Timers.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ This document is divided into two sections. The first one simply describes the a
66
### tinyAVR
77
On the tinyAVR parts using megaTinyCore, there are no bad PWM pins - we don't use TCBs on mTC for PWM. Not worth the flash, not worth the clocks to check.
88

9-
We support compiletime selection of alternate pinout sets for the PWM via the submenu option.
9+
We support compile time selection of alternate pinout sets for the PWM via the submenu option.
1010

11-
You will see very small differences in flashsize when switching between pins because the routines to check pins for current PWM activity and findthe bit to clear to turn it off (which constitute a significat portion of the time taken for digitalWrite(), which is why we have digitalWriteFast(), see [Digital Reference](Ref_Digital.md))
11+
You will see very small differences in flashsize when switching between pins because the routines to check pins for current PWM activity and findthe bit to clear to turn it off (which constitute a significant portion of the time taken for digitalWrite(), which is why we have digitalWriteFast(), see [Digital Reference](Ref_Digital.md))
1212

1313
### AVR Dx/Ex-series
1414
PWM can come from a TCA or TCE, a TCB (of which these parts have 2 to 5), or - if present - a TCD or TCF. This is marked on pinout diagrams.
@@ -133,7 +133,7 @@ without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
133133
We have a separate [document entirely dedicated to TCD0](Ref_TCD.md)
134134

135135
### TCE - New in the EB-series
136-
A 4-channel PWM timer otherwise very similar to TCA, except that it also has this bizzare contraption called Waveform Extension on it (which looks less than useful for most Arduino people). Up to 16-bit resolution with the debut of the old HiRes functionality from XMega: The chip has a PLL that runs at up to 80 MHz and if used, is generally run at 4x the system clock (ie, the 20 MHz internal oscillator is prescaled, kicked up to 80 MHz, which it subsequently divides down ) *no split mode!* Will be detailed in the documentation for DxCore, which intends to support those.
136+
A 4-channel PWM timer otherwise very similar to TCA, except that it also has this bizarre contraption called Waveform Extension on it (which looks less than useful for most Arduino people). Up to 16-bit resolution with the debut of the old HiRes functionality from XMega: The chip has a PLL that runs at up to 80 MHz and if used, is generally run at 4x the system clock (ie, the 20 MHz internal oscillator is prescaled, kicked up to 80 MHz, which it subsequently divides down ) *no split mode!* Will be detailed in the documentation for DxCore, which intends to support those.
137137

138138
### TCF - Another new timer
139139
Will be detailed in the documentation for DxCore, which intends to support those.
@@ -223,7 +223,7 @@ Note that while it does not currently impact any parts, there is a significant l
223223
In the future EB-series, the timer priorities will have to be considered carefully.
224224

225225
#### Channels without pins
226-
On some there exist channels that aren't connected to any pins. These can often be grabbed using the event system (however, this only is possible for the three single/16-bit mode pins, not WO3-5). You'll likely not find yourself struggling with pins having been dropped from the pincount you're using. While the Dx/Ex series parts have a grand unifying vision encompasing all modern AVRs since the tiny2, the tinyAVR pinouts are designed to make sense when you have 14-24 pins (The 8-pin modern tinies seem to have been abandoned almost as soon as they decided to make them. These days, with the competitive prices of the larger tinies, including in the 3mm x 3mm 20-pin QFN, it's hardto imagine someone getting these
226+
On some there exist channels that aren't connected to any pins. These can often be grabbed using the event system (however, this only is possible for the three single/16-bit mode pins, not WO3-5). You'll likely not find yourself struggling with pins having been dropped from the pincount you're using. While the Dx/Ex series parts have a grand unifying vision encompassing all modern AVRs since the tiny2, the tinyAVR pinouts are designed to make sense when you have 14-24 pins (The 8-pin modern tinies seem to have been abandoned almost as soon as they decided to make them. These days, with the competitive prices of the larger tinies, including in the 3mm x 3mm 20-pin QFN, it's hardto imagine someone getting these
227227

228228
But you could set input0 of LUT2 to be TCA0, enable the alternate pin mapping for the CCL LUT2 output (CCL output is on pin 3 or 6 of the LUT's "home port"), mask the other two inputs and set the truth table to 0x02, and get TCA0 WO0 on PD6. 6 PWM channels! Hm? You need seven you say? Well, okay - you could use TCB0 as the input for a the CCL LUT0, 1, or 3, but instead of enabling pin output (since those pins don't exist, or in the case of LUT1 on PORTC are already being used), you would have to instead set one of the event channels to use that CCL LUT as it's generator. Event output can be piped to either pin 2 or 7 in a port. PORTD is your only good choice. Then you could set EVOUTD to be an event user for that channel, and switch it's portmux to the alternate pin, PIN_PD7. Now you've got 7 channels! You need *another*? You can actually get an 8th if you really work at it - but millis must be either running on TCA0 or disabled, you must have an HV UPDI programmer to reprogram it, otherwise the required fuse settings will brick it. You would have to disable the UPDI functionality (hence it cannot be reprogrammed without an HV programmer). That turns PF7, the nominal UPDI pin, into a GPIO pin (reset can be turned into an input, but not an output on the DD (and barely can in general) `*`) This has very few functions available - in fact it has only 2 special functions, the SS pin of one of the wacky SPI mappings on the DD-series... and the alternate output pin of EVOUTF! You can then repeat the process above with TCB1 and EVOUTF. And at that point you have 8 independently controllable duty cycles coming out of 8 pins on your 14-pin package, of which 3 pins are power or ground, and another of which (PF6/reset) is input only. So 80% of the potential output pins and more over half of the physical pins could be used to output PWM without even having to use some sort of software PWM scheme - once the duty cycles were set and the peripherals enabled, the PWM would be generated without CPU intervention. The two remaining pins could then be used as, say, a serial port so you could tell it what duty cycles to use or something.
229229

0 commit comments

Comments
 (0)