Coder Social home page Coder Social logo

ee24's Introduction

Hi there! ๐Ÿ‘‹

I'm Nima Askari, an Electronic Engineer passionate about sharing my knowledge through libraries I've written. Welcome to my GitHub profile!

About Me

I'm dedicated to creating libraries that make life easier for electronic engineers like you. Whether it's optimizing code or simplifying complex tasks, I strive to provide solutions that enhance your projects.

Connect with Me, Support Me

  • YouTube
  • Instagram
  • LinkedIn
  • Email
  • Ko-fi

You can install my STM32CubeMx packages from here:

Thank you for your support! Together, we can build a vibrant community of electronic engineers. Let's innovate and create amazing projects!

ee24's People

Contributors

leech001 avatar nimaltd avatar ruslanurya avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ee24's Issues

Example of writing to eeprom

Library does not fully support writing operation.
It is important to remember about switching WP (Write Protection) pin before call write function.

        _Bool status = false;
	status = EE24_Init(&eeprom24, &hi2c1, EE24_ADDRESS_DEFAULT);

	uint8_t data[4] = {0xBE, 0xEF, 0xAB, 0xCD};

	HAL_GPIO_WritePin(EEPROM_WP_GPIO_Port, EEPROM_WP_Pin, GPIO_PIN_RESET);
        status = EE24_Write(&eeprom24, 0u, &data, 4, 1000);
	HAL_GPIO_WritePin(EEPROM_WP_GPIO_Port, EEPROM_WP_Pin, GPIO_PIN_SET);

	memset(&data, 0u, sizeof(data));
	status = EE24_Read(&eeprom24, 0u, &data, 4, 1000);

The rest of library is ok. Simple and working library.
Thanks :D

Erase chip function has a problem

In this function:

bool ee24_eraseChip(I2C_HandleTypeDef* i2c)
{
  const uint8_t eraseData[32] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF\
    , 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
  uint32_t bytes = 0;
  while ( bytes < (_EEPROM_SIZE_KBIT / 8) * 1024)
  {
    if (ee24_write(i2c, bytes, (uint8_t*)eraseData, sizeof(eraseData), 100) == false)
      return false;
    bytes += sizeof(eraseData);           
  }
  return true;  
}

If _EEPROM_SIZE_KBIT was less than 8, the while condition will be always false because for example 2 divided by 8 is 0 in non-floating values. I think the condition should be like this:
while ( bytes < (_EEPROM_SIZE_KBIT * 256))

Also I didn't find out what does this condition mean ๐Ÿค”. Anyway, thanks for your attention ๐Ÿ™๐Ÿป

