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: 2020-07-16
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: SRAM
Downloaded: 2583 times
Not followed.
License: MIT license
SRAM 2 Click is based on ANV32A62A SRAM memory from Anvo-Systems Dresden. It's a 64Kb serial SRAM with a non-volatile SONOS storage element included with each memory cell, organized as 8k words of 8 bits each. The devices are accessed by a two-wire bus. Up to 4 cascadable devices can share the common bus.
Do you want to subscribe in order to receive notifications regarding "SRAM 2 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "SRAM 2 click" changes.
Do you want to report abuse regarding "SRAM 2 click".
Library Description
Library provides control over reading and writing data via I2C module. You can use 2 specific functions for reading and writing to memory.
Key functions:
void sram2_write_protect( uint8_t state )
- Write protect data selectionvoid sram2_write_memory( uint16_t addr, uint8_t wr_data )
- Generic write data functionuint8_t sram2_read_memory( uint16_t addr )
- Generic read data functionExamples description
The application is composed of three sections :
void application_task ( )
{
uint8_t cnt;
mikrobus_logWrite( ">> Write data [MikroE] to memory.", _LOG_LINE );
sram2_write_protect( SRAM2_WR_ENABLE );
for ( cnt = 0; cnt < 8; cnt++ )
{
sram2_write_memory( memory_addr + cnt, message_data[ cnt ] );
}
Delay_ms( 1000 );
sram2_write_protect( SRAM2_WR_DISABLE );
mikrobus_logWrite( ">> Read data from memory. Data : ", _LOG_TEXT );
for ( cnt = 0; cnt < 8; cnt++ )
{
rx_data = sram2_read_memory( memory_addr + cnt );
mikrobus_logWrite( &rx_data, _LOG_BYTE );
mikrobus_logWrite( " ", _LOG_TEXT );
Delay_100ms();
}
mikrobus_logWrite( " ", _LOG_LINE );
mikrobus_logWrite( "--------------------------------", _LOG_LINE );
Delay_ms( 2000 );
}
Other mikroE Libraries used in the example:
Additional notes and informations
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.