3

In my application I'm using a MSP430, however I need to buffer 11kB of data from a UART connection. Obviously the 512B of RAM available is not enough to do this, however the MSP430 has 16kB of flash which would easily do the job.

My basic understanding of flash is that it is used for program code so I am wondering if it is possible to use flash for this purpose?

Thanks

user28350
  • 117
  • 4
  • 1
    Not usually. Flash tends to be slow (and in many implementations, roundabout) to write, often is erasable only in blocks, and has limited lifetime in terms of rewrite cycles. That said, if your baud rate is low enough and the processor is capable of self flashing, it may be possible to a degree. More realistically though, if you cannot think up a clever way to solve the problem without more memory, then you've probably chosen the wrong chip. – Chris Stratton Sep 08 '13 at 07:21
  • In general it's possible, but it's worth adding how often you need to buffer data (endurance may be an issue) and how quickly the data arrived (write speed may be a second issue). There are also differences between devices if you wanted to mention the specific part you're using. – PeterJ Sep 08 '13 at 07:22

1 Answers1

6

Flash is slow to write to, only accessible in blocks for erasing/writing, on many controllers (not sure about MSP430) slow to read data from (in contrast to reading instructions) and flash has limited write cycles (order of 100,000 times).

So the answer is: It can probably be done, but you shouldn't want to do it.

Maybe an external I2C RAM is an option.

jippie
  • 33,221
  • 16
  • 95
  • 161