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

ROM emulator. 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

The emulator described in the article, together with a computer, can replace its ROM during the debugging of the software of a microprocessor device. This will allow you to quickly correct the program, saving time that would otherwise be spent on reprogramming the EEPROM. The emulator is relatively slow because it does not have its own RAM. But for the same reason, it is simple and cheap.

One of the problems that arise in the development of microprocessor equipment is the debugging of a program written to ROM. Usually, for this purpose, so-called reprogrammable ROMs (RPZUs) are used with information erasing by ultraviolet irradiation. Since any change to the program results in the need to erase the EEPROM and re-write information into it, debugging takes a lot of time. In addition, after 10 - 25 cycles, with each of which the reliability of data storage decreases, the microcircuit has to be replaced. Thus, creative work is overshadowed by the tedious mechanical process of overwriting, not to mention the financial side of the issue - EEPROMs with UV erasure are not cheap.

The emulator will help to solve the problem, the schematic diagram of which is shown in Fig. 1. Instead of a ROM chip with a capacity of up to 64 Kbytes, an XP1 plug is inserted into the panel of the device being debugged intended for it. Depending on the type of ROM, only the order of connecting the emulator wires to the plug contacts can change (the one shown in the diagram corresponds to a 27512 chip with a capacity of 64 KB).

ROM emulator
(click to enlarge)

The XP2 plug is connected to the LPT1 parallel port socket of any IBM-compatible personal computer (PC). Since the port is mainly intended for data transfer to an external device (printer), it has 12 output lines and a total of five input lines. This forces the 16-bit ROM address received by the computer to be multiplexed, which, of course, affects the emulation speed.

The emulator consists of the following functional blocks: clock generator (DD1.1-DD1.2), clock synchronizer (DD2.2, DD3.1), trigger device (DD2.1), pulse counter (DD4), block write pulse shaper address (DD1.5, DD3.3), data register (DD5) and address multiplexer (DD6, DD7).

The work begins with the arrival of a low-level signal CS from the microprocessor device to the input S (pin 4) of the trigger DD2.1 (the timing diagrams of the signals are shown in Fig. 2).

ROM emulator

The latter goes into a state corresponding to logical 1 at the direct output (pin 5) connected to input D (pin 12) trigger DD2.2. On the decline of the clock pulse (this is provided by the DD1.4 inverter), a logical 1 also appears at the output (pin 9) of DD2.2, allowing the passage of clock pulses to the output of the DD3.1 element. They are counted by the counter DD4, the output signals of the two least significant digits of which control the address multiplexers DD6 and DD7. The ROM address is transmitted to the PC in four four-bit groups: A0 - A3, A4 - A7, A8 - A11, A12 - A15. To receive it, the ERROR inputs are used. SLCT, ACK, PE parallel port.

The counter DD4 is covered by feedbacks in such a way that its conversion factor is 5. That is how many periods of clock pulses the emulation cycle takes. In the first four pulses from the output of the DD3.4 element, arriving at the BUSY input of the LPT port simultaneously with the switching of the multiplexers. synchronize the procedure for reading the address by the computer. In the fifth period, the computer issues a data byte to the DATA1 -DATA8 outputs, which must be located in the emulated ROM at the specified address. This byte is stored in register DD5. At the end of the period trigger DD2.1 returns to its original state. True, the latter will happen only if the CS signal has ended by this moment. Otherwise, the described cycle will repeat itself.

The emulator is assembled on a double-sided printed circuit board, the drawing of which is shown in fig. 3. The board provides groups of contact pads X1-X4, to which the wires are soldered to the XP1 and XP2 plugs.

ROM emulator
(click to enlarge)

Instead of the microcircuits indicated on the circuit diagram, it is permissible to use their functional analogues from any TTL or TTLSH series (K155. K555. KR1533. KR531). When replacing the DD1 chip, a selection of clock generator elements (R1, R3, C2) may be required, the emulation speed depends on the pulse repetition rate of which. Setting the frequency above 100 kHz is not recommended, as this may cause malfunctions.

The XP1 plug can be made from a defective EEPROM with UV erasure. Having broken the transparent window, you should remove the thin conductors connecting the crystal to the contact pads of the case. The cable wires are soldered to the outer part of the terminals in such a way that they do not interfere with inserting the former microcircuit into the panel.

