2871 views|4 replies

298

Posts

0

Resources
The OP
 

About the use of memory AT45DB041 [Copy link]

I won't post the code, but will give a brief description of the problem. The code was written by someone else:

The purpose is to write data to a certain block in the memory. Its operation process is: command 0x53 (transfer data in the main memory to the buffer) ------ command 0x84 (write data to the buffer) ------ command 0x88 (transfer data in the buffer to the main memory) ---- command 0x60 (compare data in the main memory with data in the buffer). The problem now is that I don't quite understand the function of the 0x53 command. Can anyone who has used it help me answer this question? What is this command mainly used for?

This post is from stm32/stm8

Latest reply

FLASH must be erased before new data can be written into it!!! AT45DB041 has a command to write data directly to the main memory page through the buffer (with or without self-erasing). The written area has been erased and can be written directly; but if data has been written before, it must be erased before writing data. Before erasing, in order to protect the data in other areas of the page, it is necessary to read the data of this page into the cache area first, then write the new data into the cache area, then erase the main memory page, and finally return the data in the cache area to the main memory page. Let's first understand the principle of FLASH memory.   Details Published on 2020-8-22 09:40
 

234

Posts

0

Resources
2
 
This post was last edited by foxpro2005 on 2020-8-21 21:50

Haha, I wrote this driver code earlier, and I think it is relatively complete.

0x53: Read the data of the FLASH memory main memory page into the FLASH internal buffer area 1

The operation flow of his code is: read (read the main memory page to the cache) - modify (modify the data in the cache) - write (write the data in the cache back to the main memory page) - check (compare the data in the main memory page with the data in the buffer to see if they are consistent)

This post is from stm32/stm8

Comments

ena
Yes, that's the process. But I don't know why we need to read the data from the main storage area into the buffer first. Can't we just write it directly into the buffer?  Details Published on 2020-8-22 08:12
 
 

298

Posts

0

Resources
3
 
foxpro2005 Published on 2020-8-21 21:44 Haha, I wrote this driver code earlier, and I think it is relatively complete 0x53: It is to read the data of the main memory page of the FLASH memory into F ...

Yes, that's the process. But I don't know why we need to read the data from the main storage area into the buffer first. Can't we just write it directly into the buffer?

This post is from stm32/stm8
 
 

234

Posts

0

Resources
4
 

FLASH must be erased before new data can be written into it!!!

AT45DB041 has a command to write data directly to the main memory page through the buffer (with or without self-erasing). The written area has been erased and can be written directly; but if data has been written before, it must be erased before writing data. Before erasing, in order to protect the data in other areas of the page, it is necessary to read the data of this page into the cache area first, then write the new data into the cache area, then erase the main memory page, and finally return the data in the cache area to the main memory page.

Let's first understand the principle of FLASH memory.

This post is from stm32/stm8

Comments

ena
Well, I roughly understand. That is, each time you write, you write by page. In order to avoid erasing the already written part, you first read it into the buffer, reprogram the page in the buffer, and then write it to the main memory. But it is best to write more data at a time without repeated erasing.  Details Published on 2020-8-22 14:27
 
 
 

298

Posts

0

Resources
5
 
foxpro2005 posted on 2020-8-22 09:40 FLASH must be erased before new data can be written into it! ! ! AT45DB041 has a command to write data directly to the main memory page through the buffer ( ...

Well, I roughly understand. That is, each time you write, you write by page. In order to avoid erasing the already written part, you first read it into the buffer, reprogram the page in the buffer, and then write it to the main memory. But it is best to write more data at a time without repeated erasing.

This post is from stm32/stm8
 
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list