Hi
Im trying to write in MCI FIFO but without success..
Im doing like: MCI_DATA_CTRL = 0x11; _printf("\r\nFIFO_COUNTER = 0x%X", MCI_FIFO_CNT); MCI_FIFO |= 0xFFFFFFFF; _printf("\r\nFIFO = 0x%X", MCI_FIFO); _printf("\r\nFIFO_COUNTER = 0x%X", MCI_FIFO_CNT);
The answer I got is: 0 0 0 Do not show up the data that i wrote in MCI FIFO! Im using LPC2368.
Waiting for a help!
Thank you,
Fabio.
Now, you really, really, really have to spend significant time trying to describe exactly why you see a need for a bit-or operation when writing to the FIFO.
Why, just why do you write:
MCI_FIFO |= 0xFFFFFFFF;
And where have you seen the datasheet tell you that it is OK to perform a read operation from an output FIFO? You do know what the C operator |= does, don't you?
Did you remember my comment, mentioned earlier - and copied from the processor user manual - about the order of assign to registers?
The user manual says that when you write 0x01 to the data control register, the transfer will start. But what transfer? Do you really believe that you have set up all information needed for performing a transfer befure your line:
MCI_DATA_CTRL = 0x91; // 9 = 10^9 = 512 = block size
How can you start a transfer, on the line _before_ you assign your first data to the FIFO? And how can you start a transfer, _before_ you tell the chip how much data that is available in the FIFO for processing?
The user manual says that when you enable the transfer, the controller will enter state WAIT_S or WAIT_R.
For the Data Counter Register, the manual says that the register loads its value from the Data Length Register when the DPMS moves from IDLE to WAIT_R or WAIT_S. But have you spent any time giving the Data Length Register any length value for use? Where?
Do you have a personal policy to avoid reading datasheets/user manuals? Does this policy often work well for you? Or does it happen, now and then, that you get stuck, because nothing works?
By the way: how can you write this comment: "9 = 10^9 = 512 = block size" I would have thought that 10^9 would be 1,000,000,000. Wouldn't 512 be 2^9?
I would have thought that 10^9 would be 1,000,000,000. Wouldn't 512 be 2^9?
Well, as the writing on the T-Shirt goes:
There are 10 types of people in the world:
those who can read binary, and all the others.
;->
So the intention was 10^1001 ;)
It was clearly a type mistake, it's just you see that the result is right.
And the datasheet is confuse.. We have Command Path State Machine (CPSM) and Data Path State Machine (DPSM). But dont help to the sequence..
So..I follow CPSM steps and send the write command. I wait for an answer and if it's OK I go to DPSM? And then I prepare all registers, lenght, timer, FIFO.. Then I put 0x1 in Data_Control and the data is sent?
So what is the right way to put data in MCI FIFO? If I cant assign a direct data like this: MCI_FIFO = 0xFF;
How can I do?
Now my status is no longer 0
It is 0x45000 bits 12 - TxActive 14 - TxFIFO Half Empty 18 - TxFIFO Empty are asserted
So the problem Im having is with this damn FIFO. I dont understand how I can write in FIFO If I have to write a full 512B block and FIFO size its smaller.