Source: Technology Makes Dreams GreaterCompiled by: Li XiaoyaoA few days ago, I happened to discuss some knowledge about ROM, RAM, and FLASH with my colleagues. Suddenly, when we talked about these English terms, we realized our understanding was quite superficial. Among us, the meanings of some MCU terms were also unclear, so tonight I will compile knowledge in this area. ROM and RAM refer to semiconductor memory. ROM stands for Read Only Memory, while RAM stands for Random Access Memory. ROM can retain data even when the system is powered off, while RAM typically loses data after power loss; a typical example of RAM is the computer’s memory. There are two main types of RAM: one is called Static RAM (SRAM), which is very fast and currently the fastest storage device for reading and writing, but it is also very expensive, so it is only used in demanding situations, such as CPU Level 1 and Level 2 caches. The other type is Dynamic RAM (DRAM), which retains data for a short time and is slower than SRAM. However, it is still faster than any ROM, and in terms of price, DRAM is much cheaper than SRAM. Computer memory is DRAM. There are many types of DRAM, the most common being FPRAM/FastPage, EDORAM, SDRAM, DDR RAM, RDRAM, SGRAM, and WRAM. Here, I will introduce one type: DDR RAM. DDR RAM (Double Data Rate RAM) is also known as DDR SDRAM. This improved type of RAM is basically the same as SDRAM, except that it can read and write data twice per clock cycle, effectively doubling the data transfer speed. This is currently the most widely used memory in computers, and it has a cost advantage, having effectively defeated Intel’s other memory standard, Rambus DRAM. Many high-end graphics cards also come equipped with high-speed DDR RAM to increase bandwidth, significantly enhancing the pixel rendering capability of 3D acceleration cards. Memory Working Principle:Memory is used to store data and programs that are currently in use (i.e., being executed). The computer memory we usually refer to is dynamic memory (i.e., DRAM). The term ‘dynamic’ in dynamic memory indicates that when we write data to DRAM, after a certain time, the data will be lost. Therefore, an additional circuit is needed for memory refresh operations. The specific working process is as follows: a DRAM storage unit stores either 0 or 1 depending on whether the capacitor has a charge. A charged capacitor represents 1, while an uncharged capacitor represents 0. However, over time, the charged capacitor will discharge, and the uncharged capacitor will absorb charge, which is the reason for data loss; refresh operations periodically check the capacitors. If the charge is greater than half of the full charge, it is considered to represent 1, and the capacitor is fully charged; if the charge is less than half, it is considered to represent 0, and the capacitor is discharged, thus maintaining data continuity. There are many types of ROM as well. PROM is programmable ROM. The difference between PROM and EPROM (Erasable Programmable ROM) is that PROM is one-time programmable, meaning once the software is burned into it, it cannot be modified. This was an early product and is no longer in use. EPROM can be erased with ultraviolet light, making it a universal storage medium. Another type, EEPROM, is erased electronically, is very expensive, has a long write time, and writes slowly. For example, mobile phone software is generally stored in EEPROM. When we make a call, the last dialed numbers are temporarily stored in SRAM, not immediately written to the call log (which is stored in EEPROM) because there is an important task (the call) to perform. If it were to write immediately, the long wait would be unbearable for the user. FLASH memory, also known as flash storage, combines the advantages of both ROM and RAM. It not only possesses the characteristics of electrically erasable programmable (EEPROM) but also retains data without power loss while allowing for fast data reading (the advantage of NVRAM). U-disks and MP3 players use this type of storage. Over the past 20 years, embedded systems have used ROM (EPROM) as their storage device. However, in recent years, Flash has completely replaced ROM (EPROM) in embedded systems, serving as storage for Bootloaders, operating systems, program codes, or directly as hard drives (U-disks). Currently, Flash mainly consists of two types: NOR Flash and NAND Flash. NOR Flash’s reading is similar to that of commonly used SDRAM; users can directly run the code loaded in NOR FLASH, which can reduce the capacity of SRAM and thus save costs. NAND Flash does not adopt random access memory reading technology; its reading is conducted in blocks, usually reading 512 bytes at a time. Flash using this technology is relatively inexpensive. Users cannot run code directly from NAND Flash, so many development boards that use NAND Flash also include a small NOR Flash to run the boot code. Generally, small capacities use NOR Flash due to its fast reading speed, often used to store important information such as operating systems, while large capacities use NAND FLASH. The most common applications of NAND FLASH are DOC (Disk On Chip) used in embedded systems and the ‘flash drives’ we typically use, which can be erased online. Currently, the major suppliers of FLASH are Intel, AMD, Fujitsu, and Toshiba, while the main manufacturers of NAND Flash are Samsung and Toshiba.NAND Flash vs. NOR Flash ComparisonNOR and NAND are the two main types of non-volatile flash memory technology on the market today. Intel first developed NOR flash technology in 1988, fundamentally changing the previous monopoly of EPROM and EEPROM. Shortly after, in 19***, Toshiba introduced NAND flash architecture, emphasizing lower cost per bit, higher performance, and easy upgrades through interfaces like disks. However, after more than a decade, many hardware engineers still cannot distinguish between NOR and NAND flash. The term ‘flash memory’ is often interchangeable with ‘NOR memory’. Many industry professionals are unclear about the advantages of NAND flash technology over NOR technology, as in many cases flash memory is only used to store a small amount of code, making NOR flash more suitable. NAND is, however, an ideal solution for high data storage density. NOR is currently the main non-volatile flash memory technology on the market. NOR is generally only used to store small amounts of code; it is mainly applied in code storage media. NOR’s characteristics include simplicity of application, no need for specialized interface circuits, and high transfer efficiency. It belongs to chip-in-execution (XIP, eXecute In Place), allowing applications to run directly in (NOR type) flash memory without needing to read the code into system RAM. It has high cost-effectiveness for small capacities of 1-4MB, but its low write and erase speeds significantly affect its performance. NOR flash has an SRAM interface with enough address pins for easy access to each byte internally. NAND structure can provide extremely high unit density, achieving high storage density with fast write and erase speeds. The difficulty of using NAND lies in flash management and the need for special system interfaces.1. Performance Comparison:Flash memory is non-volatile storage, and it can be erased and reprogrammed in memory units called blocks. Any write operation on a flash device can only occur in empty or erased units, so in most cases, an erase operation must be performed before writing. NAND devices perform erase operations very easily, while NOR requires that all bits in the target block be set to 1 before erasing. Since NOR devices are erased in blocks of 64-128KB, the time to perform a write/erase operation is 5 seconds. In contrast, NAND devices are erased in blocks of 8-32KB, and performing the same operation takes at most 4ms. The difference in block size during erase operations further widens the performance gap between NOR and NAND. Statistics indicate that for a given set of write operations (especially when updating small files), more erase operations must occur in NOR-based units. Thus, when selecting a storage solution, designers must weigh the following factors: ● NOR has a slightly faster read speed than NAND. ● NAND’s write speed is much faster than NOR. ● NAND’s 4ms erase speed is much faster than NOR’s 5 seconds. ● Most write operations require a prior erase operation. ● NAND’s erase units are smaller, resulting in fewer erase circuits. (Note: The erase time for NOR FLASH SECTOR varies by brand and size; for example, a 4M FLASH may have a SECTOR erase time of 60ms, while others may take up to 6 seconds.)2. Interface Differences:NOR flash has an SRAM interface with enough address pins for easy access to each byte internally. NAND devices use complex I/O ports to serially access data, and the methods may vary by product or manufacturer. Eight pins are used to transmit control, address, and data information. NAND read and write operations use 512-byte blocks, akin to how hard disks manage such operations. Naturally, NAND-based storage can replace hard disks or other block devices.3. Capacity and Cost:NAND flash’s unit size is almost half that of NOR devices. Due to a simpler manufacturing process, NAND structures can offer higher capacity within a given mold size, thereby reducing prices. NOR flash occupies a large portion of the 1-16MB flash memory market, while NAND flash is only used in products ranging from 8-128MB, indicating that NOR is mainly applied in code storage media, while NAND is suitable for data storage, with NAND dominating the market of CompactFlash, Secure Digital, PC Cards, and MMC storage cards.4. Reliability and Durability:When using flash media, a critical consideration is reliability. For systems that require extended MTBF, Flash is a very suitable storage solution. Reliability can be compared from three aspects: lifespan (durability), bit swapping, and bad block handling. A) Lifespan (Durability): In NAND flash, the maximum erase cycles for each block is one million, while NOR’s erase cycles are one hundred thousand. NAND memory has a 10:1 block erase cycle advantage, and the typical NAND block size is eight times smaller than NOR devices, resulting in fewer deletions over a given time. B) Bit Swapping: All flash devices are affected by bit swapping phenomena. In rare cases (more frequent in NAND than NOR), a bit may flip or be reported as flipped. A bit change may not be very noticeable, but if it occurs in a critical file, this small fault may cause system downtime. If just reported as problematic, reading multiple times may resolve it. However, if the bit truly changes, error detection/correction (EDC/ECC) algorithms must be employed. Bit reversal issues are more common in NAND flash, and NAND vendors recommend using EDC/ECC algorithms when using NAND flash. This issue is not critical when using NAND for multimedia information storage. However, when using local storage devices to store operating systems, configuration files, or other sensitive information, EDC/ECC systems must be used to ensure reliability. C) Bad Block Handling: Bad blocks in NAND devices are randomly distributed. Previous efforts to eliminate bad blocks have proven impractical due to low yield and high costs. NAND devices require an initialization scan of the medium to detect bad blocks and mark them as unusable. In manufactured devices, if this processing cannot be reliably performed, it will lead to a high failure rate.5. Ease of Use:Using NOR-based flash is straightforward; it can be connected like other memory and code can be run directly on it. NAND is much more complex due to the need for I/O interfaces. Access methods for various NAND devices may differ by manufacturer. When using NAND devices, a driver must be written before proceeding with other operations. Writing information to NAND devices requires considerable skill, as designers must never write to bad blocks, meaning virtual mapping must be performed throughout the NAND device.6. Software Support:When discussing software support, it is important to differentiate between basic read/write/erase operations and higher-level software for disk emulation and flash management algorithms, including performance optimization. Running code on NOR devices does not require any software support, while performing the same operation on NAND devices typically requires a driver, specifically a Memory Technology Driver (MTD). Both NAND and NOR devices require MTD during write and erase operations. The MTD required for NOR devices is relatively fewer, and many manufacturers provide more advanced software for NOR devices, including M-System’s TrueFFS driver, which is adopted by companies such as Wind River System, Microsoft, QNX Software System, Symbian, and Intel. The driver is also used for emulating DiskOnChip products and managing NAND flash, including error correction, bad block handling, and wear leveling. The main suppliers of NOR FLASH are INTEL, MICRO, and other companies, which were once mainstream products but are now facing tough competition from NAND FLASH. Its advantage is that programs can be run directly from FLASH, but the process is complex and expensive. The main suppliers of NAND FLASH are SAMSUNG and Toshiba, used in U-disks, various storage cards, and MP3 players. Due to differences in manufacturing processes, it has a larger storage capacity than NOR FLASH and is cheaper. However, it also has drawbacks, such as the inability to address and run programs directly, only being able to store data. Additionally, NAND FLASH is prone to bad sectors, necessitating error-checking algorithms. In handheld devices, NAND FLASH is used to store data and programs, but NOR FLASH must be present to boot. Except for SAMSUNG processors, other mainstream processors used in handheld devices do not support direct program booting from NAND FLASH. Therefore, a small NOR FLASH is required to boot the machine and load the OS and other software from NAND FLASH into SDRAM for execution, which is quite cumbersome. DRAM utilizes the charge on the gate capacitance of MOS transistors to store information. Once power is lost, all information is lost because the gate will leak electricity. Therefore, a refresh mechanism is needed to supplement the charge to these gate capacitors periodically, and after each data read, the charge must also be replenished. This is called dynamic refresh, hence the name dynamic random access memory. Since it only uses one MOS transistor to store information, it can achieve high integration and large capacity. SDRAM adds synchronization with the CPU clock. SRAM uses registers to store information, so once the power is lost, all data is lost. As long as power is supplied, its data will persist without needing dynamic refresh, hence it is called static random access memory. The above are mainly used for system memory, with large capacities that do not need to retain data after power loss. Flash ROM uses the charge stored on a floating gate to retain information. Because the floating gate does not leak electricity, information can still be retained after power loss. Its simple structure allows for high integration and large capacity. Flash ROM requires electrical erasure before writing, and unlike EEPROM, which can be erased byte by byte, flash ROM can only be erased in sectors. However, it can be written byte by byte. Flash ROM is mainly used in BIOS, U-disks, MP3 players, and other devices that require large capacity and data retention after power loss.PSRAM, Pseudo-Static Random Access Memory.Background: PSRAM has a single transistor DRAM storage cell, which is significantly different from traditional SRAM cells that have six transistors or four transistors with two load resistors. However, it has a stable interface similar to SRAM, and the internal DRAM architecture gives PSRAM some advantages over low-power 6T SRAM, such as being more compact and competitively priced. Currently, 90% of manufacturers in the overall SRAM market produce PSRAM components. In the past two years, major SRAM/PSRAM suppliers in the market include Samsung, Cypress, Renesas, Micron, and Toshiba.Basic Principle: PSRAM is pseudo-SRAM, with internal memory particles similar to SDRAM particles, but with an external interface similar to SRAM, requiring no complex controller and refresh mechanism like SDRAM. The interface of PSRAM is the same as that of SRAM. PSRAM capacities include 8Mbit, 16Mbit, 32Mbit, etc. While its capacity is not as high as SDRAM, it is certainly much higher than that of SRAM. The speed supports burst mode and is not very slow. Manufacturers such as Hynix, Coremagic, WINBOND, MICRON, and others supply it, and its price is slightly higher than SDRAM of the same capacity but much cheaper than SRAM. PSRAM is primarily used in mobile phones, electronic dictionaries, handheld computers, PDAs, PMP, MP3/4 players, GPS receivers, and other consumer electronics. Compared to SRAM (which uses 6T technology), PSRAM uses 1T+1C technology, making it smaller in size, while its I/O interface is the same as that of SRAM. In terms of capacity, it currently has 4MB, 8MB, 16MB, 32MB, 64MB, and 128MB. Compared to SDRAM, PSRAM has much lower power consumption. Therefore, it is an ideal choice for many portable products that require a certain cache capacity. Excerpted from the Internet. Of course, the classifications of ROM and RAM are not limited to these few types. For a comprehensive understanding of the differences among RAM, ROM, and FLASH storage, please refer to this document; Summary of Differences Between RAM or ROM and FLASH Storage. This also reminds me of some relevant information about the MPC5607B chip, which can be found in Baidu Cloud sharing. Lastly, I suddenly thought of System on a Chip (SoC): System on a Chip refers to a technology that integrates a complete system on a single chip, packaging all or part of the necessary electronic circuits. A complete system generally includes a central processing unit (CPU), memory, and peripheral circuits. SoC is developed in parallel with other technologies, such as Silicon On Insulator (SOI), which can provide enhanced clock frequency, thereby reducing the power consumption of microchips. System on a chip technology is typically applied to small, increasingly complex consumer electronic devices. For example, the system on a chip for audio detection devices provides all users with audio receivers, analog-to-digital converters (ADC), microprocessors, necessary memory, and input/output logic control on a single chip. Additionally, system chips are also applied in single-chip wireless products, such as Bluetooth devices, single-chip WLAN, and cellular phone solutions. Due to unprecedented high integration performance, system on a chip is a major solution to replace integrated circuits. SoC has become an inevitable trend in the current development of microelectronic chips.Welcome to Angel Round and A Round Enterprises to Join the Group (As long as the automotive technology is strong enough, friendly connections with over 500 automotive investment institutions, including top institutions; have completed multiple enterprises); There are dozens of groups related to automotive complete vehicles, automotive semiconductors, key components, new energy vehicles, intelligent connected vehicles, aftermarket, automotive investment, autonomous driving, vehicle networking, etc. Please scan the admin’s WeChat to join the group (Please indicate your company name)