Skip to content
This repository was archived by the owner on Jan 29, 2023. It is now read-only.

Commit 869cf31

Browse files
authored
v1.0.1 for bug related to TCB0
### Initial Release v1.0.1 1. Fix bug giving error when using TCB0 (`USE_TIMER_0 == true`) 2. Default to use TCB0 for boards having only 1 TCB Timer, such as `ATtiny817`, `ATtiny807`
1 parent e844b26 commit 869cf31

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

README.md

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -255,16 +255,19 @@ Check the new [**multiFileProject** example](examples/multiFileProject) for a `H
255255
1. [Arduino 101: Timers and Interrupts](https://www.robotshop.com/community/forum/t/arduino-101-timers-and-interrupts/13072)
256256
2. [Getting Started with Timer/Counter Type B (TCB)](https://ww1.microchip.com/downloads/aemDocuments/documents/MCU08/ApplicationNotes/ApplicationNotes/TB3214-Getting-Started-with-TCB-DS90003214.pdf)
257257
3. [megaTinyCore README.md](https://github.com/SpenceKonde/megaTinyCore/blob/master/README.md)
258-
4. [AVR128DA48-Curiosity-Nano-Hardware-User Guide](https://ww1.microchip.com/downloads/en/DeviceDoc/AVR128DA48-Curiosity-Nano-UG-DS50002971B.pdf)
259-
5. [AVR128DB48-Curiosity-Nano-Hardware-User Guide](https://ww1.microchip.com/downloads/en/DeviceDoc/AVR128DB48-Curiosity-Nano-HW-UserG-DS50003037A.pdf)
258+
4. [ATtiny3217 Curiosity Nano Hardware User Guide](https://ww1.microchip.com/downloads/en/DeviceDoc/40002193A.pdf)
259+
5. [AVR128DA48-Curiosity-Nano-Hardware-User Guide](https://ww1.microchip.com/downloads/en/DeviceDoc/AVR128DA48-Curiosity-Nano-UG-DS50002971B.pdf)
260+
6. [AVR128DB48-Curiosity-Nano-Hardware-User Guide](https://ww1.microchip.com/downloads/en/DeviceDoc/AVR128DB48-Curiosity-Nano-HW-UserG-DS50003037A.pdf)
261+
260262

261263

262264

263265
### 2. Timer TCB0-TCB1
264266

265267
TCB0-TCB1 are 16-bit timers
266268

267-
The ATtiny boards with 14, 20, 28 or 32 pins, such as `ATtiny3217`, will have only maximum 2 TCB timers, (TCB0-TCB1).
269+
The ATtiny boards, such as `ATtiny3217`, `ATtiny1617`, will have only maximum 2 TCB timers, (TCB0-TCB1).
270+
The ATtiny boards, such as `ATtiny817`, will have only maximum 1 TCB timer, (TCB0).
268271

269272
The number of TCB timers will be automatically configured by the library.
270273

@@ -289,8 +292,8 @@ Before using any Timer, you have to make sure the Timer has not been used by any
289292
#define USING_250KHZ false // Not supported now
290293
291294
// Try to use RTC, TCA0 or TCD0 for millis()
292-
#define USE_TIMER_0 false // Check if used by millis(), Servo or tone()
293-
#define USE_TIMER_1 true // Check if used by millis(), Servo or tone()
295+
#define USE_TIMER_0 true // Check if used by millis(), Servo or tone()
296+
#define USE_TIMER_1 false // Check if used by millis(), Servo or tone()
294297
295298
#if USE_TIMER_0
296299
#define CurrentTimer ITimer0
@@ -416,8 +419,8 @@ The 16 ISR_based Timers, designed for long timer intervals, only support using *
416419
#define USING_250KHZ false // Not supported now
417420
418421
// Try to use RTC, TCA0 or TCD0 for millis()
419-
#define USE_TIMER_0 false // Check if used by millis(), Servo or tone()
420-
#define USE_TIMER_1 true // Check if used by millis(), Servo or tone()
422+
#define USE_TIMER_0 true // Check if used by millis(), Servo or tone()
423+
#define USE_TIMER_1 false // Check if used by millis(), Servo or tone()
421424
422425
#if USE_TIMER_0
423426
#define CurrentTimer ITimer0
@@ -519,7 +522,7 @@ void setup()
519522

520523
### Example [ISR_16_Timers_Array_Complex](examples/ISR_16_Timers_Array_Complex)
521524

522-
https://github.com/khoih-prog/ATtiny_TimerInterrupt/blob/bb76ba25917507432c4c03626229ab4912a442f0/examples/ISR_16_Timers_Array_Complex/ISR_16_Timers_Array_Complex.ino#L16-L376
525+
https://github.com/khoih-prog/ATtiny_TimerInterrupt/blob/e844b26a8ef72e9d91c47f963f61ca01fee7fc18/examples/ISR_16_Timers_Array_Complex/ISR_16_Timers_Array_Complex.ino#L16-L376
523526

524527

525528
---
@@ -535,7 +538,7 @@ While software timer, **programmed for 2s, is activated after more than 10.000s
535538

536539
```
537540
Starting ISR_16_Timers_Array_Complex on AVR_CuriosityNano3217
538-
ATtiny_TimerInterrupt v1.0.0
541+
ATtiny_TimerInterrupt v1.0.1
539542
CPU Frequency = 20 MHz
540543
TCB Clock Frequency = Full clock (20/16MHz, etc) for highest accuracy
541544
Starting ITimer OK, millis() = 13
@@ -605,7 +608,7 @@ Timer : 15, programmed : 80000, actual : 79997
605608

