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 serial 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

Non-volatile memory chips with serial data input and output are widely used today to store set modes and fixed settings in TVs, radios and other household appliances. When repairing it, it often becomes necessary to read the contents of such microcircuits or write new data to them. Usually this is done with the help of special devices - programmers. But in order to program one or two microcircuits in amateur conditions, it is unprofitable to purchase a rather expensive programmer. A normal personal computer will do just fine.

One of the most common non-volatile memory chips is AT93C46 from ATMEL. To communicate with the microcontroller, it is equipped with a serial interface, consisting of only three single-bit buses SK (synchronization), D1 (data input) and DO (data output). These buses are connected in parallel to all the nodes in the device with such an interface. The data is transmitted bit by bit. accompanying each bit with a clock pulse SK.

The AT93C46 chip also provides CS (chip select) inputs for switching it to the active state and ORG (organization). If the latter is connected to a power source, 64 sixteen-bit memory cells are formed in the microcircuit, if with a common wire - 128 eight-bit cells.

To read content or program using a computer, the AT93C46 chip must be connected to the socket of the LPT1 or LPT2 port, as shown in the figure. Since the ORG input of the microcircuit is connected to a common wire, the memory organization is eight-bit. It is recommended to apply the +5 V voltage from an external source, but you can use any free output line of the port by programmatically setting a high logic level on it.

Programming Serial Memory Chips

The service program shown in the table is written in BASIC (Power Basic compiler version 2.10f). The program starts by asking for the port number to which the chip is connected. Depending on the response of the port variable operator, the value of the base address of the selected port is soldered: 888 (hexadecimal 378H) for LPT1 or 632 (hexadecimal 278H) for LPT2. The out port.0 command sets all port data bus pins to a logic low voltage.

Next, the operator is asked to select the mode of reading data from the chip or writing to it and enter the name of the file in which the read information will be saved or the information prepared for writing is located. Those who use other versions of BASIC should be aware that the syntax of the operators for working with files may be different. The program not only saves the data read from the chip or written to it in a file or reads from it, but also displays it on the monitor screen in the form of a hexadecimal dump. The procedures for reading and writing data are somewhat different, but they use the same operations to "communicate" with the microcircuit, designed in the program as functions:

  • cs(num) sets the logical level of the signal applied to the CS input of the memory chip, in accordance with the value of its parameter (0 or 1);
  • sk(num) performs a similar operation for the input SK;
  • skout generates a clock pulse;
  • del and del1 form time intervals equal, respectively, to the duration of clock pulses and pauses between them. The maximum clock frequency for different modifications of the AT93C46 chip can be in the range from 0.25 to 2 MHz, the minimum is equal to zero. If necessary, the frequency of pulses generated by the computer can be changed by setting other limit values ​​for the variable i in the functions del and del1;
  • shiftin reads a data byte from the chip's DO output;
  • dinchip(num). shiftout(address) and shiftoutd(odata) are used to write information to the chip through the DI input. The first one puts one bit into it, the value of which is specified by the num parameter. The second writes a seven-bit address, the last writes a data byte.

The internal control unit of the AT93C46 chip receives and executes commands from the DI line. Each instruction begins with a start bit of logic 1, followed by two opcode bits and the required number of memory and data address bits. Before each command is given, the CS input must be set to a high logic level, after its completion - to a low one.

The read data (READ) instruction has an opcode of 10 followed by a location address. In response, the microcircuit will output the DO data byte stored at the specified address, which can be read using the shiftin function.

After the power is turned on, the AT93C46 chip automatically switches to a mode in which erasing and writing data is prohibited, which prevents their accidental damage. So before. To write data to it, you must enable this operation by issuing the EWEN - Erase/Write Enable command. Its operation code is 00 followed by address 11 xxxxx. The values ​​of the last five bits of the address are not analyzed by the EWEN command, and they can be anything. Once given, the EWEN command is valid until it is canceled by a special command or until the microcircuit power is turned off.

The write command (WRITE) has opcode 01 followed by the location address and the data byte to be written. Having received such a command, the control device starts to execute an internal recording cycle, the duration of which is not more than 10 ms. Until it ends, the microcircuit does not respond to new commands. If at this time a short logic low pulse is applied to the CS input, the DO output will be set and will remain low until the cycle is completed. As soon as it goes high, you need to set the CS input low. after which the chip is ready to receive new commands. If the mentioned pulse is not applied to the CS input or is applied after the write cycle is completed, the DO output state will remain high-impedance.

In addition to the considered commands, there are others: prohibit erasing / writing (EWDS), write a constant to all memory cells (WRAL), erase all memory cells (ERAL). In practice, they are used relatively rarely. A description of all commands, as well as other details of the design and operation of the AT93C46 chip, can be found in [1, 2].

Programming Serial Memory Chips
(click to enlarge)

The described program with minor modifications can be used to program any memory chip of the АТ9Схх family by setting the appropriate address range. For example, the AT93C56 chip contains 256. and AT93C66 - 512 eight-bit memory cells.

93X16.EXE - a version of the program designed to work with the AT93C46 chip in a sixteen-bit mode (the ORG input is connected to a power source).

Literature

  1. Nonvolatile Memory Data Book. - ATM EL. May 1996.
  2. Grebnev V.V. Chips of non-volatile memory from ATMEL. - S.-Pb.: EFO. 1997.

Author: A.Goncharenko, Odessa, Ukraine

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

Connected Vehicle Technologies 28.05.2015

Qualcomm Technologies and Daimler AG have announced a strategic partnership to develop "connected car" technologies.

In the first phase, the partners plan to focus on transforming vehicles with mobile technologies such as 3G/4G connectivity, in-vehicle wireless charging, and Qualcomm Halo Wireless Electric Vehicle Charging (WEVC). In addition, the companies will jointly explore possible applications of Qualcomm Technology developments under the general name Automotive Solutions.

Qualcomm Technologies is participating in Daimler's Wireless Power Transfer 2.0 program for electric vehicles. Qualcomm's Halo WEVC technology is said to enable fast charging of electric and hybrid vehicles using a compact module that eliminates the need for a wired connection. Qualcomm WiPower technology, in turn, will allow you to charge consumer electronic devices inside the car without resorting to a wired connection.

Other interesting news:

▪ Ion Engine X-3

▪ Dual Channel Isolated SiC MOSFET Drivers 2EDF0275F and 2EDS9265H

▪ Mercedes electric cars with wireless charging

▪ New speed record for electric boats

▪ Smartphones are stupid

News feed of science and technology, new electronics

 

Interesting materials of the Free Technical Library:

▪ site section Tone and volume controls. Article selection

▪ article The Russian constitution is a bribe. Popular expression

▪ article What is the probability of getting identical decks of cards after shuffling? Detailed answer

▪ article Draftsman. Job description

▪ article Bi-phase generator with adjustable pause. Encyclopedia of radio electronics and electrical engineering

▪ article Standards for testing electrical equipment and devices for electrical installations of consumers. dry reactors. 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