This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

text file to msp flash

Other Parts Discussed in Thread: MSP430G2553, MSP-FLASHER

Hi,

I have a text file with some data. How do I copy it into flash memory of MSP430?

I am using g2553.

Thnx

  • Is that "text file" in "msp430-txt" format specifically generated to be loaded into msp430g2553?

    If so, you may load that into your msp430g2553. You will need either BSL or JTAG interface hardware between your PC and the msp chip. And you need a PC program such as BSLDEMO2 or MSP-FLASHER.
  • No no.
    It is just some excel sheet with some data values and text. I need that data in the flash memory of MSP. How can I do that.
  • In that case, it will be more practical to copy that text file to a USB Flash Drive.
    Why do you want to copy it to the Flash of a a MSP chip instead?
  • Hi,
    It is a look up table. I need that table while executing the code.
  • To use a Text File directly for table lookup is rather inefficient. One normally convert (by hand or by some other program) them into constant arrays for table lookup and embed the constant arrays in the source code. The compiler (or assembler) will make the constant arrays more compact and efficient for the code to use.

    For example, the first 10 prim number in a text file might look like this:
    1,3,5,7,9,11,13,17,19,23

    It is 24 bytes long. You code in MSP will need to parse the ascii characters with "," as deliminator and convert the numerals to binary numbers. On top of that, you do not know how to copy that into the MSP

    On the other hand, if you embed this line in your source code:
    const char prim[10] = {1,3,5,7,9,11,13,17,19,23};

    It will only take 10 bytes. Your code in MSP will only use prim[7+1]; to get the 7th prim number. On top of that, they will be copied together with the code automatically.
  • i could do this. But the data values are very large in number. Or is it better to interface sd card and read it every five minutes?
    What is your suggestion.
  • It is just my opinion that it would be easier to write a PC program that reads the text file as input, parses it, and generate an output file in a form to be used as part of the source code constant arrays.

    You could do all that in the MSP430 too, if there is enough memory and time. The PC has far more memory and much faster than a MSP430.
  • But the final system will have only stand alone MSP430. How can I deal with this.
  • GURU MOORTHY said:
    But the final system will have only stand alone MSP430. How can I deal with this.

    That is why you need the compiler/assembler (to prepare an object code) and the link-loader to load your MSP430 before it faces the world alone.

    If you are to go out to face the cold world, are you going to pack some cotton and wool to make clothing when needed? I am only suggesting that you depend on someone else to make those raw material into ready to use clothing. Pack the clothing, not the cotton and wood (nor the craftsmen who make clothing).

**Attention** This is a public forum