We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi all
I want to interface the MMC card with the LPC 2378 controller ...i have downloded the code bundle from the net where they have given the example program for the MMC interface ,but i am unable to fine a write and read function in the program they have declared the function but not defined it ...
int MCI_ReadFifo(unsigned int * dest); int MCI_WriteFifo(unsigned int * src);
they have writen in mci.c file .
can anyone tel how to write data and read the data from the MMC and at wt address we start writing the data .
i have went through the code but stil not getting it .
Regards Suresh
sorry i didnt mention that ,yes mean the NXP code bundle,but as u said its avaible in MCI/readfifo.s ,in that file the two function have beed disabled
; int MCI_ReadFifo(unsigned int * dest); ; int MCI_WriteFifo(unsigned int * src);
and if i enable it i get the following error :
readfifo.s(6): error: A1163E: Unknown opcode int , expecting opcode or Macro readfifo.s(7): error: A1163E: Unknown opcode int , expecting opcode or Macro
Plz suggest wt to do ....
and if possible i want the function written in 'C '
The lines
doesn't mean that the two functions have been disabled. They are just comments about the C calling convention for the two functions.
If you uncomment these two lines, bad things will happen, since an assembler can not handle C code :)
can i get the 'C' code for the same ...since i want to know to which address in MMC we write and read the data so that it wil be easy for me to use it as data storage unit ,because its in assembly i am not that much familiar with assembly language .
The functions are copying data from the fifo (fixed address in hardware) to a supplied destination pointer in memory, or copying data from a supplied source pointer to the hardware fifo.
They do not have anything directly to do with the used address on the MMC card.
You have to realise that the MMC card interface is serial, and does not have any dedicated address lines. It is the upper layers of the MMC handling that takes care of sending commands and addresses to the card.
In short - rewriting the two functions in C will cost you performance, but not gain you any portability or readability. You can never just expect to pick up a piece of non-trivial code and expect it to work as a magic black box. Somewhere, it is expected that you have a bit of knowledge about the topic too. Have you read through the chapter about SD/MMC in the LPC23xx user manual? See it as mandatory reading.
thanks for the information but is it possible to use the MMC as EEPROM for storing the data so that we can retrieve any particular data from random read .here in the program they have the destination and the source address from which they write and read into the MMC and at last compare and see,
I want to Write a data at a particular address in MMC and read data from that address at the latter stage .can this be done ,if yes i need the help to do it .
PLZ suggest for the above queries
From your response, I have to assume that the answer to my previous question is no - you have not read through the mandatory chapter about SD/MMC in the processor user manual.
It describes the state machine for the MMC.
The MCI source code isn't the easiest to read, but it does have a good set of primitives for working with a card. But those primitives requires that you spend some time learning how communication with MMC cards is performed.
hi
I went through the data sheet ,i came to know that at a time a ful block can be written and read from the MMC .
ok ,for my application we use MMC to update the software parameters ,like load the data into the MMC and then take it to the field where the u have the product running ,here we stop the running controller and then put a jumper and insert the MMC and switch the controller on . the data stored in the MMC is transfered into the controller so that the next time it is switched on ,it works on the new sets of parameters .
so if the data is stored in text file and loaded into the MMC then how can we read the data from the controller ,do we have to install FAT32 ,wt r the things i need to do for reading a file from the MMC to get the data stored in it.
PLZ suggest.
For reading files, you need a file system.
For reading raw blocks, you don't.
Most embedded systems doesn't make use of text files because of the extra amount of code for validation/error handling. However, the LPC23xx has quite a lot of program memory - but where would it emit any errors about mal-formed text files?
If going for binary data - use a serial port and write the data from PC to one unit. Add a serial-port command to write down the downloaded configuration (in raw blocks) to the MMC. Then transfer the MMC to units on site.
The disadvantage is that you can't copy data directly from a PC. The advantage is that the field units doesn't need the code for a file system and configuration file parsing, and can settle for a simple crc32/md5/... to verify that the retrieved configuration is ok.
yes i tried coping a text file and reading it with the controller but only hex values were coming ,
ok fine ur telling to make a link between MMC and PC via a controller so that wht ever data is typed on the hyperterminal is sent to controller and then fed to the MMC so that its simple to load data and read the data at fields ,
fine this is a good idea to do it without any extra code . Thanks
if in future i want to expand it to read a file systems wt should i do ,wt changes i should make to read the file systems ....if any notes is there it wil be helpful for me to do it latter since the technology is expanding our customer wil demand it one day so can u help me to find out wt to do ....
Only got hex data???
Hexadecimal or binary - that is just a question of how the information is presented. The MMC (or the sample driver code) does not care about actual contents. Sample source code likes to dump the information in hex format, to make sure that any (!) information will be possible to present without any problems with character sets etc.
How to use a file system? Buy one from Keil, or surf for free sample code and figure out if it works - or write your own and then figure out if it works :)
But don't limit yourself to asking for all information. Search for it. Searching allows you access to much more data, and a lot faster. You can't spend your life asking for everything.