External Memory, for interfacing with AVRs

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

Hello guys,

 

Is there any external memory (EEPROM, Flash, SRAM anything else) which I could interface with ATmega-644p. That said memory should operate from 5Volt logic, and SPI, or parallel interface would be preferred for the high speed writes, i assume ~ 1.0 - 5 MHz.

volatile or nonvolatile. 

 

 

work in progress...

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

What kind of data do you want to store?  Tell us your requirements.

 

Jim

 

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"

 

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

Dave_Zeb. wrote:

... or parallel interface ...

 

The 644 does not support external memory via a parallel interface so you'll have to bit bang one. Which means SPI is likely to be as fast, if not faster.

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

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

Dave_Zeb. wrote:
 or parallel interface would be preferred for the high speed writes, i assume ~ 1.0 - 5 MHz.
4MHz for megaAVR with EBI (5V, 16MHz) though more pins than mega644P.

 

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

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


The data to be stored is coming from ADC (AD7723) clocked ~ 200Khz at moment. So its uint16_t word which travels the 16-bit data bus into the ATmega-644p. Ideally the experiment which has duration of milliseconds, generates data which travels the data-bus and gets itself saved inside the external memory. After the experiment is over, I use PC with some Python version running on it and read the data out and plot them. The essential and "key" moment is somehow get that data from ADC measurement and save it into memory.

Currently all my logic is running at 5 Volts. SPI interface is free and only used form ISP programming.

 

found several Atmel memory ICs, would those be useful to solve this type of task?

 

 

work in progress...

Last Edited: Thu. May 2, 2019 - 06:30 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I just found that I could use an SD-MMC card which is amazing. I can have a lot of storage and easy pc importing capabilities.

https://www.avrfreaks.net/forum/...

 this stuff will be possible to implement on the ATmega 644?

work in progress...

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

SD mass storage has latency that might be an issue.

Might consider streaming over USB as its latency is bounded (1ms)

Dave_Zeb. wrote:
this stuff will be possible to implement on the ATmega 644?
0.4MB/s?  Yes though will be tight.

C code for Teensy: USB Serial

(bottom)

Transmit Bandwidth Benchmark

[approx 1MB/s]

 

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

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

How much memory do you think you will need?

 

With the speed of SPI, and the large variety of RAM/EEPROM/FRAM out there you are sure to find the capacity you are looking for.

 

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

Microchip has serial RAM memories up to 125kB.

 

Some months ago Kartman talked about a serial RAM, also SPI with many MB in capacity. You should be able to find it.

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

Dave_Zeb. wrote:

found several Atmel memory ICs, would those be useful to solve this type of task?

 

hat does the datasheet say about write speed on those?

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

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

Dave_Zeb. wrote:

I just found that I could use an SD-MMC card which is amazing. I can have a lot of storage and easy pc importing capabilities.

https://www.avrfreaks.net/forum/...

 this stuff will be possible to implement on the ATmega 644?

umm I wouldn't use that. I'd use FatFs like 99.9999% of the rest of us.

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

I use 4Mbit external flash memory to store audio for a 1284P. It communicates via SPI. Works good at 2Mhz. 

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

jimlake wrote:

I use 4Mbit external flash memory to store audio for a 1284P. It communicates via SPI. Works good at 2Mhz. 

 

That flash memory will wear out eventually.

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

 

it says following: reading is 150ns pretty great, but writing is bad it ranges for page (3ms-10ms) milliseconds! super-slow....

technically can I interface this directly to ATmega644 via GPIO Banks? or there need to be some logic in between.?

 

The ADC (AD7723) is a 16 bit 1.2 MSPS capable device. So it can generate a 1.200000 samples per second x 16 bit word = 19.200000 bits if i did the math correct. This is full speed which I doubt the AVR will deliver. So instead I down-clocked it to some ~100-500 KHz.

That should be the amount of data needed to store.

 

work in progress...

Last Edited: Thu. May 2, 2019 - 10:50 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Dave_Zeb. wrote:
This is full speed which I doubt the AVR will deliver.
megaAVR might; megaAVR EBI is approx 5MB/s.

XMEGA AVR is faster.

XMega cranks out NTSC color and digital stereo sound! | AVR Freaks

IIRC, 320*200pixel/frame * 1B/pixel * 60frame/s is approx 4MB/s

XMEGA is 3V; the ADC AD7723 is 5V.

 

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

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

Flash and EEPROM memory is going to be S L O W.  FRAM may do it but it's pricey.

 

I thought your spec said volatile OR non-volatile.

 

 

Can't you simply figure out how much storage you will need plus some headroom, and then do a search on digikey/mouser etc to see if a SPI SRAM is available?

 

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

with 200KHz * 16 bit you use 3,2Mbit in 1 second.

you could have a look at the AT45DB series they are SPI and might be able to do the job.

Keep in mind then that you have that bus exclusively for the dataflash. You seem to be able to do a continuous write once you have set it up to do so, that implies keeping the chip selected.

 

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


after looking through the "digikey" and "mouser", I came across "Cypress" semiconductor parts available at 22$ per part for parallel interface and 8.0$ for serial one.

The main advantage is that they have  5.0 Volt logic and are speeds. I am leaning more towards the serial one. Ideally if I purchase 10 parts then I can connect them to the same spi bus and read and write to them with Slave Select line as usual. Are there any special concurns to take into acount before i spent  smiley money on those parts. 

Thanks in advance

 

 

----------------------------------------------------- this one is same part but ulilizing the SPI interface.------------------------------------

 

 

work in progress...

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

Dave_Zeb. wrote:

... parts available at 22$ per part...

 

For that money you could buy a Pi and not have to worry. Bottom line --- the AVR is the wrong controller for this application.

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

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

well now i see all the privildgs of embedding raspberry pi. But converting the 5 volt logic and all the hardware to interface with lower voltage is really not cheap too.

I guess, I'll go for the SPI F-RAMs.. and buy them with some overhead to have a room for more, just in case.

 

work in progress...

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

I’d suggest a beagleboneblack would be more suitable - the Pi’s i/o is not very fast. Logic level translation would only be a couple of $$$ for some chips.

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

Could you please mention a logic level translation IC which would be worth using in my scenario. It will not slow down the signals travlling via data-bus?

 

work in progress...

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

Best you go to a site were you can order and just type in " level converter" that should give a lot of choice, and has the advantage that you should be able to also get them were you live.

 

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

'slow down' - that would be an interesting effect!

 

http://www.ti.com/product/SN74LV...

 

This can have the opposite effect - it can speed up the edges as it has quite good drive characteristics. It caused me some emc issues because I neglected that fact.

 

There's probably a through hole version in 8 bits in the LVC series

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

PIC32MX440F128L - Microcontrollers and Processors

5V tolerant on most pins, 16 bit wide PMP from the AD7723, DMA, USB

 

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

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

angelu wrote:

Microchip has serial RAM memories up to 125kB.

 

Some months ago Kartman talked about a serial RAM, also SPI with many MB in capacity. You should be able to find it.

I was talking about this https://www.avrfreaks.net/forum/...

 

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

Thanks for lots of interesting and useful replies on my topic question. It was indeed very much helpful. Time to do some soldering now.

 

work in progress...