Menu English Ukrainian russian Home

Free technical library for hobbyists and professionals Free technical library


ENCYCLOPEDIA OF RADIO ELECTRONICS AND ELECTRICAL ENGINEERING
Free library / Schemes of radio-electronic and electrical devices

Programming FLASH-memory chips. Encyclopedia of radio electronics and electrical engineering

Free technical library

Encyclopedia of radio electronics and electrical engineering / Microcontrollers

Comments on the article Comments on the article

Reprogrammable permanent memory microcircuits with electrical data erasure, made using FLASH technology, have taken a strong position in electronic and computer technology, displacing other types of non-volatile storage devices. Their main advantage is the possibility of reprogramming "in the system" without unsoldering the chip from the printed circuit board or removing it from the panel. A large allowable number of reprogramming cycles makes it possible to build "FLASH-disks" with a volume of tens of megabytes on such microcircuits, which differ from conventional hard or floppy disk drives in the complete absence of moving parts. As a result, they are durable and able to operate in high vibration environments such as vehicles and other moving objects. The published article is devoted to the programming of FLASH-memory chips.

FLASH-memory chips differ from other types of ROMs by the presence of a built-in "programmer" directly on the chip - an erasing and writing machine (AC3). It eliminates the need in the programming process to apply increased voltage to the microcircuit outputs, to form certain sequences of pulses. AC3 does all this independently and imperceptibly for the user, who only needs to report the address of the cell and the code that should be written into it using the appropriate command, and wait for the operation to complete. In many cases, a lengthy operation (such as erasing a block of data) can be paused, read the desired information from another area of ​​memory, and then continue.

Today, many companies (the most famous are Intel, AMD, Atmel, Winbond) produce a wide range of FLASH memory chips up to 4 MB. Their external interface is either parallel or serial. Chips with a serial interface are mainly intended for storing small amounts of data in small-sized or specialized devices, for example, for storing fixed settings for a radio receiver or a program for operating a household appliance.

Next, we will talk about "parallel" FLASH microcircuits, which, in terms of the physical and logical device of the interface with the processor, do not differ in any way from conventional ROMs, except that they, like RAM, have a write enable input. It is in these microcircuits that the BIOS codes of modern computers are stored. Data organization is either eight or 16 bits. Often it can be chosen by connecting a specially provided output to a common wire or power source. In addition to the address and data buses, three control signals are supplied to the microcircuits: crystal select (CE), output enable (OE), and write enable (WE). The latter - only if the chip needs to be programmed. The minimum duration of the read cycle is 70... 150 ns.

In the first FLASH microcircuits, the array of memory cells was a single block, and data could only be erased entirely from the entire array. In many modern microcircuits, memory is divided into blocks, and erasing data in one of them does not affect the data stored in others. Block sizes are very different - from 128 bytes to 128 KB or more. However, when reading data, the entire memory of the microcircuit is considered as a single array, and that's it. that it is physically divided into blocks does not matter.

Typically, the blocks are the same and equal, but they can be different. For example, Intel's 28Fxxx series chips have a so-called boot block of 16 KB and two parameter blocks of 8 KB each. This is followed by a block of 96 KB, and the rest of the memory consists of blocks of 128 KB. The properties of these blocks are somewhat different. Boot has hardware write and erase protection. It is turned on by applying the appropriate logic level to a specially provided output of the microcircuit. Parameter blocks are designed to store frequently changed data and withstand a greater number of erase / write cycles than others.

Each of the microcircuits of the series under consideration is made in two versions, differing in the placement of blocks in the address space. In microcircuits with index B (bottom), they are located, starting from address zero, in the order indicated above. In products with the T index (top), the order is reversed (boot - in the area of ​​​​higher addresses).

The FLASH-memory microcircuits currently produced are designed for nominal supply voltages from 2.7 to 5 V. They do not require an increased voltage (12 V) at all or are necessary only in some special modes. In the passive ("unselected") state, such microcircuits consume a current of no more than 1 mA from the power source (in most cases, ten times less). Sometimes a special sleep mode is provided, in which the consumption is negligible. True, it is impossible to read data from a "sleeping" microcircuit, but in order to "wake" it up. sometimes it takes several tens of microseconds. The current consumed in active mode is tens of milliamps, and if you put a chip in a passive state, the AC3 of which performs a long operation (for example, erases data), the current will not decrease until it is completed.

Much attention is paid to protecting the data stored in the FLASH-memory from accidental change, especially under the influence of noise and transients when the power is turned on and off. In most cases, there are three types of hardware protection. The first one is. that the microcircuit does not respond to pulses in the WE circuit with a duration of less than 15 ... 20, the second is that with a low logic level at the OE input, no signal manipulations at other inputs can cause a recording, the third is that. that when the supply voltage drops below a certain level, AC3 turns off. For microcircuits of different types, the shutdown threshold is in the range of 1.5 ... 3.8V.

