-
Notifications
You must be signed in to change notification settings - Fork 14
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
Read status register command not working with Mega2650 #22
Comments
Weird... |
No it doesn't. I'd like to use this lib on a SAMD11 board now, but it gives the compiler error: `C:\Program Files (x86)\Arduino\libraries\DataFlash\DataFlash.cpp: In member function 'void DataFlash::setup(int8_t, int8_t, int8_t)': C:\Program Files (x86)\Arduino\libraries\DataFlash\DataFlash.cpp:152:15: error: 'SPSR' was not declared in this scope
Should this lib work with the SAMD11? If not can it be modified to do so? If you want I make this as a different issue. |
I am using the Beta core from MattairTech: https://github.com/mattairtech/ArduinoCore-samd https://www.mattairtech.com/software/arduino/beta/package_MattairTech_index.json |
I think the problem may be with the definition of SPI_2XCLOCK_MASK, I found it in Arduino file SPI.h:
|
SPSR, SPCR are AVR registers.. They doesn't seem to be used. I also realized that the SPI interface has changed... |
Should this library work for the ARM SAMD11? |
Yes if the Arduino SDK was ported. |
MooZ,
I have been working with the AT45DB011D which you helped me adapt the library to use. I found that the Write Protect pin does not protect the chip unless the Sector Protection Register has been enabled. However, I don't see commands for that within your library. Are these commands available? If not, can you add them?
Sincerely,
Stephen
…________________________________
From: MooZ <[email protected]>
Sent: Monday, September 18, 2017 3:23 PM
To: BlockoS/arduino-dataflash
Cc: perigalacticon; Author
Subject: Re: [BlockoS/arduino-dataflash] Read status register command not working with Mega2650 (#22)
Yes if the Arduino SDK was ported.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#22 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AETnkmdudQrWdqADjGv5ouRPfmG4bqFMks5sjsMcgaJpZM4PYM-8>.
|
Yes I can do it :) |
Hey Mooz, is there any chance you can do this soon, as I'm building a project for halloween?
I'm using the AT45DB321D
…________________________________
From: MooZ <[email protected]>
Sent: Monday, October 16, 2017 2:57 AM
To: BlockoS/arduino-dataflash
Cc: perigalacticon; Author
Subject: Re: [BlockoS/arduino-dataflash] Read status register command not working with Mega2650 (#22)
Yes I can do it :)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#22 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AETnkgysU7jrwN01BelMyjByKrN5haWWks5ssv5rgaJpZM4PYM-8>.
|
Ok. I'll try to finish it for tomorrow |
Done! Well more or less (not happy with the API and comments are missing). DataFlash::SectorProtectionStatus protection;
uint8_t sectorCount;
// Protect only sector 2.
protection.set(2, true);
// Enable sector protection.
dataflash.enableSectorProtection();
// Set sector protection register.
dataflash.programSectorProtectionRegister(protection);
// Sector 2 is now protected.
// Sectors are not protected anymore.
dataflash.disableSectorProtection(); I also need to add a method to compute the first and last page index of a given sector. |
Thanks!
I'll give it a try tonight.
…________________________________
From: MooZ <[email protected]>
Sent: Monday, October 23, 2017 5:30 PM
To: BlockoS/arduino-dataflash
Cc: perigalacticon; Author
Subject: Re: [BlockoS/arduino-dataflash] Read status register command not working with Mega2650 (#22)
Done! Well more or less (not happy with the API and comments are missing).
You can find an example in examples/sectorProtection/sectorProtection.pde
Anyway here's a short example.
DataFlash::SectorProtectionStatus protection;
uint8_t sectorCount;
// Protect only sector 2.
protection.set(2, true);
// Enable sector protection.
dataflash.enableSectorProtection();
// Set sector protection register.
dataflash.programSectorProtectionRegister(protection);
// Sector 2 is now protected.
// Sectors are not protected anymore.
dataflash.disableSectorProtection();
I also need to add a method to compute the first and last page index of a given sector.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#22 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AETnki7ihyLAYYbR8DTFxZNlRBX98Q0zks5svQV5gaJpZM4PYM-8>.
|
I've used the library with a AT45DB011D and an Uno successfully, but when using with a Mega2650 I get nothing returned from the read status register command. I found I have to use a CS pin other than the Mega2650 SPI SS pin which is pin 53.
The text was updated successfully, but these errors were encountered: