FPGA Intellectual Property
PCI Express*, Networking and Connectivity, Memory Interfaces, DSP IP, and Video IP
6354 Discussions

Speed of SPI core problem

Altera_Forum
Honored Contributor II
1,070 Views

Hi 

 

I have generated a uClinux kernel for my DE0 board,and I use the IP core of SD card is SPI core with 30MHz clock 

(According to http://www.alterawiki.com/wiki/mmcsd). 

 

 

I can operate the SD card well, but the speed of data transfer is very slow. 

I download 1.7MB file from SD card to SDRAM on board, and I need 8 minutes. 

 

 

The speed is normal??????????????????????? 

 

Could you give me some suggestions to solve the problem. 

Let the speed is faster. 

 

Thank you very much. 

 

Below is the information setup about SPI core which is created by "sopc-create-config-files" 

 

--- Quote Start ---  

 

/* mmc_spi.spi_control_port is a altera_avalon_spi */ 

#define MMC_SPI_BASE 0x80000040 

#define CONFIG_SYS_ALTERA_SPI_LIST { MMC_SPI_BASE } 

#define CONFIG_ALTERA_SPI 

#define CONFIG_CMD_SPI 

#define CONFIG_CMD_MMC 

#define CONFIG_MMC 

#define CONFIG_GENERIC_MMC 

#define CONFIG_CMD_MMC_SPI 

#define CONFIG_MMC_SPI 

#define CONFIG_MMC_SPI_BUS 0 

#define CONFIG_MMC_SPI_CS 0 

#define CONFIG_MMC_SPI_SPEED 30000000 

#define CONFIG_MMC_SPI_MODE SPI_MODE_3 

#define CONFIG_CMD_FAT 

#define CONFIG_DOS_PARTITION 

 

--- Quote End ---  

0 Kudos
5 Replies
Altera_Forum
Honored Contributor II
291 Views

I think I can replace the SPI mode with SD 1-bit mode. 

 

But Altera don't provide IP core of SD 1-bit. It just provide the SPI core which is free. 

 

The most importance is the uClinux don't provide the driver of "SD 1-bit". 

 

Therefore I don't know how to do 

 

Please someone give me some suggestions. 

 

Thank you very much
0 Kudos
Altera_Forum
Honored Contributor II
291 Views

Increase the speed in spi core parameters.

0 Kudos
Altera_Forum
Honored Contributor II
291 Views

 

--- Quote Start ---  

Increase the speed in spi core parameters. 

--- Quote End ---  

 

 

 

Thank you very much for your reply. 

 

I don't understand that how to change the speed parameter. 

 

I can't find such that speed parameter. 

 

Could you tell me more detail ??? Thank you in advance. 

 

The attached file is the SPI core parameter setting in SOPC. 

 

http://moon.cse.yzu.edu.tw/~s941643/file/SPIcore.png
0 Kudos
Altera_Forum
Honored Contributor II
291 Views

Your SPI clock is 25000Hz aka 25kHz, so You get 25Kbps serialized speed or 25/8 = 3.125 KBps, so do the math: 

to upload 1.7MB (1700KB) file, You need 1700 / 3.125 = 544 seconds or more than 9 minutes. 

 

Increase the SPI clock at least 100 times, so it should be 2500000Hz or 2.5MHz and do the tests again.
0 Kudos
Altera_Forum
Honored Contributor II
291 Views

 

--- Quote Start ---  

Your SPI clock is 25000Hz aka 25kHz, so You get 25Kbps serialized speed or 25/8 = 3.125 KBps, so do the math: 

to upload 1.7MB (1700KB) file, You need 1700 / 3.125 = 544 seconds or more than 9 minutes. 

 

Increase the SPI clock at least 100 times, so it should be 2500000Hz or 2.5MHz and do the tests again. 

--- Quote End ---  

 

 

 

Sorry I ask stupid question. 

 

I'm really really fool. 

 

The problem is hang me very long time. 

 

Thank you very much for your reply.
0 Kudos
Reply