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

txt file storage on MCB2388

Hi,
I am trying to have a TXT file which stores some data. This data is to be read by the microcontroller. Where can I store such a file on the board.

If something similar to this has been done then please share.

Board: MCB2300
Processor: LPC2388
with ARM7

Thanks

Parents
  • Have you looked at the Documentation for the board? That will tell you what resources it has available...

    "I am trying to have a TXT file which stores some data"

    Why a "TXT file" specifically?

    What data?

    How much of it?

    www.catb.org/.../smart-questions.html

    Lots has been done and shared - Google is your friend;
    eg, www.lmgtfy.com

    "Board: MCB2300"

    Keil provide examples for use with their boards - Have you looked at the examples provided for that board?

    "Processor: LPC2388"

    NXP provide examples for use with their chips; so do Keil & other 3rd parties - Have you looked at the examples provided for that processor?
    And that processor family?

    "with ARM7"

    You get the idea...

Reply
  • Have you looked at the Documentation for the board? That will tell you what resources it has available...

    "I am trying to have a TXT file which stores some data"

    Why a "TXT file" specifically?

    What data?

    How much of it?

    www.catb.org/.../smart-questions.html

    Lots has been done and shared - Google is your friend;
    eg, www.lmgtfy.com

    "Board: MCB2300"

    Keil provide examples for use with their boards - Have you looked at the examples provided for that board?

    "Processor: LPC2388"

    NXP provide examples for use with their chips; so do Keil & other 3rd parties - Have you looked at the examples provided for that processor?
    And that processor family?

    "with ARM7"

    You get the idea...

Children
  • Note that the concept of a text file doesn't matter anything for a microcontroller

    So you want to store data. Then you must consider if you want to add a file system just because you want to store a file - and who would be the interested reader of this file at a later time.

    Or maybe you would do better by just storing binary data.

    Anyway - one thing to consider is how often you need to update the data, since the memory regions available for permanent storage are not designed for infinite numbers of erase/rewrite cycles.

    The processor has the code flash, but this is only updated in sector-sized chunks. Not good for adding a character at a time to a file, but fine if you expect your product need maybe 1000 updates during the lifetime. Actually more than that, but a safety margin doesn't hurt.

    Note that it is far simpler to play with binary data, than to add a file system just to then work with a text file.

    Of course, people have done something similar. People have implemented file systems based on Keil libraries. Or based on own code. Or based on Internet-available file systems.

    And people have implemented solutions using just the raw flash surface together with the IAP support available in the processor.

    And people have implemented solutions using memory cards too, allowing the file data to be copied to the memory card before it is inserted in the embedded unit.

    You don't even mention the size required for your text file, i.e. if the flash is a possibility, or if only an external memory card can handle the amount of data. Size is just as important as the frequency of updates. Or the source of the new data.

  • TXT file becuase we need to be able to read, edit and modify the data in the file easily, and reading txt files in c is easy. Any kind of file is ok, does not have to be a txt file specifically.

    So an example of the data would be

    userID password Somedata
    312345689 12S E213
    123654879 2d6 B312
    +23654879 2d6 C312

    I have looked into examples and found a way to store files on SD Card, but as I am stil new to working with MicroProcessors. I am unsure of how it really works
    And from exploring the example code, it would only see what the files are in the SD Card, create an empty file and possibly read it, but i do not see a real way to make major changes to the file.
    It needs to be able to add data, and go comparisons on the data as well

    The usage would be:
    1) Adding new users
    2) Deleting existing users
    3) Modifying users
    4) Doing a comparison

    so for point 4 - We get an input string (the source of this string is irrelevant right now), and we want to be able to compare the input string with the data in the file to check if the right password is used (as an example)

    The data could be ranging from 20 lines to even 40,000 lines (but this would be limited by the processor, so if we cant go more than 2000 lines, that is also OK because its a prototype)

    The reason I did not give details, because I wanted more of a Yes or No answere, and yes i know how to google it and did try that, but i am looking specifically for LPC2388
    It was proving harder than i imagined

  • Per Westermark:

    Binary data would be a bit of a problem as we want Humans to be able to eventually read/write/modify the data.

    BUT: worst case we can also work with this (though we prefer not to)

    There would be alot of updating. But we dont really need a complex file system, just one datafile that can be used to store data (please see the other post to know what kind of data and what we want to do with the data)

    I am ok with implementing external memory, but im not sure how to do it.

    Still very new at this

  • That is, so often, the case!

    It is far too easy (and common) to look at something and say, "that looks easy" and to think that it therefore must be easy.

    As the old saying goes,

    "It takes a great deal of effort to make something appear effortless"

    Always beware of judging something "easy" when you don't know the details!

  • Never said it was easy, just Harder... so i never assumed it was easy.
    anyways thanks for "ALL the help" you have provided...

    if you know how to help then do.

  • I am unsure of how it really works

    Then do some reading, play with samples and come back when you have specific questions.

  • Then you should have posed the question in a form that would requires a "yes" or "no" answer.

    Your original post could not be answered meaningfully with "yes" or "no".