adafruit / Adafruit_FRAM_SPI

Driver for Adafruit's SPI-Based FRAM Breakouts
Other
34 stars 30 forks source link

Address range. #5

Closed pholmes2012 closed 6 years ago

pholmes2012 commented 6 years ago

I have modified an Adafruit FRAM SPI breakout board to use a 4Mbit FRAM chip and found two issues with this driver.

  1. The default maunufacture ID is 0x7f and default product ID is 0x7f7f so fails obviously.

  2. The read and write functions take only a 16bit address, 24bit addresses are required for > 64K chips.

I have modified this driver locally and everything works up to the full 512K.

I realise you are probably not interested in supporting modified boards, which covers point 1, but will you be addressing point 2 in the near future?

ladyada commented 6 years ago

hiya if you can make sure it still works with an original SPI FRAM board we'd take a PR for both!

pholmes2012 commented 6 years ago

It does, I added a default parameter to begin() specifying the address byte width, therefore all existing sketches will default to 2 bytes.

One thing that bothers me slightly is that the new chips' datasheet mentions that the top 4 or 5 bits of the 24bit address are used for something, I have not read it in depth yet. Basically that may mean the default parameter should be an address bit width rather than byte width. I will look into that.

Ok I will look at doing a PR this weekend.

Paul.

On Thu, Nov 23, 2017 at 5:41 PM, ladyada notifications@github.com wrote:

hiya if you can make sure it still works with an original SPI FRAM board we'd take a PR for both!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/adafruit/Adafruit_FRAM_SPI/issues/5#issuecomment-346673412, or mute the thread https://github.com/notifications/unsubscribe-auth/AIAdFyiwTLZNf5SyooVyXP_GU9-y1Amgks5s5a5SgaJpZM4QpCsF .

deanm1278 commented 6 years ago

ok PR has been checked and merged. Thanks for the contribution!