This example demonstrates a digital sound recorder using ADC for sampling and DAC for playback. Samples are timed at a defined frequency, controlled by a timer and event system. SPI is used to store raw data on an SD card, driver included. This example demonstrates direct register read and write operations for peripheral initialization, and therefore does not use peripheral drivers.
The example is explained in more details in the application note AN2547.
- MPLAB X IDE v6.25 or later
- XC8 (v3.00) alternatively AVR/GNU C Compiler 5.4.0 can be used
- ATtiny_DFP 3.3.272 or later
- ATtiny817 Xplained Pro or ATtiny817 Xplained Mini
- I/O1 Xplained Pro Extension Kit
- OLED1 Xplained Pro Extension Kit
- Microphone and speaker
- Connect I/O1 Xplained Pro to
EXT1
- Connect OLED1 Xplained Pro to
EXT3
- Connect a microphone to
ADC_IN7 (PA7)
- Connect a speaker to
DAC_OUT (PA6)
- Download the zip file or clone the example to get the source code.
- Open
attiny817-digital-sound-recorder-mplab.X
in MPLAB. - Connect the ATtiny817 Xplained Pro with your computer.
- Make sure the kit is selected as the tool to be programmed under project settings.
- Press the make and program button to program the device.
- Use the buttons on the OLED display to start recording, erase or start playback.
We have here shown how you can use a ATtiny817 as a digital sound recorder.