EYE on NPI – Renesas MRAM #EyeOnNPI #Renesas #DigiKey #Adafruit @digikey @Adafruit @RenesasGlobal

This week’s EYE on NPI takes a look at a new kind of memory called MRAM – and some fresh new QSPI memory chips from Renesas that let you try out MRAM for your embedded projects! Memory and memory management is one of the trickiest challenges for an engineer, when it comes time to optimize power, speed and performance because you bump up against many of the restrictions different types of memory have – and the reason there’s so many types of memory is cause there’s no one perfect type of memory storage.

Just about every microcontroller has two kinds of storage – flash storage and RAM storage. RAM storage is just like the kind you have in your computer – except a few KB usually, instead of GB. RAM storage is pretty expensive, which is why a microcontroller that is only a few bucks has only a few KB. BUT RAM is really fast – you can read and write to any section of RAM within one or two instructions. That makes it great for rapid data capture, analysis and scratch-pad workspace. There’s one down-side to this speed – when the microcontroller is reset, or power is lost, the RAM is also lost.

For that reason, your microcontroller has the other kind of memory – flash – to store the program itself. Otherwise, your program would just disappear when you unplugged it (not good!). Flash memory is pretty inexpensive, so you usually get much more flash than RAM. (Before flash memory, we had microcontrollers that had crystal windows and you could erase the chip with a desktop UV eraser – a process that would take a few minutes, so you either had a lot of chips you’d cycle through the eraser, or you’d just have to think really, really hard before writing lines of your code, because it would take 3 minutes until you could fix any bug you introduced!) Once in a while you also get microcontrollers that have a separate flash memory area, often referred to as EEPROM. Usually this is used for storing configurations, calibrations, identifiers, etc.

So normally, you’ve got non-volatile flash storage for code, volatile RAM storage for running the code, and maybe a smidge of EEPROM. Say you want to build a sensor data logger – you can’t store the data in RAM, because you’ll lose it when power is lost. You can’t safely stick it in flash because that’s where your code lives, and EEPROM is way too small. No problem, you can buy external non-volatile flash memory for microcontrollers! Again, for small amounts of storage, say less than 64K you can get low cost I2C EEPROM.

For your sensor datalogger you want more storage – more like a megabyte – so you can data log for a few hours. So you add some external flash memory to your board! You can do this in two ways, one is to connect a SD card or micro SD card, using SDIO or SPI, to your microcontroller. SD cards have flash memory and a little controller inside them, but they’re still essentially non-volatile flash in a removable package and they come in sizes from 2 MB to larger than 128 MB!

The other option is to add a (Q)SPI flash chip – these are usually only up to maybe 16 MB of storage, and they are not removable. In fact we use these often on our CircuitPython boards to add a small 2 or 8 megabyte disk drive to store code and assets. These flash chips are fairly inexpensive and can handle 100,000 erase/write cycles.

There’s one big downside tho – while these SPI flash chips have great non-volatility, they have an annoying problem that when you want to change data in a block you have to erase that whole block first, then write the new changed data – and a block is 4KB to 16KB! And erasing takes at least a few milliseconds, if not longer. Same with SD cards by the way, the erase time is fairly long, so when you want to write new data to a card, it can hang out for 250ms until its complete. There’s some ways to work around this, by buffering a block’s worth before writing – but you risk losing data. And if you have a filesystem like FAT on the flash or card, you also have to update the FAT table every time a file changes size. Basically, SD or SPI flash are great for reading and super slow and yucky for writing – especially when you need to write often, quickly or in large bursts.

THUS, this week’s EYE on NPI is interesting to us because it introduces a new kind of memory we’ve never used before – MRAM for magnetic random access memory. Where as flash memory stores memory by saving a bit by storing charge on a MOSFET gate, MRAM stores it on a ferromagnetic particle that can changed from N to S polarity to store 1 or 0.

