Memory storage device selection

Go To Last Post
14 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am starting a project that requires logging data of different types. I believe that the best device to store all the data (about 200 kbits max) is either an EEPROM or a Flash memory. What are the advantages and disadvantages of each of these devices. Will one be simpler to use? I will be using SPI to read a 13 bit ADC so in the interest of time( not having to learn a new interface like I2C) I think I will focus on learning just the SPI interface and using it for both the ADC and memory. Is this reasoning correct or will the process of sharing SPI be difficult? I will be using ImageCraft compiler. I will be storing 11 Bytes every ten seconds.

Thanks,
Josh

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
Is this reasoning correct or will the process of sharing SPI be difficult?
Pretty reasonable, there should not be any problems with sharing the SPI buss. You will simply need a CS pin for each device as well as Miso, Mosi and SCK.

Remember to put EXTERNAL pull up (or pulldown as the case may be) resistors to the CS pins so that the devices will be disabled during ISP programming or they may interfere with programming.

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

First of all wrong forum. General electronics is the correct.

Ok, enough said there.

What processor are you going to use to handle this?

Sharing the bus is only going to cost you /CS lines, but again that will be based on the processor, and maybe an external decoder. If you are going to only have these two chips on the bus, then an external decoder for /CS is not needed, a simple port pin will do the trick.

Quote:
I believe that the best device to store all the data (about 200 kbits max)

Quote:

I will be storing 11 Bytes every ten seconds.

Are you storing bits or bytes? Plus you state that you are using a 13 bit ADC, so you will need two bytes for every store. YOu also mention you are storing 11 bytes of data every 10 seconds.

You might want to do one of two things.
1) Recalculate your math.
or
2) Give us a better understanding of what you are trying to acheive.

Jim

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

To js,
Jeez, do you ever sleep? Or are you just trying to get closer to 10k posts?

Jim

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Will the information on using a pull up vs. pull down and the resistance value be in the AVR data sheet?

-Josh

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you read the datasheet you will get your answer.

If you read my response post your question can also be answered.

Jim

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

sorry about posting in the wrong forum, I will pay closer attention next time.

The processor is going to be the Atmega88. There are going to be a few other sources of data that will be stored to memory every ten seconds. These include data from an 8 and 16 bit timer a few other ADC channels and data from another sensor that is monitored by an external edge triggered interrupt, all sources of data to be stored totals 11 Bytes. The SPI will only have those two devices. Yes, I understand Bytes vs. Bits and they are listed correctly. The maximum is actually 190080 bits or 23760 Bytes(so it will record for six hours) but I simply rounded.

-Josh

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I had done some data logging, that uses SPI for three or four devices (depending on the version). Pretty easy to use.

About Flash or EEPROM, you must pay attention to the fact that usually Flash runs at 3V3 (no 5V versions) and has bigger capacities than EEPROM, while the last can be used at 5V (usually) and cames with smaller capacities, and usually I2C (aka TWI). Another advantage of the EEPROM is that is byte erasable, while flash is only 'sector or block' erasable, that means that you can only erase a minimum amount of bytes at once (from 256 to 4K, upon architecture).

Respect to the amount of data to be stored, don't forget to calculate the 'structural' data. I mean that you need some kind of file format, file handling, and data storing structure to be able to read back data, know how much data had been written, etc. That eats some memory, some times up to 50%. And it depends on the final application, thus it can be so easy, or too complex (FAT file system, NTFS, etc).

Guillem.
"Common sense is the least common of the senses" Anonymous.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well that is one plus for EEPROM. The board will be running at 5 volts so I might as well use the EEPROM to avoid interfacing different logic levels.

The device is going to be storing the same set of data(11 bytes) multiple times. I will be sending the data out of the MCU using the USART to a max232 and then to an RS232 port. I will write a program on the PC to receive this data and sort out the differt sets of data.

My initial thought is that since the data is going to be stored on the MCU in the exact same sequence that I would not need any structural information within the stored data(this does assume no extra bytes are accidentally inserted or taken out). I don't know if this is something that I can reliably count on though. I do think that I will have to insert some type of ending pattern or store(maybe in the MCU's own EEPROM) the location where the last valid data was written to. I believe that would be needed when I actually transfer the data to the computer in order to end the transmission. Does this sound correct, am I missing anything, or just plain wrong?

I have found EEPROMS that store 256Kbit-1Mbit, operate at 5 volts and have SPI interfaces. one example 25AA512-I/P-ND (digikey) it is made by Microchip

-Josh

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It seems that you have an easy decision here. I would choose probably the same, given the information provided.

Respect to the file handling, you can do exactly whay you say if you work only with one file. You know where it starts, and you can detect the end of it by a byte counter or so on (be aware about the memory wear out). Or you can detect the default value (0xFF) ot the erased EEPROM, but this would mean that you can't write 0xFF as the last byte(s) of you data set. This is simple, if you write always 12 bytes, and the last one is 0x00. And you have to erase the EEPROM every time you begin a new record.

If you have to store more than one record, then complexity increases. But this depends strongly on your specs.

For communications, I would encourage you to use some communication standard, like ModBus, since it simplifies data transmission and handling.

Guillem.
"Common sense is the least common of the senses" Anonymous.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Guillem,

You refer to both a file and a record are these two things different? The data collection will be for one continuous period of time (at most 6 hours)and then will be transfered to the PC with no further data collection.

You also say to use some communication standard like Modbus. Why is this necessary, Can a pc not reliably handle a stream of data sent over the serial port?

-Josh

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
Or are you just trying to get closer to 10k posts?
Just bored at times with what I'm doing, so I need something a bit more stimulating like being insulted by people I'm trying to help. :?

Then I realise how simple and easy (though boring) the job at hand is and how it pays the bills.

10K posts and all the fame and fortune it brings?? Well I'm just over half way down the hill now. Better get an hour sleep to recharge my batteries, I see the op is in good hands.

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Mmm, I need some sleep also. I'm a confusing guy (too many things to think for a single neuron...), thus I write file and record for the same thing, yes. I would mean that you start recordin, record certain amount of data, and stop recording, thus you have one record, that is stored in a file. I would mean that perhaps you record temperature and current (as an example only), but you store also some other relevant data with the records, like timestamp, your favourite beverage, or so on, packed everything into a file, together with the record itself.

This is useful if you plan to store different records into the same storage media before you can retrieve it, since this happens often. But this is an important part of the specs for any datalogger.

Respect to the ModBus protocol, I can assure you that you can have synchronization problems between your app and a PC. Specially if you use Windoze, and/or USB data streaming.

Of course, you don't need to use ModBus, but some kind of 'frame synchronism' and probably frame delimiters, and/or security check (CRC's) are usually helpful and would save some hair on your head ;) And you also would learn something useful.

Have fun.

@JS: Have nice dreams, John.

Guillem.
"Common sense is the least common of the senses" Anonymous.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
Have nice dreams, John.
What a terrible night, I had a nightmare, dreamt I was programming in C...woke up in a cold sweat..

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly