Common memory STM32-

Memory species

The memory is an important part of the computer architecture. The memory is used to store program code and data parts, with the memory of the computer that has the memory function. The basic memory type shown in Figure 22-1.

5d306ab46849644234
The memory storage medium according to their characteristics are divided into "volatile memory" and "nonvolatile memory" two categories. Wherein "volatile / nonvolatile" refers to the memory backup, it stores the data contents will be lost if characteristics. Since the access speed is generally a volatile memory, nonvolatile memory and long-term storage of data, which occupy an important role in the computer. The most typical volatile memory is represented in the computer memory, the representative of the non-volatile memory is a hard disk.

RAM memory

RAM is a "Random Access Memory" abbreviation is translated into a random access memory. The so-called "random access" means that when the memory is read or written message, the time required regardless of the position of this information is located. The origin of the word has been used since the early computer memory as a drum, the drum is sequential read and write device, and the RAM can be read with any address of the internal data, the time is the same, hence the name. In fact, now it has been exclusively used to refer to RAM volatile semiconductor memory as a computer memory. The storage mechanism of RAM, divided into dynamic random access memory DRAM (Dynamic RAM) and a static random access memory SRAM (Static RAM) two kinds.

DRAM

Dynamic random access memory DRAM memory cell capacitor to charge to represent data, the charge represents 1, uncharged represents 0, Figure 22-2. But over time, representative of a capacitance discharge, the capacitor will absorb the charge represents 0, so it requires periodic refresh operations, which is the word "Dynamic (the Dynamic)" describe the characteristics. Capacitance refresh operation will check if the power is greater than 1/2 of the full amount, that its representatives 1, and the capacitor is fully charged; if the level is less than 1/2, it is considered representative of 0, and the capacitor discharge, whereby to ensure the accuracy of the data.

5d306abdee72f68354

SDRAM

According to DRAM means of communication, is divided into synchronous and asynchronous, according to these two methods to use when communicating the need to distinguish between the clock signal. Figure 22-3 is a communication timing synchronization with a clock, which indicates valid data on the rising edge of the clock.

5d306acf3f6a112683

由于使用时钟同步的通讯速度更快,所以同步 DRAM 使用更为广泛,这种 DRAM 被称为 SDRAM(Synchronous DRAM)。

DDR SDRAM

为了进一步提高 SDRAM 的通讯速度,人们设计了 DDR SDRAM 存储器(Double Data Rate SDRAM)。它的存储特性与 SDRAM 没有区别,但 SDRAM 只在上升沿表示有效数据,在 1 个时钟周期内,只能表示 1 个有效数据;而 DDR SDRAM 在时钟的上升沿及下降沿各表示一个数据,也就是说在 1 个时钟周期内可以表示 2 数据,在时钟频率同样的情况下,提高了一倍的速度。至于 DDRII 和 DDRIII,它们的通讯方式并没有区别,主要是通讯同步时钟的频率提高了。

当前个人计算机常用的内存条是 DDRIII SDRAM 存储器,在一个内存条上包含多个DDRIII SDRAM 芯片。

SRAM

静态随机存储器 SRAM 的存储单元以锁存器来存储数据,见图 22-4。这种电路结构不需要定时刷新充电,就能保持状态(当然,如果断电了,数据还是会丢失的),所以这种存储器被称为“静态(Static)” RAM。

5d306b05ecdd469068

同样地, SRAM 根据其通讯方式也分为同步(SSRAM)和异步 SRAM, 相对来说,异步SRAM 用得较多。

DRAM与SRAM的应用场合

对比 DRAM 与 SRAM 的结构,可知 DRAM 的结构简单得多,所以生产相同容量的存储器, DRAM 的成本要更低,且集成度更高。而 DRAM 中的电容结构则决定了它的存取速度不如 SRAM,特性对比见表 22-1。

5d306b13eb08836356

所以在实际应用场合中, SRAM 一般只用于 CPU 内部的高速缓存(Cache),而外部扩展的内存一般使用 DRAM。

非易失性存储器

非易失性存储器种类非常多,半导体类的有 ROM 和 FLASH,而其它的则包括光盘、软盘及机械硬盘。

ROM存储器

