This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

SD CARD FIFO

Hello,

Im trying to implement a SD Card Interface.
I'm having a doubt..

I´m able to initialize and write and read data.
But it is so crazy the data I'm reading!!
I try to write 0,1,2,3.... And when I read I dont get this sequence.

I guess the problem is the way I'm writing in MCI_FIFO.

When I'm writing I set all necessary registers (lenght, timer..)

And then I initialize the transfer:

MCI_DATA_CTRL |= 0x91;

Then how should I write the code to put data in MCI_FIFO?

IF I do a for like this:

for(x=0; x<128;x++)
{
 MCI_FIFO = x;
}

but it makes no sense, what is the right way to do this?

Help me!

Parents Reply Children
  • You're all so smart!!<

    You have no idea.

    And neither you know how to solve the problem! kkk

    And you really believe you are in a position to be the judge of that?

    Congratulations!

    You can keep those to yourself, thank you very much. Nobody wants to be congratulated by you.

  • Do you actually want to learn how to do this stuff for yourself - or not?

    If you're not interested in doing this stuff, that's fair enough - it's not for everybody - but that's no reason to expect others to do it for you for free.

    I am not interested in doing accountancy, so I pay an acountant to do that stuff for me - but I don't expect him to do it for me for free!

  • I have done a "fill in lines between the numbered dots" for you.

    You can solve it directly from my text. If you do known the syntax for pointer indirection, address-of operator, indexing, ...

    If not, then it should be very easy to figure out what chapters to take a closer look at in a C self-study book.

    It's just that it isn't meaningful to tell you how to perform indexed writes to the FIFO as a magical line. If you do not spend the time to understand why and what, then you will just get stuck again 5 seconds later.

    Your question is a bit like "what is the product of 7 * 9?" A quite easy question. But if you don't understand multiplication, it will suddenly be a very hard question. And if someone do tell you the answer is 63, you would still be just as stuck, because you would still not understand how multiplication works.

    So the solution to your problem is to send a couple of hours reading up on pointers and arrays. It would be well invested time. And you would need this knowledge anyway, to get through any real application. One reason for that is that pointers are so integral to C code. C makes use of pointers in many situations where other languages have more specialized ways of writing code.