2021-07-06 12:34 AM
I ask this question because I am already using all the i2c pins for my lcd screen and I need to write in EEPROM and it seems that I need to configure a I2C to use the hal function to write ...
2021-07-06 01:20 AM
Hello,
If you have an I2C EEPROM in your design, you'll have to configure an I2C instance to communicate with it.
2021-07-06 01:47 AM
I saw that it was maybe possible to use a SPI pin, do you know if it is possible to write/read eeprom with SPI ?
(thank you for your first answer btw)
2021-07-06 01:53 AM
1) SPI is not I2C.
2) There is solution to simulate I2C using 2 GPIO. google "STM32 software I2C", hopefully you'll find something.
2021-07-06 04:10 AM
Besides, an I2C bus can be connected to more than one devices/slaves. I2C devices have addresses, so that it is possible to know what device you are currently using.
2021-07-06 06:05 AM
As @LMI2 said, I2C is a bus - the whole point of a bus is that multiple devices can share it. That's why it has addresses.
You don't need a separate I2C for each peripheral:
https://en.wikipedia.org/wiki/I%C2%B2C
https://learn.sparkfun.com/tutorials/i2c/all
2021-07-06 06:08 AM
@STM32L0Fan : "do you know if it is possible to write/read eeprom with SPI ?"
That depends on the EEPROM:
You will have to study the documentation for your EEPROM to find which applies ...
2021-07-06 06:53 AM
State the SPECIFIC parts we're talking about here, the STM32 and EEPROM at the very least
Both SPI and I2C use multiple PINS
I2C parts are addressable, usually the manufacturers chose address ranges that don't clash, and often have address jumpers to select between multiple addresses.
2021-07-06 08:33 AM
Ok thank you for your answer, the answer to my issue is that with the hal function : HAL_FLASHEx_DATAEEPROM_Program() you can do what I wanted to do.
2021-07-06 09:14 AM
That would suggest you're using an STM32L0 part, with an Internal EEPROM, not an external one using I2C or SPI