Principle of FM24C16 Ferroelectric Memory and Its Application in Multi-MCU System

Publisher:TapirLatest update time:2015-04-16 Source: eechina Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
1. Technical principles, characteristics and applications of ferroelectric memory 
The core technology of ferroelectric memory (FRAM) of Ramtron Corporation in the United States is ferroelectric crystal material. This special material enables ferroelectric memory to have the characteristics of both random access memory (RAM) and non-volatile memory. The working principle of ferroelectric crystal is: when an electric field is added to the ferroelectric crystal material, the central atoms in the crystal will move along the direction of the electric field and reach a stable state. Each free-floating central atom in the crystal has only two stable states, one is recorded as 0 in logic and the other is recorded as 1. The central atom can stay in this state for more than 100 years at room temperature and without an electric field. Ferroelectric memory does not need to be refreshed regularly and can save data when the power is off. Since there is no atomic collision in the entire physical process, ferroelectric memory has the characteristics of high-speed reading and writing, ultra-low power consumption and unlimited writing. Compared with E2PROM, ferroelectric memory has the following advantages:

(1) FRAM can write data at bus speed and does not require any delay after writing, while E2PROM generally needs 5 to 10ms to wait for data to be written after writing;
(2) FRAM has a nearly unlimited write life. Generally, the life of E2PROM is between 100,000 and 1 million write times, while the new generation of ferroelectric memory has reached a write life of 100 million times.
(3) The slow speed and high current writing of E2PROM require 2,500 times more energy than FRAM to write each byte.

Due to the above advantages, FRAM is particularly suitable for those occasions with high requirements for data acquisition and writing time without data loss. Its reliable storage capacity also allows us to safely store some important information in it. Its nearly unlimited write life makes it very suitable as a temporary memory in important systems, used to transmit various data between systems, and for frequent reading and writing of various subsystems. Since the advent of FRAM, it has been widely used in instrumentation, aerospace, industrial control systems, network equipment, ATMs, etc. due to its various advantages.

In the designed carbon control system, due to the high requirements for the timely control of carbon potential, and the system consists of two subsystems, each of which needs to read and write memory frequently, we replaced the original X25045 with FM24C16 to meet the requirements.

2 FM24C16 pin description and working process

The appearance diagram and pin definition of FM24C16-P (8-pin dual in-line) are shown in Figure 1 and Table 1.


FM24C16 is a serial non-volatile memory with a storage capacity of 2 048×8b, divided into 8 pages, 256B per page; the operating voltage is +5V; the interface mode is an industrial standard 2-wire interface: SDA and SCL; the functional operation is similar to the serial E~PROM, with two operating states of read and write, and the read and write timing is similar to the I2C bus.

The write operation of FM24C16 can be divided into two types: byte write and page write. Byte write means writing a single byte each time, and page write can write a whole page (256B) of data at a time. Moreover, since there is no write delay, the data write speed is very fast (usually μs level), especially when writing pages, no data buffering is required, and 256B of data can be written at a time, truly realizing page write, which is something other E2PROMs cannot do, such as AT24C16, which can write up to 16B of data at a time when writing pages.

The write operation sequence of FM24C16 can be divided into the start bit (START), data bit, slave response bit, and stop bit (STOP). Among them, the slave response bit (because FM24C16 is a slave device and MCU is a master device, it is called slave response) is the response signal sent by FM24C16 after receiving each byte of data. It is the only sign to check whether the data is written successfully. The writing process is: MCU sends the start bit through SDA and SCI. Then output the slave device fixed address bit: 1010 from SDA, then output the 3b page selection bit (select which page of FM24C16 to write data to), then output the write control bit 0 (read as 1, write as 0), and then receive the slave response bit from FM24C16. If no slave response is received, exit the operation. After receiving the slave response, MCU serially outputs the 8-bit FM24C16 byte address from SDA to determine the byte unit of the written data, and sends 1b data to FM24C16 after receiving the slave response, and then waits for the slave response signal to confirm that the data is written successfully. If it is a byte write, the MCU sends a stop bit to end the write operation. If it is just a page write, the MCU outputs the second byte data. After FM24C16 determines that the MCU wants to continue writing data, it automatically increases its internal address pointer by 1 and writes the data to the byte unit after the increase, and then gives a slave response. The MCU continues to write data to FM24C16. During the page write operation, when the address pointer reaches the 7FH (page end address) unit, it automatically flips to 00H in the next write cycle, and the written data overwrites the original data of the 00H unit. The

specific write operation timing diagram and the subsequent read operation timing diagram are relatively complicated and are not given here. If necessary, you can log in to the Ramtron company website; http://WWW. Ramtron. com to check the technical information, or log in to its agent website in mainland China: http://WWW. ramtron. com. cn/china/product/data. asp to check

the technical information, or you can imitate the I2C bus timing diagram.

The read operation of FM24C16 is more complicated than the write operation, and can be divided into two types: byte read and page read. Corresponding to byte write and page write, the functions of the two reads are also the difference between single byte and whole page. Another way to divide the read operation is to read immediately and read at will (including continuous read). The difference is that the immediate read is to read the data immediately after writing, while the arbitrary read and continuous read are to read at any time. Therefore, when they operate, pseudo write must be performed first, and then the data is read. The so-called pseudo write refers to the execution of the write operation before writing the data, and its purpose is to determine the byte unit address to be read. The following is an explanation of the operation process of arbitrary read: the write operation is executed before writing the data, that is, after receiving the slave response after the input byte unit address, the MCU sends the start bit, and then sends the slave device fixed address (1010), 3b page selection bit and read control bit 1. After receiving the slave response, the MCU reads 1 B of data from FM24C16. If only 1 B of data is read, the MCU sends a no response signal, and then sends a stop bit to end the read operation. If it is a page read, the MCU will send a master response signal and continue to read the next byte of data until the last byte of data is read. The MCU sends a no response signal and a stop bit to end the read operation.