The algorithm of the emulator operation described above requires the transfer of the microprocessor device to the step-by-step mode. It is convenient for the first "run" of the program and the initial stages of its debugging. To work in continuous mode, it is necessary to supplement the emulator with a synchronization device, assembling it according to the scheme shown in Fig. 4. It is designed for the KR580VM80A microprocessor with the KR580GF24 clock generator and was tested on the Radio-86RK computer. For other types of microprocessors, the synchronizer may need to be modified.

ROM emulator

The table shows the procedure for ROM emulation by a computer at maximum speed. It is written in the ASSEMBLY language built into the Borland Pascal programming system and is intended for use in programs developed using this system. The global variable pDATA of type pointer in the main program must be set to the address of the first element of the byte array containing the emulated ROM image. Data exchange proceeds at maximum speed by minimizing the number of accesses to the PC memory and using processor registers for temporary data storage (memory access takes several times longer than a register-to-register operation).

ROM emulator
(click to enlarge)

The peculiarity of the described procedure is that it is an infinite loop and, for the sake of speeding up work, disables all interruptions, including those from the keyboard. Thus, you can stop emulation only by pressing the "RESET" button of the PC or by turning off its power. The display of any information about the operation of the device being debugged on the PC monitor screen is also excluded. To eliminate these shortcomings is within the power of a programmer of average skill, but only at the cost of slowing down the procedure.

The keys specified in the command line or in the configuration file set the emulation mode, select the file with the image of the emulated ROM. The command line takes precedence over the configuration file.

The following keys are provided:

-sf - the fastest emulation (using the procedure discussed above);

-sns - mode, somewhat slower than the previous one, since it provides for polling the keyboard and exit by pressing the [Esc] key;

-sp is the slowest mode. The monitor screen displays the address of each ROM cell accessed by the device being debugged, and the data from it. The process of reading quarters of the address is also displayed. This is convenient at the initial stages of debugging a microprocessor device, since it allows you to monitor the progress of its program execution;

-f filename - specifies the name of the file with the ROM image:

/y - disables the control of the equality of the length of the ROM image file of the information capacity of the latter;

/? - Displays help on the emulator's operating modes.

Pressing the [F2] key stops the current address reading process and puts the program into the waiting mode for a new one.

A ROM image is a binary file in which all the bytes stored in the emulated ROM are written sequentially, in ascending order of addresses, starting from zero. - codes of commands and data of the debugged microprocessor device. Note that gaps in the address sequence are not allowed. The values ​​in unused cells must also be written to the file.

Such a file can be created using the TASM cross-assembler, if called from the command line

TASM.EXE -85 -g3 PROG.ASM

Here, the -85 switch sets the type of processor (8085) for which the translated program PROG.ASM is intended, and -g3 specifies the output of the result in binary form. The resulting PROG.OBJ file can serve as a ROM image for the emulator.

Authors: S. Belyaev, D. Chernykh, Tambov

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

100-core processor EZchip TILE-Mx100 28.02.2015

EZchip Semiconductor introduced the TILE-Mx family of multi-core processors. The EZchip TILE-Mx100 processor is configured with 100 ARMv8-A cores, making it the world's most multi-core 64-bit ARM processor.

The EZchip TILE-Mx100 processor is designed for network equipment, including network function virtualization (NFV) tools. A large number of cores, high-performance communication between them and the presence of packet processing accelerators - all this allows you to provide high performance and functionality demanded in this application area.

TILE-Mx is equipped with numerous interfaces, including GbE, 10GbE, 25GbE, 40GbE, 50GbE and even 100GbE, as well as PCI-Express.

Deliveries of evaluation samples of TILE-Mx should begin in the second half of next year.

Other interesting news:

▪ Teenagers don't listen to their parents

▪ Contraceptives for kangaroos

▪ Everyone lives in their own reality

▪ Life on Mars

▪ Record Density DDR5 Chips 24Gbps

News feed of science and technology, new electronics

 

Interesting materials of the Free Technical Library:

▪ site section Preamplifiers. Article selection

▪ article Selective Affinity (Affinity of Souls). Popular expression

▪ article Which famous physicist was awarded the Nobel Prize in Chemistry? Detailed answer

▪ Schizonepet's article is multi-incised. Legends, cultivation, methods of application

▪ article Power amplifier on 6 transistors. Encyclopedia of radio electronics and electrical engineering

▪ article Fireproof finger. Focus Secret

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