Научная статья на тему 'Digital system for studying microcontrollers via Internet'

Digital system for studying microcontrollers via Internet Текст научной статьи по специальности «Компьютерные и информационные науки»

CC BY
110
22
i Надоели баннеры? Вы всегда можете отключить рекламу.

Аннотация научной статьи по компьютерным и информационным наукам, автор научной работы — Шеховцов Борис Григорьевич, Беспалов Антон Сергеевич, Галин Дмитрий Георгиевич

The architecture of the proposed system is built on the base of two-processor scheme which allows designing programs for adjustment of a microcontroller without using a special programmer device. In case of failure the master microcontroller easily puts it in a normal operation mode. Built-in hardware provides access via Internet which allows applying the clientserver architecture for performing the practice and laboratory lessons with distant users.

i Надоели баннеры? Вы всегда можете отключить рекламу.
iНе можете найти то, что вам нужно? Попробуйте сервис подбора литературы.
i Надоели баннеры? Вы всегда можете отключить рекламу.

Текст научной работы на тему «Digital system for studying microcontrollers via Internet»

УДК 004.231.3

BORIS SHEHOVTSOV, ANTON BESPALOV, DMITRY GALIN

DIGITAL SYSTEM FOR STUDYING MICROCONTROLLERS VIA INTERNET

The architecture of the proposed system is built on the base of two-processor scheme which allows designing programs for adjustment of a microcontroller without using a special programmer device. In case of failure the master microcontroller easily puts it in a normal operation mode. Built-in hardware provides access via Internet which allows applying the clientserver architecture for performing the practice and laboratory lessons with distant users.

1. Introduction

At present time, one of the main problems of the scholastic process is a discrepancy between possibility of the traditional methods of education and coverage of the actual knowledge, which modern society requires from the university graduates.

With the modern level of development of telecommunication facilities, the possibility of granting access of students to educational resource appeared from education institution bounds.

Leading companies of the world already created and currently are creating the means of development hardware and software for different devices with microcontrollers using. Some of companies have even released the special versions, targeting higher education institutions, for training aims.

These packages allow developing, debugging and simulating hardware and software on personal computer and, as a result, get fully viable designs.

In spite of all advantages this approaches provide, a student has no possibility to implement the real device and gain experience enabled by computer modeling. Additionally, modeling does not allow to simulate functioning of some peripherals, requiring feeding physical signal for its functioning, for instance, ADC, comparer etc.

In this paper the attempt has been made to create the digital system, using advantages of different training facilities, with the goal to implement different devices and get the practical skills upon their development and debugging.

System architecture based on client-server methodology in carrying out practical and laboratory works allows, on the one hand, get essential savings of facilities at organizations with full-time forms of training. On the other hand, it allows distant training closer to hardware via virtual space.

2. Selection of ways for task completion

For provision of flexibility in work with digital systems, and its consequent modernization in structure of laid module principle, which allows to give the comfort for functioning, both in laboratory, and via local-area network with minimum interference from service personnel.

Such approach would easily allow configuration to solve different problems and to use it for fulltime and distant form of education both.

For ensuring reliability of digital system and simplification of management its components, system is built on two-processor scheme.

One microcontroller executes control functions and provides loading of user software and shaping controlling signal required for work of some units, as well as issue result on personal computer, with which work is executed.

The Debugging microcontroller is connected to peripheral modules (ADC, DAC, PWM, LCD, meters of frequency, real-time clock, and others) and executes user software.

Such principle allows software developing for debugging microcontroller; not taking care of some failure or incorrect written program system can be suspended and it will be impossible to bring it back into normal working state without intervention of specialist. Any time master controller can generate the reset signal for debugging controller and it brings back into normal working state. For instance, this possibility is especially important for remote access to the system via local-area network.

Among enormous amount of existing microcontrollers for creating the digital systems, 8-bits microcontrollers of PIC 18 family of Microchip Technology Inc. (www.microchip.com) were chosen having the best performance on correlation price/capacity/consumed power now.

These microcontrollers have a command system, optimized for high level languages such as C and C++, a compact performance and very small power consumption.

There are more technical descriptions on microcontrollers PIC 18 in Russian language. This fact, certainly, simplifies their study and usage. The knowledge base of Russian - language documentation is constantly renewed.

Besides, Microchip Technology Inc. gives MPLAB, the environment of the software development. It can be free loaded from site of the manufacturer. This development environment supports more than 30 different types of microcontrollers and allows software developing and debugging on Assembler language.

