Micropython EEPROM write error
Posted: Fri Dec 01, 2017 7:29 am
Dear ,
I am trying to write a simple program to test my I2C EEPROM(24LC01BI_SN), i use micropython to write 0 to 100 into EEPROM address from 0 to 100,
after write success. I read back and check back the value , the value is incorrect in some address. E.g. address 10 should be contain 0x0a, but the result is 0x0b and in address 0x0c the value is "r " .... may i know that how to fix this problem?
import machine
import time
addr =0
buf[0] = 0
while buf[0]<100:
... buf[0]=buf[0]+1
... ee.writeto_mem(80, addr, buf)
... time.sleep_ms(500)
... addr=addr+1
ee.readfrom_mem(80, 10, 10)
>>>>>b'\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14'
ee.readfrom_mem(80, 5, 10)
>>>>>b'\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f'
I am trying to write a simple program to test my I2C EEPROM(24LC01BI_SN), i use micropython to write 0 to 100 into EEPROM address from 0 to 100,
after write success. I read back and check back the value , the value is incorrect in some address. E.g. address 10 should be contain 0x0a, but the result is 0x0b and in address 0x0c the value is "r " .... may i know that how to fix this problem?
import machine
import time
addr =0
buf[0] = 0
while buf[0]<100:
... buf[0]=buf[0]+1
... ee.writeto_mem(80, addr, buf)
... time.sleep_ms(500)
... addr=addr+1
ee.readfrom_mem(80, 10, 10)
>>>>>b'\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14'
ee.readfrom_mem(80, 5, 10)
>>>>>b'\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f'