This is the mail archive of the mailing list for the eCos project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Atmel DataFlash commands?


I am trying to interface with the Atmel DataFlash AT45DB642D
in the serial mode over the SPI. The current
devs_flash_atmel_dataflash.c states

// Read commands opcodes
#define DF_CONT_ARRAY_READ_CMD              0x68
#define DF_MMEM_PAGE_READ_CMD               0x52
#define DF_BUF1_READ_CMD                    0x54
#define DF_BUF2_READ_CMD                    0x56
#define DF_STATUS_READ_CMD                  0x57

However, these are _not_ what the datasheet of the part
defines and e.g. the DF_CONT_ARRAY_READ_CMD actually
returns wrong data (the bytes returned seem to be shifted
1 bit to the right)

According to the datasheet (and another working source I have
access to) the correct commands in the serial mode are:

#define DF_CONT_ARRAY_READ_CMD              0xe8
#define DF_MMEM_PAGE_READ_CMD               0xd2
#define DF_BUF1_READ_CMD                    0xd4
#define DF_BUF2_READ_CMD                    0xd6
#define DF_STATUS_READ_CMD                  0xd7


I have no access to other hardware using this or any other
DataFlash, so I am not sure whether these defines actually
work on other hardware.

It looks like I am not the only one encountering it - a similar
problem is discussed e.g. at

However, the original commands are not mentioned in the
AT45DB642D datasheet _at_all_, so the Andrew Lunn's advice
to use another SPI mode probably does not apply.

has an interesting comment:

#define ContArrayRead 0x68 // Continuous Array Read (Note : Only A/B-parts supported)

so maybe this is the clue - this is a "D" part.

In the case it matters the hardware is an ERTEC 200 based
board. I am writing the SPI driver myself - I can't
guarantee it works 100%, but the other commands seem
to work.

Right now I just re-#defined the constants if my platform is being
used; however, this should probably be caught generically.


Before posting, please read the FAQ:
and search the list archive:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]