peterhinch/micropython_eeprom

Example project specifically for the 25LC512

ph1lj-6321 opened this issue · 8 comments

Hi
Any chance of a complete project example - I have reviewed and attempted to implement something on the Tiny2040, alas getting no where fast

I'm not sure what you mean by a complete project. The test scripts are what I used in developing these drivers.

The 25LC512 is not one of the chips I tested, but given that the 25xx1024 works there should be no problem if you adapt the instructions, notably the chip size constructor arg.

err1

This is what is returned - note the bdevice & eeprom_spi are on the device

I also test it with your eep_spi.py

err2

both were tested with the amended line in the onboard eeprom_spi.py

`class EEPROM(BlockDevice):

def __init__(self, spi, cspins, size=512, verbose=True, block_size=9):
    # args: virtual block size in bits, no. of chips, bytes in each chip
    if size not in (128, 256, 512):
        print('Warning: possible unsupported chip. Size:', size)
    super().__init__(block_size, len(cspins), size * 1024)`

The size arg is in KiB as stated here. Your chip is 512Kb (bits) which is 64KiB (bytes). So you need size=64. You will get a warning message "possible unsupported chip" but the driver should still work.

If you can confirm that the chip passes the tests I will include it in the list of tested chips and update the code to remove the warning message for that chip size.

Thank you, that was a silly mistake on my part - thanks for your prompt response

image

After running the Write_Read

Not that it matters - but I get nothing returned when I run the "eep_spi.py"

Thanks again

Not that it matters - but I get nothing returned when I run the "eep_spi.py"

Please read the docs. Nothing will happen on import but the tests listed in the doc can be run.

>>> import eep_spi
>>> eep_spi.test()

etc. If it runs full_test the chip can be categorised as working :)

Did the chip pass the tests?

Hi sorry

Yeap - thanks for your help

Thanks for the feedback. I've updated README.md, removed the driver's warning message for that chip size, and added some text from eep_spi.py to explain usage when it's initially imported.