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: 2019-09-23
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: EEPROM
Downloaded: 3047 times
Not followed.
License: MIT license
Dual EE Click contains two AT24CM02 EEPROM ICs onboard which gives total of 4MB of memory. Each memory IC can be addressed through the I2C interface with the transfer speed of 400KHz.
Do you want to subscribe in order to receive notifications regarding "Dual EE click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "Dual EE click" changes.
Do you want to report abuse regarding "Dual EE click".
Library Description
The library includes functions to write data to memory and read data from memory.
Key functions:
uint8_t dualee_read(uint32_t regAddress, uint8_t *dataBuff, uint8_t nBytes)
- Reading data from memoryuint8_t dualee_write(uint32_t regAddress, uint8_t *dataBuff, uint8_t nBytes)
- Writing data to memoryExamples description
The application is composed of three sections :
void applicationTask()
{
uint8_t dataReady_;
uint16_t addressTemp;
char receivedData_;
char addressStr[10];
if (inputDone == 1)
{
mikrobus_logWrite( "", _LOG_LINE);
mikrobus_logWrite("Current page address is 0x", _LOG_TEXT);
addressTemp = (pageAddress >> 16) & 0x00FF;
IntToHex(addressTemp, addressStr);
mikrobus_logWrite( addressStr, _LOG_TEXT);
IntToHex(pageAddress, addressStr);
mikrobus_logWrite( addressStr, _LOG_LINE);
mikrobus_logWrite( "", _LOG_LINE);
mikrobus_logWrite( "Enter '+' if you want to increment current address or '-' if you want to decrement current address", _LOG_LINE);
mikrobus_logWrite( "Enter 'w' write text in current address or 'r' to read from current address:", _LOG_LINE);
mikrobus_logWrite( "", _LOG_LINE);
inputDone = 0;
}
dataReady_ = UART_Rdy_Ptr( );
if (dataReady_ != 0)
{
receivedData_ = UART_Rd_Ptr( );
switch (receivedData_)
{
case '+' :
{
if(pageAddress < _DUALEE_ADDRESS_END)
{
pageAddress ++;
}
else
{
mikrobus_logWrite( "Can't increment address, this is last address!", _LOG_LINE);
}
inputDone = 1;
break;
}
case '-' :
{
if(pageAddress > _DUALEE_ADDRESS_START)
{
pageAddress --;
}
else
{
mikrobus_logWrite( "Can't decrement address, this is first address!", _LOG_LINE);
}
inputDone = 1;
break;
}
case 'w' :
{
dualee_textWrite();
inputDone = 1;
break;
}
case 'r' :
{
dualee_textRead();
inputDone = 1;
break;
}
}
}
Delay_ms(1000);
}
Additional Functions :
Note :
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.