Page 224 - Mechatronics with Experiments
P. 224
210 MECHATRONICS
(writing their appropriate bits to “1” or “0”), and then when the conversion data is
ready (determined by reading a specific bit from a status register), reading the data
register’s first 10 bits for a 10-bit ADC converter. For example, PIC 18F452 has
about 100 special function registers (SFR) each of which is 8-bits long (B0-B7). This
means that a total of 800 bits are used to handle (configure, read, write) all of the I/O.
In non-real-time applications, we tend to work with data structures that are long and
organized in some hierarchy as opposed to dealing with specific bits.
Design Steps of an Embedded Microcontroller-Based Mechatronic
System Design of a microcontroller-based mechatronic system includes the following
steps. These steps encompass the microcontroller and its interface to the electromechanical
system. We assume the electromechanical system is already designed.
Step 1: Specifications – define the purpose and function of the device. What are the
required inputs (sensors and communication signals) and required outputs (actuators
and communication signals)? This is the hardware requirement of microcontroller.
What are the logical functions required? This is the software requirement of micro-
controller.
Step 2: Selection – select a proper microcontroller that has the necessary I/O capabilities
to meet the hardware requirements as well as the CPU and memory capabilities to
meet the software requirements.
Step 3: Selection – select a proper development tool set for the microcontroller, that is
PC-based development software tools and hardware tools for debugging.
Step 4: Selection – identify electronic components and sub-systems necessary to inter-
face the microcontroller to the mechatronic system.
Step 5: Design – complete schematics for the hardware interface circuit, including each
component identification and its connections in the interface circuit.
Step 6: Design – write the pseudo-code of the application software structure, its modules
and flow chart.
Step 7: Implement – build and test the hardware.
Step 8: Implement – write the software.
Step 9: Implement – test and debug the hardware and the software.
Microcontroller Development Tools Typical development tools used in an
embedded controller development environment are grouped into two categories: hardware
tools and software tools (Figure 4.2). The hardware tools include:
1. a desktop/laptop PC to host most of the development software tools,
2. the target processor (i.e., an evaluation board or the final target microcontroller
hardware),
3. debugging tools such as a ROM emulator, logic analyzer,
4. EEPROM/EPROM/Flash writer tools (also called the “programmer”, because it is
used to download the program to the target microcontroller).
The software tools include the target processor specific
1. assembler, compiler, linker, and debugger,
2. real-time operating system (not required).