Shop OBEX P1 Docs P2 Docs Learn Events
SD Card Buffer — Parallax Forums

SD Card Buffer

Kit MortonKit Morton Posts: 39
edited 2007-07-23 02:40 in Propeller 1
Hi all,
I have a vs1002 mp3 decoder and a sd card hooked of to my propeller, and I am trying to play the mp3 files from the card.
The problem is that I can't read the data off the card fast enough for the mp3 chip. So I need some way to buffer the data form the sd card. But I don't really have any idea how to go about it.
So does anybody have any hints or code examples for this kind of thing?
Thanks
-Kit

Comments

  • BTXBTX Posts: 674
    edited 2007-07-22 14:04
    Hi Kit
    Are you using Rokicki's code ? If so, read 2048 bytes at once with "sdfat.pread", you will get about 400Kbytes/sec if your card is enough fast.
    I think that is enough fast to play almost all mp3 files !!, but I never try that.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Regards.

    Alberto.
  • Kit MortonKit Morton Posts: 39
    edited 2007-07-22 16:20
    Yes I am using Rokicki's sd code.
    I just tried using pread, but I can't seem to get it to work. Are there any examples for how to use it. Because it doesn't work in the way that I thought it would.
    Thanks
    -Kit
  • BTXBTX Posts: 674
    edited 2007-07-23 02:09
    Hi Kit.
    I don't remember if in "Multi propeller board" thread is some code about this, but if not,· I'll try to post it early.
    I can tell you now, what I did to get the 400Kbytes/sec in read.

    1-I used sdfat.pread
    2-I read everytime blocks of 2048 bytes each.
    3-I used· four buffers, to put the data read from SD.
    4-I tried to do nothing while read the SD...only one COG for that, in a repeat loop, and only looking for·a·status flag for the buffers, if they were read by the master COG.
    5-I used a very fast SD card (150x)
    6-I maintain all wires between SD and the propeller very short (Look at my multipropeller board pictures)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Regards.

    Alberto.
  • Harrison.Harrison. Posts: 484
    edited 2007-07-23 02:40
    Kit,
    Post your code so people can look at it. Generally it is easier for people to find your problem by looking at your code snippets. I personally just skip over threads where there is no code since it is nearly impossible to guess what is wrong.
Sign In or Register to comment.