EEPROM WriteWait
william chan
Posts: 1,326
Hey Mike,
Why does the WriteWait method in Basic_I2C_Driver require 3 input parameters?
I think it should be simplified to 2 input parameters.
I tried using eeprom.WriteWait(eeprom#bootpin,eeprom#eeprom,loc) where loc is the location of the last WriteLong, but it seems to be unstable.
Should use zero instead for the 3rd parameter?
Replacing the WriteWait with waitcnt(clkfreq/40 + cnt) solves the stability problem.
But i was hoping to use WriteWait to minimize the total writing time of a large array. (1024 longs)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.fd.com.my
www.mercedes.com.my
Why does the WriteWait method in Basic_I2C_Driver require 3 input parameters?
I think it should be simplified to 2 input parameters.
I tried using eeprom.WriteWait(eeprom#bootpin,eeprom#eeprom,loc) where loc is the location of the last WriteLong, but it seems to be unstable.
Should use zero instead for the 3rd parameter?
Replacing the WriteWait with waitcnt(clkfreq/40 + cnt) solves the stability problem.
But i was hoping to use WriteWait to minimize the total writing time of a large array. (1024 longs)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.fd.com.my
www.mercedes.com.my
Comments
1) The pin # of the I2C bus to be used (CLK pin # with DTA pin # the next highest)
2) The device select code for the EEPROM. This includes a device number (0-7)
3) An EEPROM address with blocks of 64K using separate select codes. Note that the bits representing the block # are combined with the device select code's device number so you can use either to select a memory.
The 3 parameters were used to make the different calls (READ / WRITE / WAIT) look and act similarly.
As usual for any sort of problem, it's important to give schematics, program source, and enough of a description so others can understand what's happening. WriteWait uses a feature of all current EEPROMs, that the EEPROM will stop responding during a write cycle until the cycle is finished. WriteWait simply attempts to start a read operation by selecting the device, then a memory location, but quitting before the read is actually done.
I think that could be my problem......
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.fd.com.my
www.mercedes.com.my