Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Cypress/Ramtron FRAM support + add readManufacturerId() function #14

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

martinayotte
Copy link

add Cypress/Ramtron FRAM support + add readManufacturerId() function

@martinayotte
Copy link
Author

Hi Felix !
As you can see, I've done additional commits.
I've received some W25Q128, and probably due to QA testing, the WPS bit in Status3 was HIGH, so the whole Write Protect Scheme was in Individual Block Locks mode, so now initialize() take care of reseting that.

@LowPowerLab
Copy link
Owner

Thanks much, I need to look into this in more detail!
Can you confirm that apart from mem size, the 128mbit W25Q128 should be equivalent to the 4mbit chip I am officially using (W25X40)?

@martinayotte
Copy link
Author

Hi Felix,
As I said, probably not so clearly, when I try my W25Q128, I was able to retreive ChipID and UniqueID, but trying to write into flash failed. Then, I've added readStatus3(), and I've figured out that WPS bit was high. Reading the datasheet, it was explained that it turns the WriteProtect into mode where Individual Block Lock bits are used. I had to turn it off to have normal mode. So, that means the Initialize() should not only clear Status1, but also Status3.

@martinayotte
Copy link
Author

Hi Felix,
Any news about this PR ?

jedecid |= SPI.transfer(0);
if (jedecid == 0x7F7F) { // The 0x7F7F signature means it is a Cypress/Ramtron chip, the real ID will follow in additionnal bytes
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Device specific logic should be kept out of library code.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, the whole Cypress/Ramtron family is using the 7F7F as a "continuation" ID because the returned ID is in fact 72 bits instead 24 bits like most other chips.

@LowPowerLab
Copy link
Owner

I looked at the code a while ago and I think the conclusion was that because there is device specific code in there, my gut tells me I should not merge that. It's too specific to a particular chip, this is a generic library. An inherited class derivation is more appropriate. If you submit that I can probably merge something like that. Thanks

@martinayotte
Copy link
Author

As mentioned above, the whole Cypress/Ramtron family is using the 7F7F as a "continuation" ID because the returned ID is in fact 72 bits instead 24 bits like most other chips. So, your library will simply not support them ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants