Hello everyone,
So I'm trying to play a .wav file on my Arduino MKRZERO (with the built in SD card reader). I have an 8-ohm speaker plugged into an LM386 low power amp, and the LM386 plugged into pin DAC0/A0 on the Arduino. I'm following this tutorial and have not changed the code other than the name of the wav file: https://www.arduino.cc/en/Tutorial/SimpleAudioPlayerZero.
When I run the code, the SD card fails to initialize and I get this output:
Sketch uses 18972 bytes (7%) of program storage space. Maximum is 262144 bytes.
Global variables use 2784 bytes (8%) of dynamic memory, leaving 29984 bytes for local variables. Maximum is 32768 bytes.
Atmel SMART device 0x10010005 found
Device : ATSAMD21G18A
Chip ID : 10010005
Version : v2.0 [Arduino:XYZ] Dec 20 2016 15:36:46
Address : 8192
Pages : 3968
Page Size : 64 bytes
Total Size : 248KB
Planes : 1
Lock Regions : 16
Locked : none
Security : false
Boot Flash : true
BOD : false
BOR : false
Arduino : FAST_CHIP_ERASE
Arduino : FAST_MULTI_PAGE_WRITE
Arduino : CAN_CHECKSUM_MEMORY_BUFFER
Erase flash
done in 0.861 seconds
Write 18972 bytes to flash (297 pages)
[==============================] 100% (297/297 pages)
done in 0.172 seconds
Verify 18972 bytes of flash with checksum.
Verify successful
done in 0.020 seconds
CPU reset.
Not sure if the CPU reset is causing the SD card initialization to fail (or why its resetting in the first place), but the sound does not play. The SD card is formatted correctly and the wav file has the correct settings per the tutorial.
Any help would be greatly appreciated! This is my first post so I apologize if I forgot to include any key details!
Thanks,
Aaron