ROM 是“Read Only Memory”的缩写,意为只能读的存储器。由于技术的发展,后来设计出了可以方便写入数据的 ROM,而这个“Read Only Memory”的名称被沿用下来了,现在一般用于指代非易失性半导体存储器,包括后面介绍的 FLASH 存储器,有些人也把它归到 ROM 类里边。

MASK ROM

MASK(掩膜) ROM 就是正宗的“Read Only Memory”,存储在它内部的数据是在出厂时使用特殊工艺固化的,生产后就不可修改,其主要优势是大批量生产时成本低。当前在生产量大,数据不需要修改的场合,还有应用。

OTPROM

OTPROM(One Time Programable ROM)是一次可编程存储器。这种存储器出厂时内部并没有资料,用户可以使用专用的编程器将自己的资料写入,但只能写入一次,被写入过后,它的内容也不可再修改。在 NXP 公司生产的控制器芯片中常使用 OTPROM 来存储密钥; STM32F429 系列的芯片内部也包含有一部分的 OTPROM 空间。

EPROM

EPROM(Erasable Programmable ROM)是可重复擦写的存储器,它解决了 PROM 芯片只能写入一次的问题。这种存储器使用紫外线照射芯片内部擦除数据,擦除和写入都要专用的设备。现在这种存储器基本淘汰,被 EEPROM 取代。

EEPROM

EEPROM(Electrically Erasable Programmable ROM)是电可擦除存储器。 EEPROM 可以重复擦写,它的擦除和写入都是直接使用电路控制,不需要再使用外部设备来擦写。而且可以按字节为单位修改 数据,无需整个 芯片擦除。现在 主要使用的 ROM 芯片都是EEPROM。

FLASH存储器

FLASH 存储器又称为闪存,它也是可重复擦写的储器,部分书籍会把 FLASH 存储器称为 FLASH ROM,但它的容量一般比 EEPROM 大得多,且在擦除时,一般以多个字节为单位。如有的 FLASH 存储器以 4096 个字节为扇区,最小的擦除单位为一个扇区。根据存储单元电路的不同, FLASH 存储器又分为 NOR FLASH 和 NAND FLASH,见表 22-2。

5d306b2cd5b0f40685

NOR 与 NAND 的共性是在数据写入前都需要有擦除操作,而擦除操作一般是以“扇区/块”为单位的。而 NOR 与 NAND 特性的差别,主要是由于其内部“地址/数据线”是否分开导致的。

由于 NOR 的地址线和数据线分开,它可以按“字节”读写数据,符合 CPU 的指令译码执行要求,所以假如 NOR 上存储了代码指令, CPU 给 NOR 一个地址, NOR 就能向CPU 返回一个数据让 CPU 执行,中间不需要额外的处理操作。

而由于 NAND 的数据和地址线共用,只能按“块”来读写数据,假如 NAND 上存储了代码指令, CPU 给 NAND 地址后,它无法直接返回该地址的数据,所以不符合指令译码要求。 表 22-2 中的最后一项“是否支持 XIP”描述的就是这种立即执行的特性(eXecute InPlace)

若代码存储在 NAND 上,可以把它先加载到 RAM 存储器上,再由 CPU 执行。所以在功能上可以认为 NOR 是一种断电后数据不丢失的 RAM,但它的擦除单位与 RAM 有区别,且读写速度比 RAM 要慢得多。

另外, FLASH 的擦除次数都是有限的(现在普遍是 10 万次左右),当它的使用接近寿命的时候,可能会出现写操作失败。由于 NAND 通常是整块擦写,块内有一位失效整个块就会失效,这被称为坏块,而且由于擦写过程复杂,从整体来说 NOR 块块更少,寿命更长。由于可能存在坏块,所以 FLASH 存储器需要“探测/错误更正(EDC/ECC)”算法来确保数据的正确性。

Since the difference between the two characteristics of the FLASH memory, the NOR FLASH code memory generally used in applications, such as embedded controllers internal program memory space. The NAND FLASH general application in a large amount of data storage applications, including SD card, U disk and solid state drives, are NAND FLASH type.

How will RAM, EEPROM, FLASH memory for the present examples to explain the tutorial.

Guess you like

Origin www.cnblogs.com/luoxiao23/p/11209911.html