(I made a little changes in inputs and I2C handler pointer, but it isn't the problem ๐Ÿ˜…)

How Save/Load "uint32_t" variables?

Hi,
I try to save and load 32-bit variables as follows:

Write:

uint32_t rel_temp[48]={
	300,300,300,300,300,300,300,300,300,300,300,300,300,300,300,300,
	300,300,300,300,300,300,300,300,300,300,300,300,300,300,300,300,
	300,300,300,300,300,300,300,300,300,300,300,300,300,300,300,300
};
EEPROM24XX_Save(0x0000,(uint8_t *)rel_temp,(48*4));
//EEPROM24XX_Save(0x0000,(uint8_t *)&rel_temp,(48*4));

Read:

uint32_t rel_temp[48];
EEPROM24XX_Load(0x0000,(uint8_t *)rel_temp,(48*4));
//EEPROM24XX_Load(0x0000,(uint8_t *)&rel_temp,(48*4));

But it doesn't work!
Is there a way to do this?
I use this method in w25qxx library and it works well.
Thanks!

Example for init

can you provide example for init of the EEPROM pins, as no clear documentation for that?

Problem with writing more then 16 bytes.

Chipset: STM32F410
EEPROM Chip: EE24AT02 (EE24_2KBIT)

Problem occurs when try to write more than 16 bytes:
Code:

  for (uint32_t i = 0; i < 32; i ++) {
    EEPROM_DATA[i] = i;
  }
  if (EE24_Init(&ee24, &hi2c1, EE24_ADDRESS_DEFAULT))
  {
    EE24_Write(&ee24, 0, EEPROM_DATA, 32, 1000);
  }

Result:

10 11 12 13 14 15 16 17
18 19 1A 1B 1C 1D 1E 1F
10 11 12 13 14 15 16 17
18 19 1A 1B 1C 1D 1E 1F

While the correct result should be:

00 01 02 03 04 05 06 07
08 09 0A 0B 0C 0D 0E 0F
10 11 12 13 14 15 16 17
18 19 1A 1B 1C 1D 1E 1F

What might be the problem?

24c08 and EEPROM24XX_Save

I fill first 16 bytes from this code:

uint8_t	ReadEEPROM[16];
ReadEEPROM[0] = eeprom.ip[0];
ReadEEPROM[1] = eeprom.ip[1];
ReadEEPROM[2] = eeprom.ip[2];
ReadEEPROM[3] = eeprom.ip[3];
ReadEEPROM[4] = eeprom.sn[0];
ReadEEPROM[5] = eeprom.sn[1];
ReadEEPROM[6] = eeprom.sn[2];
ReadEEPROM[7] = eeprom.sn[3];
ReadEEPROM[8] = eeprom.gw[0];
ReadEEPROM[9] = eeprom.gw[1];
ReadEEPROM[10] = eeprom.gw[2];
ReadEEPROM[11] = eeprom.gw[3];										
ReadEEPROM[12] = eeprom.srvip[0];
ReadEEPROM[13] = eeprom.srvip[1];
ReadEEPROM[14] = eeprom.srvip[2];
ReadEEPROM[15] = eeprom.srvip[3];
EEPROM24XX_Save(0,ReadEEPROM,sizeof(ReadEEPROM));

then i trying to fill another part of page:

ReadEEPROM[0] = (uint8_t)((eeprom.api_port & 0xFF00) >> 8);
ReadEEPROM[1] = (uint8_t)(eeprom.api_port & 0x00FF);										
ReadEEPROM[2] = (uint8_t)((eeprom.srvport & 0xFF00) >> 8);
ReadEEPROM[3] = (uint8_t)(eeprom.srvport & 0x00FF);										
EEPROM24XX_Save(16,ReadEEPROM,4);

when I read the first page some data was corrupted (netInfo.gw)

EEPROM24XX_Load(0,ReadEEPROM,sizeof(ReadEEPROM));
netInfo.ip[0] = ReadEEPROM[0];
netInfo.ip[1] = ReadEEPROM[1];
netInfo.ip[2] = ReadEEPROM[2];
netInfo.ip[3] = ReadEEPROM[3];
netInfo.sn[0] = ReadEEPROM[4];
netInfo.sn[1] = ReadEEPROM[5];
netInfo.sn[2] = ReadEEPROM[6];
netInfo.sn[3] = ReadEEPROM[7];
netInfo.gw[0] = ReadEEPROM[8];
netInfo.gw[1] = ReadEEPROM[9];
netInfo.gw[2] = ReadEEPROM[10];
netInfo.gw[3] = ReadEEPROM[11];		
servip[0] = ReadEEPROM[12];
servip[1] = ReadEEPROM[13];
servip[2] = ReadEEPROM[14];
servip[3] = ReadEEPROM[15];
		
EEPROM24XX_Load(16,ReadEEPROM,4);
api_port = ((uint16_t)ReadEEPROM[0] << 8) | ReadEEPROM[1];
servport = ((uint16_t)ReadEEPROM[2] << 8) | ReadEEPROM[3];

Which problem with this? If i used only first 16 bytes all is ok. When i trying to fiil more pages i received data coruption in first page.

Lib not read or write value

Hi, i try this code

if (ee24_isConnected()) {
        uint8_t memory_ready = 111;
        ee24_write(0, &memory_ready, sizeof(memory_ready), 100);
        ee24_read(0, &memory_ready, sizeof(memory_ready), 100);
    }

after finish running code value of memory_ready is '0'.
But all function return is TRUE.

Please help.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.