External memory/sram

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

Greetings

 

Being a newbee to the AVR world, i wonder if anybody could give me directions on providing external memory to e.g. ATmega328​ (i prefer to use a CPU in a small size chip).

I need to create a data logger where i can store min. 64Kb, 

 

Thanks, OM

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

Google Arduino Data Logger to see the many projects using a M328!

 

Jim

 

 

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

Yes i have found a bunch of them, using SD cards/some kind of shield.

But that will not fly, i need to make with a real sram chip - due to vibrations. So my plans is to solder it directly to a PCB, then encapsulate it all in some kind of Epoxy.

So want i want is to adresse it to an external memory chip, similar to what is was done in the old MCS-51 days (and the reason i dont use that, is it too large with its 40 pins package)

 

Thanks, OM

 

ki0bk wrote:

Google Arduino Data Logger to see the many projects using a M328!

 

Jim

 

 

 

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

The thread title mentions "SRAM". The 328 does not have an external memory bus interface (sometimes "EBI") so the only way you could support a large SRAM on it would be to bit bang, address, data and control bus signals on plain IO. Some AVR have internal logic to help with this.

 

But do you really mean "SRAM" anyway? Is the data to be volatile or non-volatile. If non-volatile then most people would use some kind of flash memory storage for a data logger - perhaps EEPROM on a serial SPI or I2C interface. AT45 (used to be "Atmel" but no longer) are a popular choice - they have SPI interfaces. Or there's the ubiquitous SD/MMC cards - they are easy to add and you can get GB's of storage for a few bucks.

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

There are SRAM devices with other interfaces:  SPI, I2C, 1-Wire.

 

But:

But do you really mean "SRAM" anyway? Is the data to be volatile or non-volatile.

Agreed.

 

Or there's the ubiquitous SD/MMC cards

But that will not fly, ... due to vibrations

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"Read a lot.  Write a lot."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

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

Hi Clawson

 

Its does not have to be a type 328, but i need something i a small package due to space. But i'm a newbee and i know the 328 from my Nano's which i prototype on. But it could be any chip for that matter.

It doest matter what ever its volatile or non-volatile, it just need to log a while, make its decisions and does its things, then start over.

I haven't looked into serial flash memory, but is it not "dog slow", i havens done electronics for years so i'm not up to speed all technology's any more ( but i have left the radio tubes...)

It cant be SD cards, due to vibrations

 

thanks, OM
 

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

EEPROM is easy to work with, byte storage, i2c interface (atmel TWI), take a look at:

https://www.digikey.com/product-...

 

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

but is it not "dog slow",

Define that, please.

 

Bottom line, what speed do you need?  If an SPI SRAM device will meet the speed requirements, what does it matter.

 

How much storage do you need?

 

Microchip has a number of devices (as do other manufacturers).  One is the 23K640.  64kbit, SPI up to 20 MHz.  Page size is 32 bytes for speedier access than 'by-byte'.

 

The AVR's SPI (and MSPI) is limited to F_CLK/2, so on an 8 MHz device, SPI can run at 4 MHz.  With 32-byte pages, a read or write consists of an 8-bit instruction word, a 16-bit address word, and 32 8-bit data words.  So the read/write time for 32 bytes of data is 8+16+32*8 = 280 bit periods.  With a 4 MHz SPI clock, that will take 70 us.  Maximum theoretical sustained access speed will be over 450 kB/s with an AVR system clock of 8 MHz.  Over 57 kB/s per MHz system clock.  Maybe a little less with housekeeping overhead.  This particular device also supports a 'sequential mode', wherein (up to) the entire device memory can be read or written in one go, with only an 8-bit instruction and a 16-bit start address.  For this device, that's 65,560 bits, for a total of 16.39 ms at 4 MHz, a sustained speed of nearly 500 kB/s, or (up to) about 10% faster than page mode.

 

For sure slower than internal SRAM, but is it fast enough for your needs?

 

Other devices up to 1Mbit are available.

 

You may also consider FRAM, MRAM, eMRAM...

 

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"Read a lot.  Write a lot."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

Last Edited: Tue. Aug 29, 2017 - 03:17 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

"dog slow" but you said it was a datalogger application, those are usually slow time based apps, please tell us your specs for better suggestions!!!

 

Jim

 

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

OttoMan28 wrote:
It cant be SD cards, due to vibrations

OK, I'll bite:  Why don't SD cards work when vibrated?

 

If it was "max" 64KB, then many options come to mind.  FRAM, flash, serial EEPROM, and probably others.  But I don't know how big they are nowadays.

 

I see at DigiKey that FRAM does go up to 4Mb/512KB.  But pretty pricey; 64KB is $5+ and gets expensive in higher densities.  Contrast with SPI EEPROM at about a buck for 64KB.

 

 

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

So far two "key" requirements have emerged that were not even hinted at in the OP:

 

  1. It has to fly;
  2. It has to be "not dog slow" (whatever that means).

 

Are there any more that will emerge to shoot-down other suggestions as they arrive ... ?

 