The core of Avalanche’s STT-MRAM cell is a proprietary perpendicular magnetic tunnel junction (p-MTJ) element which includes including a magnetic fixed layer, a dielectric barrier layer and a changeable ferromagnetic storage layer. The magnetic orientation of the fixed layer is fixed during the manufacturing process. During a programming operation, the magnetic orientation of the storage layer is electrically switched from a parallel state (low resistance state “0”) to an antiparallel state (high resistance state “1”), or vice versa, depending on the current direction through the p-MTJ element. Two distinct resistance states can thus be realized for data storage and sensing. The structure of the p-MTJ element can be tailored for different performance specs and application needs.

What’s nice is that every bit/byte can be written or read at any time, no block erases, no delays! You can drive these chips with SPI or QSPI at 100+MHz and down to 1.8V. These chips will be more expensive than NV SRAM or FLASH, but when you need fast writes and reads without waits, these are a great option. Another nice bonus with MRAM is that it is naturally less susceptible to radiation bit-flips – something that folks working on cubesats are super experienced with as a bane of their existence – you send a microcontroller into LEO and the flash memory gets corrupted by high energy particles. While this part is not specifically rad-hard or space-ready, for DIY experimentation, its way way less expensive than official aerospace devices – as seen in the PyCubed dev board.

These chips are pin-compatible with most other SPI flash you may have designed in, so it’s easy to try out MRAM! Check out the chips on Digi-Key available in 8-SOIC package for easy prototyping!


See a manufacturer video of these products here.


Adafruit publishes a wide range of writing and video content, including interviews and reporting on the maker market and the wider technology world. Our standards page is intended as a guide to best practices that Adafruit uses, as well as an outline of the ethical standards Adafruit aspires to. While Adafruit is not an independent journalistic institution, Adafruit strives to be a fair, informative, and positive voice within the community – check it out here: adafruit.com/editorialstandards

Join Adafruit on Mastodon

Adafruit is on Mastodon, join in! adafruit.com/mastodon

Stop breadboarding and soldering – start making immediately! Adafruit’s Circuit Playground is jam-packed with LEDs, sensors, buttons, alligator clip pads and more. Build projects with Circuit Playground in a few minutes with the drag-and-drop MakeCode programming site, learn computer science using the CS Discoveries class on code.org, jump into CircuitPython to learn Python and hardware together, TinyGO, or even use the Arduino IDE. Circuit Playground Express is the newest and best Circuit Playground board, with support for CircuitPython, MakeCode, and Arduino. It has a powerful processor, 10 NeoPixels, mini speaker, InfraRed receive and transmit, two buttons, a switch, 14 alligator clip pads, and lots of sensors: capacitive touch, IR proximity, temperature, light, motion and sound. A whole wide world of electronics and coding is waiting for you, and it fits in the palm of your hand.

Have an amazing project to share? The Electronics Show and Tell is every Wednesday at 7pm ET! To join, head over to YouTube and check out the show’s live chat – we’ll post the link there.

Join us every Wednesday night at 8pm ET for Ask an Engineer!

Join over 36,000+ makers on Adafruit’s Discord channels and be part of the community! http://adafru.it/discord

CircuitPython – The easiest way to program microcontrollers – CircuitPython.org

Maker Business — “Packaging” chips in the US

Wearables — Enclosures help fight body humidity in costumes

Electronics — Transformers: More than meets the eye!

Python for Microcontrollers — Python on Microcontrollers Newsletter: Silicon Labs introduces CircuitPython support, and more! #CircuitPython #Python #micropython @ThePSF @Raspberry_Pi

Adafruit IoT Monthly — Guardian Robot, Weather-wise Umbrella Stand, and more!

Microsoft MakeCode — MakeCode Thank You!

EYE on NPI — Maxim’s Himalaya uSLIC Step-Down Power Module #EyeOnNPI @maximintegrated @digikey

New Products – Adafruit Industries – Makers, hackers, artists, designers and engineers! — #NewProds 7/19/23 Feat. Adafruit Matrix Portal S3 CircuitPython Powered Internet Display!

Get the only spam-free daily newsletter about wearables, running a "maker business", electronic tips and more! Subscribe at AdafruitDaily.com !

No Comments

No comments yet.

Sorry, the comment form is closed at this time.