We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]
Rating:
Author: MIKROE
Last Updated: 2018-02-09
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: MRAM
Downloaded: 5084 times
Not followed.
License: MIT license
MRAM click is a memory storage device with 32KB of memory space. The used memory module can withstand an unlimited number of write cycles, it has data retention period greater than 20 years and it can read and write to random addresses with no delay.
Do you want to subscribe in order to receive notifications regarding "MRAM click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "MRAM click" changes.
Do you want to report abuse regarding "MRAM click".
Library Description
Initializes and defines SPI bus driver and driver functions which are used for storing data to memory and for reading memory.
Library also communicates with the Status register. For more details check the documentation.
Key functions
uint8_t mram_checkStatusBit(uint8_t status_bit) - The function checks one bit from the Status register determined by the function parameter.
void mram_readDataBytes(const uint16_t address, uint8_t *buffer, const uint16_t nBytes) - The function reads a number of bytes determined by the nBytes parameter from the memory to the buffer with start address determined by the address parameter.
void mram_writeDataBytes(const uint16_t address, uint8_t *buffer, const uint16_t nBytes) - The function writes a number of bytes determined by the nBytes parameter from the buffer to memory with start address determined by address parameter.
void mram_enableHoldMode(uint8_t state) - A low on the Hold pin interrupts a memory operation for another task.
Examples Description
The application is composed of three sections :
void applicationTask() { uint8_t numberBytesWrite; uint8_t numberBytesRead; char txt[20] = {0}; uint16_t i; numberBytesWrite = 6; numberBytesRead = 3; mram_writeDataBytes(0x0000, &data_write[0], numberBytesWrite); mram_readDataBytes(0x0002, &data_read[0], numberBytesRead); for(i = 0; i < numberBytesRead; i++) { WordToStr(data_read[i], txt); mikrobus_logWrite(txt, _LOG_LINE); } Delay_ms(2000); }
Additional notes and information
Depending on the development board you are using, you may need USB UART click, USB UART 2 click or RS232 click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.