You do realise that 8051-based chips have moved on a long way since the DIP-40 days, don't you ... ? 

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

theusch wrote:
Why don't SD cards work when vibrated?
Fall out of the socket perhaps?
OttoMan28 wrote:
it just need to log a while, make its decisions and does its things,
Tell us more about "decisions" and "things"?

 

You say volatile or non-volatile but in the volatile case does that imply that power is never removed? Or that if power is removed then already logged but not yet processed data may be lost?

 

Anyway in 40 pin chips you have things like the venerable mega162 that has an external bus interface. In larger (64 pin) chips like mega64 and mega128 (also "old" designs) they have a bus interface too. In fact I'd be surprised if Microchip's "device selector" does not let you filter on the deices with external memory interfaces. There are, of course, also xmega chips - many have a proper "EBI" but they are 3.3V only which may not suit everyone.

 

Winding back I think it might help to say a little more about type, quantity and frequency of data, why NV memory is "too slow" and what's actually being done with the data? A "logger" suggests something that builds a log of activity over time. One could get very disappointed if a power interruption meant the last 5 minutes, hours, days, weeks, months, years of "logged" data might be lost. In such circumstances the certainty of "slow" non volatile is often an advantage.

 

Oh and if you have bottomless pockets (or this is just a one-off not a production app) then things like FRAM often look "nice" - fast and NV all at the same time (even unlimited life - which may not always be said for other NV technologies).

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

Since the OP mentions encapsulating the logger in epoxy maybe the SD card is not a good idea as contacts can corrode/tarnish depending on the material.  Also the epoxy could work it's way between the two mating surfaces and render the kit useless.

 

There is SPI SRAM, and EEPROM.  The EEPROM being non-volatile so if your logger loses power you do not lose your data.  But, depending on the amount of writes you do to the device dictates the lifespan of the EEPROM as they do wear out after a while....but this may be inconsequential depending on your setup.

 

So, the best thing you can do is sit down, and write out a detailed spec of what the device is to do, and what the expectations of each component are.  THen present this spec and we can provide opinions therefore.

 

JIm

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

Please Read: Code-of-Conduct

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

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

OttoMan28 wrote:
min. 64Kb,
Oh and just being a pedant but is that 64KB or 64Kb (ie 8KB) ?

 

(and I won't even mention kibibits and kibibytes and the missing letter 'I' ;-)

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

SD "Cards" are available in PCB-mountable form - eMMC

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

jgmdesign wrote:

There is SPI SRAM, and EEPROM.

 

And, for completeness, MRAM and FRAM.

'This forum helps those who help themselves.'

 

pragmatic  adjective dealing with things sensibly and realistically in a way that is based on practical rather than theoretical consideration.

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

Brian Fairchild wrote:

jgmdesign wrote:

 

There is SPI SRAM, and EEPROM.

 

And, for completeness, MRAM and FRAM.

Sometimes I feel like Mr Cellophane... ;-)

 

joeymorin wrote:

You may also consider FRAM, MRAM, eMRAM...

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"Read a lot.  Write a lot."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

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

You missed:

clawson wrote:
...  things like FRAM often look "nice" ... 

 

cheeky

 

 

EDIT

 

sounds like a cue for a "Doctor, Doctor ..." joke ...

Last Edited: Tue. Aug 29, 2017 - 04:00 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

My apologies to Mr. Morin, Mr. Lawson, et. al. for not applying proper internet etiquette.

 

 

I was putting the other non-volatile technologies (FRAM for example) under the category EEPROM.

 

Andy is correct..eMMC as well.

 

What I was trying to build up to was the last sentence in my post:

jgmdesign wrote:
So, the best thing you can do is sit down, and write out a detailed spec of what the device is to do, and what the expectations of each component are. THen present this spec and we can provide opinions therefore.

 

My apologies if I insulted my international peers.......surprisecheeky

 

Jim

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

Please Read: Code-of-Conduct

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

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

Nah, I've just had Broadway on my mind... ;-)

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"Read a lot.  Write a lot."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

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

jgmdesign wrote:
My apologies if I insulted my international peers...

You have no peers.  You are as peerless as the House of Commons.

 

jgmdesign wrote:
not applying proper internet etiquette.

 

If you apply the proper 'terne 'quette, will you staunch the flow of vitriol?

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

theusch wrote:

jgmdesign wrote:
My apologies if I insulted my international peers...

You have no peers.  You are as peerless as the House of Commons.

 

jgmdesign wrote:
not applying proper internet etiquette.

 

If you apply the proper 'terne 'quette, will you staunch the flow of vitriol?

 

I give up

 

Jim

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

Please Read: Code-of-Conduct

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

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

OttoMan28 wrote:
But that [SD memory card] will not fly, i need to make with a real sram chip - due to vibrations. So my plans is to solder it directly to a PCB, then encapsulate it all in some kind of Epoxy.

JAE

microSDTM Memory Card Connector

ST11-H Series

http://www.mouser.com/catalog/specsheets/ST11-H%20CPI.pdf

