ENCYCLOPEDIA OF RADIO ELECTRONICS AND ELECTRICAL ENGINEERING Debugger for microcontrollers of the HC908 family. Encyclopedia of radio electronics and electrical engineering Encyclopedia of radio electronics and electrical engineering / Microcontrollers Recently, the Russian market has many single-chip microcontrollers (MC) in DIP and SOIC packages with the number of pins from 8 to 28. Such MCs are inexpensive, have an extended supply voltage range of 2,7 ... 6 V, and can be clocked without the use of a quartz resonator . They are successfully used in amateur designs. However, tools for debugging devices on the MK, capable of not only software but also hardware simulating the operation of a real system, reacting to all input signals and generating output signals, are in most cases too complicated and expensive for amateur use. For eight-bit MCs of the HC908 family, a debugger with such properties can be made independently. The main characteristics of the MC family HC908, manufactured by Motorola, are given in Table. 1. The ability to easily implement a hardware debugger is based on the fact that all MCUs of this family, regardless of the internal configuration, have two important features. First, the built-in program memory is made using FLASH technology and is reprogrammable. In the FLASH ROM module, in addition to the memory cells themselves, there is a step-up voltage converter, which allows you to erase and program the ROM without connecting an additional external voltage source to the MK. Secondly, a special debug mode is provided, in which the debug monitor program stored in the memory of the MK during its manufacture is activated. It contains a driver for exchanging information with an external device via a single-wire bidirectional communication line and subroutines for executing six commands received via this line, for example, from a personal computer (PC). With the help of these commands, it is possible to read all the information in the memory of the MK, or write it there, as well as run the program for execution from any address [1]. Using debug commands, you can create custom PC software that does the following:
All this makes it possible to create a real-time programmer and debugger [2] using only the internal resources of the HC908 family of microcontrollers. It is enough to make a PC interface board and use a software package that includes the WinlDE integrated development environment, the CASM08 macro assembler, the ICS08 software and in-circuit simulators, the DEBUG08 in-circuit real-time debugger and the PROG08 programmer. This package can be found on the website as a shell program for the ICS08 in-circuit simulator. It is distributed free of charge and without restrictions. The interface board performs two functions: it provides the transfer of the MK to the debug mode and converts the signals of the bidirectional single-wire interface of the MK into standard signals of the PC serial port. To put any member of the HC908 family into debug mode, do the following:
As a result, the MK will enter the debug mode. After that, the signal levels on the lines PTx1-PTx4 can be changed in any order. However, the UTST voltage at the RST input must remain unchanged at 8,5 V. The IRQ input can change during debugging, and as a result of setting it low, an interrupt request is generated. The logic high voltage on this pin can be driven up to UTST. On the input / output line RTx5 in the process of debugging, there is a two-way exchange of information between the MK and the PC at a speed of 9600 Baud. The diagram of the interface board is shown in the figure. It contains only five chips. The XS1 socket is connected to the PC COM port plug. The XP1 plug is used to connect to the microcontroller system being debugged (target). On the board of the latter, a mating connector must be provided, the contacts of which are connected to the outputs of the MC in accordance with Table. 3. Chip DD3 converts the signal levels of the RS-232 interface to TTL logic levels and vice versa. Tri-state buffer elements DD4.1 and DD4.2 turn a bidirectional MK line (PTx5) into two unidirectional lines (TXD and RXD), characteristic of RS-232. Instead of the MC145407 indicated in the diagram, other functionally similar devices can be used as DD3, for example, ADM202E or ADM232L, which differ in pinout. In addition to the level conversion stages, each of these microcircuits has built-in voltage sources of +10 and -10 V. The first is used to obtain a voltage of +7 V using the divider R10R8,5. The load on the output of the built-in source is approximately 2 mA. In order for it to withstand such a current, it is not recommended to use capacitors C4 - C7 with a capacity less than that indicated in the passport data of the microcircuit used. The DTR signal through the DD3 chip buffer and the DD4.3 element enters the base of the transistor VT5, which controls the keys on the transistors VT2 and VT3. Transistor VT2 switches voltage +5 V, and VT3 - UTST. While on the line DTR log. 1, transistors VT2 and VT3 are closed, capacitor C1 is discharged. At this time, a reset signal (log. 0) was applied to the RST input of the MK. With the transition of DTR to the state of the log. 0 and opening the key on the transistor VT2 starts charging the capacitor C1. When the voltage at C1 reaches the threshold of operation of the DD1 chip, a log will be set at its output. 1. This will lead to the transition of the signal at the RST input of the MK to the same state with a voltage level increased to 8,5 V. As a result, the MK will enter the debug mode. Element DD2.3 logically summarizes the reset signals coming from the PC and from the device being debugged (the latter - via the RST_IN line), which ensures that the MK is re-entered into debug mode when an internal reset signal is generated. The combination of logic levels on the PTx1-PTx4 lines necessary to enter the MK into debug mode is created using the DD5 microcircuit. With the closure of the key on the transistor VT2, the outputs of its elements are activated. After switching the MC to the debug mode, the outputs go into the third state, so further the specified lines of the MC ports on the target board can be used at the discretion of the developer. The interrupt request signal IRQ_IN from the target system is fed to the input of the element DD2.4 and returned through the switch on the transistor VT4. This solution provides the required voltage level on the IRQ line at the moment the MC enters the debug mode and allows you to "skip" the signals of external interrupt requests during debugging without the danger of damaging their source with increased voltage. Jumpers X1 and X2 serve to bring the levels on the lines PTx1-PTx4 in line with the clock frequency of the MK. Jumper X1 is set when using MK HC908GR / GP with a quartz resonator at a frequency of 32,768 kHz. The position of the X2 jumper determines the signal level on the RTxZ line, which is necessary to configure the MC to work in debug mode with a quartz resonator at a frequency of 9,8304 or 4,9152 MHz. If the operating clock frequency of the MK of the target system differs from the specified ones, it is possible to apply an external signal OSC1 of the desired frequency for the duration of the debugging. For this, a generator on the elements DD2.1 and DD2.1 is used. Chips DD4, DD5 MS74NS125 can be replaced by domestic counterparts KR1554LP8. Literature
Author: D.Panfilov, T.Remizevich, A.Arkhipov 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: ▪ The smallest magnifying glass sees bonds between atoms ▪ Xiaomi Mi PTZ Camera for hoverboard News feed of science and technology, new electronics
Interesting materials of the Free Technical Library: ▪ section of the site Winged words, phraseological units. Selection of articles ▪ See How to use Windows Live Movie Maker. video art ▪ article Which country in the world has the lowest birth rate? Detailed answer ▪ article Operator of a mobile concrete mixer. Job description ▪ article Candle passing through the hand. 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 |