[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
Parallella Community • View topic - SD with SPI

SD with SPI

Any technical questions about the Epiphany chip and Parallella HW Platform.

Moderator: aolofsson

SD with SPI

Postby patc » Tue Sep 02, 2014 12:54 pm

Dunno if anyone is interested but I wanted to read data from the SD card using SPI (too lazy to study sdhc!). However MISO and MOSI need to be swapped with each other and I ended up soldering a SD card holder on top of the Parallella's one (also added a decoupling 100nF Vdd/Vss).

I first tested on MicroZed and put my modified drivers on the Zedboard forum last weekend:
http://www.zedboard.org/content/sd-card ... standalone

then moved to the Parallella. However there's one modif:

#define SLAVE2_SELECT 3
static int select(void) {
SPI_Type *spi = SPI_REG(SPI1);

spi->CR &= ~SPI_CR_SSCTRL_MASK;
//spi->CR |= SLAVE0_SELECT << SPI_CR_SSCTRL_SHIFT; // MicroZed
spi->CR |= (SLAVE2_SELECT << SPI_CR_SSCTRL_SHIFT); // Parallella
spi->ER = SPI_ER_ENABLE_MASK;

if (wait_ready())
return RET_SUCCESS;

deselect();
return RET_FAILLED;
}

Those drivers are still pretty rough but seem to be working well.


(BTW it's a pity that U17 being not populated, those 12 MIO lines aren't available for something else)
Attachments
sd.jpg
sd.jpg (155.32 KiB) Viewed 10056 times
patc
 
Posts: 83
Joined: Wed Aug 06, 2014 7:18 pm

Re: SD with SPI

Postby 9600 » Tue Sep 02, 2014 3:29 pm

Why do you need to use SPI? Am I right in thinking you plan to run something other than Linux?

Cheers,

Andrew
Andrew Back
User avatar
9600
 
Posts: 997
Joined: Mon Dec 17, 2012 3:25 am

Re: SD with SPI

Postby patc » Tue Sep 02, 2014 7:03 pm

Hi Andrew, indeed I won't be using Linux and beside SD I plan to use SPI to control a TFT display as well.

While searching for already existing stuff regarding file access on SD card I noticed that I wasn't the only one looking for it, hence someone might find what I've put together useful.
patc
 
Posts: 83
Joined: Wed Aug 06, 2014 7:18 pm

Re: SD with SPI

Postby aolofsson » Wed Sep 03, 2014 10:15 am

Respect! :D

Andreas
User avatar
aolofsson
 
Posts: 1005
Joined: Tue Dec 11, 2012 6:59 pm
Location: Lexington, Massachusetts,USA


Return to Epiphany and Parallella Q & A

Who is online

Users browsing this forum: No registered users and 27 guests

cron