...

Card lock structure

...

Countermeasure to prevent the card from popping out.

...

though no shock or vibration spec.

via http://www.mouser.com/new/JAE-Electronics/jae-st11-H-memorycards/

found by searching on 'retention' :

http://www.mouser.com/Connectors/Memory-Connectors/Memory-Card-Connectors/_/N-axj8k?Keyword=retention

 

"Dare to be naïve." - Buckminster Fuller

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

clawson wrote:
In fact I'd be surprised if Microchip's "device selector" does not let you filter on the deices with external memory interfaces.
It's nil for AVR EBI via Microchip's parametric search tool and MAPS.

From the Atmel MCU selector for AVR EBI sorted by pin count and program memory size :

44 pins

mega162

 

64 pins

mega64A

mega128A

mega1281

mega2561

 

100 pins

mega640

xmega64A1U

mega1280

xmega128A1U

mega2560

 

mega162 - one package is a 7mm-sq QFN

XMEGA A1U - one package is a 7mm-sq BGA (0.65mm pitch)

mega's data space is 64KB.

XMEGA's data space is 16MB.

 


http://www.microchip.com/selection-tools

http://www.atmel.com/

(middle left)

Atmel MCU Selector

 

"Dare to be naïve." - Buckminster Fuller

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

jgmdesign wrote:
Since the OP mentions encapsulating the logger in epoxy maybe the SD card is not a good idea as contacts can corrode/tarnish depending on the material.  Also the epoxy could work it's way between the two mating surfaces and render the kit useless.
Some RF module datasheets state no encapsulation; one states apply a tent over the module.

Could glue a tent over the socketed SD card before potting the PCBA.

 

"Dare to be naïve." - Buckminster Fuller

Last Edited: Wed. Aug 30, 2017 - 01:08 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

http://www.atmel.com/

(middle left)

Atmel MCU Selector

The Atmel MCU Selector has always had (and thankfully still has) an 'export to Excel' option (top right corner of page).  It has a lot more information (71 columns), including the number of EBI.  These are the AVR8 devices with EBI:

ATmega128
ATmega1280
ATmega1281
ATmega128A
ATMEGA162
ATmega2560
ATmega2561
ATmega64
ATmega640
ATmega64A
ATxmega128A1
ATxmega128A1U
ATxmega64A1
ATxmega64A1U

 

There are also 18 AVR32, 7 ARM7, 23 ARM9xx, and fifty-ish Cortex (A5, M3, M4, & M7)

 

EDIT: typo

 

 

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"Read a lot.  Write a lot."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

Last Edited: Wed. Aug 30, 2017 - 03:23 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

And if it's for a one off / small batch.

Yiu can solder wire's directly to an uSD card

http://hackaday.com/?s=sd+solder

http://hackaday.com/2015/08/18/r...

 

64kB isn't too much anyway these day's. Ill bet there are plenty of uC's around with that amount of internal ram, but probably no AVR's

(Thinking of stm32F4... at the moment)

 

ESP8266 could be yet another option. These usually come with an Flash chip of several MB.

And they are dead simple to get started with (PlatformIO (free),  D1-mini (USD2))

 

And don't forget OP needs a "real sram chip" but " It doest matter what ever its volatile or non-volatile"

 

Note to OP:

There is an ocean of possibilitys nowadays with electronics and you are pretty vague about your requirements.

So for a better suided answer we at least need to know:

- Amount of data (bits or bytes)

- Speed requirement.

- Physical size limitations.

- Idle / Active current (Does it need to run years on a single button cell?)

- Longevity / durability.  EEprom / Flash / SD all have a limited number of write cycles, Fram does not, but is expensive.

- Budget ? There must be plenty of COTS data loggers.

Paul van der Hoeven.
Bunch of old projects with AVR's:
http://www.hoevendesign.com

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

Paulvdh wrote:
64kB isn't too much anyway these day's. Ill bet there are plenty of uC's around with that amount of internal ram, but probably no AVR's
32KB internal RAM is max for AVR.

PIC32MZ DA at the other end of the scale with 32MB of internal DDR2 DRAM.

 

http://www.microchip.com/wwwproducts/en/ATxmega384C3

http://www.microchip.com/wwwproducts/en/ATxmega384D3

http://www.microchip.com/design-centers/32-bit/architecture/pic32mz-da-family

 

"Dare to be naïve." - Buckminster Fuller

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

joeymorin wrote:
... eMRAM...

Semiconductor Engineering

Four Foundries Back MRAM

Next-gen embedded memory technology ramps up in wake of flash scaling issues.

August 23rd, 2017 - By: Mark LaPedus

https://semiengineering.com/four-foundries-back-mram/

...

The next big opportunity for STT-MRAM is the embedded memory IP market. NOR flash, the traditional embedded memory, is running into an assortment of issues as it migrates from 40nm to 28nm and beyond.

...

via https://www.everspin.com/pub/news/2017

 


https://www.everspin.com/everspin-embedded-mram

 

"Dare to be naïve." - Buckminster Fuller