Additionally, for more serious projects, there is C-compiler, optimized for PIC18 family, which can be integrated in MPLAB environment.

Common type of digital system is given on Figure 1.

Fig. 1. View of the Digital system

It is not difficult to understand the purpose of modules used in Digital System by analyzing a structured scheme.

Majority of them is assigned for traditional problems solving, appeared in the most various microcontroller systems designing. In our opinion, the most interesting are presented below modules. They allow considerably enlarge possibilities of the digital system.

Structured scheme of digital system is shown on Figure 2.

Hardware Analog I Signal Formation [ Module

Fig .2. Structured Scheme of Digital system

USB Module. This module is based on a microcircuit FT232BM of FTDI Technologies company (http://www.ftdichip.com). It presents USB bus signals converter to RS-232 protocol signals and it allows achieving the best data transfer compare to traditional RS-232 (Fig.3).

PC

USB to RS232 FT232BM Converter

Fig .3. USB to RS-232 Converter

The FTDI Ltd provides a free driver for Windows and Linux operating systems and special free software for their own microcircuits configuration and usage. FTDI Ltd provides also examples which usage significantly simplifies and accelerates the development.

The microcircuit FT232BM requires external quartz generator, operating system identification scheme, small bus filters, and scheme of baud rate choice on USB bus.

The identification scheme is based on microcircuit AT93C46 of Atmel Corp (http:// www.atmel.com). This scheme represents non-volatile memory EEPROM with the organization 128H8 or 64H16, accessible on interface SPI.

Using special FTDI utility MProg user can write Vendor ID and Product ID of device, small text identifier and some settings. Vendor ID, Product ID, and text identifier are used for driver installation and device registration in system.

Information accepted on USB interface and transformed by microcircuit, is output as RS-232 protocol packages.

ADC and DAC Modules are presented on Figure 4.

Hardware Analog Signal Formation Module

Fig .4. ADC and DAC Modules The DAC Module is represented a DAC7611 of Burr-Brown Corp (http://www.burr-brown.com).The DAC7611 is a 12-bit digital-to-analog converter (DAC) with guaranteed 12-bit monotonic performance over the industrial temperature range. It requires a single +5V supply and contains an input shift register, latch, 2.435V reference, DAC, and high speed rail-to-rail output amplifier. For a full-scale step, the output will settle to 1 LSB within 7ms. The device consumes

2.5mW (0.5mA at 5 V). A precision, low-power amplifier buffers the output of the DAC section and provides additional gain to achieve from 0 to 4.095V range.

The synchronous serial interface is compatible with a wide variety of DSPs and microcontrollers. Clock (CLK), serial data in (SDI), and load strobe (LD) comprise the serial interface. In addition, two control pins provide a chip select (CS) function and an asynchronous clear (CLR) input. The CLR input can be used to ensure that the DAC7611 output is 0V on power-up or as required by the application.

DAC controlled by SPI serial protocol. Debugging Controller consists of SPI serial protocol hardware realization; however it has been multiplicated with I2C protocol with many devices are connected. DAC is connected to general purpose outputs. It requires software solution of SPI exchange protocol but taking into consideration its uncomplicated structure, it could be made easily.

Hardware and Software analog signal formation modules are connected to ADC via analog commutation module. This analog commutation module is represented 4-channels synchronous analog multiplexer ADG774.

Hardware analog signal formation module consists of three direct current and three variable resistors which form three independent supply voltage divisors. Direct current resistors are in way selected to limit highest analog signal at rate of 4V. Voltage measurement is executed by variable resistors in range from 0 to 4V. Such input signals values are allowable for normal functioning of built-in ADC input cascades.

Software analog signal formation module is necessary for input signals which are sent thereof in distant laboratory works carrying out with built-in ADC of Debugging Controller.

It is built on the base of 4-channels digital potentiometer AD8403, Analog Devices Inc. It presents semiconductor equivalent of the variable resistor with the difference, that resistance changing is implemented by means of digital code, not slider.

AD8403 has 256 gradations of changing the resistance. There are potentiometers with nominal resistance 1, 10, 50 and 100K0hm. In our work we used potentiometer 100K0hm for reducing power consumption.

Master Controller controls digital potentiometer by SPI serial protocol.

The physical quantities measurement is provided by temperature measuring module and by accelerometer (Fig. 5).

Fig .5. Temperature Measuring Module and Accelerometer

The temperature measuring module is implemented on integrated sensor TMP36 and operational amplifier 0P295 of Analog Devices Inc. Ambient temperature transforms in range from -40°C to +125°C with precision 2°C in output voltage signal with dependency 10mV/°C and linearity in 0.5°C. In spite of quite big output signal, its value is not enough for qualitative digitization by integrated ADC.

The voltage amplifier has been provided for enlarging output signal amplitude to digitize value on operational amplifier 0P295, as was required. Hence, with maximum measured temperature output signal is drawn near to maximum voltage of the digitization built-in ADC debugging microcontroller.

Acceleration measuring module. Measurement of acceleration is one of the most relevant and often measured in industry physical quantities. Therefore there is a great demand for inexpensive, compact and reliable systems for its measurement.

Module is built on the base of 2-Axis Acceleration Sensor ADXL202E of Analog Devices Inc. The block diagram is shown in Figure 6.

Xfilt =L= CXfilt -Q—

Sensor X Demodulator

RXfilt

Generator

Sensor Y Demodulator

RYfilt

—O Xout

PWM Modulator

—O Yout

Yfilt H= CYfilt

T

Fig . 6. ADXL202E Accelerometer

After being low-pass filtered, the analog signal is converted to a duty cycle modulated signal in the DCM stage. A single resistor sets the period for a complete cycle (T2) with range of values between 0.5 ms and 10 ms. A 0g acceleration produces a nominally 50% duty cycle. The acceleration signal can be determined by measuring the length of the T1 and T2 pulses with a timer or polling loop using a low cost microcontroller.

On the Figure 7, T1 is length of the plus phase of the impulse, and T2 is total length of the impulse.

T1

T2 -►

-

Fig . 7. Phases of the accelerometer impulse A(g) = 8 x

■ 0.5

An analog output voltage can be obtained either by buffering the signal from the XFILT and YFILT pin, or by passing the duty cycle signal through a RC filter to restore the constant value. I2C Digital System Devices are given on the figure 8, and provide:

- Real time clock with independent generator and power supply;

- Non-volatile memory with size of 256KBit (32Kb) providing information storage without voltage more than 200 years.

Fig . 8. I2C Devices

Real time clocks module. The module is based on DS1307 of Dallas Semiconductor Corp (http://www.dalsemi.com). The chip represents an independent system of time counting, and includes separate timers for counting seconds, minutes, days, weeks, and years. Information about current time does not require any additional transformations and is stored as binary-coded decimals on the eight fast addresses. Moreover, the user can load and read own data in 56 bytes of the built-in nonvolatile memory.

Reading and recording of information using a chip is carried out with the help of I2C protocol.

For normal and uninterrupted operation, real-time clocks requires the crystal resonator designed for frequency of 32768 Hz, and an additional power supply which is usually the lithium-ionic battery, necessary for operation in an absence of the main power supply.

In addition, chip has an out on which impulses of certain frequency can be generated and used for time synchronization in an application.

Nonvolatile memory module is applied to store any data with absence of a voltage supply. Actually, it is a R0M chip which can be erased for writing new information, as needed.

The module is implemented on a 24LC256 chip of Microchip Technology Inc which has architecture 32768 x 8 and serial access on I2C protocol. I2C Bus allows to transmit data with a velocity 100KBit/sec and 400KBit/sec and allows connecting several devices on scheme «wired AND». For this purpose SDA and SCL outputs should have the scheme «an open collector». The amount of the devices which have been connected to a bus is restricted only to its maximum capacity 400pF and possibilities of addressing of online units.

The chip can store information without a voltage supply more than 200 years and has 100000 erase and recording cycles. It has paging (64 bytes) and fast time of programming (less than 5 ms).

A possibility of hardware write and erasing protect by the adjustment of logical signals on WP output, and a possibility of cascade memory capacity jointing, using hardware addressing outputs A2-A0, relates to additional features.

LAN interface Module is based on W3100A microcircuit of Korean company WIZ net (http:// www.wiznet.co.kr). It is designed for connecting the laboratory bench to local-area network.

This microcircuit represents hardware implementation of TCP/IP stack and supports such data transfer protocols as TCP/IP ver.4, TCP/IP ver.6, UDP, ICMP, and ARP.

The Microcircuit has special registers for keeping main local-area network setup parameters (IP address, subnet mask, host address, ports addresses, etc.), which can be easily programmed and changed depending on specific local-area network segment configuration.

W3100A makes information exchange with personal computer via ports (sockets), which are beforehand defined by system administrator and programmed in the bench. W3100A supports the simultaneous work with four sockets.

In respect to the microcontroller, W3100A could be considered as external ROM with some specific functions. It has 15-bits address bus, 8-bits data bus and WR, RD, CS controlling signals, required for reading and writing information.

Several types of addressing to internal memory W3100A are possible:

- direct - such type of addressing use all address buses of W3100A. This type of connection provides the fastest information exchange, however it requires the large number of microcontroller outputs;

- indirect - such type of addressing are using only two address bus outputs. Writing and reading information is executed via special indirect access registers. Additional possibility consists in indirect address register internal increment avoiding modifying the memory cell address under blocks writing or reading information. Such addressing type provides the data transfer rate less, than direct addressing;

- I2C - this type of addressing is used in case when high data transfer rate is not needed. Writing and reading information is implemented in compliance with specification of the I2C bus.

However, for connection to the local-area network, one of W3100A is not enough, since it provides only logical protocol implementation. For data transfer it is necessary also to provide the physical level.

In the laboratory bench physical level is built in RTL8201BL microcircuit and 16PT8515 matching transformer. The structure scheme is shown on figure 9.

Fig . 9. LAN Module block diagram

iНе можете найти то, что вам нужно? Попробуйте сервис подбора литературы.

The LAN-interface Module executes transfer of data and command functions from personal computer to master microcontroller and back in laboratory bench. In addition, it informs about lost or incorrectly received packages.

The LAN-interface Module is built on scheme with direct addressing, since work with laboratory bench in programming and debugging modes requires quite big level of transmitted data.

Local-area network parameters configuration is executed by USB interface means of laboratory bench.

Master microcontroller. It is PIC 18F6720 Microchip Technology Inc with the functions of:

- Interaction with server software via LAN interface;

- Programming, launching and restarting debugging microcontroller;

- Reading results from debugging microcontroller and its output to server program;

- Controlling the clock for selection one of the accessible clock rates;

- Shaping a clock rate for debugging microcontroller at step by step remote execution of the program;

- Controlling an analog commutator purposed for selection of analog signals generator on a built-in ADC;

- Controlling a digital potentiometer for analog signals software forming on a built-in ADC.

For providing these functions, the specialized software has been developed. It must be loaded

into a master microcontroller via special XP2 connector at a production phase.

The debugging microcontroller is chosen as PIC18F8720 of Microchip Technology Inc. This chip is the most full-function one of all PIC18 series and its using allows to solve a huge amount of various problems.

It has 128Kb built-in FLASH-memory for programs, RAM with 3840 bytes, 1Kb of the nonvolatile data memory and many built-in timers, peripheral modules and different hardware interfaces which simplifies considerably organization of interaction with externals peripheral units.

It operates with internal, external programs memory, and with their combination. In our case the switching with an internal programs memory is used.

PIC 18F8720 command system is well optimized for creating software in low-level programming languages, such as Assembler, and high-level programming languages, such as C and C++.

The second serial port (for connection with the second personal computer, for example) and the interrupts external connector are additional features of Digital System.

This hardware can be applied for connecting many devices for considerably enlarging possibilities of Digital System.

3. Remote Access to Digital System Architecture

Despite of all advantages of applying Digital System in learning process its costs remains quite high, and acquisition of sufficient number of copies for high-quality educational process is quite problematic.

For solving this problem the remote access to Digital System via local area network or Internet was proposed.

Since the Digital System is a functionally determined device it is expedient to assign the organization of a remote access to the software controlled by the operating system.

The software designed for working with the Digital System is divided into server and client parts. The server part of software is allocated on a computer with the Digital System installed and the client applications are located on computers of students. The scheme of such architecture is shown on figure 10.

n

Client 2 Client 4 1 Client N 1

Fig . 10. Usage of Digital system via Local Area Network The purposes of the Server software part are: user authentication, processing of client applications requests, feeding of Digital System with control commands.

Client software part purposes are: creation of requests to server, sending software to server for loading into the Digital System, receiving and displaying the results from server.

During the development of hardware and software parts of the System the 30-day evaluation versions of the following software were used: P-CAD 2004, Multisim 2001, Borland Delphi 2005, and IAR Embedded Workbench for PIC18.

Fig .11. Usage of Digital system via Internet

4. Conclusion

The Digital System built on the basis of modern microcontrollers and having wide variety of peripheral modules by the technical characteristics is not worse and in some positions even outperforms the analogous characteristics of other devices.

Using of the two processor architecture allowed to increase the reliability and the robustness of the system significantly. Using of the remote access considerably simplifies the organization of laboratory works at full-time and remote forms of training.

The designed system corresponds to the modern requirements and is a novelty.

The system is architecturally designed, developed, manufactured and debugged in the framework of student's scientific and technical creativity of the Computers department of Kharkiv national university of radioelectronics.

References: 1. Горшков Б Л. Методы практического конструирования при нормировании сигналов с датчиков. Москва: ЗАО АВТЭКС, 2003. 2. Пейтон А. Дж., Волш В. Аналоговая электроника на операционных усилителях. Москва: БИНОМ, 1994. 352 с. 3. PIC18FXX2 Однокристальные 8-разрядные FLASH CMOS с 10-разрядным АЦП компании Microchip Technology Incorporated. Москва: ООО «Микро-Чип». 2003. 4. WaltKester. Analog-Digital Conversion, Analog Devices Inc. ADI Central Application Department. 2004. 5. AD7714 3V/5V. CMOS. 500^A Signal Conditioning ADC. Datasheet Rev. C. Analog Devices Inc. One Technology Way. 1998. 6. AD780 2.5V/3.0V High Precision Reference. Datasheet Rev. A. Analog Devices Inc. One Technology Way. 1998. 7. OP295/OP495 Dual/Quad Rail-to-Rail Operational Amplifiers. Datasheet Rev. B. Analog Devices Inc. One Technology Way. 1995. 8. PIC18FXX20 64/80-Pin High Performance. 1Mbit Enhanced FLASH Microcontrollers with A/D. Microchip Technology Inc. 2003.

Поступила в редколлегию 23.04.2007 Шеховцов Борис Григорьевич, канд. техн. наук, доцент, профессор кафедры ЭВМ ХНУРЭ. Научные интересы: микропроцессорная и микрокомпьютерная техника. Увлечения: горные лыжи, классическая музыка, хорошие песни. Адрес: Украина, 61166, Харьков, ул. 23 Августа, 81, кв. 54, тел. 3437616.

Беспалов Антон Сергеевич, инженер кафедры ЭВМ ХНУРЭ. Научные интересы: микропроцессорная техника. Увлечения: биллиард, мотоспорт, музыка, русская литература. Адрес: Украина, 61145, Харьков, ул. Новгородская, 4, кв. 87, тел. 7014011.

Галин Дмитрий Георгиевич, инженер ADB Polska Sp. z o.o. Научные интересы: микропроцессорная техника. Увлечения: программирование, литература, кинематограф. Адрес: Украина, 62472, Харьковская обл., Харьковский район, г.Мерефа, пер.Горького, 12.

УДК 004.7 Д.В. ФАСТОВА

ПОДСИСТЕМА ПРОГНОЗИРОВАНИЯ ВРЕМЕННОЙ ХАРАКТЕРИСТИКИ СХОДА ЛАВИНЫ

Определяется структура информационного обеспечения геоинформационной системы, показываются связи между элементами информационного обеспечения, ее функциями и задачами. Выделяются основные задачи подсистемы прогнозирования, среди которых главной является проблема прогнозирования времени схода лавины. Приводятся этапы функционирования подсистемы прогнозирования. Предлагается метод прогнозирования временной характеристики схода лавины, который базируется на построении двух видов моделей: интерпретационной модели лавинного климата и нечеткой модели интерпретации временной характеристики лавинного схода.

Введение

Согласно технологии системного моделирования, информационное обеспечение имитационной модели для прогнозирования временной характеристики схода лавин должно включать множество математических моделей, а также разнородные данные соответствующей проблемной ориентации [1, 2]. Результаты прогнозирования должны быть обработаны и представлены с требуемым уровнем информативности для отражения различных аспектов развития лавинной ситуации.

Задача прогнозирования лавинной опасности в геоинформационных системах разбивается на два типа - прогнозирование степени лавинной опасности и прогнозирование времени схода лавины. Результаты прогнозирования используются в системе поддержки принятия решений, в которой с участием экспертов производится корректировка и вырабатываются рекомендации по проведению противолавинных мероприятий. Оправдываемость прогнозов зависит от математического обеспечения геоинформационной системы. Среди известных методов прогнозирования степени лавинной опасности можно выделить метод ближайшего соседа [3] и множественный регрессионный анализ [4]. Описанные методы требуют значительных вычислительных ресурсов и поэтому не получили массового применения, но широко используется для прогноза лавинной опасности в Швейцарии и Франции [4, 5]. Эффективность прогнозов, полученных с использованием данных методов, составляет приблизительно 65-70%.

i Надоели баннеры? Вы всегда можете отключить рекламу.