EEPROM write-read I2C suggestions ... but I am out of cogs
courtens
Posts: 101
I need to store 30 words (number values in the range of 0-5000) to the on-board EEPROM. I found this related thread, but there is always a cog required. My problem is, I am out of cogs.
So now I am considering to "import" a I2C object into my main cog, hopping that there will be no naming convention collisions.
Is there a simple stripped down I2C object anyone recommends?
I had a look at pasm_i2c_driver.spin, but I don't know what value to set SCL and devSel to.
So now I am considering to "import" a I2C object into my main cog, hopping that there will be no naming convention collisions.
Is there a simple stripped down I2C object anyone recommends?
I had a look at pasm_i2c_driver.spin, but I don't know what value to set SCL and devSel to.
PUB WriteWord(SCL, devSel, addrReg, data)
Comments
Spin's use of dot notation (object.method) means you won't have any naming issues.
I thought I needed to start a new cog with the object started in it to start use the dot notation naming convention. Is this not so?
-Phil
Do I need to call jm.start(device) first? And how, or as what, would do I need to declare "device"?
-Phil
Of course, you have to use the method appropriate for the variable type. By writing into the EEPROM at the location the variable lives in RAM, it will be auto-loaded after the next reset -- no read to call a read method.