ENCYCLOPEDIA OF RADIO ELECTRONICS AND ELECTRICAL ENGINEERING ROM emulator. Encyclopedia of radio electronics and electrical engineering Encyclopedia of radio electronics and electrical engineering / Microcontrollers 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). 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). 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. 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. 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). 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. Latest news of science and technology, new electronics: Machine for thinning flowers in gardens
02.05.2024 Advanced Infrared Microscope
02.05.2024 Air trap for insects
01.05.2024
Other interesting news: ▪ Teenagers don't listen to their parents ▪ Contraceptives for kangaroos ▪ Everyone lives in their own reality ▪ 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 Fireproof finger. Focus Secret
Leave your comment on this article: All languages of this page Home page | Library | Articles | Website map | Site Reviews www.diagram.com.ua |