Hello,
I made SD card interface with Arduino & PIC 4550 with 1 bit SPI interface. I got more than 4mbps speed over SPI. But with XMOS sdcard library I get very low speed, where as XMOS is too fast than arduino Uno & PIC.
I checked source code and found that XMOS sdcard library used bit bang and there is a long delay between each bit change. I think if I remove this delay the SPI speed will be faster.
can any body tell me why this delay has been introduce & what is the purpose of it? Can this code run with out this delay?
Can any body tell me how to use clock block and buffered port in SDCARD library instead of bit bang?
Please guide how to achieve high speed SPI with XMOS?
Thanks & regards
jags
Why XMOS SDCARD lib is too slow interface.
-
- Experienced Member
- Posts: 117
- Joined: Tue Oct 18, 2011 3:28 pm
-
- Respected Member
- Posts: 279
- Joined: Fri Dec 11, 2009 1:34 pm
Hi jagspaul,jagspaul wrote:Hello,
I made SD card interface with Arduino & PIC 4550 with 1 bit SPI interface. I got more than 4mbps speed over SPI. But with XMOS sdcard library I get very low speed, where as XMOS is too fast than arduino Uno & PIC.
I checked source code and found that XMOS sdcard library used bit bang and there is a long delay between each bit change. I think if I remove this delay the SPI speed will be faster.
can any body tell me why this delay has been introduce & what is the purpose of it? Can this code run with out this delay?
Can any body tell me how to use clock block and buffered port in SDCARD library instead of bit bang?
Please guide how to achieve high speed SPI with XMOS?
Thanks & regards
jags
Have you seen the SPI interface on Github?
https://github.com/xcore/sc_spi
There are some performance figures in the documentation:
http://github.xcore.com/sc_spi/overview ... erformance
You should be able to use this to achieve a higher data rate than the implementation in the SD card library. If you do modify the SD card library to use the higher speed SPI, remember to contribute your changes back to Github so other people can use it :)
-
- Respected Member
- Posts: 363
- Joined: Thu Dec 10, 2009 10:17 pm
If you bitbang SPI out without a delay it might be too fast for non high speed cards. One thing to also check is that you are using block read/writes as they are significantly faster than just a single sector operation.
-
- Experienced Member
- Posts: 117
- Joined: Tue Oct 18, 2011 3:28 pm
Thank you Andy & Berni for your reply.
I will try to implement SIP library to SD card interface. However if anybody already done this please share you knowledge & help me.
jags
I will try to implement SIP library to SD card interface. However if anybody already done this please share you knowledge & help me.
jags
-
- Active Member
- Posts: 52
- Joined: Mon Oct 31, 2011 4:08 pm
Hi all,
I'm going to release an SD host module which uses 4bit interface in the github.
My preliminary tests give a read speed of 4MBytes/sec (multiblock read, optimization, less than 5 threads).
Lele
I'm going to release an SD host module which uses 4bit interface in the github.
My preliminary tests give a read speed of 4MBytes/sec (multiblock read, optimization, less than 5 threads).
Lele
-
- Respected Member
- Posts: 296
- Joined: Thu Dec 10, 2009 10:33 pm
Lele,
Have you considered the licensing requirements of using various SD card features?
I have been trying to find out without much luck but here is a reply someone got from the SD Technical Committee in 2009:
Dear XXXX,
SPI is defined as general protocol.
However, the Physical Layer specification defines
specific bus protocol for SD cards. SD host products
need to refer the Physical Layer specification
regardless of bus mode. Therefore, HALA is required.
Sincerely,
XXXXXX XXXXXXXX
SDA Technical Committee
There is more on that here: http://forums.parallax.com/showthread.p ... -licensing
Is any of this licensing compatible with the MIT license or any other we like to use around here?
Have you considered the licensing requirements of using various SD card features?
I have been trying to find out without much luck but here is a reply someone got from the SD Technical Committee in 2009:
Dear XXXX,
SPI is defined as general protocol.
However, the Physical Layer specification defines
specific bus protocol for SD cards. SD host products
need to refer the Physical Layer specification
regardless of bus mode. Therefore, HALA is required.
Sincerely,
XXXXXX XXXXXXXX
SDA Technical Committee
There is more on that here: http://forums.parallax.com/showthread.p ... -licensing
Is any of this licensing compatible with the MIT license or any other we like to use around here?
-
- Experienced Member
- Posts: 117
- Joined: Tue Oct 18, 2011 3:28 pm
Hi Lele
I am very much interested to have your SD host module source. Hope it would be better help for me.
jags
I am very much interested to have your SD host module source. Hope it would be better help for me.
jags
-
- Active Member
- Posts: 52
- Joined: Mon Oct 31, 2011 4:08 pm
Thanks Heather, you are right,
that might be a problem. I've read your link and look around.
The SD association in their link:
https://www.sdcard.org/developers/howto/
states:
That is a problem for those that will use my code.
(Linux has the 4bit protocol sources available for free.
The protocol is the same as MMC.)
However I accept suggestions.
Lele
that might be a problem. I've read your link and look around.
The SD association in their link:
https://www.sdcard.org/developers/howto/
states:
I'm not a company and not planning to manufacture hardware :DHost and Ancillary Products
If your company is planning to manufacture or have manufactured SD standard devices ...
your company is required to:
...
2.Enter into a Host/Ancillary Product License Agreement (HALA)
That is a problem for those that will use my code.
(Linux has the 4bit protocol sources available for free.
The protocol is the same as MMC.)
However I accept suggestions.
Lele
-
- Active Member
- Posts: 52
- Joined: Mon Oct 31, 2011 4:08 pm
I've just released the new sc_sdcard library in the github.
-
- Experienced Member
- Posts: 117
- Joined: Tue Oct 18, 2011 3:28 pm
Thanks Lele.
Please post the links.
jags
Please post the links.
jags