606609
```
607610
Starting ISR_16_Timers_Array_Complex on AVR_CuriosityNano3217
608-
ATtiny_TimerInterrupt v1.0.0
611+
ATtiny_TimerInterrupt v1.0.1
609612
CPU Frequency = 20 MHz
610613
TCB Clock Frequency = Full clock (20/16MHz, etc) for highest accuracy
611614
Starting ITimer OK, millis() = 13
@@ -671,7 +674,7 @@ Timer : 15, programmed : 80000, actual : 79997
671674

672675
```
673676
Starting ISR_16_Timers_Array_Complex on AVR_CuriosityNano3217
674-
ATtiny_TimerInterrupt v1.0.0
677+
ATtiny_TimerInterrupt v1.0.1
675678
CPU Frequency = 20 MHz
676679
TCB Clock Frequency = Half clock (10/8MHz, etc.) for high accuracy
677680
Starting ITimer OK, millis() = 13
@@ -737,7 +740,7 @@ The following is the sample terminal output when running example [Change_Interva
737740

738741
```
739742
Starting Change_Interval_HF on AVR_CuriosityNano3217
740-
ATtiny_TimerInterrupt v1.0.0
743+
ATtiny_TimerInterrupt v1.0.1
741744
CPU Frequency = 20 MHz
742745
TCB Clock Frequency = Full clock (20/16MHz, etc) for highest accuracy
743746
Starting ITimer OK, millis() = 13
@@ -829,6 +832,8 @@ Submit issues to: [ATtiny_TimerInterrupt issues](https://github.com/khoih-prog/A
829832
8. Improve and customize examples for `Curiosity Nano AVRDA/AVRDB` boards to use on-board LED and SW
830833
9. Add notes `howto upload by drag-and-drop` to `CURIOSITY` virtual drive
831834
10. Using Serial for debugging with `AVR_CuriosityNano3217`
835+
11. Default to use `TCB0` in examples for boards having only 1 TCB Timer, such as `ATtiny817`, `ATtiny807`
836+
12. Fix bug giving error when using TCB0 (`USE_TIMER_0 == true`)
832837

833838
---
834839
---

0 commit comments

Comments
 (0)