I have working code for the dataflash on the xplain (AT45DB642D). I’ve done some minimal read write tests, but i /think/ it works… caveat emptor. Reading and writing to the 2 buffers, as well as direct flash access has been tested (writing buffer->flash with both auto and explicit erase, reading in high and low speed stream mode). I haven’t implemented all of the possible ways to access the device, just the major ones. Only page at a time erase, no security/locking support. Support for entering and resuming from low power mode is implemented.
Unfortunately, the spi interface on the ATXMEGA128A1 only goes up to 16 MHz, so I can’t test the flash at full speed, as it is supposed to work at up to 66 MHz or so. Takes a couple minutes to do a full read/write/scrub byte-by-byte test, not too bad. Might do some datalogging stuff soon.
Next up: the sdram!
The code:
dataflash.cc
dataflash.hpp
Note that the code uses some other SPI and initialization code I wrote, I might post all the code together later, once more of it is written.