Author Topic: also about the AT45DB161D SPI_EEPROM use!  (Read 9024 times)

Offline tr111

  • Jr. Member
  • **
  • Posts: 72
    • View Profile
also about the AT45DB161D SPI_EEPROM use!
« on: September 20, 2007, 04:28:40 AM »
HELLO:
        In the app_hw_m5223x.h
        #define SPI_FLASH_PAGE_LENGTH 264                                        // standard page size (B-device only allows 256)
//#define SPI_FLASH_PAGE_LENGTH 256                                      // size when power of 2 mode selected (only possible on D-device)
#define SPI_FLASH_BLOCK_LENGTH (8*SPI_FLASH_PAGE_LENGTH)                 // block size - a block can be deleted
#define SPI_FLASH_SECTOR_LENGTH (64*4*SPI_FLASH_PAGE_LENGTH)             // exception sector 0a is 2k and sector 0b is 62k
#define SPI_FLASH_PAGES         1024                                     // 256k part expected
#define SPI_DATA_FLASH_SIZE    (SPI_FLASH_PAGES*SPI_FLASH_PAGE_LENGTH)

I think this is satisfy to AT45DB021:
• Page Program Operation
– Single Cycle Reprogram (Erase and Program)
– 1024 Pages (264 Bytes/Page) Main Memory

if I use the AT45DB161D must be like this
#define SPI_FLASH_PAGE_LENGTH 512                                       // standard page size (B-device only allows 256)
//#define SPI_FLASH_PAGE_LENGTH 256                                      // size when power of 2 mode selected (only possible on D-device)
#define SPI_FLASH_BLOCK_LENGTH (8*SPI_FLASH_PAGE_LENGTH)                 // block size - a block can be deleted
#define SPI_FLASH_SECTOR_LENGTH (64*4*SPI_FLASH_PAGE_LENGTH)             // exception sector 0a is 2k and sector 0b is 62k
#define SPI_FLASH_PAGES         4,096                                     // 256k part expected
#define SPI_DATA_FLASH_SIZE    (SPI_FLASH_PAGES*SPI_FLASH_PAGE_LENGTH)

AT45DB161D:
• User Configurable Page Size
– 512 Bytes per Page
– 528 Bytes per Page
• Page Program Operation
– Intelligent Programming Operation
– 4,096 Pages (512/528 Bytes/Page) Main Memory
• Flexible Erase Options
– Page Erase (512 Bytes)
– Block Erase (4 Kbytes)
– Sector Erase (128 Kbytes)
– Chip Erase (16 Mbits)
• Two SRAM Data Buffers (512/528 Bytes)

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: also about the AT45DB161D SPI_EEPROM use!
« Reply #1 on: September 20, 2007, 06:57:47 AM »
Hi

Yes, this is the way to configure:

For compatibility between B (C) and D device types I would use the following settings
AT45DB011B  #define SPI_FLASH_PAGE_LENGTH 264 / #define SPI_FLASH_PAGES  512
AT45DB021B  #define SPI_FLASH_PAGE_LENGTH 264 / #define SPI_FLASH_PAGES  1024
AT45DB041B/D  #define SPI_FLASH_PAGE_LENGTH 264 / #define SPI_FLASH_PAGES  2048
AT45DB081B  #define SPI_FLASH_PAGE_LENGTH 264 / #define SPI_FLASH_PAGES  4096
AT45DB161D  #define SPI_FLASH_PAGE_LENGTH 528 / #define SPI_FLASH_PAGES  4096
AT45DB321C/D  #define SPI_FLASH_PAGE_LENGTH 528 / #define SPI_FLASH_PAGES  8192
AT45DB641D  #define SPI_FLASH_PAGE_LENGTH 1056 / #define SPI_FLASH_PAGES  8192

The D type devices support extra commands, but also legacy ones to ensure compatibility. They can also be programmed (but not unprogrammed!) to support power-of-two page lengths (256 rather than 264, 512 rather than 528 etc.) but these haven't been used to ensure that all types are interchangeable.

Regards

Mark