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

Debugger for microcontrollers of the HC908 family. 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

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.

Debugger for microcontrollers of the HC908 family

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:

  • loading into the RAM of the MK the program for erasing/programming the FLASH ROM;
  • loading into the FLASH-memory of the MC application (developed) program;
  • launching the application program for execution from a given address in real time, stopping at the desired checkpoint;
  • transfer to the PC of the state of the registers and memory cells of the MK after stopping at the checkpoint.

Debugger for microcontrollers of the HC908 family

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:

  • connect the interrupt inputs IRQ and reset RST to a source of increased voltage UTST = 8,5 V;
  • on the lines of the ports indicated in Table. 2, set the combination of logic signals: PTx1=1, PTx2=0, PTx5=1. On the RTxZ line - log. 0 if the frequency of the quartz resonator is 4,9152 MHz, or log. 1 if it is 9,8304 MHz. For the MK model KX, the state of RTxZ is always log. 0, but for RK and RF it does not matter. These MKs always operate at a clock frequency of 9,8304 MHz. Models GR and GP are set to PTx4 = 0, when using a quartz resonator with a frequency of 32,768 kHz, a log is fed to the IRQ input. 0, and the state of RTxXNUMX is indifferent;
  • within a few tens of milliseconds from the moment the supply voltage of 5 V is applied, keep the MK reset input (RST) in the log state. 0. Then increase the voltage on it to UTST.

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.

Debugger for microcontrollers of the HC908 family
(click to enlarge)

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.

Debugger for microcontrollers of the HC908 family

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

  1. Remizevich T. Microcontrollers for embedded applications. From general approaches to Motorola's HC05 and HC08 families. - M.: DODEKA, 2000.
  2. Kobakhidze Sh. Microcontrollers for beginners. And not only ... Tools for developing and debugging devices on the MK. - Radio, 2000, No. 4, p. 22, 23.

Author: D.Panfilov, T.Remizevich, A.Arkhipov

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

New generation Chevrolet Volt with smart charging system 03.12.2014

Chevrolet at the auto show in Los Angeles (USA) literally lifted the veil of secrecy over the next generation Volt hybrid car, showing a fragment of its frontal part.

The car was presented in blue. Judging by what was shown to the public, the new hybrid will receive a more aggressive appearance compared to the current generation.

In addition, Chevrolet spoke about the "smart" system for recharging the battery pack. The owners of the new "Volta", in particular, will be able to set certain parameters of the recharging process for the "home" network: this can be an operating mode, charging start and end times, etc. The settings will be automatically selected by the car based on GPS coordinates, so that the motorist will not have to install them every time after arriving home.

In addition, the car will receive an informative indication of the charging status. By the color of the backlight, it will be possible to understand whether the process of replenishing energy or the machine is in the delayed start recharging mode.

The new generation hybrid will debut in January 2015 at the North American International Auto Show in Detroit.

Other interesting news:

▪ Space incubator

▪ The smallest magnifying glass sees bonds between atoms

▪ Record rope

▪ Xiaomi Mi PTZ Camera for hoverboard

▪ The new face of Nokia

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 Computer TV tuner as a frequency meter. Encyclopedia of radio electronics and electrical engineering

▪ article Candle passing through the hand. 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