2017-02-08 01:35 AM
i want to using External EEPROM via I2C on STM32F051R8T6.
but i always get error when compile it.
can someone tell me or help me ?
2017-02-08 04:41 AM
maybe can we have compilation error ?
2017-02-08 05:07 AM
Hello
klen.klen
,It will be difficult to help you on your issue unless you provide more details about your case and error that you have,localize where the code hangs/stop,identify what is the problem that you see.
Also,you can share your code with user forum to get more help.
Did you checked the I2C examples available in the STM32packages?
Refer to this thread
https://community.st.com/0D50X00009Xke3SSAR
and thisapplication note would be helpful for you, it provides the EEPROM emulation driver in STM32F0.Hope this helpsyou.
Regards
Imen
2017-02-22 12:39 AM
hy, sorry my computer were re-installed
I forget to backup all of my data
so, all of my program has lost
can you help what i have to do on AT24C64?
2018-01-21 10:29 PM
Hello, Am using STM32F0 uC for interfacing with a AT24C64. I am not able to write sequentially to the EEPROM after one page, i.e 32 Bytes. Can someone please if the logic is wrong.
This is the code:
data[0]=0x00; //First word address 8bit
data[1]=0x00; //Second word address 8bitfor(i=2;i<34;i++){data[i]=0x11;}HAL_I2C_Master_Transmit(&hi2c1, EEPROM_ADDRESS<<1, data, 34, 50); //data is int type,34 is number bytes of datadata[0]=0x00; //First word address 8bitdata[1]=0x20; //Second word address 8bit// Next Pagefor(i=2;i<34;i++){data[i]=0x22;}HAL_I2C_Master_Transmit(&hi2c1, EEPROM_ADDRESS<<1, data, 34, 50); //data is int type,34 is number bytes of datawhile (1){/* USER CODE END WHILE */data[0]=0x00;data[1]=0x00;HAL_I2C_Master_Transmit(&hi2c1, EEPROM_ADDRESS<<1, data, 2, 50); //data is int type pointing to first address herefor(i=0;i<32;i++){HAL_I2C_Master_Receive(&hi2c1, EEPROM_ADDRESS<<1, &dataout[i], 1, 50);//maximum is 32 byte data locations}data[0]=0x00;
data[1]=0x20;HAL_I2C_Master_Transmit(&hi2c1, EEPROM_ADDRESS<<1, data, 2, 50); //data is int type pointing to first address herefor(i=0;i<32;i++){HAL_I2C_Master_Receive(&hi2c1, EEPROM_ADDRESS<<1, &dataout_1[i], 1, 50);//maximum is 32 byte data locations}}
2018-01-21 11:46 PM
hi this looks incorrect:
for(i=0;i<32;i++)
{HAL_I2C_Master_Receive(&hi2c1, EEPROM_ADDRESS<<1, &dataout[i], 1, 50);//maximum is 32 byte data locations}I think you need,
HAL_I2C_Master_Receive(&hi2c1, EEPROM_ADDRESS<<1, &dataout[0], 32, 50);//maximum is 32 byte data locations
2018-01-22 12:55 AM
I tried this out it doesnt work.
It is basically considering one byte at a time for 32 times and i think the issue is with the Transmit before the while loop where am writing to the EEPROM
2018-01-22 04:11 AM
You might need to insert some delays between programming pages. It says in the datasheet:
BYTE WRITE: A write operation requires two 8-bit data word addresses following the device address word and acknowledgment. Upon receipt of this address, the EEPROM will again respond with a zero and then clock in the first 8-bit data word. Following receipt of the 8-bit data word, the EEPROM will output a zero and the addressing device, such as a microcontroller, must terminate the write sequence with a stop condition. At this time the EEPROM enters an internally-timed write cycle, tWR, to the nonvolatile memory. All inputs are disabled during this write cycle and the EEPROM will not respond until the write is complete (see Figure 12-2 on page 11).
2018-01-22 04:53 AM
Awesome that works for me. Thank you so much.