Sometimes it is possible to completely prohibit changing and erasing the entire data array or its parts. The imposition or removal of such a ban usually requires "extraordinary" measures (for example, briefly applying increased voltage to certain terminals).

Software protection is also provided. To change the contents of a cell, FLASH memory is not enough, as in conventional RAM. write one code to one address. A command is required, consisting of several codes written to specific addresses.

Any FLASH-chip is able to tell its type to the device in which it is installed, which allows you to automatically select the necessary algorithms for writing and erasing data. The appropriate commands are provided to programmatically enable and disable the ID reading mode. Having turned it on, the manufacturer's identifier is read at the address OH, and the devices are read at the address 1H (the identifiers of some microcircuits are given in the table). In the same mode, but at other addresses, in some cases you can get additional information, for example, about the state of hardware write protection.

Programming FLASH-memory chips

It is possible to switch to the mode of reading identifiers without a command, by applying a voltage of +9 V to the address input A12. The permissible deviation of its value for microcircuits of different types is different. In some cases it is not more than ±5%. in others, it is enough that the voltage only exceeds a certain value, for example, 10 V. The identifiers are read at the above addresses, setting them without taking into account the A9 discharge. Usually this method is used in universal programmers.

AC3 of most flash memory chips accept commands given in accordance with the so-called JEDEC standard, although there are exceptions. Sometimes, when upgrading chips, their command system is supplemented with standard code combinations, while retaining, however, the old commands (this is necessary so that the upgraded chips can work in previously released devices). Intel uses its own command system.

Before considering the commands in detail, let's talk a little about connecting FLASH chips. Microcircuits of the same type, as a rule, are produced in several types of packages, differing in location, pitch and number of pins. Often, "mirror" options are provided, allowing you to install microcircuits on any side of the board without changing the topology of the printed conductors.

The pin numbers in the diagrams below are typical for 512K memory chips in the most common 32-pin PLCC and PDIP packages. The "pinout" of microcircuits of a smaller volume is similar, but the conclusions of the highest digits are not connected to them (for example, the 29th and 010st are free for Am30F1).

A scheme similar to that shown in Fig. 1 are used if it is necessary to erase and write data without removing the chip from the microprocessor system.

Programming FLASH-memory chips

It is assumed that the system data bus is eight-bit, addresses are 16-bit. The ROM is allocated in the address space of 32 KB, the rest of it can be occupied by RAM Since the amount of memory of the Am29F040 is 512 KB, a FLASH memory page register is provided that controls the upper bits of the address. To read and write data, you can use the following simple procedures (written in Pascal):

Programming FLASH-memory chips

If it is necessary to program the FLASH-chip outside the device in which it will work, it can be connected to a personal computer. The easiest way to do this is to install an optional parallel I/O card in your computer. Such boards such as PCL-731 from Advantech, DIO-48 from IOP DAS or PET-48DIO from ADLink are commercially available. As a rule, they have 48 inputs / outputs and they work similarly to two 8255 microcircuits (KP5806V55A) in O mode with the same information and control ports, even if in reality there are no such microcircuits in their composition. If necessary, the parallel input/output board can be made independently, using the article by N. Vasiliev "PC Interface Extender" ("Radio", 1994, No. 6, pp. 20, 21).

For reading or programming, the FLASH chip is connected to the ports of two 8255 chips according to the circuit shown in Fig. 2. The PA port of the first of them is used for data input/output, separate bits of its PC port are used for outputting control signals CE, OE and WE. Ports PA, PB, and PC second form the 24-bit address bus of the FLASH chip. If a smaller bit width of this bus is sufficient, the corresponding number of high-order bits of the PC port is not connected.

Programming FLASH-memory chips

I/O board ports and auxiliary constants must be described in the program as follows:

Programming FLASH-memory chips

And the procedures for accessing FLASH memory described above are replaced by the following:

м

Now - actually about programming FLASH-microcircuits. According to the JEDEC standard, each command begins with the entry of the OAAN code at address 5555H. Next, code 55H is written at address 2AAAH and, finally, the code of the operation to be performed at address 5555H.

Programming FLASH-memory chips

Speaking, for example, about the 40H command, we will mean just such a sequence with the number 40H as the operation code.

Programming FLASH-memory chips

After turning on the power, any FLASH microcircuit automatically enters this mode and there is no need to set it with a special command. However, it is required, for example, to return from the read identifiers mode. It is sometimes referred to as a reset or initial setup command. To transfer some microcircuits to the array reading mode, one cycle of writing the 0F0H code to any address is enough.

Programming FLASH-memory chips

