Skip to content

Commit c9e9b8f

Browse files
committed
Use high frequency oscillator in Nano 33 Sense examples
1 parent 426a8f7 commit c9e9b8f

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

examples/Nano33SenseReceive/Nano33SenseReceive.ino

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ void setup()
5252
Serial.begin(115200);
5353
while (!Serial);
5454

55+
// Enable high frequency oscillator
56+
NRF_CLOCK->EVENTS_HFCLKSTARTED = 0;
57+
NRF_CLOCK->TASKS_HFCLKSTART = 1;
58+
while (NRF_CLOCK->EVENTS_HFCLKSTARTED == 0);
59+
5560
setupChirp();
5661

5762
PDM.onReceive(onPDMdata);
@@ -144,7 +149,7 @@ void setupChirp(void)
144149
// A fixed frequency correction coefficient is needed to correct a clock
145150
// mismatch between the 16000Hz requested sample rate and the Nano's actual
146151
// audio sample rate.
147-
err = chirp_connect_set_frequency_correction(chirp, 1.0096);
152+
err = chirp_connect_set_frequency_correction(chirp, 1.00812);
148153
chirpErrorHandler(err);
149154

150155
err = chirp_connect_start(chirp);

examples/Nano33SenseSend/Nano33SenseSend.ino

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#include "chirp_connect.h"
2828
#include "credentials.h"
2929

30-
#define VOLUME 0.3 // Between 0 and 1
30+
#define VOLUME 0.1 // Between 0 and 1
3131
#define BUFFER_SIZE 256
3232
#define OUTPUT_SAMPLE_RATE 16667
3333

@@ -57,6 +57,11 @@ void setup()
5757
Serial.begin(115200);
5858
while(!Serial); // Wait for Serial monitor before continuing
5959

60+
// Enable high frequency oscillator
61+
NRF_CLOCK->EVENTS_HFCLKSTARTED = 0;
62+
NRF_CLOCK->TASKS_HFCLKSTART = 1;
63+
while (NRF_CLOCK->EVENTS_HFCLKSTARTED == 0);
64+
6065
setupChirp();
6166
sendChirp();
6267

0 commit comments

Comments
 (0)