Open perigalacticon opened 7 years ago
Weird... Does it have a 5V/3.3V switch? If so, make sure it's on 3.3V.
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
m_SPSR = (SPSR & SPI_2XCLOCK_MASK);
^`
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: https://github.com/arduino/Arduino/blob/master/hardware/arduino/avr/libraries/SPI/src/SPI.h
`
`
SPSR, SPCR are AVR registers.. They doesn't seem to be used. You may remove m_SPSR and m_SPCR.
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 notifications@github.com 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 GitHubhttps://github.com/BlockoS/arduino-dataflash/issues/22#issuecomment-330329226, or mute the threadhttps://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 notifications@github.com 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 GitHubhttps://github.com/BlockoS/arduino-dataflash/issues/22#issuecomment-336796725, or mute the threadhttps://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). 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.
Thanks!
I'll give it a try tonight.
From: MooZ notifications@github.com 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 GitHubhttps://github.com/BlockoS/arduino-dataflash/issues/22#issuecomment-338802749, or mute the threadhttps://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.