Sei sulla pagina 1di 5

Design and Development of a Framework for

HIL Testing of Digital Hardware with MATLAB


Prof Preet Jain 1, Nilesh Chaurasia2, Ishwar Rathod3
Asst. Prof, Elec. & Comm. Engg. Shri Vaishnav Institute of Tech. &Sc., Indore
Student, M.E., Embedded System & VLSI Design, Shri Vaishnav Institute of Tech. &Sc., Indore
Lect., Elec. & Comm. Engg. Shri Vaishnav Institute of Tech. &Sc., Indore
Email: (preetjain@gmail.com, nileshchaurasia@rediffmail.com, rathod_is123@yahoo.co.in)

I/Os. And it is easily available [1]. We have


chosen the C language because C is one of
powerful language to test and verify algorithms
and designs for embedded domains too [3]. In
this work we have interfaced micro-controllers
with standard serial communication interface and
written C source code for program running on
controllers in the test environment.

Abstract
It is very useful to form a general-purpose (that
is re-configurable) framework for HIL
(Hardware in Loop Testing) of digital hardware.
In many cases we simulate the digital hardware
during the design time and we have different
tools for viewing the result whether the design is
working fine or not. But when we actually need
to test the actual hardware these many tools are
helpless. And also it is advisable that the
framework is become very helpful if it is able in
the case of combination as well as sequential
circuits. And it is also found that if this interface
is re-configurable in the sense that one can write
their own test algorithms, and one can also
specify the hardware connection for there test
hardware (that is probing). And keeping this in
mind I have developed a framework with microcontroller kit (which is simply can be designed)
and well-known MATLAB software. We have
chosen this kit because this kit contains variety
of we have chosen this micro-controller because
this contains variety of interfaces and many
digital I/Os. And it is easily available [1]. We
have chosen matlab because matlab is one of
powerful tool to test and verify algorithms and
designs [4]. In this framework we have
interfaced hardware kit, test hardware with
MATLAB through serial interfaces.

Use of MATLAB for the solution of


problems associated in the testing domain is a
quite important because matlab one of the most
popular engineering tools for problems
associated in different domains of engineering
[4]. Particularly in our case we can write the test
algorithms in the M-file and also one can view
the test data in several ways.
And also one can write the test algorithm in the
MATLAB scripting language that is m-file (a
language for MATLAB programs it is basically a
scripting language), and one can also specify the
hardware connection for their test hardware (that
is probing).
We propose an interface of matlab for
test and debug interface with micro-controller.
Also we have developed hardware for testing and
probing the hardware under test.
Use of microcontroller for the solution of
problems associated in the debug and industrial
testing domain is a quite important because in
debug and industrial testing it is required to
execute the different algorithms to control and
sense the different signal values, and digitally
control the operations and devices [3]. The Intel
8051 Architecture has many digital I/Os,
Interfaces like Timer/Counters and Interrupts. [1]

1. Introduction
Keeping this in mind we have developed a
framework with a standard Intel 8051
architecture microcontroller (which is one of the
most versatile microcontroller families) and well
known Keil software for programming in C. We
have chosen this microcontroller because this
contains variety of interfaces and many digital

We propose an interface of microcontrollers


testing hardware and MATLAB with the standard
serial communication interface for industrial
testing; also we have developed a hardware for
industrial testing that is testing through controller
and MATLAB. And more importantly the test
data can be effortlessly analyzed in the
MATLAB environment and a final report or
abstract information can be extracted from the
test data. And in MATLAB one can view and
analyze the test data in diversified ways like
plots etc [4].

language is based (principally) on matrices, But


it is slow (compared with FORTRAN or C)
because it is an interpreted language, i.e. not precompiled. Automatic memory management, i.e.,
you don't have to declare arrays in advance ) [4].
It reduces program development time
than traditional programming languages such as
Fortran and C. MATLAB has many applicationspecific toolboxes which supports development
of high level test applications.
As we all know that Microcontroller
/microprocessor are the way to implements
flexible digital systems. Keil is an interactive,
integrated, environment for development of
programs for Intel 8051 microcontroller based
solutions [2].
We have used Philips P89v51RD2
based self developed microcontroller kit. The
Philips P89v51RD2 is a Intel 8051 architecture
based advanced processor. One can use any other
standard 8051 microcontroller. We have used this
particular controller because it has ISP feature,
which makes it easy for downloading of the
application program. The microprocessor can be
programmed to exhibit any kind of autonomous
behavior using a PC. After building a hardware
users creates a program with easy-to-use,
feature-rich Keil software. You can program the
microcontroller hardware for actively interact
with surrounding and take the decisions and
control the devices attached with.
The Keil environment is rich in features
in which we can program different sensors and
actuators. We have shown in figure 2 that how
we can build a program and in figure 3 add the
source file in the project in the Keil software and
in figure 4 build the application. In that way we
can program the microcontroller with the help of
Keil software. But this program is run on a single
microcontroller. [2]

In our work we have interfaced one


microcontroller board with my test hardware and
controlled the testing board with MATLAB MScripting file. Testing a specific digital hardware
boards really difficult and time consuming if you
are doing it with manual methods, and also it
required great amount of time to analyze the test
data. And also if test hardware requires many
digital I/O lines it is very difficult to generate
and set the test setup.

Figure 1. Micro-controller Board

Testing processor has a local copy of dedicated


standalone software for the required function one
has to do. The mapping of an application into the
processor and in the MATLAB environment is
presented in this paper.