The write cycle following the 0A0H command contains the address of the programmable cell and the code written to it. In most cases, writing to each cell requires a separate command. Keep in mind that, like conventional EEPROMs, in the bits of a programmable cell, you can only replace logical ones with zeros. To perform the reverse operation, it is usually necessary to first erase the contents of the entire memory block and repeat the programming of all its cells. Note that the AC3s of many FLASH chips do not recognize these errors and report success. To make sure that the programming is correct, a control reading of the recorded data is necessary.

In Winbond chips with 128-byte blocks, the programming of any cell is automatically preceded by the erasure of all data in the containing block. Therefore, you should always first copy the block to RAM, make the necessary changes to the copy and reprogram all 128 bytes. Having received the OOH command, the address and the first of the programmable bytes, AC3 enters it into the block's internal buffer and waits for 200 µs without starting programming. If during this time one more OOH command and the next byte are received, it will also go into the buffer, and AC3 will wait for the next 300 µs. This continues until then. until all 128 bytes of the block are received or the pause exceeds the allowable value (300 μs). The AC3 then erases the block and starts the actual programming. The sequence of writing to the buffer of data intended for different cells of the block does not matter, but those cells for which data has not been received will contain codes 0FFH after programming.

There are two ways to write programming data to such a chip. The first of them (usual for others) is called software-protected. Each byte to be written must be preceded by an OOH command. However, the protection can be disabled by issuing the 80H and 20H commands in sequence.

Programming FLASH-memory chips

After that, the byte written to any address enters the internal buffer of the microcircuit, and this mode is maintained even after turning off and on the power. Get out of it at the command of OON.

Programming FLASH-memory chips

There are two equivalent command options for writing data to an Intel FLASH chip. First of all, one of the codes 40H or 10H is written at any address. and then - the programmable code at the desired address.

Programming FLASH-memory chips

"Erase all memory" command.

AC3 of the FLASH microcircuit starts this important operation by receiving a sequence of two commands - 80H and 10H.

Programming FLASH-memory chips

Intel microcircuits are given a similar command by writing to arbitrary addresses of codes 20H and 0D0H

Programming FLASH-memory chips

Erasing the entire contents of memory takes from tens of milliseconds to several seconds. Some microcircuits provide the ability to suspend this process by writing the OVON code to any address. After writing (also to any address) code 30H (for Intel chips - ODOH), erasing will continue.

Delete block command. To erase the contents of a memory block, two commands must be issued. The first of them is 80H, the second differs in that its operation code 90H must be written not at address 5555H, but at the address of any of the cells of the erased block.

Programming FLASH-memory chips

"Read identifiers" command. To switch to this mode, the command 90H is used, but sometimes a sequence of two commands is required - 80H and 60H.

Programming FLASH-memory chips

In Intel microcircuits, it is enough to write the code 90H at any address. This mode is exited by the command "Read data array" discussed above.

How to check the completion of the execution of "long" programming and erasing commands? The easiest way is to use the reference data of the microcircuit and provide for the software formation of the corresponding delays. But the actual execution time of certain operations often differs significantly from the reference values ​​even for different cells and blocks of the same microcircuit, increasing as the latter "ages".

Reading the status register AC3 allows you to accurately find out the moment the end of a particular operation. The FLASH chip outputs the contents of this register to the data bus as long as the AC3 is busy performing an erase or programming procedure. There are two signs that the process is not finished. The first is that the value of bit D7 of the status register is inverse with respect to the value written to the same bit of the memory cell (during erasing, it is equal to 0). At the end of the operation, it will match the recorded one. The second symptom is the "flickering" of bit D6 (its value changes with each read of the register until the operation is completed).

As a rule, both signs are observed, however, there are exceptions. For example, in Intel chips there is no "flickering" bit, and the D7 bit is 0 during programming, regardless of the code being written. The end of the operation in this case is evidenced by D7=1. In microcircuits with block recording (for example, from Winbond), the value of bit D7 is inversely analogous to the bit of the last code written to the block buffer.

Usually, upon completion of programming or erasing, the FLASH chip automatically returns to the data array read mode, but Intel chips require a corresponding command for this.

If the chip fails, the "long" operation may never complete, causing the programming computer to "hang". To avoid this, it is necessary to provide for checking the duration of the erasing and programming operations and, in case of exceeding a reasonable value, an "emergency" output with a fault message.

Sometimes, especially when working with microcircuits that have gone through a number of erasing / programming cycles close to the limit, it makes sense to repeat the unsuccessful operation several times. One of the attempts may be successful.

In conclusion, a few words about utilities that allow you to update the computer's BIOS stored in FLASH memory. They are developed for each type of system (motherboard) boards and take into account the peculiarities of connecting FLASH microcircuits to system buses. Therefore, attempts to use a utility designed for one type of board to update the BIOS of another often lead to a complete failure of the computer.

