Synchronizaton events are remarkably common in biological systems. Many of these events take place in hard-to-see places (e.g. pacemaker cells of hearts, inside the hippcampus, and in insulin-secreting cells in the pancreas) [1]. Some, however, are spectacularly apparent. One example is firefly synchronization, which happens for a few weeks each year at a few places around the world. Another is snowy tree cricket chirp synchronization, which occurs for much of the year right here in Ithaca and across the United States! Go outside on many evenings and you'll hear it happening.
The snowy tree cricket is interesting for a number of reasons. In addition to synchronizing their chirps, these crickets change the frequency and speed of their chirps as a function of the ambient temperature. For this reason, they are nicknamed the "thermometer cricket." Here on the east coast, you can estimate the temperature outside (in Fahrenheit) by adding 40 to the number of chirps that you count in 15 seconds. In other parts of the country the linear relationship is slightly different, so it's a good idea to calibrate your crickets before taking any measurements. Fascinatingly, this relationship between temperature and chirp-rate has a name (Dolbear's Law). Even if you grew up in a part of the world without snowy tree crickets, you may still recognize their sound! Snowy tree crickets are often dubbed into soundtracks for movies and television to help depict summer evenings.
In this laboratory exercise, you will synthesize two artificial crickets - one on each of the dual-core processors in the RP2040 microcontroller. These crickets will be synthesized using Direct Digital Synthesis and sound shockingly real. You will then use a microphone to detect cricket chirps. This will involve calculating an FFT and looking for power at the chirp frequency. Finally, you will implement a synchronization algorithm so that your two crickets synchronize. Once everyone proves that their own crickets synchronize, we will turn on all of the crickets in the class to attempt class-wide synchronization of over 100 synthesized snowy tree crickets. Will it work? I don't know! But it will be fun to try.
Key concepts: Timers, timer interrupts, direct digital synthesis, SPI communication, ADC, DMA, FFT's, GPIO, VGA, multicore, threading, microphones, synchronization of pulse-coupled oscillators, DAC, fixed-point arithmetic
I've embedded a demo below of the system that you will build. Note: watch the demo with headphones. One cricket is synthesized into the left ear, and the other is synthesized into the right ear.
Experience shows that students prefer these webpages short. For that reason, please find the reading and background materials on the webpages linked below. Please note that the information in these readings will be critical for completing the lab.
#define
statements at the top of the source code and the DAC datasheet, build the code, and load it onto the Pico. Please note that different manufacturers use different names for signal names! Here are the correct connections:
3.3V(OUT)
-->VDD
GND
-->VSS
PIN_CS
--> $\overline{\text{CS}}$
PIN_SCK
-->SCK
PIN_MOSI
-->SDI
LDAC
--> $\overline{\text{LDAC}}$
- 8 syllables
- Syllable frequency = 2300 Hz
- Syllable length = 17 ms
- Syllable repeat interval = 2 ms
- Chirp repeat interval = 260 ms
Once all groups have demonstrated synchronization between their two crickets, we will attempt class-wide synchronization.
Your written lab report should include the sections mentioned in the policy page, and: