Dataflash by ATmega8


Hi….

last year I need a storage by a little capacity. I have to use of 24c512 but this chip don’t have i2c adress pin!! And I have to for my project used of 2 th of this chip. So I used another chip like "Dataflash". There is a sample in Atmel website by name "SoundRecorder" . you can download Here.

This project is write in c language . but my project was designed in basic(Bascom).!!

I write a sample code for dataflash "45db161" have 2megabyte capacity.

Sample picture of my dataflash project

For this project you need a 3.7v power supply that prepared by LM317 regulator. So you need MAX232 for connect uart to pc .my AVR chip project is Mega8 that you can program on any Avr chip have 2kbyte rom. In bascom spi hardware don’t work correct, so I have to software spi ,but the software spi configure have low speed into hardware spi. :-(

Descriebtion:

At45db161b have 17 sector (0-16) , sector 0 have 8 page and equal by a Block.

Sector 1 have 32 Block and 248 page. Each one of sector s (Sector 2 to sector 16) have 256 page .

In additional At45db161b has 512(0-511) blocks. Please see below image.



Advanced In dataflash, for more speed this chip have 2 puffer for read & write!! So supported 4 mode program spi for read\write ….. while you are programing the memory, you must always checking the "status register " to great the operate is complete.

Sample Schematic of DataFlash & AVR

This schematic is a sample and designed in proteuse . in proteuse At45db161b not define. I used of spi debugger.

You can download Source code And Schematic Here.