I posted this on the main arduinoArduino forum, but no one has responded in 24 hours.
I'm trying to use the WaveHCWaveHC
library from adafruitAdafruit with a custom PCB. I am having trouble getting the SPISPI
com to work for some reason, I modified the ArduinoPins.hArduinoPins.h
, SS_PINSS_PIN
, from pin 10 to 8.
Using the arduinoArduino SD library, I can see all the files no problem.
In the WaveHCWaveHC
library, all of the examples freeze after card.init()card.init()
, I traced it to the spiSend(uint8_t b)spiSend(uint8_t b)
in SdReader.cppSdReader.cpp
. It seems to get stuck in "while(!(SPSR & (1 << SPIF))"while(!(SPSR & (1 << SPIF))
. This looks like the SPDRSPDR
register (the SPISPI
data register) is never loaded properly.
Does anyone know what is going on?
Adafruit library : https://github.com/adafruit/WaveHC
Edit : This is the output from the SDReadTest example (Arduino SD Library)
Initializing SD card...Wiring is correct and a card is present.
Card type: SD2
Volume type is FAT32
Volume size (bytes): 1973350400
Volume size (Kbytes): 1927100
Volume size (Mbytes): 1881
Files found on the card (name, date and size in bytes):
SYSTEM~1/ 2016-11-07 14:11:06
INDEXE~1 2016-11-07 14:11:06 76
0.WAV 2016-11-07 11:44:14 22124
1.WAV 2016-11-07 11:44:14 18604
2.WAV 2016-11-07 11:44:14 19244
3.WAV 2016-11-07 11:44:14 19884
4.WAV 2016-11-07 11:44:14 21164
5.WAV 2016-11-07 11:44:14 23084
6.WAV 2016-11-07 11:44:14 21484
7.WAV 2016-11-07 11:44:14 29484
8.WAV 2016-11-07 11:44:14 20844
9.WAV 2016-11-07 11:44:14 25004
P.WAV 2016-11-07 11:44:14 21804
Notes :
- I am using an Atmega328P @ 8MHz with the pro mini bootloader (this may be the issue)
- SPI_DEFAULT_HALF_SPEED
SPI_DEFAULT_HALF_SPEED
is set to true - SPI_INIT_SLOW
SPI_INIT_SLOW
is set to 1