Skip to content

Commit 9225c39

Browse files
authored
Merge pull request #16 from chirp/bug/use-high-freq-oscillator
Fix: Use high freq oscillator
2 parents 426a8f7 + 8091c94 commit 9225c39

File tree

5 files changed

+18
-5
lines changed

5 files changed

+18
-5
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
Recent changes to the [Chirp Arduino SDK](https://developers.chirp.io/docs).
44

5+
## v3.3.1 (beta)
6+
- Use high frequency oscillator in Nano 33 Sense examples
7+
58
## v3.3.0 (09/08/2019)
69

710
- Added support for cortex-m4 (Nano 33 Sense)

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Chirp for Arduino
22

3-
*Version 3.3.0, August 2019*
3+
*Version 3.3.1, August 2019*
44

55
## Overview
66

@@ -10,7 +10,7 @@ Chirp is a library enabling Arduino-based devices to send and receive data using
1010
* A digital I2S MEMS microphone (if your board does not contain a microphone)
1111
* A digital I2S amplifier and compatible speaker
1212

13-
For receiving data, you will need a digital MEMS microphone. Some boards (for example, the Nano 33 Sense and Microsoft MXChip) already include a MEMS mic so you are good to go. For others, you will need an external mic such as the [SPH0645](https://www.adafruit.com/product/3421) or [ICS-43434](https://www.mouser.co.uk/ProductDetail/TDK-InvenSense/ICS-43434?qs=u4fy%2FsgLU9PAgmWRI7%252BqXA%3D%3D).
13+
For receiving data, you will need a digital MEMS microphone. Some boards (for example, the Nano 33 Sense and Microsoft MXChip) already include a MEMS mic so you are good to go. For others, you will need an external mic such as the [SPH0645](https://www.adafruit.com/product/3421) or [ICS-43434](https://www.mouser.co.uk/ProductDetail/TDK-InvenSense/ICS-43434?qs=u4fy%2FsgLU9PAgmWRI7%252BqXA%3D%3D).
1414

1515
For sending data, we recommend using a digital I2S audio output such as the [UDA1334A](https://www.adafruit.com/product/3678) or [MAX98357A](https://www.adafruit.com/product/3006), connected to a compatible speaker.
1616

examples/Nano33SenseReceive/Nano33SenseReceive.ino

+6-1
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

+6-1
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

library.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=ChirpSDK
2-
version=3.3.0
2+
version=3.3.1
33
author=Asio Ltd <developers@chirp.io>
44
maintainer=Joe Todd <joe@chirp.io>
55
sentence=Chirp SDK

0 commit comments

Comments
 (0)