accessing SD card on ePaper featherwing from huzzah32

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
tonyhansen
 
Posts: 31
Joined: Fri Nov 29, 2013 12:37 am

accessing SD card on ePaper featherwing from huzzah32

Post by tonyhansen »

I've been trying to access the SD card on the tri-color eInk featherwing connected to a huzzah32 using arduino code. I have not found the proper combination yet.

I can access the built-in 1MB flash memory using the code from File->Examples->SPIFFS->SPIFFS_Test.

But none of the SD card sketch examples appear to work for me.

From https://learn.adafruit.com/adafruit-huz ... er/pinouts I see that I need to use these pin selections:

SD CS to pin D14
SRAM CS to pin D32
EINK CS to pin D15
EINK DC to pin 33

So, for example, I set CHIP_SELECT to 14 in the SDInfo sketch. I tried setting DISABLE_CHIP_SELECT to either its default of -1 and to 15, but neither one seems to make a difference.

I've tried a couple different SD cards: a freshly formatted VFAT/FAT32 8GB card with a few files written to it from a Windows PC, and a VFAT/FAT32 4GB card with NOOBS on it.

Disabling SPI device on pin 15

Assuming the SD chip select pin is: 14
Edit SD_CHIP_SELECT to change the SD chip select pin.
error: cardSize failed
SD errorCode: 0X50,0X20

SdInfo.h says that error string, 0x50, is SD_CARD_ERROR_READ,

So I assume that I'm missing something super simple.

Can anyone make a suggestion to get me over the hump?

User avatar
adafruit_support_carter
 
Posts: 29156
Joined: Tue Nov 29, 2016 2:45 pm

Re: accessing SD card on ePaper featherwing from huzzah32

Post by adafruit_support_carter »

FAT32 should be supported, but make sure it's really FAT32. Some info here:
https://learn.adafruit.com/adafruit-mic ... ting-notes

Otherwise your pin assignment looks OK, and using the SDInfo sketch is a good test.

Since there are additional items on the SPI bus - the SRAM and the eink display, you may also need to add extra lines to explicitly set their CS lines to deselect those other devices.

User avatar
tonyhansen
 
Posts: 31
Joined: Fri Nov 29, 2013 12:37 am

Re: accessing SD card on ePaper featherwing from huzzah32

Post by tonyhansen »

Thank you @adafruit_support_carter. Some good news below.
  • I verified that the SD cards were formatted properly, using the recommended SD software from sdcard.org. No change.
  • Being certain that the SRAM and EINK CS's were deselected didn't make a difference.
  • But, I DID find that changing the SPI data rate from the 50MHz down to 20MHz started giving me valid data from the SD card. (40 and 30 did not work, but 20 did.)
```
if (!sd.cardBegin(SD_CHIP_SELECT, SD_SCK_MHZ(20))) { // was 50
```

Now to write some code that will read/write the SD card AND write to the ePaper display AND read/write the SPIFFS.

One more question: What data rates does the ePaper featherwing support? Will slowing the SPI clock down to 20MHz change how well it works in any way?

User avatar
adafruit_support_carter
 
Posts: 29156
Joined: Tue Nov 29, 2016 2:45 pm

Re: accessing SD card on ePaper featherwing from huzzah32

Post by adafruit_support_carter »

There's some timing info the datasheet:
https://cdn-learn.adafruit.com/assets/a ... L0376F.pdf

Slowing it down generally shouldn't matter.

User avatar
tonyhansen
 
Posts: 31
Joined: Fri Nov 29, 2013 12:37 am

Re: accessing SD card on ePaper featherwing from huzzah32

Post by tonyhansen »

Thank you for confirming that, @adafruit_support_carter. I appreciate the help.

- Tony

User avatar
stephanschulz
 
Posts: 21
Joined: Tue Jan 08, 2013 4:35 pm

Re: accessing SD card on ePaper featherwing from huzzah32

Post by stephanschulz »

Hello tonyhansen

I am in a similar situation wanting to use the 2.13 ePaper Featherwing mono color + Huzzah32 feather.
The SD card mounting is very unreliable I noticed.

Which SD library are you using? The standard SD.h or SdFat.h, or?

I have not yet found "SD.cardBegin(SD_CHIP_SELECT, SD_SCK_MHZ(20))" anywhere as a reference.
It might be part of SdFat.h, but this library does not work with my Huzzah32.

Thanks for your help.

User avatar
stephanschulz
 
Posts: 21
Joined: Tue Jan 08, 2013 4:35 pm

Re: accessing SD card on ePaper featherwing from huzzah32

Post by stephanschulz »

SdFat.h finally worked and I was about to use
```
#include "SPI.h"
#include <SdFat.h>
SdFat SD;

#define SD_CHIP_SELECT 14 //SS
#define SPI_SPEED SD_SCK_MHZ(20)

if (!SD.begin(SD_CHIP_SELECT, SPI_SPEED)) {
```
Reducing the speed really helped.

Yeah.

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”