AVR闪存读写

AVR flash memory reading and writing

我不了解有关 AVR 中闪存访问的一件基本事情。 正如数据表所说,闪存页面由 atmega16 的 64 个字组成,共有 128 页。因为它有 16kbytes 的闪存,所以很容易得到字大小为 2 字节,页面大小为 128 字节。

嗯..在Spi编程模式下有load和write指令。首先,它们之间有什么区别?

第二个问题是关于加载内存页面指令。有两条指令:一条用于低字节,一条用于高字节。我们必须发送四个字节:命令标识字节(如果我可以这样称呼的话)、地址的 MSB、地址的 LSB 和数据字节。问题到底是这些指令的作用是什么?虽然我们加载的页面由128字节组成,但这里的高字节和低字节是什么?

Well.. In Spi programming mode there are load and write instructions. First of all, what is the difference between them?

您可能不知道 "Page Buffer"。要将新数据写入页面,必须先填充页面缓冲区。它有一个临时页面,必须逐字填写。 -> 加载指令

一次操作将缓冲区复制到闪存。 -> 写入指令

And the second question is about load memory page instructions. There are two instructions: one for low byte and one for high. We have to send four bytes: command identification byte(if I can call it so), MSB of the address, LSB of the address and data byte. Question exactly is what do that instructions do? What are high and low bytes here although we load page which consists from 128 bytes?

它指的是加载到页面缓冲区的每个字的低字节和高字节。