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

Commit 51d5057

Browse files
authored
v1.1.0 to improve and customize examples
### Release v1.1.0 1. Improve and customize examples for `Curiosity Nano AVRDA/AVRDB` boards to use on-board LED and SW 2. Add notes `howto upload by drag-and-drop` to `CURIOSITY` virtual drive
1 parent 76fc97c commit 51d5057

File tree

1 file changed

+72
-9
lines changed

1 file changed

+72
-9
lines changed

README.md

Lines changed: 72 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
## Table of Contents
1717

18+
* [Important Note for Arduino IDE](#Important-Note-for-Arduino-IDE)
1819
* [Why do we need this Dx_TimerInterrupt library](#why-do-we-need-this-Dx_TimerInterrupt-library)
1920
* [Features](#features)
2021
* [Why using ISR-based Hardware Timer Interrupt is better](#why-using-isr-based-hardware-timer-interrupt-is-better)
@@ -74,6 +75,56 @@
7475
---
7576
---
7677

78+
### Important Note for Arduino IDE
79+
80+
With some Arduino IDE versions, such as v1.8.19, upload directly via USB to some boards, such as `Curiosity_AVR128DA48` or `Curiosity_AVR128DB48` can't be done without unknown-to-me fix. We'll get the following error when uploading
81+
82+
```
83+
avrdude: Version 6.3-20201216
84+
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
85+
Copyright (c) 2007-2014 Joerg Wunsch
86+
87+
System wide configuration file is "/home/kh/.arduino15/packages/DxCore/hardware/megaavr/1.4.10/avrdude.conf"
88+
User configuration file is "/home/kh/.avrduderc"
89+
User configuration file does not exist or is not a regular file, skipping
90+
91+
Using Port : usb
92+
Using Programmer : curiosity_updi
93+
avrdude: usbdev_open(): Found nEDBG CMSIS-DAP, serno: MCHP3280041800002682
94+
avrdude: usbdev_open(): WARNING: failed to set configuration 1: Device or resource busy
95+
avrdude: Found CMSIS-DAP compliant device, using EDBG protocol
96+
avrdude: usbdev_send(): wrote -5 out of 912 bytes, err = Input/output error
97+
avrdude: jtag3_edbg_prepare(): failed to send command to serial port
98+
99+
avrdude done. Thank you.
100+
101+
the selected serial port
102+
does not exist or your board is not connected
103+
```
104+
105+
We can use drag-and-drop method to `drag-and-drop` the compiled **hex** file to `CURIOSITY` virtual drive.
106+
107+
If `success`, The LED blinks **slowly** for 2 sec. The LED will blinks **rapidly* for 2 sec if `failure`
108+
109+
110+
For example, To run [Change_Interval example](https://github.com/khoih-prog/Dx_TimerInterrupt/tree/main/examples/Change_Interval), use Arduino IDE to compile, and get the `Change_Interval.ino.hex` file. For Ubuntu Linux, the file is store in directory `/tmp/arduino_build_xxxxxx`
111+
112+
113+
<p align="center">
114+
<img src="https://github.com/khoih-prog/Dx_TimerInterrupt/blob/main/pics/Change_Interval.png">
115+
</p>
116+
117+
118+
After drag-and-drop `Change_Interval.ino.hex` into `CURIOSITY` virtual drive, the code will run immidiately if successfully loaded (LED blinks **slowly**)
119+
120+
121+
<p align="center">
122+
<img src="https://github.com/khoih-prog/Dx_TimerInterrupt/blob/main/pics/Curiosity_AVR128DA48.png">
123+
</p>
124+
125+
126+
---
127+
---
77128

78129
### Why do we need this [Dx_TimerInterrupt library](https://github.com/khoih-prog/Dx_TimerInterrupt)
79130

@@ -128,12 +179,14 @@ The catch is your function is now part of an ISR (Interrupt Service Routine), an
128179
<img src="https://github.com/khoih-prog/Dx_TimerInterrupt/blob/main/pics/Curiosity_AVR128DA48.png">
129180
</p>
130181

131-
- **AVRDB-based boards (AVR128DB, AVR64DB, AVR32DD, etc.) using DxCore**
182+
183+
- **AVRDB-based boards (AVR128DB, AVR64DB, AVR32DB, etc.) using DxCore**
132184

133185
<p align="center">
134186
<img src="https://github.com/khoih-prog/Dx_TimerInterrupt/blob/main/pics/Curiosity_AVR128DB48.png">
135187
</p>
136188

189+
137190
### To be supported Boards
138191

139192
- **AVRDD-based boards (AVR64DD) using DxCore**
@@ -220,10 +273,20 @@ Check the new [**multiFileProject** example](examples/multiFileProject) for a `H
220273
1. [Arduino 101: Timers and Interrupts](https://www.robotshop.com/community/forum/t/arduino-101-timers-and-interrupts/13072)
221274
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)
222275
3. [DXCore README.md](https://github.com/SpenceKonde/DxCore/blob/master/README.md)
276+
4. [AVR128DA48-Curiosity-Nano-Hardware-User Guide](https://ww1.microchip.com/downloads/en/DeviceDoc/AVR128DA48-Curiosity-Nano-UG-DS50002971B.pdf)
277+
5. [AVR128DB48-Curiosity-Nano-Hardware-User Guide](https://ww1.microchip.com/downloads/en/DeviceDoc/AVR128DB48-Curiosity-Nano-HW-UserG-DS50003037A.pdf)
278+
279+
223280

224281
### 2. Timer TCB0-TCB4
225282

226-
TCB0-TCB are 16-bit timers.
283+
TCB0-TCB4 are 16-bit timers
284+
285+
The AVRDx boards with 14, 20, 28 or 32 pins, such as AVRDx28, will have only 3 TCB timers, (TCB0-TCB2)
286+
287+
The AVRDx with 48 pins, such as AVRDA48, AVRDB48, , will have 4 TCB timers, (TCB0-TCB3)
288+
289+
The AVRDx with 64 pins, such as AVRDA64, AVRDB64, , will have 5 TCB timers, (TCB0-TCB4)
227290

228291
---
229292
---
@@ -487,7 +550,7 @@ void setup()
487550

488551
### Example [ISR_16_Timers_Array_Complex](examples/ISR_16_Timers_Array_Complex)
489552

490-
https://github.com/khoih-prog/Dx_TimerInterrupt/blob/0441816fc4540a8f7c03247950ad4386defda202/examples/ISR_16_Timers_Array_Complex/ISR_16_Timers_Array_Complex.ino#L16-L369
553+
https://github.com/khoih-prog/Dx_TimerInterrupt/blob/76fc97c9e52fbc79a02db77f3f0e9d8842062a7a/examples/ISR_16_Timers_Array_Complex/ISR_16_Timers_Array_Complex.ino#L16-L384
491554

492555

493556
---
@@ -503,7 +566,7 @@ While software timer, **programmed for 2s, is activated after more than 10.000s
503566

504567
```
505568
Starting ISR_16_Timers_Array_Complex on AVR128DA
506-
Dx_TimerInterrupt v1.0.0
569+
Dx_TimerInterrupt v1.1.0
507570
CPU Frequency = 16 MHz
508571
TCB Clock Frequency = 16MHz for highest accuracy
509572
Starting ITimer OK, millis() = 6
@@ -656,7 +719,7 @@ Timer : 15, programmed : 80000, actual : 80016
656719

657720
```
658721
Starting ISR_16_Timers_Array_Complex on AVR128DA
659-
Dx_TimerInterrupt v1.0.0
722+
Dx_TimerInterrupt v1.1.0
660723
CPU Frequency = 16 MHz
661724
TCB Clock Frequency = 16MHz for highest accuracy
662725
Starting ITimer OK, millis() = 6
@@ -742,7 +805,7 @@ Timer : 15, programmed : 80000, actual : 80000
742805
```
743806
744807
Starting ISR_16_Timers_Array_Complex on AVR128DA
745-
Dx_TimerInterrupt v1.0.0
808+
Dx_TimerInterrupt v1.1.0
746809
CPU Frequency = 16 MHz
747810
TCB Clock Frequency = Half clock (12/8MHz, etc.) for high accuracy
748811
Starting ITimer OK, millis() = 10
@@ -811,7 +874,7 @@ The following is the sample terminal output when running example [Change_Interva
811874

812875
```
813876
Starting Change_Interval_HF on AVR128DA
814-
Dx_TimerInterrupt v1.0.0
877+
Dx_TimerInterrupt v1.1.0
815878
CPU Frequency = 16 MHz
816879
TCB Clock Frequency = 16MHz for highest accuracy
817880
[TISR] TCB 1
@@ -893,8 +956,8 @@ Submit issues to: [Dx_TimerInterrupt issues](https://github.com/khoih-prog/Dx_Ti
893956
6. Selectable **TCB Clock FULL, HALF** depending on necessary accuracy
894957
6. Fix `multiple-definitions` linker error
895958
7. Optimize library code by using `reference-passing` instead of `value-passing`
896-
897-
959+
8. Improve and customize examples for `Curiosity Nano AVRDA/AVRDB` boards to use on-board LED and SW
960+
9. Add notes `howto upload by drag-and-drop` to `CURIOSITY` virtual drive
898961

899962
---
900963
---

0 commit comments

Comments
 (0)