Page 221 - Mechatronics with Experiments
P. 221
CHAPTER 4
MICROCONTROLLERS
Most of the discussions in this chapter are based on the PIC 18F452 microcontroller (or
PIC 18F4431 version which has a quadrature encoder interface). The following manuals
can be downloaded from http://www.microchip.com and should be used as a reference
and as part of this chapter:
1. PIC 18FXX2 Data Sheet or PIC 18F4431 Data Sheet
2. MPLAB IDE V6.xx Quick Start Guide
3. MPLAB C18 C Compiler Getting Started
4. MPLAB C18 C Compiler Users’ Guide
5. MPLAB C18 C Compiler Libraries
4.1 EMBEDDED COMPUTERS VERSUS
NON-EMBEDDED COMPUTERS
The digital computer is the brain of a mechatronic system. As such, it is called the controller
when used for the control function of an electro-mechanical system. Any computer with
proper I/O interface devices (digital and analog I/O) and software tools can be used as a
controller. For instance, a desktop PC can be used as a process controller by adding an I/O
expansion board and control software. Clearly, there are many hardware components on a
desktop PC (a non-embedded computer) that are not needed for process control functions.
An embedded computer uses only the necessary hardware and software components and
is much smaller than a non-embedded computer, such as a desktop PC. An embedded
computer used as the controller of a mechatronic system is referred to as the embedded
controller. A microcontroller is the main building block of an embedded computer.
Figure 4.1a shows a comparison between an embedded and non-embedded (i.e.,
desktop) computer. Figure 4.1b shows a picture of a commercially available embedded
controller used in mobile equipment applications. The main differences between embedded
and non-embedded computers are as follows:
1. Embedded computers are generally used in real-time applications. Therefore, they
have hard real-time requirements. Hard real-time requirement means that certain
tasks must be completed within a certain amount of time, or the computer must react
to an external event within a certain time. Otherwise the consequences may be very
serious. The consequences of not meeting the real-time response requirements in a
desktop application are not as serious.
2. Embedded computers are not general purpose computing machines, but have more
specialized architectures and resources. For instance, a desktop computer would have
Mechatronics with Experiments, Second Edition. Sabri Cetinkunt.
© 2015 John Wiley & Sons, Ltd. Published 2015 by John Wiley & Sons, Ltd.
Companion Website: www.wiley.com/go/cetinkunt/mechatronics
207