In the process of reading and writing FM24C16, the following two issues should be noted:

(1) Timing problem, which mainly refers to the timing of the high and low electrons of SDA and SCL. If the timing is incorrect or unstable during the reading and writing process, it will cause reading and writing failures. Therefore, in order to ensure stability, NOP statements can be added to the program to delay appropriately, but not too much, so as not to affect the reading and writing speed.
(2) SDA data can only change when SCL is low. When SCL is high, SDA data must remain unchanged, otherwise it will be mistakenly regarded as a control bit instead of a data bit, resulting in reading and writing failures. [page]

3. Application interface and program

The interface circuit between FM24C16 and the microcontroller is very simple. The following is an example of the application in the carbon control instrument system to explain it and give some subroutines. The application interface diagram is shown in Figure 2. Two AT89C55 microcontrollers are used in the system. Their P2.0 and P2.1 ports are connected to SDA and SCL. 1.8kΩ pull-up resistors are connected to +5V on the SDA and SCL pins. The working power supply is also +5V. The WP pin is connected to the power ground to ensure that data can be written at will. The two AT89C55s use P1.0 and P1.1 as communication ports to determine who operates FM24C16: before chip 1 operates, it detects P1.0 port. If it is high, it sets P1.1 port low and sends a signal to chip 2 to occupy FM24C16. Then it detects P1.0 port again. If it is still high, it enters the operation. If it is low, it exits the operation and sets P1.1 port high. If P1.0 port is low, it means that chip 2 occupies FM24C16, and chip 1 gives up the operation and waits for the next query and operation. The operation of chip 2 corresponds to that of chip 1. In this way, FM24C16 not only serves as a common data area, but also becomes an analog communication port for two MCUs. In theory, one FM24C16 can be connected to many MCUs, and unnecessary communication between MCUs can be omitted. This requires FM24C16 to withstand fast and frequent reading and writing, which is beyond the reach of other E2PROMs.


The following is the FM24C16 page write and arbitrary byte read assembly subroutines. The program has been verified by application and the effect is good (to ensure stability, empty statements can be added in corresponding places to delay).

Page write subroutine:

PAGE-WR: ACALL START_BIT
MOV A, #10100000B
MOV R7, #4
ACALL SHFTO
; SHFTO is a bit-sending subroutine. The above 3 lines send
1010 to FM24C16
MOV A, #20H
MOV R7, #3
ACALL SHFTO
; The above 3 lines determine to write FM24C16 001 page
MOV A, #00H
MOV R7, #1
ACALL SHFTO; The above 3 lines send write control bit 0
ACALL SlAVE_ACK
; SLAVE-ACK is a slave response subroutine. Here, the slave response bit is detected.
MOV
A, #00H
MOV R7, #8
ACALL SHFTO
; The above 3 lines determine that the first address of the written data is 00H
ACALLSLAVE-ACK; Detect the slave response bit MOV R0, #00H; R0 is the first address of the unit where
the written data is located MOV R4, #7FH ; R4 is the number of bytes to be written (currently 256B) NEXT-DATA: MOV A, @R0; Load the first data to be written INC R0; R0 points to the address of the unit where the second data is located MOV R7, #8 ACALL SHFTO; Write data ACALL SLAVE-ACK; Detect slave acknowledgement bit DJNZ R4, NEXT-DATA ; Loop to write the next byte of data ACALL STOP-BIT ; STOP-BIT is the stop bit, ending the write operation (no write delay wait here) RET; Return, program ends Read any address subroutine: SELECT-RD: ACALL START-BIT ACALL START-BIT MOV A, #10100000B MOV R7, #4 ACALL SHFTO MOV A, #20H MOV R7, #3 ACALL SHFTO MOV A, #0FOH MOV R7, #1 ACALL SHFTO ACALL SlAVE-ACK MOV R5, #00H MOV R7, #8 ACALL SHFTO ACALL SlAVE-ACK ; The above is a pseudo write, confirm to read the 001 00H unit data of FM24C16 ACALL START-BIT MOV A, #10100000B MOV R7, #4 ACALL SHFTO MOV A, #20H MOV R7, #3 ACALL SHFTO MOV A, #0FOH MOV R7, #1 ACALL SHFTO ; The above 3 lines send read control bit 1 ACALL SlAVE-ACK MOV R5, #00H ; Clear R5 to store the read data MOV R7, #8 ; R7 is used as the read bit counter CLOCK8: SETB SCL MOV C, SDA CLR SCL MOV A, R5  RLC A MOV R5, A ; The above 6 lines read the 1 bit sent by FM24C16 DJNZ R7, CLOCK8 ; Loop to read 1B data ACALL NO_ACK ; NO_ACK means no response is needed. Subroutine ACLL STOP_BIT ; Stop RET ; Program ends

























































Reference address:Principle of FM24C16 Ferroelectric Memory and Its Application in Multi-MCU System

Previous article:Application of C8051F020 single chip microcomputer in online automatic analyzer of total phosphorus
Next article:Controlling Samsung 320×240 LCD module with 80C31 and SED1335

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号