The utility is launched as a normal application program, specifying as a parameter the name of the file containing the codes of the new BIOS version. It reads this file, creating an array of data in RAM to be written to FLASH memory. Then it determines the type of microcircuit and selects the appropriate procedures for working with it. After that, the erasing of old and recording of new data begins, and at this time the program cannot use any BIOS functions, including displaying information on the screen or polling the keyboard. If it is still necessary to do this, the necessary subroutines are introduced into the utility itself. Once the programming is complete and verified to be correct, the computer is usually restarted and starts a "fresh life" with an updated BIOS.

Author: A. Dolgiy, Moscow

See other articles Section Microcontrollers.

Read and write useful comments on this article.

<< Back

Latest news of science and technology, new electronics:

Machine for thinning flowers in gardens 02.05.2024

In modern agriculture, technological progress is developing aimed at increasing the efficiency of plant care processes. The innovative Florix flower thinning machine was presented in Italy, designed to optimize the harvesting stage. This tool is equipped with mobile arms, allowing it to be easily adapted to the needs of the garden. The operator can adjust the speed of the thin wires by controlling them from the tractor cab using a joystick. This approach significantly increases the efficiency of the flower thinning process, providing the possibility of individual adjustment to the specific conditions of the garden, as well as the variety and type of fruit grown in it. After testing the Florix machine for two years on various types of fruit, the results were very encouraging. Farmers such as Filiberto Montanari, who has used a Florix machine for several years, have reported a significant reduction in the time and labor required to thin flowers. ... >>

Advanced Infrared Microscope 02.05.2024

Microscopes play an important role in scientific research, allowing scientists to delve into structures and processes invisible to the eye. However, various microscopy methods have their limitations, and among them was the limitation of resolution when using the infrared range. But the latest achievements of Japanese researchers from the University of Tokyo open up new prospects for studying the microworld. Scientists from the University of Tokyo have unveiled a new microscope that will revolutionize the capabilities of infrared microscopy. This advanced instrument allows you to see the internal structures of living bacteria with amazing clarity on the nanometer scale. Typically, mid-infrared microscopes are limited by low resolution, but the latest development from Japanese researchers overcomes these limitations. According to scientists, the developed microscope allows creating images with a resolution of up to 120 nanometers, which is 30 times higher than the resolution of traditional microscopes. ... >>

Air trap for insects 01.05.2024

Agriculture is one of the key sectors of the economy, and pest control is an integral part of this process. A team of scientists from the Indian Council of Agricultural Research-Central Potato Research Institute (ICAR-CPRI), Shimla, has come up with an innovative solution to this problem - a wind-powered insect air trap. This device addresses the shortcomings of traditional pest control methods by providing real-time insect population data. The trap is powered entirely by wind energy, making it an environmentally friendly solution that requires no power. Its unique design allows monitoring of both harmful and beneficial insects, providing a complete overview of the population in any agricultural area. “By assessing target pests at the right time, we can take necessary measures to control both pests and diseases,” says Kapil ... >>

Random news from the Archive

Antiseptic from water 12.10.2020

A device that converts ordinary water into a sanitizer, developed by Kharkov scientists from the Mechnikov Institute of Microbiology and Immunology, will be mass-produced.

The developers called the device IOON. The technology is based on the targeted synthesis of trivalent silver, which destroys the bacterial or viral membrane, disrupts metabolism and microbial separation (reproduction) processes.

According to the scientists, they sought to create an antiseptic that would act very quickly, was not toxic, killed most bacteria, and to which the bacteria could not adapt. The startup team won a $25000 grant from Ukrainian Startup Found and received mentoring support from Polish-Ukrainian Startup Bridge and EO Business Incubator.

"We invested the grant won in the improvement of our device for serial production. There is both a new case and electronics, which were developed by engineers from the Ukrainian representative office of a German company," the scientists said.

Other interesting news:

▪ Combat robot controlled via satellite

▪ Thread - 8500 years

▪ Containers under the cover

▪ Hot Batteries

▪ coffee burns fat

News feed of science and technology, new electronics

 

Interesting materials of the Free Technical Library:

▪ site section Electric motors. Article selection

▪ article totalitarian state. Popular expression

▪ article Why football fans shout: Shai-boo! Shai-boo!? Detailed answer

▪ Article Pedicure master. Job description

▪ article KR580IK80A in an amateur display. Encyclopedia of radio electronics and electrical engineering

▪ article Simple laboratory power supply, 220/16,32 volts 0,5 amps. Encyclopedia of radio electronics and electrical engineering

Leave your comment on this article:

Name:


Email (optional):


A comment:





All languages ​​of this page

Home page | Library | Articles | Website map | Site Reviews

www.diagram.com.ua

www.diagram.com.ua
2000-2024