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
Curiosity PIC32 MZ EF development board is a fully integrated 32-bit development platform featuring the high-performance PIC32MZ EF Series (PIC32MZ2048EFM) that has a 2MB Flash, 512KB RAM, integrated FPU, Crypto accelerator, and excellent connectivity options. It includes an integrated programmer and debugger, requiring no additional hardware. Users can expand
functionality through MIKROE mikroBUS™ Click™ adapter boards, add Ethernet connectivity with the Microchip PHY daughter board, add WiFi connectivity capability using the Microchip expansions boards, and add audio input and output capability with Microchip audio daughter boards. These boards are fully integrated into PIC32’s powerful software framework, MPLAB Harmony,
which provides a flexible and modular interface to application development a rich set of inter-operable software stacks (TCP-IP, USB), and easy-to-use features. The Curiosity PIC32 MZ EF development board offers expansion capabilities making it an excellent choice for a rapid prototyping board in Connectivity, IOT, and general-purpose applications.
Microcontroller Overview
MCU Card / MCU
Architecture
PIC32
MCU Memory (KB)
2048
Silicon Vendor
Microchip
Pin count
100
RAM (Bytes)
524288
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