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

Commit 2a8c1cb

Browse files
authored
v1.1.1 using Serial1 instead of Serial
### Release v1.1.1 1. Using Serial1 instead of Serial for debugging with Curiosity Nano AVRDA/AVRDB 2. Update `README.md`
1 parent 590ba8b commit 2a8c1cb

File tree

24 files changed

+425
-452
lines changed

24 files changed

+425
-452
lines changed

README.md

Lines changed: 176 additions & 216 deletions
Large diffs are not rendered by default.

changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
## Table of Contents
1010

1111
* [Changelog](#changelog)
12+
* [Release v1.1.1](#release-v111)
1213
* [Release v1.1.0](#release-v110)
1314
* [Initial Release v1.0.0](#initial-release-v100)
1415

@@ -17,6 +18,11 @@
1718

1819
## Changelog
1920

21+
### Release v1.1.1
22+
23+
1. Using Serial1 instead of Serial for debugging with Curiosity Nano AVRDA/AVRDB
24+
2. Update `README.md`
25+
2026
### Release v1.1.0
2127

2228
1. Improve and customize examples for `Curiosity Nano AVRDA/AVRDB` boards to use on-board LED and SW

examples/Argument_Complex/Argument_Complex.ino

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -88,19 +88,19 @@ void TimerHandler1(unsigned int outputPinsAddress)
8888

8989
//timer interrupt toggles pins
9090
#if (TIMER_INTERRUPT_DEBUG > 1)
91-
Serial.print("Toggle pin1 = "); Serial.println( ((pinStruct *) outputPinsAddress)->Pin1 );
91+
Serial1.print("Toggle pin1 = "); Serial1.println( ((pinStruct *) outputPinsAddress)->Pin1 );
9292
#endif
9393

9494
digitalWrite(((pinStruct *) outputPinsAddress)->Pin1, toggle);
9595

9696
#if (TIMER_INTERRUPT_DEBUG > 1)
97-
Serial.print("Read pin2 A0 ("); Serial.print(((pinStruct *) outputPinsAddress)->Pin2 );
98-
Serial.print(") = ");
99-
Serial.println(digitalRead(((pinStruct *) outputPinsAddress)->Pin2) ? "HIGH" : "LOW" );
97+
Serial1.print("Read pin2 A0 ("); Serial1.print(((pinStruct *) outputPinsAddress)->Pin2 );
98+
Serial1.print(") = ");
99+
Serial1.println(digitalRead(((pinStruct *) outputPinsAddress)->Pin2) ? "HIGH" : "LOW" );
100100

101-
Serial.print("Read pin3 A1 ("); Serial.print(((pinStruct *) outputPinsAddress)->Pin3 );
102-
Serial.print(") = ");
103-
Serial.println(digitalRead(((pinStruct *) outputPinsAddress)->Pin3) ? "HIGH" : "LOW" );
101+
Serial1.print("Read pin3 A1 ("); Serial1.print(((pinStruct *) outputPinsAddress)->Pin3 );
102+
Serial1.print(") = ");
103+
Serial1.println(digitalRead(((pinStruct *) outputPinsAddress)->Pin3) ? "HIGH" : "LOW" );
104104
#endif
105105

106106
toggle = !toggle;
@@ -114,32 +114,32 @@ void setup()
114114
pinMode(myOutputPins.Pin2, INPUT_PULLUP);
115115
pinMode(myOutputPins.Pin3, INPUT_PULLUP);
116116

117-
Serial.begin(115200);
118-
while (!Serial && millis() < 5000);
117+
Serial1.begin(115200);
118+
while (!Serial1 && millis() < 5000);
119119

120-
Serial.print(F("\nStarting Argument_Complex on ")); Serial.println(BOARD_NAME);
121-
Serial.println(DX_TIMER_INTERRUPT_VERSION);
122-
Serial.print(F("CPU Frequency = ")); Serial.print(F_CPU / 1000000); Serial.println(F(" MHz"));
120+
Serial1.print(F("\nStarting Argument_Complex on ")); Serial1.println(BOARD_NAME);
121+
Serial1.println(DX_TIMER_INTERRUPT_VERSION);
122+
Serial1.print(F("CPU Frequency = ")); Serial1.print(F_CPU / 1000000); Serial1.println(F(" MHz"));
123123

124-
Serial.print(F("TCB Clock Frequency = "));
124+
Serial1.print(F("TCB Clock Frequency = "));
125125

126126
#if USING_FULL_CLOCK
127-
Serial.println(F("Full clock (24/16MHz, etc) for highest accuracy"));
127+
Serial1.println(F("Full clock (24/16MHz, etc) for highest accuracy"));
128128
#elif USING_HALF_CLOCK
129-
Serial.println(F("Half clock (12/8MHz, etc.) for high accuracy"));
129+
Serial1.println(F("Half clock (12/8MHz, etc.) for high accuracy"));
130130
#else
131-
Serial.println(F("250KHz for lower accuracy but longer time"));
131+
Serial1.println(F("250KHz for lower accuracy but longer time"));
132132
#endif
133133

134134
// Timer TCB2 is used for micros(), millis(), delay(), etc and can't be used
135135
CurrentTimer.init();
136136

137137
if (CurrentTimer.attachInterruptInterval(TIMER1_INTERVAL_MS, TimerHandler1, (unsigned int) &myOutputPins))
138138
{
139-
Serial.print(F("Starting ITimer OK, millis() = ")); Serial.println(millis());
139+
Serial1.print(F("Starting ITimer OK, millis() = ")); Serial1.println(millis());
140140
}
141141
else
142-
Serial.println(F("Can't set ITimer. Select another freq. or timer"));
142+
Serial1.println(F("Can't set ITimer. Select another freq. or timer"));
143143
}
144144

145145
void loop()

examples/Argument_None/Argument_None.ino

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -88,32 +88,32 @@ void setup()
8888
{
8989
pinMode(LED_BUILTIN, OUTPUT);
9090

91-
Serial.begin(115200);
92-
while (!Serial && millis() < 5000);
91+
Serial1.begin(115200);
92+
while (!Serial1 && millis() < 5000);
9393

94-
Serial.print(F("\nStarting Argument_None on ")); Serial.println(BOARD_NAME);
95-
Serial.println(DX_TIMER_INTERRUPT_VERSION);
96-
Serial.print(F("CPU Frequency = ")); Serial.print(F_CPU / 1000000); Serial.println(F(" MHz"));
94+
Serial1.print(F("\nStarting Argument_None on ")); Serial1.println(BOARD_NAME);
95+
Serial1.println(DX_TIMER_INTERRUPT_VERSION);
96+
Serial1.print(F("CPU Frequency = ")); Serial1.print(F_CPU / 1000000); Serial1.println(F(" MHz"));
9797

98-
Serial.print(F("TCB Clock Frequency = "));
98+
Serial1.print(F("TCB Clock Frequency = "));
9999

100100
#if USING_FULL_CLOCK
101-
Serial.println(F("Full clock (24/16MHz, etc) for highest accuracy"));
101+
Serial1.println(F("Full clock (24/16MHz, etc) for highest accuracy"));
102102
#elif USING_HALF_CLOCK
103-
Serial.println(F("Half clock (12/8MHz, etc.) for high accuracy"));
103+
Serial1.println(F("Half clock (12/8MHz, etc.) for high accuracy"));
104104
#else
105-
Serial.println(F("250KHz for lower accuracy but longer time"));
105+
Serial1.println(F("250KHz for lower accuracy but longer time"));
106106
#endif
107107

108108
// Timer TCB2 is used for micros(), millis(), delay(), etc and can't be used
109109
CurrentTimer.init();
110110

111111
if (CurrentTimer.attachInterruptInterval(TIMER1_INTERVAL_MS, TimerHandler1))
112112
{
113-
Serial.print(F("Starting ITimer OK, millis() = ")); Serial.println(millis());
113+
Serial1.print(F("Starting ITimer OK, millis() = ")); Serial1.println(millis());
114114
}
115115
else
116-
Serial.println(F("Can't set ITimer. Select another freq. or timer"));
116+
Serial1.println(F("Can't set ITimer. Select another freq. or timer"));
117117
}
118118

119119
void loop()

examples/Argument_Simple/Argument_Simple.ino

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ void TimerHandler1(unsigned int outputPin = LED_BUILTIN)
8383

8484
#if (TIMER_INTERRUPT_DEBUG > 1)
8585
//timer interrupt toggles pin outputPin, default LED_BUILTIN
86-
Serial.print("pin1 = "); Serial.print(outputPin);
87-
Serial.print(" address: "); Serial.println((uint32_t) &outputPin );
86+
Serial1.print("pin1 = "); Serial1.print(outputPin);
87+
Serial1.print(" address: "); Serial1.println((uint32_t) &outputPin );
8888
#endif
8989

9090
digitalWrite(outputPin, toggle);
@@ -95,37 +95,37 @@ void setup()
9595
{
9696
pinMode(LED_BUILTIN, OUTPUT);
9797

98-
Serial.begin(115200);
99-
while (!Serial && millis() < 5000);
98+
Serial1.begin(115200);
99+
while (!Serial1 && millis() < 5000);
100100

101-
Serial.print(F("\nStarting Argument_Simple on ")); Serial.println(BOARD_NAME);
102-
Serial.println(DX_TIMER_INTERRUPT_VERSION);
103-
Serial.print(F("CPU Frequency = ")); Serial.print(F_CPU / 1000000); Serial.println(F(" MHz"));
101+
Serial1.print(F("\nStarting Argument_Simple on ")); Serial1.println(BOARD_NAME);
102+
Serial1.println(DX_TIMER_INTERRUPT_VERSION);
103+
Serial1.print(F("CPU Frequency = ")); Serial1.print(F_CPU / 1000000); Serial1.println(F(" MHz"));
104104

105-
Serial.print(F("TCB Clock Frequency = "));
105+
Serial1.print(F("TCB Clock Frequency = "));
106106

107107
#if USING_FULL_CLOCK
108-
Serial.println(F("Full clock (24/16MHz, etc) for highest accuracy"));
108+
Serial1.println(F("Full clock (24/16MHz, etc) for highest accuracy"));
109109
#elif USING_HALF_CLOCK
110-
Serial.println(F("Half clock (12/8MHz, etc.) for high accuracy"));
110+
Serial1.println(F("Half clock (12/8MHz, etc.) for high accuracy"));
111111
#else
112-
Serial.println(F("250KHz for lower accuracy but longer time"));
112+
Serial1.println(F("250KHz for lower accuracy but longer time"));
113113
#endif
114114

115115
// Timer2 is used for micros(), millis(), delay(), etc and can't be used
116116
CurrentTimer.init();
117117

118118
if (CurrentTimer.attachInterruptInterval(TIMER1_INTERVAL_MS, TimerHandler1, outputPin1))
119119
{
120-
Serial.print(F("Starting ITimer OK, millis() = ")); Serial.println(millis());
120+
Serial1.print(F("Starting ITimer OK, millis() = ")); Serial1.println(millis());
121121

122122
#if (TIMER_INTERRUPT_DEBUG > 1)
123-
Serial.print(F("OutputPin1 = ")); Serial.print(outputPin1);
124-
Serial.print(F(" address: ")); Serial.println((uint32_t) &outputPin1 );
123+
Serial1.print(F("OutputPin1 = ")); Serial1.print(outputPin1);
124+
Serial1.print(F(" address: ")); Serial1.println((uint32_t) &outputPin1 );
125125
#endif
126126
}
127127
else
128-
Serial.println(F("Can't set ITimer. Select another freq. or timer"));
128+
Serial1.println(F("Can't set ITimer. Select another freq. or timer"));
129129
}
130130

131131
void loop()

examples/Change_Interval/Change_Interval.ino

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,15 @@ volatile uint32_t Timer1Count = 1;
7979

8080
void printResult(uint32_t currTime)
8181
{
82-
Serial.print(F("Time = ")); Serial.print(currTime);
83-
Serial.print(F(", Timer1Count = ")); Serial.print(Timer1Count);
82+
Serial1.print(F("Time = ")); Serial1.print(currTime);
83+
Serial1.print(F(", Timer1Count = ")); Serial1.println(Timer1Count);
8484
}
8585

8686
void TimerHandler1()
8787
{
8888
static bool toggle = false;
8989

90-
// Flag for checking to be sure ISR is working as Serial.print is not OK here in ISR
90+
// Flag for checking to be sure ISR is working as Serial1.print is not OK here in ISR
9191
Timer1Count++;
9292

9393
//timer interrupt toggles pin LED_BUILTIN
@@ -99,32 +99,32 @@ void setup()
9999
{
100100
pinMode(LED_BUILTIN, OUTPUT);
101101

102-
Serial.begin(115200);
103-
while (!Serial && millis() < 5000);
102+
Serial1.begin(115200);
103+
while (!Serial1 && millis() < 5000);
104104

105-
Serial.print(F("\nStarting Change_Interval on ")); Serial.println(BOARD_NAME);
106-
Serial.println(DX_TIMER_INTERRUPT_VERSION);
107-
Serial.print(F("CPU Frequency = ")); Serial.print(F_CPU / 1000000); Serial.println(F(" MHz"));
105+
Serial1.print(F("\nStarting Change_Interval on ")); Serial1.println(BOARD_NAME);
106+
Serial1.println(DX_TIMER_INTERRUPT_VERSION);
107+
Serial1.print(F("CPU Frequency = ")); Serial1.print(F_CPU / 1000000); Serial1.println(F(" MHz"));
108108

109-
Serial.print(F("TCB Clock Frequency = "));
109+
Serial1.print(F("TCB Clock Frequency = "));
110110

111111
#if USING_FULL_CLOCK
112-
Serial.println(F("Full clock (24/16MHz, etc) for highest accuracy"));
112+
Serial1.println(F("Full clock (24/16MHz, etc) for highest accuracy"));
113113
#elif USING_HALF_CLOCK
114-
Serial.println(F("Half clock (12/8MHz, etc.) for high accuracy"));
114+
Serial1.println(F("Half clock (12/8MHz, etc.) for high accuracy"));
115115
#else
116-
Serial.println(F("250KHz for lower accuracy but longer time"));
116+
Serial1.println(F("250KHz for lower accuracy but longer time"));
117117
#endif
118118

119119
// Timer TCB2 is used for micros(), millis(), delay(), etc and can't be used
120120
CurrentTimer.init();
121121

122122
if (CurrentTimer.attachInterruptInterval(TIMER1_INTERVAL_MS, TimerHandler1))
123123
{
124-
Serial.print(F("Starting ITimer OK, millis() = ")); Serial.println(millis());
124+
Serial1.print(F("Starting ITimer OK, millis() = ")); Serial1.println(millis());
125125
}
126126
else
127-
Serial.println(F("Can't set ITimer. Select another freq. or timer"));
127+
Serial1.println(F("Can't set ITimer. Select another freq. or timer"));
128128
}
129129

130130
#define CHECK_INTERVAL_MS 1000L
@@ -156,7 +156,7 @@ void loop()
156156

157157
Timer1Count++;
158158

159-
Serial.print(F("Changing Interval, Timer = ")); Serial.println(TIMER1_INTERVAL_MS * (multFactor + 1));
159+
Serial1.print(F("Changing Interval, Timer = ")); Serial1.println(TIMER1_INTERVAL_MS * (multFactor + 1));
160160

161161
lastChangeTime = currTime;
162162
}

examples/Change_Interval_HF/Change_Interval_HF.ino

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ volatile uint32_t Timer1Count = 0;
7979

8080
void printResult(uint32_t currTime)
8181
{
82-
Serial.print(F("Time = ")); Serial.print(currTime);
83-
Serial.print(F(", Timer1Count = ")); Serial.println(Timer1Count);
82+
Serial1.print(F("Time = ")); Serial1.print(currTime);
83+
Serial1.print(F(", Timer1Count = ")); Serial1.println(Timer1Count);
8484
}
8585

8686
void TimerHandler1()
@@ -96,35 +96,35 @@ void TimerHandler1()
9696

9797
void setup()
9898
{
99-
Serial.begin(115200);
100-
while (!Serial && millis() < 5000);
99+
Serial1.begin(115200);
100+
while (!Serial1 && millis() < 5000);
101101

102102
pinMode(LED_BUILTIN, OUTPUT);
103103

104-
Serial.print(F("\nStarting Change_Interval_HF on ")); Serial.println(BOARD_NAME);
105-
Serial.println(DX_TIMER_INTERRUPT_VERSION);
106-
Serial.print(F("CPU Frequency = ")); Serial.print(F_CPU / 1000000); Serial.println(F(" MHz"));
104+
Serial1.print(F("\nStarting Change_Interval_HF on ")); Serial1.println(BOARD_NAME);
105+
Serial1.println(DX_TIMER_INTERRUPT_VERSION);
106+
Serial1.print(F("CPU Frequency = ")); Serial1.print(F_CPU / 1000000); Serial1.println(F(" MHz"));
107107

108-
Serial.print(F("TCB Clock Frequency = "));
108+
Serial1.print(F("TCB Clock Frequency = "));
109109

110110
#if USING_FULL_CLOCK
111-
Serial.println(F("Full clock (24/16MHz, etc) for highest accuracy"));
111+
Serial1.println(F("Full clock (24/16MHz, etc) for highest accuracy"));
112112
#elif USING_HALF_CLOCK
113-
Serial.println(F("Half clock (12/8MHz, etc.) for high accuracy"));
113+
Serial1.println(F("Half clock (12/8MHz, etc.) for high accuracy"));
114114
#else
115-
Serial.println(F("250KHz for lower accuracy but longer time"));
115+
Serial1.println(F("250KHz for lower accuracy but longer time"));
116116
#endif
117117

118118
// Timer2 is used for micros(), millis(), delay(), etc and can't be used
119119
CurrentTimer.init();
120120

121121
if (CurrentTimer.attachInterrupt(TIMER1_FREQUENCY, TimerHandler1))
122122
{
123-
Serial.print(F("Starting ITimer OK, millis() = ")); Serial.println(millis());
124-
Serial.print(F("Frequency, Timer = ")); Serial.println(TIMER1_FREQUENCY);
123+
Serial1.print(F("Starting ITimer OK, millis() = ")); Serial1.println(millis());
124+
Serial1.print(F("Frequency, Timer = ")); Serial1.println(TIMER1_FREQUENCY);
125125
}
126126
else
127-
Serial.println(F("Can't set ITimer. Select another freq. or timer"));
127+
Serial1.println(F("Can't set ITimer. Select another freq. or timer"));
128128
}
129129

130130
#define CHECK_INTERVAL_MS 1000L
@@ -154,7 +154,7 @@ void loop()
154154

155155
CurrentTimer.setFrequency(TIMER1_FREQUENCY / (multFactor + 1), TimerHandler1);
156156

157-
Serial.print(F("Changing Frequency, Timer = ")); Serial.println(TIMER1_FREQUENCY / (multFactor + 1));
157+
Serial1.print(F("Changing Frequency, Timer = ")); Serial1.println(TIMER1_FREQUENCY / (multFactor + 1));
158158

159159
lastChangeTime = currTime;
160160
}

0 commit comments

Comments
 (0)