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
  • You never did consider that I basically gave you the solution to your problem in a previous post?

    An "int" data type can't be indirected.

    But a pointer works with addresses.

    And you do know the address of your FIFO.

    And you should know how to index relative to a pointer.

    So have you tried yet?

    If this is hard for you, then you just have to spend some hours with a good C book. You just have to know how to work with pointers and arrays. If you do, then you would also know how to work with your FIFO.

    And if you had followed my suggestions about looking at sample code, you would also have gotten the idea that if DMA can use the FIFO, then maybe memcpy() could too. So you would suddenly have had a second alternative. Besides using DMA yourself, which would have been a third alternative.

    The problem? You jump to a conclusion. Test. Fail. Come directly to this forum. Never ponder why you fail, and if you can do better by taking one step back, turn slightly and then try again to walk forward and hopefully find the open door.

Reply
  • You never did consider that I basically gave you the solution to your problem in a previous post?

    An "int" data type can't be indirected.

    But a pointer works with addresses.

    And you do know the address of your FIFO.

    And you should know how to index relative to a pointer.

    So have you tried yet?

    If this is hard for you, then you just have to spend some hours with a good C book. You just have to know how to work with pointers and arrays. If you do, then you would also know how to work with your FIFO.

    And if you had followed my suggestions about looking at sample code, you would also have gotten the idea that if DMA can use the FIFO, then maybe memcpy() could too. So you would suddenly have had a second alternative. Besides using DMA yourself, which would have been a third alternative.

    The problem? You jump to a conclusion. Test. Fail. Come directly to this forum. Never ponder why you fail, and if you can do better by taking one step back, turn slightly and then try again to walk forward and hopefully find the open door.

Children