Trust MRAM as your data's guardian. Our solution offers persistent memory with rapid read and write capabilities, ensuring data integrity and fast access for applications where reliability is paramount.
A
A
Hardware Overview
How does it work?
MRAM Click is based on the MR25H256, a 256 kilobits serial SPI MRAM memory module from Everspin company. This module contains 262,144 bits of memory that can be randomly accessed. The pinout of the used memory module is the same as most commonly used EEPROM modules so that it can directly replace it. The usual SPI lines - SO, SI, SCK and #CS pins from the MR25H256 IC are routed to the mikroBUS™ SPI port (MISO, MOSI, SCK and CS pins). Besides the SPI serial bus, there are two more pins routed to the mikroBUS™. The #HOLD pin of the MR25H256 IC is routed to the INT pin of the mikroBUS™ and it is used to hold the data transfer. When this pin is pulled to a LOW logic level, all data transfer operations are suspended. However, this function is enabled only when the device is already addressed with the CS pin pulled to a LOW level.
This allows to pause the data transfer and resume it later without the need to first address it via the CS pin, reducing the output latency that way. While the data transfer is paused, the SO pin will switch to a high impedance mode (HIGH Z) and will remain inactive. The SCK pulses are completely ignored. The #HOLD pin of the MR25H256 IC is pulled to a HIGH logic level by an onboard pull-up resistor. The #WP pin of the MR25H256 IC is routed to the INT pin of the mikroBUS™ and it is used to prevent writes to the status register, acting as a hardware write protect pin. It is routed to the RST pin of the mikroBUS™. The logical organization of the moduke, such as read and write commands and the status register of the MR25H256 IC are the same as with most commonly used EEPROM modules, such as the one used in EEPROM 4 Click. That allows this
memory module, as well as MRAM click to replace the existing EEPROM module with not too much additional work. The provided libraries offer all the functions needed to work with the MRAM click. Their usage is demonstrated in the included example application which can be used as a reference for further development. The device should wait for the system voltage to become stable before the writing is attempted. This Click board™ can be operated only with a 3.3V logic voltage level. The board must perform appropriate logic voltage level conversion before using MCUs with different logic levels. Also, it comes equipped with a library containing functions and an example code that can be used as a reference for further development.
Features overview
Development board
Clicker 2 for Kinetis is a compact starter development board that brings the flexibility of add-on Click boards™ to your favorite microcontroller, making it a perfect starter kit for implementing your ideas. It comes with an onboard 32-bit ARM Cortex-M4F microcontroller, the MK64FN1M0VDC12 from NXP Semiconductors, two mikroBUS™ sockets for Click board™ connectivity, a USB connector, LED indicators, buttons, a JTAG programmer connector, and two 26-pin headers for interfacing with external electronics. Its compact design with clear and easily recognizable silkscreen markings allows you to build gadgets with unique functionalities and
features quickly. Each part of the Clicker 2 for Kinetis development kit contains the components necessary for the most efficient operation of the same board. In addition to the possibility of choosing the Clicker 2 for Kinetis programming method, using a USB HID mikroBootloader or an external mikroProg connector for Kinetis programmer, the Clicker 2 board also includes a clean and regulated power supply module for the development kit. It provides two ways of board-powering; through the USB Micro-B cable, where onboard voltage regulators provide the appropriate voltage levels to each component on the board, or
using a Li-Polymer battery via an onboard battery connector. All communication methods that mikroBUS™ itself supports are on this board, including the well-established mikroBUS™ socket, reset button, and several user-configurable buttons and LED indicators. Clicker 2 for Kinetis is an integral part of the Mikroe ecosystem, allowing you to create a new application in minutes. Natively supported by Mikroe software tools, it covers many aspects of prototyping thanks to a considerable number of different Click boards™ (over a thousand boards), the number of which is growing every day.
Microcontroller Overview
MCU Card / MCU
Architecture
ARM Cortex-M4
MCU Memory (KB)
1024
Silicon Vendor
NXP
Pin count
121
RAM (Bytes)
262144
Used MCU Pins
mikroBUS™ mapper
Take a closer look
Schematic
Step by step
Project assembly
Track your results in real time
Application Output via Debug Mode
1. Once the code example is loaded, pressing the "DEBUG" button initiates the build process, programs it on the created setup, and enters Debug mode.
2. After the programming is completed, a header with buttons for various actions within the IDE becomes visible. Clicking the green "PLAY" button starts reading the results achieved with the Click board™. The achieved results are displayed in the Application Output tab.
Software Support
Library Description
This library contains API for MRAM Click driver.
Key functions:
mram_write_data_bytes
- Function writes n bytes of data from the buffermram_read_data_bytes
- Function reads n bytes of data and saves it in buffermram_enable_write_protect
- Function enables or disables write protect.
Open Source
Code example
This example can be found in NECTO Studio. Feel free to download the code, or you can copy the code below.
/*!
* \file
* \brief MRAM Click example
*
* # Description
* This example writes and reads from the Mram Click and displays it on the terminal.
*
* The demo application is composed of two sections :
*
* ## Application Init
* Initializes click driver.
*
* ## Application Task
* Writes 10 bytes of buffer data in memory with start address 0x0001. Then reads
* 10 bytes from memory with start address 0x0001 and shows result on USB UART.
*
*
* \author MikroE Team
*
*/
// ------------------------------------------------------------------- INCLUDES
#include "board.h"
#include "log.h"
#include "mram.h"
// ------------------------------------------------------------------ VARIABLES
static mram_t mram;
static log_t logger;
// ------------------------------------------------------ APPLICATION FUNCTIONS
void application_init ( void )
{
log_cfg_t log_cfg;
mram_cfg_t cfg;
/**
* Logger initialization.
* Default baud rate: 115200
* Default log level: LOG_LEVEL_DEBUG
* @note If USB_UART_RX and USB_UART_TX
* are defined as HAL_PIN_NC, you will
* need to define them manually for log to work.
* See @b LOG_MAP_USB_UART macro definition for detailed explanation.
*/
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, "---- Application Init ----" );
// Click initialization.
mram_cfg_setup( &cfg );
MRAM_MAP_MIKROBUS( cfg, MIKROBUS_1 );
mram_init( &mram, &cfg );
mram_default_cfg( &mram );
}
void application_task ( void )
{
uint8_t number_bytes_write;
uint8_t number_bytes_read;
uint16_t i;
uint8_t data_write[ 10 ] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
uint8_t data_read[ 20 ] = { 0 };
number_bytes_write = 10;
number_bytes_read = 10;
log_printf( &logger, " Data written!\r\n" );
mram_write_data_bytes ( &mram, 0x0001, data_write, number_bytes_write );
log_printf( &logger, " Read data:\r\n" );
mram_read_data_bytes ( &mram, 0x0001, data_read, number_bytes_read );
for ( i = 0; i < number_bytes_read; i++ )
{
log_printf( &logger, "%d ", ( uint16_t )data_read[ i ] );
}
log_printf( &logger, "\n" );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
}
int main ( void )
{
/* Do not remove this line or clock might not be set correctly. */
#ifdef PREINIT_SUPPORTED
preinit();
#endif
application_init( );
for ( ; ; )
{
application_task( );
}
return 0;
}
// ------------------------------------------------------------------------ END