2. Background
As we all know that MATLAB stands for
MATrix LABoratory. It is developed by The
Mathworks, Inc. (http://www.mathworks.com). It
is an interactive, integrated, environment for
numerical
computations,
for
scientific
visualizations [4].
It is a high-level programming
language. Program runs in interpreted, as
opposed to compiled, mode. Programming

Figure 2. Creating a new project in Keil

Users with serial communication enabled


computer hardware (or using COM dongle) can
transfer their programs to the microcontroller by
wire communication.

But due to limited I/Os capability and limitation


in the computational power a single
microcontroller have it is difficult to interface
I/O intensive applications that required executing
more complex algorithms, we have to switch to
multiprocessor environment.
Disciplined approaches are required when
designing increasingly complex digital systems.
Design abstraction using multi-processor system
model hides the complexity of underlying work
and makes design simple and more efficient.

3. Proposed Framework
We think to develop a framework which is able
to test the digital hardware and we wanted to
explore the capabilities of Micro-controller and
MATLAB both. Therefore we proposed an
interface between microcontrollers with the help
of serial communication interface with PC.
Figure 3. Adding the source in the project

We propose an interface of MATLAB for test


and debug hardware (Microcontroller board)
with which circuit under test (CUT) is connected.
We have developed a Micro-controller based
hardware for testing and probing the CUT.
We have written program in C for
microcontroller, using that utilize serial port
capabilities of microcontrollers and apply the test
vector and sense the different signals from test
hardware and send it back to the MATLAB. [4]
Figure 5 shows the proposed
framework. One microcontroller work as a
testing hardware of the test bench and the test
vector and test data is managed by the MATLAB
(M-Scripting).

Keil supports two programming languages


Assembly and C. Assembly is the low level
programming language that provide good level
of control and efficiency of microcontroller, but
it suffer from the low development speed. Where
as C is a high-level programming language. That
supports fast development of application
program. After generating the source code one
has to compile it. And after compilation the HEX
file will be generated by the Keil and which has
to be downloaded in the microcontroller. But the
generated code with C dont have good use of
architecture but when we consider time to market
matrix, C is one of the accepted language among
the developers. [2]

Figure 5. Test & Debug Interface

Figure 4. Build an application in keil

In this framework the micro-controller are


connected with standard serial communication
interface (TXD, RXD lines) with PC, which is
actually a two wire interface as shown in the
figure 5.
Microcontroller
is
seeking
the
commands from the PC through MATLAB. And
then microcontroller set the input to the CUT and
then sense the digital signals and send it back to
the MATLAB for further analysis and display.

language for MATLAB programs it is basically a


scripting language), and also specified the
hardware connection for their test hardware

4. Conclusion
We found that the framework which we
have developed Matlab integration with
Microcontroller for test & Debug interface
supports development and testing of different
digital hardware, including ICs, project boards
and digital industrial setups etc..

Each communication from PC has a test vector to


the test setup and in turn receives the test data
from the test setup. After receiving the
communication from the testing setup MATLAB
analyze the communication and run algorithms
accordingly, and generate the report and also if it
is required it will visualize the test data.

Also we have observed that due to delay in the


processing in MATLAB and accessing in the
robot actuators some times the behavior required
is not fully satisfactory. And we will say that in
highly moving environment the application of
this solution is not acceptable.

3.1 Prototype Application Developed

Also with the integration of MATLAB with test


hardware makes a great sense for engineering
hobbyists, because it is low cost and time
efficient way of testing the hardware.

In this work we have developed a C


program for microcontroller and also developed
the MATLAB program for test algorithm.

Also we have observed that due to delay in the


processing in processor accessing of fast devices
is required special attention.
In the devices some times the behavior
required is not fully satisfactory. And we will say
that in high speed environment the application of
this solution is not acceptable.
Also with the integration of multiple processor in
the single application with serial communication
interface makes a great sense for hobbyists and
students.

Figure 6. Test Hardware

We have worked on the self developed 8051


microcontroller kit which is equipped with
Philips P89v51RD2 microcontroller which is a
standards 8051 microcontroller with some added
features. With this kit we have first developed
the different controlling system, which is
equipped with the sensor, (for measuring status
of complete system).
In this prototype application we have
used microcontrollers. And interconnected and
testing hardware and tested for proper
connectivity.
Processor is actually control the column
of the display. The MATLAB will give the
necessary commands to the testing hardware.

5. Future Scope
We are working on generating the
standard M-scripting files for different test
applications.
It is also very informative to generate
the GUI for this testing framework, so that one
can develop the test algorithm with ease.
In laboratory work the setup can be
used for demonstration purpose to the students.
Also it is possible to incorporate the standard test
algorithm of testing the digital hardware. And
also one can attempt to generate the subsystem
for analog circuit testing.

And also we have written the test algorithm in


the MATLAB scripting language that is m-file (a

REFERENCES
[1]
[2]

[3]

[4]

8051 Microcontroller - Kenneth J. Ayala,


Penram International/ Thomson, 3rd
Edition, 2005.
Keil software website for online help
(http://www.keil.com/support/man/docs/c5
1/,
http://www.keil.com/support/man_c51.htm
)
D. G. Beetner, H. J. Pottinger, and K.
Mitchel, Laboratories Teaching Concepts
in Microcontrollers and HardwareSoftware Co-Design, 30th ASEE/IEEE
Frontiers in Education Conference, pp.
SIC/1-5, 2000.
Mathworks
online
help
(http://www.mathworks.com/support/)

Potrebbero piacerti anche