Take the 2-minute tour ×
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It's 100% free, no registration required.

I'm developing a measurement application with the TI MSP430 and I would like to hear some suggestions on what type of memory I can use.

The idea is to use it for logging during a certain time and then download the data to a PC when the device is connected via USB. The estimate is to hold up to 5MB of data, every sample being around 25 bytes of data.

Would a simple EEPROM chip do or is there something better out there?

share|improve this question
1  
It looks like you will have the device powered for most of the time that you have valid data. Isn't a battery backup-ed SRAM more appropriate than an EEPROM (or better, Flash) then? –  Federico Russo Jun 17 '11 at 11:00
add comment

5 Answers

I've used the AT45D series of serial flash chips. They have an internal SRAM buffer to setup a page for erase/programming. SPI interface to read data in and out.

share|improve this answer
add comment

5MByte is a lot of data to store. Reading it out over USB implies that you are using one of the new parts with the USB device interface built in. If not then you are going to be using a USB to serial converter (FTDI or similar) and will be limited to the async serial data rates for reading the data out.

Have you considered connecting an SD memory card to the MSP, storing the data in that and then moving the card to the pc for reading the stored data. I have not written an interface to this device but there are plenty that have.

share|improve this answer
    
Yes, I'm going to use one of the parts with embedded USB. The ideal would be to use the MSC protocol, but that adds a lot of complexity to my project. I'll probably settle with the HID data transfer rates. I thought about SD cards but that adds extra complexities on the enclosure as it has to be water splash proof. –  Padu Merloti Aug 10 '10 at 16:23
2  
I'd suggest this route, because SD cards will give you the most storage space. You say 5MB now, but if you want more later, you're pushing the limits of serial flash (And you're well above the limits of EEPROM). If waterproofing is an issue (and you have an appropriate USB option, which seems to be the case) you can read your SD card out over USB, and put it inside the enclosure permanently. I've seen some designs which soldered the SD card to the board (Note: This worked, but I do not recommend it). –  Kevin Vermeer Aug 10 '10 at 18:13
    
Got it, makes sense. I'll consider that option. Thanks –  Padu Merloti Aug 10 '10 at 20:48
    
Is there a specialized chip that takes care of the SD interface and implements the file system or would I still have to implement a file system and the MSC class using the MSP430? –  Padu Merloti Aug 12 '10 at 15:53
    
@Padu - I felt this needed a little more room and formatting than a comment, so I added my response as an answer. –  Kevin Vermeer Aug 12 '10 at 17:15
show 1 more comment

Serial flash is superior to EEPROM in this application. Atmel makes a great lineup. Your choice will depend largely on two things: (1) Your need to edit/sector your logs on the micro and (2) Your RAM availability on the MSP430.

Flash, unlike EEPROM, can only be written from a 1 to a 0. Changing the data from 0 to 1 requires erasing a section of the part, which is typically only available for pages or blocks of data. You'll need to buffer this page into RAM, erase the page, make your edit in RAM, and then write it back if you want to change something.

The AT45D series, as has been already pointed out, offers a number of parts which have RAM buffers on the chip to facilitate this process without using RAM on the microcontroller.

In the end, the entire series is pin-compatible, so just put down an 8-SOIC (150mil) footprint, and then you can swap out the parts if you need different options later.

share|improve this answer
    
I agree with what you are saying, but you could just copy the data from the source flash page to the destination flash page while modifying the bytes you want to change prior to erasing the source. –  mjh2007 Aug 11 '10 at 12:31
    
@mjh - What if your source and destination are the same, and/or you don't have a free page? Also, this is slow: send read command, send an address, read a byte, change if necessary, erase, send write command, send an address, write a byte, repeat x256, x512, or x4k. Your other option is to send a read command, send read address, clock for N cycles, modify the bytes you want to change, erase, send write command, send write address, clock for N cycles. This takes about 1/3 of the time that the RAM buffer takes. –  Kevin Vermeer Aug 11 '10 at 12:52
    
Why would a data logger ever need to edit the logs on the micro? –  davidcary Aug 12 '10 at 13:17
    
@davidcary - If your data logger does nothing but record one long stream of bytes, you're right - you'll never need to make changes. If it has several configurations or log files which might break across page/block boundaries, or if you wanted to make changes to a header on the file at the end, you'd need to edit the memory without wiping the existing data. –  Kevin Vermeer Aug 12 '10 at 14:18
    
At this point, I just need to create several log files, no need to modify them, except when the user plugs the device to USB and downloads it, then I need to erase (or make that space available again) the old log. –  Padu Merloti Aug 12 '10 at 15:55
show 1 more comment

I would suggest the AT25D series since it appears a little easier to use than the AT45D. Although it's a little slower and does not offer as many data transfer options or the SRAM buffers. It does have the advantage of being less expensive and it is still quick enough for most applications like data logging.

If you need 5MB of data it's unlikely that an EEPROM will work since they come in < 1Mbit packages typically. Flash chips from Atmel support up to 64-mbit or 8MB.

share|improve this answer
1  
I disagree. The smallest erasable section on the AT25D is a 4kB page, and few micros have that much spare RAM available. I've used the AT25FS series of chips, which have a small (256 byte) page erase, but they're less than 5MB. Going with the buffered system means you don't have to worry as much about RAM management. Of course, if you have no need to edit your logs, then the AT25 series will work fine. –  Kevin Vermeer Aug 10 '10 at 18:08
    
Yes, large erase pages are annoying when an application needs to write some byte, and then later change that byte. But why would a data logger ever need to do that? It seems to me that, for data logging applications application, it makes no difference if the smallest erasable section is 256 byte or 1 Megabyte. –  davidcary Aug 12 '10 at 13:14
add comment

[This is in response to the comments following Ian's answer].
An SD card is just an SPI device, so there's no chip/interface necessary. Other protocols include a 2-wire interface (like I2C) and a 4-wire interface (with a complex CRC), but SPI is the most commonly used.

There is an SD card application note available for the MSP430 from TI here. It's brief, but it includes sample code. It handles reading and writing to various sectors on the SD card, which may be all you want if you're not going to plug it into a PC. Also look at these implementations by Foust (recommended) or Evans from MSU.

Once you have the basic functions to read and write a sector, you can either abstract a simple, custom filesystem over USB, or use an existing filesystem library. FatFS, EFSL, or DOSFs are all options for the latter. If implementing all of the required functions seems too hard, remember that all but a few can/will be stubs.

However, the file system will be abstracted through your USB interface to a degree. This will be easier if you have a real filesystem library and your card is in a readable filesystem, but that takes work. If you want to write your own "Filesystem" and save work/time/memory for the USB implementation, you can make its definition as simple and inflexible as log 1 starts at 0x0, log 2 starts at 0x10 0000, log 3 at 0x20 0000, and log 4 at 0x30 0000. Then, you can send this data over USB.

The USB interface can be as complex as you like it to be - from serial interface to mass storage device.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.