SlideShare a Scribd company logo
Embedded Systems Design 2nd Edition Steve Heath
download
https://ebookgate.com/product/embedded-systems-design-2nd-
edition-steve-heath/
Get Instant Ebook Downloads – Browse at https://ebookgate.com
Get Your Digital Files Instantly: PDF, ePub, MOBI and More
Quick Digital Downloads: PDF, ePub, MOBI and Other Formats
Embedded Systems Architecture Programming and Design
2nd Edition Raj Kamal
https://ebookgate.com/product/embedded-systems-architecture-
programming-and-design-2nd-edition-raj-kamal/
Making Embedded Systems Design Patterns for Great
Software 2nd Edition Elecia White
https://ebookgate.com/product/making-embedded-systems-design-
patterns-for-great-software-2nd-edition-elecia-white/
Fast and Effective Embedded Systems Design 1st Edition
Rob Toulson
https://ebookgate.com/product/fast-and-effective-embedded-
systems-design-1st-edition-rob-toulson/
Design Patterns for Embedded Systems in C An Embedded
Software Engineering Toolkit 1st Edition Bruce Powel
Douglass
https://ebookgate.com/product/design-patterns-for-embedded-
systems-in-c-an-embedded-software-engineering-toolkit-1st-
edition-bruce-powel-douglass/
TCP IP Lean Web Servers for Embedded Systems 2nd
Edition Jeremy Bentham
https://ebookgate.com/product/tcp-ip-lean-web-servers-for-
embedded-systems-2nd-edition-jeremy-bentham/
Real Time UML Workshop for Embedded Systems 2nd Edition
Bruce Powel Douglass
https://ebookgate.com/product/real-time-uml-workshop-for-
embedded-systems-2nd-edition-bruce-powel-douglass/
Embedded System Design Third Edition Santanu
Chattopadhyay
https://ebookgate.com/product/embedded-system-design-third-
edition-santanu-chattopadhyay/
Analog and Digital Filter Design 2nd ed Edition Steve
Winder
https://ebookgate.com/product/analog-and-digital-filter-
design-2nd-ed-edition-steve-winder/
Programming embedded systems with C and GNU development
tools 2nd Edition Michael Barr
https://ebookgate.com/product/programming-embedded-systems-with-
c-and-gnu-development-tools-2nd-edition-michael-barr/
Embedded Systems Design 2nd Edition Steve Heath
Contents i
Embedded Systems Design
ii Contents
By the same author
VMEbus: a practical companion
Newnes UNIX™ Pocket Book
Microprocessor architectures: RISC, CISC and DSP
Effective PC networking
PowerPC: a practical companion
The PowerPC Programming Pocket Book
The PC and MAC handbook
The Newnes Windows NT Pocket Book
Multimedia Communications
Essential Linux
Migrating to Windows NT
All books published by Butterworth-Heinemann
About the author:
Through his work with Motorola Semiconductors, the author has been
involved in the design and development of microprocessor-based systems since 1982.
These designs have included VMEbus systems, microcontrollers, IBM PCs, Apple
Macintoshes, and both CISC- and RISC-based multiprocessor systems, while using
operating systems as varied as MS-DOS, UNIX, Macintosh OS and real-time kernels.
An avid user of computer systems, he has had over 60 articles and papers published
in the electronics press, as well as several books.
Embedded Systems Design
Second edition
Steve Heath
OXFORD AMSTERDAM BOSTON LONDON NEW YORK
PARIS SAN DIEGO SAN FRANCISCO SINGAPORE SYDNEY TOKYO
iv Contents
Newnes
An imprint of Elsevier Science
Linacre House, Jordan Hill, Oxford OX2 8DP
200 Wheeler Road, Burlington MA 01803
First published 1997
Reprinted 2000, 2001
Second edition 2003
Copyright © 2003, Steve Heath. All rights reserved
The right of Steve Heath to be identified as the author of this work
has been asserted in accordance with the Copyright, Designs and
Patents Act 1988
No part of this publication may be reproduced in any material form (including
photocopying or storing in any medium by electronic means and whether or not
transiently or incidentally to some other use of this publication) without the
written permission of the copyright holder except in accordance with the
provisions of the Copyright, Designs and Patents Act 1988 or under the terms
of a licence issued by the Copyright Licensing Agency Ltd, 90 Tottenham
Court Road, London, England W1T 4LP. Applications for the copyright
holder’s written permission to reproduce any part of this publication should be
addressed to the publisher
TRADEMARKS/REGISTERED TRADEMARKS
Computer hardware and software brand names mentioned in this book are
protected by their respective trademarks and are acknowledged
British Library Cataloguing in Publication Data
A catalogue record for this book is available from the British Library
Library of Congress Cataloguing in Publication Data
A catalogue record for this book is available from the Library of Congress
ISBN 0 7506 5546 1
Typeset by Steve Heath
Contents v
Contents
Preface xvii
Acknowledgements xix
1 What is an embedded system? 1
Replacement for discrete logic-based circuits 2
Provide functional upgrades 3
Provide easy maintenance upgrades 3
Improves mechanical performance 3
Protection of intellectual property 4
Replacement for analogue circuits 4
Inside the embedded system 8
Processor 8
Memory 8
Peripherals 9
Software 10
Algorithms 10
Microcontroller 11
Expanded microcontroller 13
Microprocessor based 14
Board based 14
2 Embedded processors 15
8 bit accumulator processors 16
Register models 16
8 bit data restrictions 17
Addressing memory 18
System integrity 19
Example 8 bit architectures 19
Z80 19
Z80 programming model 21
MC6800 22
Microcontrollers 23
MC68HC05 23
MC68HC11 23
Architecture 25
Data processors 25
Complex instructions, microcode and nanocode 25
INTEL 80286 28
Architecture 28
Interrupt facilities 29
Instruction set 30
80287 floating point support 30
Feature comparison 30
vi Contents
INTEL 80386DX 30
Architecture 30
Interrupt facilities 32
Instruction set 32
80387 floating point coprocessor 33
Feature comparison 33
INTEL 80486 34
Instruction set 35
Intel 486SX and overdrive processors 35
Intel Pentium 36
Multiple branch prediction 38
Data flow analysis 38
Speculative execution 38
The MMX instructions 39
The Pentium II 40
Motorola MC68000 40
The MC68000 hardware 41
Address bus 41
Data bus 41
Function codes 42
Interrupts 43
Error recovery and control signals 44
Motorola MC68020 44
The programmer’s model 46
Bus interfaces 49
Motorola MC68030 50
The MC68040 51
The programming model 53
Integrated processors 54
RISC processors 57
The 80/20 rule 57
The initial RISC research 58
The Berkeley RISC model 59
Sun SPARC RISC processor 60
Architecture 60
Interrupts 60
Instruction set 61
The Stanford RISC model 62
The MPC603 block diagram 63
The ARM register set 65
Exceptions 66
The Thumb instructions 67
Digital signal processors 68
DSP basic architecture 69
Choosing a processor 72
Contents vii
3 Memory systems 73
Memory technologies 74
DRAM technology 76
Video RAM 77
SRAM 77
Pseudo-static RAM 78
Battery backed-up SRAM 78
EPROM and OTP 78
Flash 79
EPROM 79
Memory organisation 79
By 1 organisation 80
By 4 organisation 81
By 8 and by 9 organisations 81
By 16 and greater organisations 81
Parity 81
Parity initialisation 82
Error detecting and correcting memory 82
Access times 83
Packages 83
Dual in line package 84
Zig–zag package 84
SIMM and DIMM 84
SIP 85
DRAM interfaces 85
The basic DRAM interface 85
Page mode operation 86
Page interleaving 86
Burst mode operation 87
EDO memory 87
DRAM refresh techniques 88
Distributed versus burst refresh 88
Software refresh 89
RAS only refresh 89
CAS before RAS (CBR) refresh 89
Hidden refresh 89
Memory management 90
Disadvantages of memory management 92
Segmentation and paging 93
Memory protection units 97
Cache memory 99
Cache size and organisation 100
Optimising line length and cache size 104
Logical versus physical caches 105
Unified versus Harvard caches 106
Cache coherency 106
viii Contents
Case 1: write through 108
Case 2: write back 109
Case 3: no caching of write cycles 110
Case 4: write buffer 110
Bus snooping 111
The MESI protocol 116
The MEI protocol 117
Burst interfaces 118
Meeting the interface needs 119
Big and little endian 121
Dual port and shared memory 122
Bank switching 123
Memory overlays 124
Shadowing 124
Example interfaces 125
MC68000 asynchronous bus 125
M6800 synchronous bus 127
The MC68040 burst interface 128
4 Basic peripherals 131
Parallel ports 131
Multi-function I/O ports 132
Pull-up resistors 133
Timer/counters 133
Types 134
8253 timer modes 134
Interrupt on terminal count 134
Programmable one-shot 134
Rate generator 136
Square wave rate generator 136
Software triggered strobe 136
Hardware triggered strobe 137
Generating interrupts 137
MC68230 modes 137
Timer processors 138
Real-time clocks 139
Simulating a real-time clock in software 140
Serial ports 140
Serial peripheral interface 142
I2
C bus 143
Read and write access 145
Addressing peripherals 146
Sending an address index 147
Timing 148
Contents ix
Multi-master support 149
M-Bus (Motorola) 150
What is an RS232 serial port? 151
Asynchronous flow control 154
Modem cables 155
Null modem cables 155
XON-XOFF flow control 158
UART implementations 158
8250/16450/16550 158
The interface signals 159
The Motorola MC68681 162
DMA controllers 163
A generic DMA controller 164
Operation 164
DMA controller models 166
Single address model 166
Dual address model 167
1D model 168
2D model 168
3D model 169
Channels and control blocks 169
Sharing bus bandwidth 171
DMA implementations 173
Intel 8237 173
Motorola MC68300 series 173
Using another CPU with firmware 174
5 Interfacing to the analogue world 175
Analogue to digital conversion techniques 175
Quantisation errors 176
Sample rates and size 176
Irregular sampling errors 177
Nyquist’s theorem 179
Codecs 179
Linear 179
A-law and µ-law 179
PCM 180
DPCM 180
ADPCM 181
Power control 181
Matching the drive 181
Using H bridges 183
Driving LEDs 184
Interfacing to relays 184
Interfacing to DC motors 185
Software only 186
Using a single timer 187
Using multiple timers 188
x Contents
6 Interrupts and exceptions 189
What is an interrupt? 189
The spaghetti method 190
Using interrupts 191
Interrupt sources 192
Internal interrupts 192
External interrupts 192
Exceptions 192
Software interrupts 193
Non-maskable interrupts 193
Recognising an interrupt 194
Edge triggered 194
Level triggered 194
Maintaining the interrupt 194
Internal queuing 194
The interrupt mechanism 195
Stack-based processors 195
MC68000 interrupts 196
RISC exceptions 198
Synchronous precise 199
Synchronous imprecise 199
Asynchronous precise 199
Asynchronous imprecise 200
Recognising RISC exceptions 200
Enabling RISC exceptions 202
Returning from RISC exceptions 202
The vector table 202
Identifying the cause 203
Fast interrupts 203
Interrupt controllers 205
Instruction restart and continuation 205
Interrupt Latency 206
Do’s and Don’ts 209
Always expect the unexpected interrupt 209
Don't expect too much from an interrupt 209
Use handshaking 210
Control resource sharing 210
Beware false interrupts 211
Controlling interrupt levels 211
Controlling stacks 211
7 Real-time operating systems 212
What are operating systems? 212
Operating system internals 214
Multitasking operating systems 215
Context switching, task tables, and kernels 215
Time slice 223
Contents xi
Pre-emption 224
Co-operative multitasking 224
Scheduler algorithms 225
Rate monotonic 225
Deadline monotonic scheduling 227
Priority guidelines 227
Priority inversion 227
Disabling interrupts 227
Message queues 228
Waiting for a resource 229
VMEbus interrupt messages 229
Fairness systems 231
Tasks, threads and processes 231
Exceptions 232
Memory model 233
Memory allocation 233
Memory characteristics 234
Example memory maps 235
Memory management address translation 239
Bank switching 242
Segmentation 243
Virtual memory 243
Chossoing an operating system 244
Assembler versus high level language 245
ROMable code 245
Scheduling algorithms 245
Pre-emptive scheduling 246
Modular approach 246
Re-entrant code 247
Cross-development platforms 247
Integrated networking 247
Multiprocessor support 247
Commercial operating systems 248
pSOS+ 248
pSOS+ kernel 248
pSOS+m multiprocessor kernel 249
pREPC+ runtime support 249
pHILE+ file system 250
pNA+ network manager 250
pROBE+ system level debugger 250
XRAY+ source level debugger 250
OS-9 250
VXWorks 251
VRTX-32 251
IFX 252
TNX 252
RTL 252
RTscope 252
MPV 252
LynxOS-Posix conformance 252
Windows NT 254
xii Contents
Windows NT characteristics 255
Process priorities 256
Interrupt priorities 257
Resource protection 258
Protecting memory 258
Protecting hardware 258
Coping with crashes 259
Multi-threaded software 259
Addressing space 260
Virtual memory 261
The internal architecture 261
Virtual memory manager 262
User and kernel modes 262
Local procedure call (LPC) 263
The kernel 263
File system 263
Network support 264
I/O support 264
HAL approach 264
Linux 265
Origins and beginnings 265
Inside Linux 268
The Linux file system 269
The physical file system 270
Building the file system 271
The file system 272
Disk partitioning 274
The /proc file system 277
Data Caching 277
Multi-tasking systems 278
Multi-user systems 278
Linux software structure 279
Processes and standard I/O 280
Executing commands 281
Physical I/O 282
Memory management 283
Linux limitations 283
eLinux 284
8 Writing software for embedded systems 288
The compilation process 288
Compiling code 289
The pre-processor 290
Compilation 293
as assembler 295
Linking and loading 296
Symbols, references and relocation 296
ld linker/loader 297
Native versus cross-compilers 298
Run-time libraries 298
Processor dependent 298
I/O dependent 299
Contents xiii
System calls 299
Exit routines 299
Writing a library 300
Creating a library 300
Device drivers 306
Debugger supplied I/O routines 306
Run-time libraries 307
Using alternative libraries 307
Linking additional libraries 307
Linking replacement libraries 307
Using a standard library 307
Porting kernels 308
Board support 308
Rebuilding kernels for new configurations 309
configAll.h 310
config.h 310
usrConfig.c 310
pSOSystem+ 312
C extensions for embedded systems 313
#pragma interrupt func2 313
#pragma pure_function func2 314
#pragma no_side_effects func2 314
#pragma no_return func2 314
#pragma mem_port int2 314
asm and _ _asm 314
Downloading 316
Serial lines 316
EPROM and FLASH 317
Parallel ports 317
From disk 317
Ethernet 318
Across a common bus 318
9 Emulation and debugging techniques 321
Debugging techniques 321
High level language simulation 321
Low level simulation 322
Onboard debugger 323
Task level debugging 325
Symbolic debug 325
Emulation 327
Optimisation problems 328
Xray 332
The role of the development system 335
Floating point and memory management functions 335
Emulation techniques 336
JTAG 337
OnCE 337
BDM 338
xiv Contents
10 Buffering and other data structures 339
What is a buffer? 339
Latency 341
Timing tolerance 341
Memory size 342
Code complexity 342
Linear buffers 342
Directional buffers 344
Single buffer implementation 344
Double buffering 346
Buffer exchange 348
Linked lists 349
FIFOs 350
Circular buffers 351
Buffer underrun and overrun 352
Allocating buffer memory 353
malloc() 353
Memory leakage 354
Stack frame errors 354
Failure to return memory to the memory pool 355
Housekeeping errors 355
Wrong memory specification 356
11 Memory and performance trade-offs 357
The effect of memory wait states 357
Scenario 1 — Single cycle processor with
large external memory 358
Scenario 2 — Reducing the cost of memory access 360
Using registers 360
Using caches 361
Preloading caches 362
Using on-chip memory 363
Using DMA 363
Making the right decisions 363
12 Software examples 365
Benchmark example 365
Creating software state machines 368
Priority levels 372
Explicit locks 373
Interrupt service routines 373
Setting priorities 375
Contents xv
Task A highest priority 375
Task C highest priority 376
Using explicit locks 376
Round-robin 376
Using an ISR routine 377
13 Design examples 379
Burglar alarm system 379
Design goals 379
Development strategy 380
Software development 380
Cross-compilation and code generation 383
Porting to the final target system 385
Generation of test modules 385
Target hardware testing 385
Future techniques 385
Relevance to more complex designs 386
The need for emulation 386
Digital echo unit 387
Creating echo and reverb 387
Design requirements 390
Designing the codecs 391
Designing the memory structures 391
The software design 392
Multiple delays 394
Digital or analogue adding 395
Microprocessor selection 396
The overall system design 396
14 Real-time without a RTOS 398
Choosing the software environment 398
Deriving real time performance from a non-real time system 400
Choosing the hardware 401
Scheduling the data sampling 402
Sampling the data 405
Controlling from an external switch 406
Driving an external LED display 408
Testing 408
Problems 410
Saving to hard disk 410
Data size restrictions and the use of a RAM disk 410
Timer calculations and the compiler 411
Data corruption and the need for buffer flushing. 411
Program listing 413
Index 422
xvi Contents
Contents xvii
Preface
The term embedded systems design covers a very wide
range of microprocessor designs and does not simply start and
endwithasimplemicrocontroller.ItcanbeaPCrunningsoftware
other than Windows and word processing software. It can be a
sophisticated multiprocessor design using the fastest processors
on the market today.
The common thread to embedded systems design is an
understanding of the interaction that the various components
within the system have with each other. It is important to under-
stand how the hardware works and the restraints that using a
certainperipheralmayhaveontherestofthesystem.Itisessential
to know how to develop the software for such systems and the
effect that different hardware designs can have on the software
and vice versa. It is this system design knowledge that has been
captured in this book as a series of tutorials on the various aspects
of embedded systems design.
Chapter 1 defines what is meant by the term and in essence
defines the scope of the rest of the book. The second chapter
provides a set of tutorials on processor architectures explaining
the different philosophies that were used in their design and
creation. It covers many of the common processor architectures
ranging from 8 bit microcontrollers through CISC and RISC
processors and finally ending with digital signal processors and
includes information on the ARM processor family.
The third chapter discusses different memory types and
their uses. This has been expanded in this edition to cover caches
in more detail and the challenges associated with them for embed-
ded design. The next chapter goes through basic peripherals such
as parallel and serial ports along with timers and DMA control-
lers. This theme is continued in the following chapter which
covers analogue to digital conversion and basic power control.
Interrupts are covered in great detail in the sixth chapter
because they are so essential to any embedded design. The differ-
ent types that are available and their associated software routines
are described with several examples of how to use them and,
perhaps more importantly, how not to use them.
The theme of software is continued in the next two chapters
which cover real-time operating systems and software develop-
ment. Again, these have a tremendous effect on embedded de-
signsbutwhosedesignimplicationsareoftennotwellunderstood
or explained. Chapter 9 discusses debugging and emulation tech-
niques.
xviii Contents
xviii Preface
The remaining five chapters are dedicated to design exam-
ples covering buffer and data structures, memory and processor
performancetrade-offsandtechniques,softwaredesignexamples
including using a real-time operating system to create state ma-
chines and finally a couple of design examples. In this edition, an
example real-time system design is described that uses a non-real-
time system to create an embedded system. The C source code is
provided so that it can be run and experimented with on a PC
running MS-DOS.
Steve Heath
Contents xix
Acknowledgements
By the nature of this book, many hardware and software
products are identified by their tradenames. In these cases, these
designations are claimed as legally protected trademarks by the
companies that make these products. It is not the author’s nor the
publisher’s intention to use these names generically, and the
reader is cautioned to investigate a trademark before using it as a
generic term, rather than a reference to a specific product to which
it is attached.
Many of the techniques within this book can destroy data
and such techniques must be used with extreme caution. Again,
neitherauthornorpublisherassumeanyresponsibilityorliability
for their use or any results.
While the information contained in this book has been
carefullycheckedforaccuracy,theauthorassumesnoresponsibil-
ity or liability for its use, or any infringement of patents or other
rights of third parties which would result.
As technical characteristics are subject to rapid change, the
datacontainedarepresentedforguidanceandeducationonly.For
exact detail, consult the relevant standard or manufacturers’ data
and specification.
xx Contents
What is an embedded system? 1
1 What is an embedded
system?
Whenever the word microprocessor is mentioned, it con-
juresupapictureofadesktoporlaptopPCrunninganapplication
such as a word processor or a spreadsheet. While this is a popular
application for microprocessors, it is not the only one and the fact
is most people use them indirectly in common objects and appli-
ances without realising it. Without the microprocessor, these
products would not be as sophisticated or cheap as they are today.
The embedding of microprocessors into equipment and
consumer appliances started before the appearance of the PC and
consumes the majority of microprocessors that are made today. In
this way, embedded microprocessors are more deeply ingrained
into everyday life than any other electronic circuit that is made. A
large car may have over 50 microprocessors controlling functions
such as the engine through engine management systems, brakes
with electronic anti-lock brakes, transmission with traction con-
trol and electronically controlled gearboxes, safety with airbag
systems, electric windows, air-conditioning and so on. With a
well-equipped car, nearly every aspect has some form of elec-
tronic control associated with it and thus a need for a microproc-
essor within an embedded system.
A washing machine may have a microcontroller that con-
tains the different washing programs, provides the power control
for the various motors and pumps and even controls the display
that tells you how the wash cycles are proceeding.
Mobilephonescontainmoreprocessingpowerthanadesk-
top processor of a few years ago. Many toys contain microproces-
sorsandthereareevenkitchenappliancessuchasbreadmachines
that use microprocessor-based control systems. The word control
is very apt for embedded systems because in virtually every
embedded system application, the goal is to control an aspect of a
physical system such as temperature, motion, and so on using a
variety of inputs. With the recent advent of the digital age replac-
ing many of the analogue technologies in the consumer world, the
dominance of the embedded system is ever greater. Each digital
consumer device such as a digital camera, DVD or MP3 player all
depend on an embedded system to realise the system. As a result,
the skills behind embedded systems design are as diverse as the
systems that have been built although they share a common
heritage.
2 Embedded systems design
What is an embedded system?
There are many definitions for this but the best way to
defineitistodescribeitintermsofwhatitisnotandwithexamples
of how it is used.
An embedded system is a microprocessor-based system
that is built to control a function or range of functions and is not
designed to be programmed by the end user in the same way that
a PC is. Yes, a user can make choices concerning functionality but
cannot change the functionality of the system by adding/replac-
ing software. With a PC, this is exactly what a user can do: one
minute the PC is a word processor and the next it’s a games
machine simply by changing the software. An embedded system
is designed to perform one particular task albeit with choices and
different options. The last point is important because it differenti-
ates itself from the world of the PC where the end user does
reprogramitwheneveradifferentsoftwarepackageisboughtand
run. However, PCs have provided an easily accessible source of
hardware and software for embedded systems and it should be no
surprise that they form the basis of many embedded systems. To
reflect this, a very detailed design example is included at the end
of this book that uses a PC in this way to build a sophisticated data
logging system for a race car.
If this need to control the physical world is so great, what is
sospecialaboutembeddedsystemsthathasledtothewidespread
useofmicroprocessors?Thereareseveralmajorreasonsandthese
have increased over the years as the technology has progressed
and developed.
Replacement for discrete logic-based circuits
The microprocessor came about almost by accident as a
programmablereplacementforcalculatorchipsinthe1970s.Upto
this point, most control systems using digital logic were imple-
mented using individual logic integrated circuits to create the
design and as more functionality became available, the number of
chips was reduced.
This was the original reason for a replacement for digital
systems constructed from logic circuits. The microprocessor was
originally developed to replace a mass of logic that was used to
create the first electronic calculators in the early 1970s. For exam-
ple, the early calculators were made from discrete logic chips and
many hundreds were needed just to create a simple four function
calculator. As the integrated circuit developed, the individual
logic functions were integrated to create higher level functions.
Instead of creating an adder from individual logic gates, a com-
plete adder could be bought in one package. It was not long before
complete calculators were integrated onto a single chip. This
enabledthemtobebuiltataverylowcostcomparedtotheoriginal
machines but any changes or improvements required that a new
What is an embedded system? 3
chip be developed. The answer was to build a chip that had some
form of programmable capability within it. Why not build a chip
that took data in, processed it and sent it out again? In this way,
instead of creating new functions by analysing the gate level logic
and modifying it — a very time-consuming process — new
products could be created by changing the program code that
processed the information. Thus the microprocessor was born.
Provide functional upgrades
In the same way that the need to develop new calculator
chips faster and with less cost prompted the development of the
first microprocessors, the need to add or remove functionality
from embedded system designs is even more important. With
much of the system’s functionality encapsulated in the software
that runs in the system, it is possible to change and upgrade
systemsbychangingthesoftwarewhilekeepingthehardwarethe
same. This reduces the cost of production even lower because
many different systems can share the same hardware base.
Insomecases,thisprocessisnotpossibleorworthwhilebut
allows the manufacturer to develop new products far quicker and
faster. Examples of this include timers and control panels for
domestic appliances such as VCRs and televisions.
In other cases, the system can be upgraded to improve
functionality. This is frequently done with machine tools, tel-
ephone switchboards and so on. The key here is that the ability to
add functionality now no longer depends on changing the hard-
ware but can be done by simply changing the software. If the
system is connected to a communications link such as a telephone
or PC network, then the upgrade can be done remotely without
having to physically send out an engineer or technician.
Provide easy maintenance upgrades
The same mechanism that allows new functionality to be
added through reprogramming is also beneficial in allowing bugs
to be solved through changing software. Again it can reduce the
need for expensive repairs and modifications to the hardware.
Improves mechanical performance
Foranyelectromechanicalsystem,theabilitytoofferafiner
degreeofcontrolisimportant.Itcanpreventexcessivemechanical
wear, better control and diagnostics and, in some cases, actually
compensate for mechanical wear and tear. A good example of this
istheenginemanagementsystem.Here,anembeddedmicroproc-
essor controls the fuel mixture and ignition for the engine and will
alter the parameters and timing depending on inputs from the
engine such as temperature, the accelerator position and so on. In
this way, the engine is controlled far more efficiently and can be
configured for different environments like power, torque, fuel
efficiency and so on. As the engine components wear, it can even
4 Embedded systems design
adjust the parameters to compensate accordingly or if they are
dramatically out of spec, flag up the error to the driver or indicate
that servicing is needed.
This level of control is demonstrated by the market in
‘chipped’ engine management units where third party companies
modify the software within the control unit to provide more
power or torque. The differences can range from 10% to nearly
50% for some turbo charged engines! All this from simply chang-
ing a few bytes. Needless to say, this practice may invalidate any
guaranteefromthemanufacturerandmayundulystressandlimit
the engine’s mechanical life. In some cases, it may even infringe
the original manufacturer’s intellectual property rights.
Protection of intellectual property
To retain a competitive edge, it is important to keep the
design knowledge within the company and prevent others from
understandingexactlywhatmakesaproductfunction.Thisknowl-
edge, often referred to as IPR (intellectual property rights), be-
comes all important as markets become more competitive. With a
design that is completely hardware based and built from off-the-
shelf components, it can be difficult to protect the IPR that was
used in its design. All that is needed to do is to take the product,
identifythechipsandhowtheyareconnectedbytracingthetracks
on the circuit board. Some companies actually grind the part
numbers off the integrated circuits to make it harder to reverse
engineer in this way.
With an embedded system, the hardware can be identified
butthesoftwarethatreallysuppliesthesystem’sfunctionalitycan
be hidden and more difficult to analyse. With self-contained
microcontrollers, all that is visible is a plastic package with a few
connections to the outside world. The software is already burnt
intotheon-chipmemoryandiseffectivelyimpossibletoaccess.As
a result, the IPR is much more secure and protected.
Replacement for analogue circuits
The movement away from the analogue domain towards
digital processing has gathered pace recently with the advent of
high performance and low cost processing.
Tounderstandtheadvantagesbehinddigitalsignalprocess-
ing, consider a simple analogue filter. The analogue implementa-
tion is extremely simple compared to its digital equivalent. The
analogue filter works by varying the gain of the operational
amplifier which is determined by the relationship between ri and
rf.
In a system with no frequency component, the capacitor ci
plays no part as its impedance is far greater than that of rf. As the
frequency component increases, the capacitor impedance de-
creases until it is about equal with rf where the effect will be to
reduce the gain of the system. As a result, the amplifier acts as a
What is an embedded system? 5
low pass filter where high frequencies will be filtered out. The
equation shows the relationship where jωis the frequency compo-
nent. These filters are easy to design and are cheap to build. By
making the CR (capacitor-resistor) network more complex, differ-
ent filters can be designed.
y(t)
x(t)
=
r
f
r i 1 + jω r c
1
f
f
y(t)
Output
to
actuator
x(t)
Input
from
sensor
t
y(t)
x(t)
r i
r f
cf
INPUT OUTPUT
The required filtering
The analogue circuit
The mathematical function
Analogue signal processing
x(t)
FIR filter
Finite impulse
response
∑ c(n) x (n-k)
n
k = 0
D/A
A/D y(t)
Low pass
antialiasing
filter
Sampler and
analogue
to
digital
converter
Digital
signal
processing
operation
Digital
to
analogue
converter
Reconstruction
low pass
filter
Analogue
out
Analogue
in
x(n) y(n)
Digital signal processing (DSP)
The digital equivalent is more complex requiring several
electronicstagestoconvertthedata,processitandreconstitutethe
data. The equation appears to be more involved, comprising of a
summation of a range of calculations using sample data multi-
plied by a constant term. These constants take the place of the CR
6 Embedded systems design
components in the analogue system and will define the filter’s
transfer function. With digital designs, it is the tables of coeffi-
cients that are dynamically modified to create the different filter
characteristics.
Giventhecomplexityofdigitalprocessing,whythenuseit?
The advantages are many. Digital processing does not suffer from
component ageing, drift or any adjustments which can plague an
analogue design. They have high noise immunity and power
supply rejection and due to the embedded processor can easily
provide self-test features. The ability to dynamically modify the
coefficients and therefore the filter characteristics allows complex
filtersandotherfunctionstobeeasilyimplemented.However,the
processing power needed to complete the ‘multiply–accumulate’
processing of the data does pose some interesting processing
requirements.
N instruction
routine
x(n) x(n+1)
Ts=1/F
A/D
conversion
Data sampling
at frequency Fs
D/A
conversion
Time to execute
one instruction
Fs
Ts
1kHz
10 kHz
100 kHz
1MHz
1 ms
100 µs
10 µs
1 µs
1kHz
10 kHz
100 kHz
1MHz
1 ms
100 µs
10 µs
1 µs
No.of instructions
between two
samples
1000
100
10
1
10000
1000
100
10
1 µs
x(n)
100 µs
y(n)
DSP processing requirements
The diagram shows the problem. An analogue signal is
sampled at a frequency fs and is converted by the A/D converter.
This frequency will be first determined by the speed of this
conversion. At every period, ts, there will be a new sample to
process using N instructions. The table shows the relationship
between sampling speed, the number of instructions and the
What is an embedded system? 7
instruction execution time. It shows that the faster the sampling
frequency, the more processing power is needed. To achieve the 1
MHz frequency, a 10 MIPS processor is needed whose instruction
set is powerful enough to complete the processing in under 10
instructions.ThisanalysisdoesnottakeintoaccountA/Dconver-
sion delays. For DSP algorithms, the sampling speed is usually
twice the frequency of the highest frequency signal being proc-
essed: in this case the 1 MHz sample rate would be adequate for
signals up to 500 kHz.
Onemajordifferencebetweenanalogueanddigitalfiltersis
the accuracy and resolution that they offer. Analogue signals may
have definite limits in their range, but have infinite values be-
tween that range. Digital signal processors are forced to represent
these infinite variations within a finite number of steps deter-
mined by the number of bits in the word. With an 8 bit word, the
increasesareinstepsof1/256oftherange.Witha16bitword,such
steps are in 1/65536 and so on. Depicted graphically as shown, a
16 bit word would enable a low pass filter with a roll-off of about
90 dB. A 24 bit word would allow about 120 dB roll-off to be
achieved.
dB
0dB
Frequency
16 bit
24 bit
Word size and cutoff frequencies
DSP can be performed by ordinary microprocessors, al-
though their more general-purpose nature often limits perform-
ance and the frequency response. However, with responses of
only a few hundred Hertz, even simple microcontrollers can
performsuchtasks.Assilicontechnologyimproved,specialbuild-
ing blocks appeared allowing digital signal processors to be
developed, but their implementation was often geared to a hard-
wareapproachratherthandesigningaspecificprocessorarchitec-
ture for the job. It is now common for processors to claim DSP
8 Embedded systems design
support through enhanced multiply–accumulate operations or
through special accelerators. It is clear though, that as general
purposeprocessingincreasesincapability,whatwasoncethesole
province of a DSP can now be achieved by a general purpose
processor.
Inside the embedded system
Processor
The main criteria for the processor is: can it provide the
processing power needed to perform the tasks within the system?
Thisseemsobviousbutitfrequentlyoccursthatthetasksareeither
underestimated in terms of their size and/or complexity or that
creeping elegance expands the specification to beyond the proces-
sor’s capability.
In many cases, these types of problems are compounded by
theperformancemeasurementusedtojudgetheprocessor.Bench-
marks may not be representative of the type of work that the
systemisdoing.Theymayexecutecompletelyoutofcachememory
andthusgiveanartificiallyhighperformancelevelwhichthefinal
system cannot meet because its software does not fit in the cache.
The software overheads for high level languages, operating sys-
tems and interrupts may be higher than expected. These are all
issues that can turn a paper design into failed reality.
Whileprocessorperformanceisessentialandformsthefirst
gating criterion, there are others such as cost — this should be
system cost and not just the cost of the processor in isolation,
power consumption, software tools and component availability
and so on. These topics are discussed in more detail in Chapter 2.
Memory
Memory is an important part of any embedded system
design and is heavily influenced by the software design, and in
turn may dictate how the software is designed, written and
developed. These topics will be addressed in more detail later on
in this book. As a way of introduction, memory essentially per-
forms two functions within an embedded system:
• It provides storage for the software that it will run
At a minimum, this will take the form of some non-volatile
memory that retains its contents when power is removed.
This can be on-chip read only memory (ROM) or external
EPROM. The software that it contains might be the com-
plete program or an initialisation routine that obtains the
full software from another source within or outside of the
system. This initialisation routine is often referred to as a
bootstrap program or routine. PC boards that have embed-
ded processors will often start up using software stored in
anonboardEPROMandthenwaitforthefullsoftwaretobe
downloaded from the PC across the PC expansion bus.
What is an embedded system? 9
• It provides storage for data such as program variables and
intermediate results, status information and any other data
that might be created throughout the operation
Software needs some memory to store variables and to
manage software structures such as stacks. The amount of
memory that is needed for variables is frequently less than
that needed for the actual program. With RAM being more
expensive than ROM and non-volatile, many embedded
systems and in particular, microcontrollers, have small
amounts of RAM compared to the ROM that is available for
the program. As a result, the software that is written for
such systems often has to be written to minimise RAM
usage so that it will fit within the memory resources placed
upon the design. This will often mean the use of compilers
that produce ROMable code that does not rely on being
resident in RAM to execute. This is discussed in more detail
in Chapter 3.
Peripherals
An embedded system has to communicate with the outside
world and this is done by peripherals. Input peripherals are
usuallyassociatedwithsensorsthatmeasuretheexternalenviron-
ment and thus effectively control the output operations that the
embeddedsystemperforms.Inthisway,anembeddedsystemcan
bemodelledonathree-stagepipelinewheredataandinformation
input into the first stage of the pipeline, the second stage processes
it before the third stage outputs data.
Ifthismodelisthenappliedtoamotorcontroller,theinputs
would be the motor’s actual speed and power consumption, and
the speed required by the operator. The outputs would be a pulse
width modulated waveform that controls the power to the motor
and hence the speed and an output to a control panel showing the
current speed. The middle stage would be the software that
processed the inputs and adjusts the outputs to achieve the re-
quired engine speed. The main types of peripherals that are used
include:
• Binary outputs
These are simple external pins whose logic state can be
controlled by the processor to either be a logic zero (off) or
a logic one (on). They can be used individually or grouped
together to create parallel ports where a group of bits can be
input or output simultaneously.
• Serial outputs
These are interfaces that send or receive data using one or
two pins in a serial mode. They are less complex to connect
but are more complicated to program. A parallel port looks
very similar to a memory location and is easier to visualise
and thus use. A serial port has to have data loaded into a
10 Embedded systems design
register and then a start command issued. The data may
also be augmented with additional information as required
by the protocol.
• Analogue values
While processors operate in the digital domain, the natural
world does not and tends to orientate to analogue values.
As a result, interfaces between the system and the external
environment need to be converted from analogue to digital
and vice versa.
• Displays
Displaysarebecomingimportantandcanvaryfromsimple
LEDs and seven segment displays to small alpha-numeric
LCD panels.
• Time derived outputs
Timersandcountersareprobablythemostcommonlyused
functions within an embedded system.
Software
The software components within an embedded system
often encompasses the technology that adds value to the system
and defines what it does and how well it does it. The software can
consist of several different components:
• Initialisation and configuration
• Operating system or run-time environment
• The applications software itself
• Error handling
• Debug and maintenance support.
Algorithms
Algorithms are the key constituents of the software that
makes an embedded system behave in the way that it does. They
can range from mathematical processing through to models of the
external environment which are used to interpret information
from external sensors and thus generate control signals. With the
digital technology in use today such as MP3 and DVD players, the
algorithms that digitally encode the analogue data are defined by
standards bodies.
While this standardisation could mean that the importance
of selecting an algorithm is far less than it might be thought, the
reality is far different. The focus on getting the right implementa-
tion is important since, for example, it may allow the same func-
tion to be executed on cheaper hardware. As most embedded
systems are designed to be commercially successful, this selection
process is very important. Defining and implementing the correct
algorithm is a critical operation and is described through several
examples in this book.
What is an embedded system? 11
Examples
This section will go through some example embedded
systems and briefly outline the type of functionality that each
offers.
Microcontroller
Microcontrollers can be considered as self-contained sys-
tems with a processor, memory and peripherals so that in many
cases all that is needed to use them within an embedded system is
to add software. The processors are usually based on 8 bit stack-
based architectures such as the MC6800 family. There are 4 bit
versions available such as the National COP series which further
reduce the processing power and reduce cost even further. These
are limited in their functionality but their low cost has meant that
they are used in many obscure applications. Microcontrollers are
usually available in several forms:
• Devices for prototyping or low volume production runs
These devices use non-volatile memory to allow the soft-
ware to be downloaded and returned in the device. UV
erasable EPROM used to be the favourite but EEPROM is
also gaining favour. Some microcontrollers used a special
package with a piggyback socket on top of the package to
allow an external EPROM to be plugged in for prototyping.
This memory technology replaces the ROM on the chip
allowing software to be downloaded and debugged. The
device can be reprogrammed as needed until the software
reaches its final release version.
The use of non-volatile memory also makes these devices
suitable for low volume production runs or where the
software may need customisation and thus preventing
moving to a ROMed version.
These devices are sometimes referred to as umbrella de-
vices with a single device capable of providing prototyping
support for a range of other controllers in the family.
• Devices for low to medium volume production runs
In the mid-1980s, a derivative of the prototype device
appeared on the market called the one time programmable
or OTP. These devices use EPROM instead of the ROM but
instead of using the ceramic package with a window to
allow the device to be erased, it was packaged in a cheaper
plastic pack and thus was only capable of programming a
single time — hence the name. These devices are cheaper
than the prototype versions but still have the programming
disadvantage. However, their lower cost has made them a
suitable alternative to producing a ROM device. For low to
medium production quantities, they are cost effective and
offer the ability to customise software as necessary.
12 Embedded systems design
4144 bytes
EPROM
176 bytes
RAM
240 bytes Boot
ROM
HC05 processor
core
Clock
Watch
dog Baud rate
generator
16 bit timer
Port
A
Port
B
Port
C
Port
D
SCI
SPI
Internal bus
Example microcontroller (Motorola MC68HC705C4A)
• Devices for high volume production runs
For high volumes, microcontrollers can be built already
programmed with software in the ROM. To do this a
customer supplies the software to the manufacturer who
then creates the masks necessary to create the ROM in the
device. This process is normally done on partly processed
silicon wafers to reduce the turnaround time. The advan-
tage for the customer is that the costs are much lower than
using prototyping or OTP parts and there is no program-
mingtimeoroverheadinvolved.Thedownsideisthatthere
is usually a minimum order based on the number of chips
thatawaferbatchcanproduceandanupfrontmaskcharge.
The other major point is that once in ROM, the software
cannot be changed and therefore customisation or bug
fixing would have to wait until the next order or involve
scrapping all the devices that have been made. It is possible
tooffersomecustomisationbyincludingdifferentsoftware
modules and selecting the required ones on the basis of a
value read into the device from an external port but this
does consume memory which can increase the costs. Some
controllerscanprovidesomeRAMthatcanbeusedtopatch
the ROM without the need for a new mask set.
What is an embedded system? 13
MC68HC
705
MC68HC
705
EPROM
prototyping
OTP External
EPROM
(no chip)
External
EPROM
(with chip)
Prototype microcontrollers
Expanded microcontroller
The choice of memory sizes and partitioning is usually a
major consideration. Some applications require more memory or
peripherals than are available on a standard part. Most
microcontroller families have parts that support external expan-
sion and have an external memory and/or I/O bus which can
allow the designer to put almost any configuration together. This
is often done by using a parallel port as the interface instead of
general-purpose I/O. Many of the higher performance
microcontrollers are adopting this approach.
Internal EPROM
Internal RAM
Internal ROM
Processor core
Clock
Watch
dog Baud rate
generator
16 bit timer
Port
A
Port
B
Port
C
Port
D
SCI
SPI
Internal bus
External ROM
External RAM
An expanded microcontroller
14 Embedded systems design
In the example shown on the previous page, the
microcontroller has an expanded mode that allows the parallel
ports A and B to be used as byte wide interfaces to external RAM
and ROM. In this type of configuration, some microcontrollers
disable access to the internal memory while others still allow it.
Microprocessor based
Microprocessor-based embedded systems originally took
existing general-purpose processors such as the MC6800 and 8080
devices and constructed systems around them using external
peripherals and memory. The use of processors in the PC market
continued to provide a series of faster and faster processors such
as the MC68020, MC68030 and MC68040 devices from Motorola
and the 80286, 80386, 80486 and Pentium devices from Intel. These
CISC architectures have been complemented with RISC proces-
sors such as the PowerPC, MIPS and others. These systems offer
more performance than is usually available from a traditional
microcontroller.
However, this is beginning to change. There has been the
development of integrated microprocessors where the processor
is combined with peripherals such as parallel and serial ports,
DMAcontrollersandinterfacelogictocreatedevicesthataremore
suitable for embedded systems by reducing the hardware design
task and costs. As a result, there has been almost a parallel
development of these integrated processors along with the desk-
top processors. Typically, the integrated processor will use a
processor generation that is one behind the current generation.
The reason is dependent on silicon technology and cost. By using
thepreviousgenerationwhichissmaller,itfreesupsiliconareaon
the die to add the peripherals and so on.
Board based
So far, the types of embedded systems that we have consid-
ered have assumed that the hardware needs to be designed, built
and debugged. An alternative is to use hardware that has already
been built and tested such as board-based systems as provided by
PCs and through international board standards such as VMEbus.
The main advantage is the reduced work load and the availability
of ported software that can simply be utilised with very little
effort. The disadvantages are higher cost and in some cases
restrictions in the functionality that is available.
Embedded processors 15
2 Embedded processors
The development of processors for embedded system de-
sign has essentially followed the development of microprocessors
as a whole. The processor development has provided the process-
ing heart for architecture which combined with the right software
and hardware peripherals has become an embedded design. With
the advent of better fabrication technology supporting higher
transistor counts and lower power dissipation, the processor core
has been integrated with peripherals and memory to provide
standalone microcontrollers or integrated processors that only
need the addition of external memory to provide a complete
hardware system suitable for embedded design. The scope of this
chapter is to explain the strengths and weaknesses of various
architectures to provide a good understanding of the trade-offs
involved in choosing and exploiting a processor family.
Thereareessentiallyfourbasicarchitecturetypeswhichare
usually defined as 8 bit accumulator, 16/32 bit complex instruc-
tionsetcomputers(CISC),reducedinstructionsetcomputer(RISC)
architectures and digital signal processors (DSP). Their develop-
mentortobemoreaccurate,theiravailabilitytoembeddedsystem
designers is chronological and tends to follow the same type of
pattern as shown in the graph.
MC6800
MC6800
MC6800
MC6800
MC6800
MC68000
MC68000
MC68000
MC68000
MC68020
MC68020
MC68020
MC68040
MC68040
MC68060
1975 1980 1984 1989 1993
Highest
performance
Medium
performance
Lowest
performance
Cost-effective
performance
End of life
Processor life history
However,itshouldberememberedthatinparallelwiththis
life cycle, processor architectures are being moved into
microcontroller and integrated processor devices so that the end
of life really refers to the discontinuance of the architecture as a
separateCPUplusexternalmemoryandperipheralsproduct.The
MC6800 processor is no longer used in discrete designs but there
are over 200 MC6801/6805 and 68HC11 derivatives that essen-
tially use the same basic architecture and instruction set.
16 Embedded systems design
8 bit accumulator processors
This category of processor first appeared in the mid-1970s
as the first microprocessors. Devices such as the 8080 from Intel
and the MC6800 from Motorola started the microprocessor revo-
lution. They provided about 1 MIP of performance and were at
their introduction the fastest processors available.
Register models
The programmer has a very simple register model for this
type of processor. The model for the Motorola MC6800 8 bit
processor is shown as an example but it is very representative of
the many processors that appeared (and subsequently vanished).
Ithastwo8bitaccumulatorsusedforstoringdataandperforming
arithmetic operations. The program counter is 16 bits in size and
two further 16 bit registers are provided for stack manipulations
and address indexing.
7 0
15
Accumulator A
Accumulator B
Index register X
Program counter
Stack pointer
Condition code
The MC6800 programmer's model
Onfirstinspection,themodelseemsquiteprimitiveandnot
capable of providing the basis of a computer system. There do not
seem to be enough registers to hold data, let alone manipulate it!
Comparing this with the register laden RISC architectures that
feature today, this is a valid conclusion. What is often forgotten is
that many of the instructions, such as logical operations, can
operateondirectmemoryusingtheindexregistertoactaspointer.
This removes the need to bring data into the processor at the
expense of extra memory cycles and the need for additional or
widerregisters.Themainareawithinmemorythatisusedfordata
storage is known as the stack. It is normally accessed using a
special register that indexes into the area called the stack pointer.
Embedded processors 17
Thisisusedtoprovidelocaldatastorageforprogramsandtostore
informationfortheprocessorsuchasreturnaddressesforsubrou-
tine jumps and interrupts.
The stack pointer provides additional storage for the pro-
grammer: it is used to store data like return addresses for subrou-
tine calls and provides additional variable storage using a PUSH/
POP mechanism. Data is PUSHed onto the stack to store it, and
POPed off to retrieve it. Providing the programmer can track
where the data resides in these stack frames, it offers a good
replacement for the missing registers.
8 bit data restrictions
An 8 bit data value can provide an unsigned resolution of
only 256 bits, which makes it unsuitable for applications where a
higher resolution is needed. In these cases, such as financial,
arithmetic, high precision servo control systems, the obvious
solution is to increase the data size to 16 bits. This would give a
resolution of 65536 — an obvious improvement. This may be
acceptable for a control system but is still not good enough for a
dataprocessingprogram,wherea32bitdatavaluemayhavetobe
defined to provide sufficient integer range. While there is no
difficulty with storing 8, 16, 32 or even 64 bits in external memory,
even though this requires multiple bus accesses, it does prevent
the direct manipulation of data through the instruction set.
However, due to the register model, data larger than 8 bits
cannot use the standard arithmetic instructions applicable to 8 bit
data stored in the accumulator. This means that even a simple 16
bit addition or multiplication has to be carried out as a series of
instructions using the 8 bit model. This reduces the overall effi-
ciency of the architecture.
Thecodeexampleisaroutineforperformingasimple16bit
multiplication.Ittakestwounsigned16bitnumbersandproduces
a 16 bit product. If the product is larger than 16 bits, only the least
significant 16 bits are retained. The first eight or so instructions
simply create a temporary storage area on the stack for the
multiplicand, multiplier, return address and loop counter. Com-
pared to internal register storage, storing data in stack frames is
not as efficient due the increased external memory access.
Accessing external data consumes machine cycles which
could be used to process data. Without suitable registers and the
16 bit wide accumulator, all this information must be stored
externally on the stack. The algorithm used simply performs a
succession of arithmetic shifts on each half of the multiplicand
stored in the A and B accumulators. Once this is complete, the 16
bitresultissplitbetweenthetwoaccumulatorsandthetemporary
storage cleared off the stack. The operation takes at least 29
instructions to perform with the actual execution time totally
dependant on the values being multiplied together. For compari-
son, most 16/32 bit processors such as the MC68000 and 80x86
families can perform the same operation with a single instruction!
18 Embedded systems design
MULT16 LDX #5 CLEAR WORKING REGISTERS
CLR A
LP1 STA A U-1,X
DEX
BNE LP1
LDX #16 INITIAL SHIFT COUNTER
LP2 LDA A Y+1 GET Y(LSBIT)
AND A #1
TAB SAVE Y(LSBIT) IN ACCB
EOR A FF CHECK TO SEE IF YOU ADD
BEQ SHIFT OR SUBTRACT
TST B
BEQ ADD
LDA A U+1
LDA B U
SUB A XX+1
SBC B XX
STA A U+1
STA B U
BRA SHIFT NOW GOTO SHIFT ROUTINE
ADD LDA A U+1
LDA B U
ADD A XX+1
ADC B XX
STA A U+1
STA B U
SHIFT CLR FF SHIFT ROUTINE
ROR Y
ROR Y+1
ROL FF
ASR U
ROR U+1
ROR U+2
ROR U+3
DEX
BNE LP2
RTS FINISH SUBROUTINE
END
M6800 code for a 16 bit by 16 bit multiply
Addressing memory
When the first 8 bit microprocessors appeared during the
middle to late 1970s, memory was expensive and only available in
very small sizes: 256 bytes up to 1 kilobyte. Applications were
small, partly due to their implementation in assembler rather than
a high level language, and therefore the addressing range of 64
kilobytes offered by the 16 bit address seemed extraordinarily
large. It was unlikely to be exceeded. As the use of these early
microprocessors became more widespread, applications started
to grow in size and the use of operating systems like CP/M and
high level languages increased memory requirements until the
address range started to limit applications. Various techniques
like bank switching and program overlays were developed to
help.
Embedded processors 19
System integrity
Another disadvantage with this type of architecture is its
unpredictability in handling error conditions. A bug in a software
application could corrupt the whole system, causing a system to
either crash, hang up or, even worse, perform some unforeseen
operations. The reasons are quite simple: there is no partitioning
between data and programs within the architecture. An applica-
tion can update a data structure using a corrupt index pointer
which overwrites a part of its program.
start
finish
Address
pointer
New
data
start
finish
System
memory
Address
pointer
System
Memory
New
data
Valid pointer
address
Invalid pointer
address
System corruption via an invalid
pointer
Data are simply bytes of information which can be inter-
preted as instruction codes. The processor calls a subroutine
withinthisarea,startstoexecutethedataascodeandsuddenlythe
whole system starts performing erratically! On some machines,
certain undocumented code sequences could put the processor in
atestmodeandstartcyclingthroughtheaddressrangesetc.These
attributes restricted their use to non-critical applications.
Example 8 bit architectures
Z80
TheZ80microprocessorisan8bitCPUwitha16bitaddress
bus capable of direct access to 64k of memory space. It was
designedbyZilogandrapidlygainedalotofinterest.TheZ80was
based on the Intel 8080 but has an extended instruction set and
many hardware improvements. It can run 8080 code if needed by
its support of the 8080 instruction set. The instruction set is
essential based around an 8 bit op code giving a maximum of 256
instructions. The 158 instructions that are specified — the others
20 Embedded systems design
are reserved — include 78 instructions from the 8080. The instruc-
tion set supports the use of extension bytes to encode additional
information. In terms of processing power, it offered about 1 MIP
at 4 MHz clock speed with a minimum instruction time of 1 µs and
a maximum instruction time of 5.75 µs.
Pin Signal Pin Signal
1 A11 21 RD
2 A12 22 WR
3 A13 23 BUSAK
4 A14 24 WAIT
5 A15 25 BUSRQ
6 CLOCK 26 RESET
7 D4 27 M1
8 D3 28 RFSH
9 D5 29 GND
10 D6 30 A0
11 Vcc 31 A1
12 D2 32 A2
13 D7 33 A3
14 D0 34 A4
15 D1 35 A5
16 INT 36 A6
17 NMI 37 A7
18 HALT 38 A8
19 MREQ 39 A9
20 IORQ 40 A10
The Z80 signals
Signal Description
A0 - A15 Address bus output tri-state
D0 - D7 Data bus bidirectional tri-state
CLOCK CPU clock input
RFSH Dynamic memory refresh output
HALT CPU halt status output
RESET Reset input
INT Interrupt request input (active low)
NMI Non-maskable interrupt input (active low)
BUSRQ Bus request input (active low)
BUSAK Bus acknowledge output (active low)
WAIT Wait request input (active low)
RD, WR Read and write signals
IORQ I/O operation status output
MREQ Memory refresh output
M1 Output pulse on instruction fetch cycle
Vcc +5 volts
GND 0 volts
The Z80 pinout descriptions
The programming model includes an accumulator and six
8 bit registers that can be paired together to create three 16 bit
registers. In addition to the general registers, a stack pointer,
program counter, and two index (memory pointers) registers are
provided.ItusesexternalRAMforitsstack.Whilenotaspowerful
today as a PowerPC or Pentium, it was in its time a very powerful
Embedded processors 21
processorandwasusedinmanyoftheearlyhomecomputerssuch
as the Amstrad CPC series. It was also used in many embedded
designs partly because of its improved performance and also for
its built-in refresh circuitry for DRAMs. This circuitry greatly
simplified the external glue logic that was needed with DRAMs.
The Z80 was originally packaged in a 40 pin DIP package
and ran at 2.5 and 4 MHz. Since then other packages and speeds
have become available including low power CMOS versions —
theoriginalwasmadeinNMOSanddissipatedabout1watt.Zilog
now use the processor as a core within its range of Z800
microcontrollerswithvariousconfigurationsofon-chipRAMand
EPROM.
Z80 programming model
The Z80 programming model essential consists of a set of 8
bit registers which can be paired together to create 16 bit versions
for use as data storage or address pointers. There are two register
sets within the model: the main and alternate. Only one set can be
usedatanyonetimeandtheswitchanddatatransferisperformed
by the EXX instruction. The registers in the alternate set are
designated by a ´ suffix.
BC
DE
HL
A F
B C
D E
H L
A’ F’
B’ C’
D’ E’
H’ L’
Program counter
PC
Index register IX
Index register IY
Stack pointer SP
IV
MR
Main
register
set
Alternate
register
set
BC’
DE’
HL’
The Z80 programming model
The model has an 8 bit accumulator A and a flags register
known as F. This contains the status information such as carry,
zero, sign and overflow. This register is also known as PSW
(program status word) in some documentation. Registers B, C, D,
E, H and L are 8 bit general-purpose registers that can be paired to
create 16 registers known as BC, DE and HL. The remaining
registers are the program counter PC, two index registers IX and
IY and a stack pointer SP. All these four registers are 16 bits in size
and can access the whole 64 kbytes of external memory that the
22 Embedded systems design
Z80 can access. There are two additional registers IV and MR
which are the interrupt vector and the memory refresh registers.
The IV register is used in the interrupt handling mode 2 to point
to the required software routine to process the interrupt. In mode
1, the interrupt vector is supplied via the external data bus. The
memory refresh register is used to control the on-chip DRAM
refresh circuitry.
Unlike the MC6800, the Z80 does not use memory mapped
I/O and instead uses the idea of ports, just like the 8080. The lower
8 bits of the address bus are used along with the IORQ signal to
access any external peripherals. The IORQ signal is used to differ-
entiatetheaccessfromanormalmemorycycle.TheseI/Oaccesses
are similar from a hardware perspective to a memory cycle but
only occur when an I/O port instruction (IN, OUT) is executed. In
some respects, this is similar to the RISC idea of load and store
instructionstobringinformationintotheprocessor,processitand
then write out the data. This system gives 255 ports and is usually
sufficient for most embedded designs.
MC6800
The MC6800 was introduced in the mid-1970s by Motorola
and is as an architecture the basis of several hundred derivative
processors and microcontrollers such as the MC6809, MC6801,
MC68HC05, MC68HC11, MC68HC08 families.
The processor architecture is 8 bits and uses a 64 kbyte
memory map. Its programming model uses two 8 bit accumula-
tors and a single 16 bit index register. Later derivatives such as the
MC68HC11 added an additional index register and allowed the
two accumulators to be treated as a single 16 bit accumulator to
provide additional support for 16 bit arithmetic.
7 0
15
Accumulator A
Accumulator B
Index register X
Program counter
Stack pointer
Condition code
The MC6800 programmer‘s model
Its external bus was synchronous with separate address
and data ports and the device operated at either 1, 1.5 or 2 MHz.
The instruction set was essentially based around an 8 bit instruc-
Embedded processors 23
tion with extensions for immediate values, address offsets and so
on. It supported both non-maskable and software interrupts.
These type of processors have largely been replaced today
by the microcontroller versions which have the same or advanced
processor architectures and instruction sets but have the added
advantageofgluelessinterfacestomemoryandperipheralsincor-
porated onto the chip itself. Discrete processors are still used but
these tend to be the higher performance devices such as the
MC68000 and 80x86 processors. But even with these faster and
higher performance devices, the same trend of moving to inte-
grated microcontroller type of devices is being followed as even
higher performance processors such as RISC devices become
available.
Microcontrollers
The previous section has described the 8 bit processors.
While most of the original devices are no longer available, their
architecturesliveonintheformofmicrocontrollers.Thesedevices
do not need much processing power — although this is now
undergoing a radical change as will be explained later — but
instead have become a complete integrated computer system by
integrating the processor, memory and peripherals onto a single
chip.
MC68HC05
The MC68HC05 is microcontroller family from Motorola
that uses an 8 bit accumulator-based architecture as its processor
core. This is very similar to that of the MC6800 except that it only
has a single accumulator.
It uses memory mapping to access any on-chip peripherals
and has a 13 bit program counter and effectively a 6 bit stack
pointer. These reduced size registers — with many other 8 bit
processors such as the Z80/8080 or MC6800, they are 16 bits is size
— are used to reduce the complexity of the design. The
microcontroller uses on-chip memory and therefore it does not
make sense to define registers that can address memory that
doesn’t exist on the chip. The MC68HC05 family is designed for
low cost applications where superfluous hardware is removed to
reduce the die size, its power consumption and cost. As a result,
the stack pointer points to the start of the on-chip RAM and can
only use 64 bytes, and the program counter is reduced to 13 bits.
MC68HC11
The MC68HC11 is a powerful 8 bit data, 16 bit address
microcontroller from Motorola that was on its introduction one of
the most powerful and flexible microcontrollers available. It was
originally designed in conjunction with General Motors for use
withinenginemanagementsystems.Asaresult,itsinitialversions
had built-in EEPROM/OTPROM, RAM, digital I/O, timers,
24 Embedded systems design
4144 bytes
EPROM
176 bytes
RAM
240 bytes Boot
ROM
HC05 processor
core
Clock
Watch
dog Baud rate
generator
16 bit timer
Port
A
Port
B
Port
C
Port
D
SCI
SPI
Internal bus
Example microcontroller (Motorola MC68HC705C4A)
7 6 5 4 3 2 1 0
7 6 5 4 3 2 1 0
7 6 5 4 3 2 1 0
11 10 9 8
12
7 6 5 4 3 2 1 0
11 10 9 8
12
1 1
0 0 0 0
0
7 6 5 4 3 2 1 0
1 1 1 H I N Z C
Accumulator (A)
Index register (X)
Stack pointer (SP)
Program counter (PC)
Condition code
register (CCR)
Half-carry flag
Interrupt mask
Negative flag
Zero flag
Carry/borrow flag
68HC05 programming model
Discovering Diverse Content Through
Random Scribd Documents
investigation of truth. The laws of scientific induction might become
the laws for the education of the soul. No more setting out with
abstract principles, imposed by authority; but facts intuitively
apprehended, gathered by observation and verified by experiment;
the order of nature faithfully followed; a cautious progression from
the simplest and most elementary ideas to the most difficult and
most complex truths; the knowledge of things instead of an analysis
of words,—such was to be the character of the new system of
instruction. In other terms, it was possible to make the child follow,
in order to lead him to know and to comprehend the capitalized
truths that constitute the basis of elementary instruction, the same
method that Bacon recommended to scholars for the discovery of
unknown truths.[99]
It is this conversion, or, as we might say, this translation, of the
maxims of the Baconian logic into pedagogical rules, that Comenius
attempted, and this is why he has been called “the father of the
intuitive method.” He was nourished, intellectually, by the reading of
Bacon, whom he resembles, not only in his ideas, but also in his
figurative and often allegorical language. Even the title of one of his
books, Didactica Magna, recalls the title of Bacon’s Instauratio
Magna.
137. The Life of Comenius.—To know Comenius and the part he
played in the seventeenth century, to appreciate this grand
educational character, it would be necessary to begin by relating his
life; his misfortunes; his journeys to England, where Parliament
invoked his aid; to Sweden, where the Chancellor Oxenstiern
employed him to write manuals of instruction; especially his
relentless industry, his courage through exile, and the long
persecutions he suffered as a member of the sect of dissenters, the
Moravian Brethren; and the schools he founded at Fulneck, in
Bohemia, at Lissa and at Patak, in Poland. But it would require too
much of our space to follow in its incidents and catastrophes that
troubled life, which, in its sudden trials, as in the firmness that
supported them, recalls the life of Pestalozzi.[100]
138. His Principal Works.—Comenius wrote a large number of
books in Latin, in German, and in Czech; but of these only a few are
worthy to engage the attention of the educator. In his other works
he allows himself to go off on philosophic excursions, and to indulge
in mystic reveries, led by his ardor to find what he called pansophia,
wisdom or universal knowledge. In this wilderness of publications
destined to oblivion, we shall notice only three works, which contain
the general principles of the pedagogy of Comenius, and the
applications which he has made of his method:—
1. The Didactica Magna, the Great Didactics (written in Czech at
about 1630, and rewritten in Latin at about 1640). In this work
Comenius sets forth his principles, his general theories on education,
and also his peculiar views on the practical organization of schools.
It is to be regretted that a French translation has not yet popularized
this important book, that would be worthy a place beside the
Thoughts of Locke and the Émile of Rousseau.[101]
2. The Janua linguarum reserata, the Gate of Tongues Unlocked
(1631). In the thought of the author, this was a new method of
learning the languages. Comenius, led astray on this point by his
religious prejudices, wished to banish the Latin authors from the
schools, “for the purpose,” he said, “of reforming studies in the true
spirit of Christianity.” Consequently, in order to replace the classical
authors, which he repudiated for this further reason, that the
reading of them is too difficult, and to make a child study them “is to
wish to push out into the vast ocean a tiny bark that should be
allowed only to sport on a little lake,” he had formed the idea of
composing a collection of phrases distributed into a hundred
chapters. These phrases, to the number of a thousand, at first very
simple, and of a single member, then longer and more complicated,
were formed of two thousand words, chosen from among the most
common and the most useful. Moreover, the hundred chapters of the
Janua taught the child, in succession and in a methodical order, all
the things in the universe,—the elements, the metals, the stars, the
animals, the organs of the body, the arts and trades, etc., etc. In
other terms, the Janua linguarum is a nomenclature of ideas and
words designed to fix the attention of the child upon everything he
ought to know of the world. Divested of the Latin text that
accompanies it, the Janua is a first reading-book, very defective
doubtless, but it gives proof of a determined effort to adapt to the
intelligence of the child the knowledge that he ought to acquire.
3. The Orbis sensualium pictus, the Illustrated World of Sensible
Objects, the most popular of the author’s works (1658). It is the
Janua linguarum accompanied with pictures, in lieu of real objects,
representing to the child the things that he hears spoken of, as fast
as he learns their names. The Orbis pictus, the first practical
application of the intuitive method, had an extraordinary success,
and has served as a model for the innumerable illustrated books
which for three centuries have invaded the schools.
Geometria.
Die Erdmesskunst.
(Facsimile of illustration in the Orbis Pictus of Comenius.)
(Facsimile of page of text of the Orbis Pictus.)
139. The Four Grades of Instruction.—We must not require a man
of the seventeenth century to abjure Latin studies. Comenius prizes
them highly; but at least he is wise enough to put them in their
place, and does not confound them, as Luther did, with elementary
studies.
Nothing could be more exact, more clearly cut, than the scholastic
organization proposed by Comenius. We shall find in it what the
experience of three centuries has finally sanctioned and established,
the distribution of schools into these grades,—infant schools,
primary schools, secondary schools, and higher schools.
The first grade of instruction is the maternal school, the school by
the mother’s knee, materni gremii, as Comenius calls it. The mother
is the first teacher. Up to the age of six the child is taught by her; he
is initiated by her into those branches of knowledge that he will
pursue in the primary school.
The second grade is the elementary public school. All the children,
girls and boys, enter here at six, and leave at twelve. The
characteristic of this school is that the instruction there given is in
the mother tongue, and this is why Comenius calls it the “common”
school, vernacula, a term given by the Romans to the language of
the people.
The third grade is represented by the Latin school or gymnasium.
Thither are sent the children from twelve to eighteen years of age
for whom has been reserved a more complete instruction, such as
we would now call secondary instruction.
Finally, to the fourth grade correspond the academies, that is,
institutions of higher instruction, opened to young men from
eighteen to twenty-four years of age.
The child, if he is able, will traverse these four grades in
succession; but, in the thought of Comenius, the studies should be
so arranged in the elementary schools, that in leaving them, the
pupil shall have a general education which makes it unnecessary for
him to go farther, if his condition in life does not destine him to
pursue the courses of the Latin School.
“We pursue,” says Comenius, “a general education, the teaching
to all men of all the subjects of human concern.... The purpose of
the people’s school shall be that all children of both sexes, from the
tenth to the twelfth or the thirteenth year, may be instructed in that
knowledge which is useful during the whole of life.”
This was an admirable definition of the purpose of the primary
school. A thing not less remarkable is that Comenius establishes an
elementary school in each village:—
“There should be a maternal school in each family; an elementary
school in each district; a gymnasium in each city; an academy in
each kingdom, or even in each considerable province.”
140. Elementary Initiation into All the Studies.—One of the most
novel and most original ideas of the great Slavic educator is the wish
that, from the earliest years of his life, the child may acquire some
elementary notions of all the sciences that he is to study at a later
period. From the cradle, the gaze of the infant, guided by the
mother, should be directed to all the objects that surround him, so
that his growing powers of reflection will be brought into play in
working on these sense intuitions. “Thus, from the moment he
begins to speak, the child comes to know himself, and, by his daily
experience, certain general and abstract expressions; he comes to
comprehend the meaning of the words something, nothing, thus,
otherwise, where, similar, different; and what are generalizations
and the categories expressed by these words but the rudiments of
metaphysics? In the domain of physics, the infant can learn to know
water, earth, air, fire, rain, snow, etc., as well as the names and uses
of the parts of his body, or at least of the external members and
organs. He will take his first lesson in optics in learning to distinguish
light, darkness, and the different colors; and in astronomy, in
noticing the sun, the moon, and the stars, and in observing that
these heavenly bodies rise and set every day. In geography,
according to the place where he lives, he will be shown a mountain,
a valley, a plain, a river, a village, a hamlet, a city, etc. In chronology,
he will be taught what an hour is, a day, a week, a year, summer,
winter, yesterday, the day before yesterday, to-morrow, the day after
to-morrow, etc. History, such as his age will allow him to conceive,
will consist in recalling what has recently passed, in taking account
of it, and in noting the part that this one or that has taken in such or
such an affair. Arithmetic, geometry, statistics, mechanics, will not
remain strangers to him. He will acquire the elements of these
sciences in distinguishing the difference between little and much, in
learning to count up to ten, in observing that three is more than
two; that one added to three makes four; in learning the sense of
the words great and small, long and short, wide and narrow, heavy
and light; in drawing lines, curves, circles, etc.; in seeing goods
measured with a yard-stick; in weighing an object in a balance; in
trying to make something or to take it to pieces, as all children love
to do.
“In this impulse to construct and destroy, there is but the effort of
the little intelligence to succeed in making or building something for
himself; so that, instead of opposing the child in this, he should be
encouraged and guided.”
“The grammar of the first period will consist in learning to
pronounce the mother tongue correctly. The child may receive
elementary notions even of politics, in observing that certain persons
assemble at the city hall, and that they are called councillors; and
that among these persons there is one called mayor, etc.”[102]
141. The People’s School.—Divided into six classes, the people’s
school should prepare the child either for active life or for the higher
courses. Comenius sends here not only the sons of peasants and
workmen, but the sons of the middle class or of the nobility, who will
afterwards enter the Latin school. In other terms, the study of Latin
is postponed till the age of twelve; and up to that period all children
must receive a thorough primary education, which will comprise,
with the mother tongue, arithmetic, geometry, singing, the salient
facts of history, the elements of the natural sciences, and religion.
The latest reforms in secondary instruction, which, only within a very
late period, have postponed the study of Latin till the sixth year,[103]
and which till then keep the pupil upon the subjects of primary
instruction,—what are they but the distant echo of the thought of
Comenius? Let it be noted, too, that the plan of Comenius gave to its
primary school a complete encyclopædic course of instruction, which
was sufficient for its own ends, but which, while remaining
elementary, was a whole, and not a beginning.[104]
Surely, the programme of studies devised by Comenius did not fail
in point of insufficiency; we may be allowed, on the contrary, to
pronounce it too extended, too crowded, conformed rather to the
generous dreams of an innovator than to a prudent appreciation of
what is practically possible; and we need not be astonished that, to
lighten in part the heavy burden that is imposed on the teacher,
Comenius had the notion of dividing the school into sections which
assistants, chosen from among the best pupils, should instruct under
the supervision of the master.
142. Site of the School.—One is not a complete educator save on
the condition of providing for the exterior and material organization
of the school, as well as for its moral administration. In this respect,
Comenius is still deserving of our encomiums. He requires a yard for
recreation, and demands that the school-house have a gay and
cheerful aspect. The question had been discussed before him by
Vives (1492-1540).
“There should be chosen,” says the Spanish educator, “a healthful
situation, so that the pupils may not one day have to take their
flight, dispersed by the fear of an epidemic. Firm health is necessary
to those who would heartily and profitably apply themselves to the
study of the sciences. And the place selected should be isolated from
the crowd, and especially at a distance from occupations that are
noisy, such as those of smiths, stone-masons, machinists,
wheelwrights, and weavers. However, I would not have the situation
too cheerful and attractive, lest it might suggest to the scholars the
taking of too frequent walks.”
But these considerations that do honor to Vives and to Comenius,
were scarcely in harmony with the resources then at the disposal of
the friends of instruction. There was scarcely occasion seriously to
consider how school-houses should be constructed and situated, at a
period when the most often there were no school-houses existing.
“In winter,” says Platter, “we slept in the school-room, and in
summer in the open air.”[105]
143. Sense Intuitions.—If Comenius has traced with a master hand
the general organization of the primary school, he has no less merit
in the matter of methods.
When they recommend the observation of sensible things as the
first intellectual exercise, modern educators do but repeat what
Comenius said three centuries ago.
“In the place of dead books, why should we not open the living
book of nature? ... To instruct the young is not to beat into them by
repetition a mass of words, phrases, sentences, and opinions
gathered out of authors; but it is to open their understanding
through things....
“The foundation of all knowledge consists in correctly representing
sensible objects to our senses, so that they can be comprehended
with facility. I hold that this is the basis of all our other activities,
since we could neither act nor speak wisely unless we adequately
comprehended what we were to do and say. Now it is certain that
there is nothing in the understanding that was not first in the
senses, and, consequently, it is to lay the foundation of all wisdom,
of all eloquence, and of all good and prudent conduct, carefully to
train the senses to note with accuracy the differences between
natural objects; and as this point, important as it is, is ordinarily
neglected in the schools of to-day, and as objects are proposed to
scholars that they do not understand because they have not been
properly represented to their senses or to their imagination, it is for
this reason, on the one hand, that the toil of teaching, and on the
other, that the pain of learning, have become so burdensome and so
unfruitful....
“We must offer to the young, not the shadows of things, but the
things themselves, which impress the senses and the imagination.
Instruction should commence with a real observation of things, and
not with a verbal description of them.”
We see that Comenius accepts the doctrine of Bacon, even to his
absolute sensationalism. In his pre-occupation with the importance
of instruction through the senses, he goes so far as to ignore that
other source of knowledge and intuitions, the inner consciousness.
144. Simplification of Grammatical Study.—The first result of the
experimental method applied to instruction, is to simplify grammar
and to relieve it from the abuse of abstract rules. “Children,” says
Comenius, “need examples and things which they can see, and not
abstract rules.”
And in the Preface of the Janua linguarum, he dwells upon the
faults of the old method employed for the study of languages.
“It is a thing self-evident, that the true and proper way of teaching
languages has not been recognized in the schools up to the present
time. The most of those who devoted themselves to the study of
letters grew old in the study of words, and upwards of ten years was
spent in the study of Latin alone; indeed, they even spent their
whole life in the study, with a very slow and very trifling profit, which
did not pay for the trouble devoted to it.”[106] It is by use and by
reading that Comenius would abolish the abuse of rules. Rules ought
to intervene only to aid use and give it surety. The pupil will thus
learn language, either in speaking, or in reading a book like the
Orbis Pictus, in which he will find at the same time all the words of
which the language itself is composed, and examples of all the
constructions of its syntax.
145. Necessity of Drill and Practice.—Another essential point in the
new method, is the importance attributed by Comenius to practical
exercises: “Artisans,” he said, “understand this matter perfectly well.
Not one of them will give an apprentice a theoretical course on his
trade. He is allowed to notice what is done by his master, and then
the tool is put in his hands: it is in smiting that one becomes a
smith.”[107]
It is no longer the thing to repeat mechanically a lesson learned
by heart. There must be a gradual habituation to action, to
productive work, to personal effort.
146. General Bearing of the Work of Comenius.—How many other
new and judicious ideas we shall have to gather from Comenius! The
methods which we would be tempted to consider as wholly recent,
his imagination had already suggested to him. For example,
preceding the Orbis Pictus, we find an alphabet, where to each letter
corresponds the cry of an animal, or else a sound familiar to the
child. Is not this already the very essence of the phononimic
processes[108] brought into fashion in these last years? But what is
of more consequence with Comenius than a few happy discoveries in
practical pedagogy, is the general inspiration of his work. He gives to
education a psychological basis in demanding that the faculties shall
be developed in their natural order: first, the senses, the memory,
the imagination, and lastly the judgment and the reason. He is
mindful of physical exercises, of technical and practical instruction,
without forgetting that in the primary schools, which he calls the
“studios of humanity,” there must be trained, not only strong and
skilful artisans, but virtuous and religious men, imbued with the
principles of order and justice. If he has stepped from theology to
pedagogy, and if he permits himself sometimes to be borne along by
his artless bursts of mysticism, at least he does not forget the
necessities of the real condition, and of the present life of men. “The
child,” he says, “shall learn only what is to be useful to him in this
life or in the other.” Finally, he does not allow himself to be absorbed
in the minute details of school management. He has higher views,—
he is working for the regeneration of humanity. Like Leibnitz, he
would freely say: “Give me for a few years the direction of
education, and I agree to transform the world!”
[147. Analytical Summary.—1. Decisive changes in human
opinion, political, religious, or scientific, involve corresponding
changes in the purposes and methods of education.
2. The Reformation was a breaking with authority in matters
of religion, as the Baconian philosophy was a breaking with
authority in matters of science; and their joint effect on
education was to subject matters of opinion, belief, and
knowledge to the individual reason, experience, and
observation.
3. In holding each human being responsible for his own
salvation, the Reformation made it necessary for every one to
read, and the logical consequence of this was to make
instruction universal; and as schools were multiplied, the
number of teachers must be increased, and their grade of
competence raised.
4. The conception that ignorance is an evil, and a constant
menace to spiritual and temporal safety, led to the idea of
compulsory school-attendance.
5. In the recoil from the intuitions of the intellect sanctioned
by Socrates, to the intuitions of the senses sanctioned by
Bacon, education passed from an extreme dependence on
reflection and reason, to an extreme dependence on sense and
observation; so that inference has been thrown into discredit,
and the verdict of the senses has been made the test of
knowledge.
6. In adapting the conception of universal education to the
social conditions of his time, Comenius was led to a gradation
of schools that underlies all modern systems of public
instruction.]
FOOTNOTES:
[95] Dittes, op. cit. p. 127.
[96] Luther’s argument for compulsion should not be omitted: “It
is my opinion that the authorities are bound to force their
subjects to send their children to school.... If they can oblige their
able-bodied subjects to carry the lance and the arquebuse, to
mount the ramparts, and to do complete military service, for a
much better reason may they, and ought they, to force their
subjects to send their children to school, for here it is the
question of a much more terrible war with the devil.” (P.)
[97] Names for treatises on grammar and philosophy respectively.
Donatus was a celebrated grammarian and rhetorician who
taught at Rome in the middle of the fourth century A.D.; and
Alexander, a celebrated Greek commentator on the writings of
Aristotle, who taught the Peripatetic philosophy at Athens in the
end of the second and the beginning of the third centuries A.D.
(P.)
[98] Michelet, Nos fils, p. 175 et seq.
[99] This is, perhaps, the earliest appearance of the conception
that learning should be a process of discovery or of re-discovery.
Condillac (1715-1780) has elaborated this idea in the introduction
to his Grammaire, and Spencer (Education, p. 122) makes it a
fundamental law of teaching. If this assumed principle were to be
rigorously applied, as, fortunately, it cannot be, progress in
human knowledge would be impossible. Mr. Bain’s comment on
this doctrine (Education as a Science, p. 94) is as follows: “This
bold fiction is sometimes put forward as one of the regular arts of
the teacher; but I should prefer to consider it as an extraordinary
device, admissible only on special occasions.” (P.)
[100] It may not be generally known that Comenius was once
solicited to become the President of Harvard College. The
following is a quotation from Vol. II., p. 14, of Cotton Mather’s
Magnalia: “That brave old man, Johannes Amos Commenius, the
fame of whose worth hath been trumpetted as far as more than
three languages (whereof every one is indebted unto his Janua)
could carry it, was indeed agreed withal, by our Mr. Winthrop in
his travels through the low countries, to come over into New
England, and illuminate this Colledge and country, in the quality
of a President, which was now become vacant. But the
solicitations of the Swedish Ambassador diverting him another
way, that incomparable Moravian became not an American.” This
was on the resignation of President Dunster, in 1654. (P.)
[101] The most complete account ever written of Comenius and
his writings is, “John Amos Comenius,” by S. S. Laurie (Boston:
1885). It is an invaluable contribution to the philosophy and the
history of education. (P.)
[102] Buisson’s Dictionnaire de Pédagogie, Article Comenius.
[103] In the French Lycées and Colleges the grades are named as
follows, beginning with the lowest: “ninth, eighth, seventh, sixth,
fifth, fourth, third, second, rhetoric, philosophy, preparatory
mathematics, elementary mathematics, special mathematics.”
Latin was formerly begun in an earlier grade.
[104] The public school of the European type may be represented
by a series of (3) pyramids, the second higher than the first, and
the third higher than the second, each independent and complete
in itself; while the public school of the American type is
represented by a single pyramid in three sections. While in an
English, French, or German town, public education is
administered in three separate establishments, in an American
town there is a single graded school that fulfills the same
functions. (P.)
[105] Platter, a Swiss teacher of the sixteenth century (1499-
1582).
[106] For this quotation, as for all those which we borrow from
the preface of the Janua linguarum, a French edition of which (in
three languages: Latin, German, and French) appeared in 1643,
we copy from the authentic text.
[107] There is a misleading fallacy in all such illustrations. What
analogy is there between the learning of history or geology and
the learning of a trade like carpentry? Should a physician and a
blacksmith be educated on the same plan? In every case
knowledge should precede practice; and the liberal arts are best
learned by first learning their correlative sciences. (P.)
[108] “A process of instruction which consists in placing beside
the elements of human speech thirty-three onomatopoetic
gestures, which recall to the sight the same ideas that the sounds
and the articulations of the voice recall to the ear.”—Grosselin. (P.)
CHAPTER VII.
T H E T E A C H I N G C O N G R E G AT I O N S.—J E S U I T S A N D
J A N S E N I S T S.
THE TEACHING CONGREGATIONS; JESUITS AND JANSENISTS; FOUNDATION OF THE SOCIETY OF JESUS
(1540); DIFFERENT JUDGMENTS ON THE EDUCATIONAL MERITS OF THE JESUITS; AUTHORITIES TO
CONSULT; PRIMARY INSTRUCTION NEGLECTED; CLASSICAL STUDIES; LATIN AND THE HUMANITIES;
NEGLECT OF HISTORY, OF PHILOSOPHY, AND OF THE SCIENCES IN GENERAL; DISCIPLINE;
EMULATION ENCOURAGED; OFFICIAL DISCIPLINARIAN; GENERAL SPIRIT OF THE PEDAGOGY OF THE
JESUITS; THE ORATORIANS; THE LITTLE SCHOOLS; STUDY OF THE FRENCH LANGUAGE; NEW
SYSTEM OF SPELLING; THE MASTERS AND THE BOOKS OF PORT ROYAL; DISCIPLINE IN PERSONAL
REFLECTION; GENERAL SPIRIT OF THE INTELLECTUAL EDUCATION AT PORT ROYAL; NICOLE; MORAL
PESSIMISM; EFFECTS ON DISCIPLINE; FAULTS IN THE DISCIPLINE OF PORT ROYAL; GENERAL
JUDGMENT ON PORT ROYAL; ANALYTICAL SUMMARY.
148. The Teaching Congregations.[109]—Up to the French Revolution,
up to the day when the conception of a public and national
education was embodied in the legislative acts of our assembled
rulers, education remained almost exclusively an affair of the
Church. The universities themselves were dependent in part on
religious authority. But especially the great congregations assumed a
monopoly of the work of teaching, the direction and control of which
the State had not yet claimed for her right.
Primary instruction, it is true, scarcely entered at first into the
settled plans of the religious orders. The only exception to this
statement that can properly be made, is the congregation of the
Christian Doctrine, which a humble priest, Cæsar de Bus, founded at
Avignon in 1592, the avowed purpose of which was the religious
education of the children of the company.[110] But, on the other
hand, secondary instruction provoked the greatest educational event
of the sixteenth century, the founding of the company of Jesus, and
this movement was continued and extended in the seventeenth
century, either in the colleges of the Jesuits, ever growing in number,
or in other rival congregations.
149. Jesuits and Jansenists.—Among the religious orders that have
consecrated their efforts to the work of teaching, the first place must
be assigned to the Jesuits and the Jansenists. Different in their
statutes, their organization, and their destinies, these two
congregations are still more different in their spirit. They represent,
in fact, two opposite, and, as it were, contrary phases of human
nature and of the Christian spirit. For the Jesuits, education is
reduced to a superficial culture of the brilliant faculties of the
intelligence; while the Jansenists, on the contrary, aspire to develop
the solid faculties, the judgment, and the reason. In the colleges of
the Jesuits, rhetoric is held in honor; while in the Little Schools of
Port Royal, it is rather logic and the exercise of thought. The shrewd
disciples of Loyola adapt themselves to the times, and are full of
compassion for human weakness; the solitaries of Port Royal are
exacting of others and of themselves. In their suppleness and
cheerful optimism, the Jesuits are almost the Epicureans of
Christianity; with their austere and somewhat sombre doctrine, the
Jansenists would rather be the Stoics. The Jesuits and the
Jansenists, those great rivals of the seventeenth century, are still
face to face as enemies at the present moment. While the inspiration
of the Jesuits tries to maintain the old worn-out exercises, like Latin
verse, and the abuse of the memory, the spirit of the Jansenists
animates and inspires the reformers, who, in the teaching of the
classics, break with tradition and routine, to substitute for exercises
aimed at elegance, and for a superficial instruction, studies of a
greater solidity and an education that is more complete.
The merit of institutions ought not always to be measured by their
apparent success. The colleges of the Jesuits, during three centuries,
have had a countless number of pupils; the Little Schools of Port
Royal did not live twenty years, and during their short existence they
enrolled at most only some hundreds of pupils. And yet the methods
of the Jansenists have survived the ruin of their colleges and the
dispersion of the teachers who had applied them. Although the
Jesuits have not ceased to rule in appearance, it is the Jansenists
who triumph in reality, and who to-day control the secondary
instruction of France.
150. Foundation of the Society of Jesus.—In organizing the Society
of Jesus, Ignatius Loyola, that compound of the mystic and the man
of the world, purposed to establish, not an order devoted to
monastic contemplation, but a real fighting corps, a Catholic army,
whose double purpose was to conquer new provinces to the faith
through missions, and to preserve the old through the control of
education. Solemnly consecrated by the Pope Paul III., in 1540, the
congregation had a rapid growth. As early as the middle of the
sixteenth century, it had several colleges in France, particularly those
of Billom, Mauriac, Rodez, Tournon, and Pamiers. In 1561 it secured
a footing in Paris, notwithstanding the resistance of the Parliament,
of the university, and of the bishops themselves. A hundred years
later it counted nearly fourteen thousand pupils in the province of
Paris alone. The college of Clermont, in 1651, enrolled more than
two thousand young men. The middle and higher classes assured to
the colleges of the society an ever-increasing membership. At the
end of the seventeenth century, the Jesuits could inscribe on the roll
of honor of their classes a hundred illustrious names, among others,
those of Condé and Luxembourg, Fléchier and Bossuet, Lamoignon
and Séguier, Descartes, Corneille, and Molière. In 1710 they
controlled six hundred and twelve colleges and a large number of
universities. They were the real masters of education, and they
maintained this educational supremacy till the end of the eighteenth
century.
151. Different Judgments on the Educational Merits of the Jesuits.—
Voltaire said of these teachers: “The Fathers taught me nothing but
Latin and nonsense.” But from the seventeenth century, opinions are
divided, and the encomiums of Bacon and Descartes must be offset
by the severe judgment of Leibnitz. “In the matter of education,”
says this great philosopher, “the Jesuits have remained below
mediocrity.”[111] Directly to the contrary, Bacon had written: “As to
whatever relates to the instruction of the young, we must consult
the schools of the Jesuits, for there can be nothing that is better
done.”[112]
152. Authorities to Consult.—The Jesuits have never written
anything on the principles and objects of education. We must not
demand of them an exposition of general views, or a confession of
their educational faith. But to make amends, they have drawn up
with precision, with almost infinite attention to details, the rules and
regulations of their course of study. Already, in 1559, the
Constitutions, probably written by Loyola himself, devoted a whole
book to the organization of the colleges of the society.[113] But in
particular, the Ratio Studiorum, published in 1599, contains a
complete scholastic programme, which has remained for three
centuries the invariable educational code of the congregation.
Without doubt, the Jesuits, always ready to make apparent
concessions to the spirit of the times, without sacrificing anything of
their own spirit, and without renouncing their inflexible purpose,
have introduced modifications into their original rules; but the spirit
of their educational practice has remained the same, and, in 1854,
Beckx, the actual general of the order, could still declare that the
Ratio is the immutable rule of Jesuit education.
153. Primary Instruction Neglected.—A permanent and characteristic
feature of the educational policy of the Jesuits is, that, during the
whole course of their history, they have deliberately neglected and
disdained primary instruction. The earth is covered with their Latin
colleges; and wherever they have been able, they have put their
hands on the institutions for university education; but in no instance
have they founded a primary school. Even in their establishments for
secondary instruction, they entrust the lower classes to teachers
who do not belong to their order, and reserve to themselves the
direction of the higher classes. Must we believe, as they have
declared in order to explain this negligence, that the only reason for
their reserve and their indifference is to be sought for in the
insufficiency of their teaching force? No; the truth is that the Jesuits
neither desire nor love the instruction of the people. To desire and to
love this, there must be faith in conscience and reason; there must
be a belief in human equality. Now the Jesuits distrust the human
intelligence, and administer only the aristocratic education of the
ruling classes, whom they hope to retain under their own control.
They wish to train amiable gentlemen, accomplished men of the
world; they have no conception of training men. Intellectual culture,
in their view, is but a convenience, imposed on certain classes of the
nation by their rank. It is not a good in itself; it may even become an
evil. In certain hands it is a dangerous weapon. The ignorance of a
people is the best safeguard of its faith, and faith is the supreme
end. So we shall not be astonished to read this in the Constitutions:
—
“None of those who are employed in domestic service on account
of the society, ought to learn to read and write, or, if they already
know these arts, to learn more of them. They shall not be instructed
without the consent of the General, for it suffices for them to serve
with all simplicity and humility our Master, Jesus Christ.”
154. Classical Studies: Latin and the Humanities.—It is only in
secondary instruction that the Jesuits have taken position with
marked success. The basis of their teaching is the study of Latin and
Greek. Their purpose is to monopolize classical studies in order to
make them serve for the propagation of the Catholic faith. To write
in Latin is the ideal which they propose to their pupils. The first
consequence of this is the proscription of the mother tongue. The
Ratio forbids the use of French even in conversation; it permits it
only on holidays. Hence, also, the importance accorded to Latin and
Greek composition, to the explication of authors, and to the study of
grammar, rhetoric, and poetry. It is to be noted, besides, that the
Jesuits put scarcely more into the hands of their pupils than select
extracts, expurgated editions. They wish, in some sort, to efface
from the ancient books whatever marks the epoch and characterizes
the time. They detach fine passages of eloquence and beautiful
extracts of poetry; but they are afraid, it seems, of the authors
themselves; they fear lest the pupil find in them the old human
spirit,—the spirit of nature. Moreover, in the explication of authors,
they pay more attention to words than to things. They direct the
pupil’s attention, not to the thoughts, but to the elegancies of
language, to the elocutionary effect; in a word, to the form, which,
at least, has no religious character, and can in nowise give umbrage
to Catholic orthodoxy. They fear to awaken reflection and individual
judgment. As Macaulay has said, they seem to have found the point
up to which intellectual culture can be pushed without reaching
intellectual emancipation.
155. Disdain of History, of Philosophy, and of the Sciences in General.
—Preoccupied before all else with purely formal studies, and
exclusively devoted to the exercises which give a training in the use
of elegant language, the Jesuits leave real and concrete studies in
entire neglect. History is almost wholly banished from their
programme. It is only with reference to the Greek and Latin texts
that the teacher should make allusion to the matters of history which
are necessary for the understanding of the passage under
examination. No account is made of modern history, nor of the
history of France. “History,” says a Jesuit Father, “is the destruction
of him who studies it.” This systematic omission of historical studies
suffices to put in its true light the artificial and superficial pedagogy
of the Jesuits, admirably defined by Beckx, who expresses himself
thus:—
“The gymnasia will remain what they are by nature, a gymnastic
for the intellect, which consists far less in the assimilation of real
matter, in the acquisition of different knowledges, than in a culture
of pure form.”
The sciences and philosophy are involved in the same disdain as
history. Scientific studies are entirely proscribed in the lower classes,
and the student enters his year in philosophy,[114] having studied
only the ancient languages. Philosophy itself is reduced to a barren
study of words, to subtile discussions, and to commentaries on
Aristotle. Memory and syllogistic reasoning are the only faculties
called into play; no facts, no real inductions, no care for the
observation of nature. In all things the Jesuits are the enemies of
progress. Intolerant of everything new, they would arrest the
progress of the human mind and make it immovable.
156. Discipline.—Extravagant statements have been made relative
to the reforms in discipline introduced by the Jesuits into their
educational establishments. The fact is, that they have caused to
prevail in their colleges more of order and of system than there was
in the establishments of the University. On the other hand, they have
attempted to please their pupils, to gild for them, so to speak, the
bars of the prison which confined them. Theatrical representations,
excursions on holidays, practice in swimming, riding, and fencing,—
nothing was neglected that could render their residence at school
endurable.
But, on the other hand, the Jesuits have incurred the grave fault
of detaching the child from the family. They wish to have absolute
control of him. The ideal of the perfect scholar is to forget his
parents. Here is what was said by a pupil of the Jesuits, who
afterwards became a member of the Order, J. B. de Schultaus:—
“His mother paid him a visit at the College of Trent. He refused to
take her hand, and would not even raise his eyes to hers. The
mother, astonished and grieved, asked her son the cause of such a
cold greeting. ‘I refuse to notice you,’ said the pupil, ‘not because
you are my mother, but because you are a woman.’ And the
biographer adds: ‘This was not excessive precaution; woman
preserves to-day the faults she had at the time of our first father; it
is always she who drives man from Paradise.’ When the mother of
Schultaus died, he did not show the least emotion, having long ago
adopted the Holy Virgin for his true mother.”
157. Emulation Encouraged.—The Jesuits have always considered
emulation as one of the essential elements of discipline. “It is
necessary,” says the Ratio, “to encourage an honorable emulation; it
is a great stimulus to study.” Superior on this point, perhaps on this
alone, to the Jansenists, who through mistrust of human nature
feared to excite pride by encouraging emulation, the Jesuits have
always counted upon the self-love of the pupil. The Ratio multiplies
rewards,—solemn distributions of prizes, crosses, ribbons,
decorations, titles borrowed from the Roman Republic, such as
decurions and prætors; all means, even the most puerile, were
invented to nourish in pupils an ardor for work, and to incite them to
surpass one another. Let us add that the pupil was rewarded, not
only for his own good conduct, but for the bad conduct of his
comrades if he informed against them. The decurion or the prætor
was charged with the police care of the class, and, in the absence of
the official disciplinarian, he himself chastised his comrades; in the
hands of his teacher, he became a spy and an informer. Thus a pupil,
liable to punishment for having spoken French contrary to orders,
will be relieved from his punishment if he can prove by witnesses
that one of his comrades has committed the same fault on the same
day.
158. Official Disciplinarian.—The rod is an element, so to speak, of
the ancient pedagogical régime. It holds a privileged place both in
the colleges and in private education. Louis XIV. officially transmits
to the Duke of Montausier the right to correct his son. Henry IV.
wrote to the governor of Louis XIII.: “I complain because you did
not inform me that you had whipped my son; for I desire and order
you to whip him every time that he shall be guilty of obstinacy or of
anything else that is bad; for I well know that there is nothing in the
world that can do him more good than that. This I know from the
lessons of experience, for when I was of his age, I was soundly
flogged.”[115]
The Jesuits, notwithstanding their disposition to make discipline
milder, were careful not to renounce a punishment that was in use
even at court. Only, while the Brethren of the Christian Schools,
according to the regulations of La Salle, chastised the guilty pupil
themselves, the Jesuits did not think it becoming the dignity of the
master to apply the correction himself. They reserved to a laic the
duty of handling the rods. An official disciplinarian, a domestic, a
porter, was charged in all the colleges with the functions of chief
executioner. And while the Ratio Studiorum recommends
moderation, certain witnesses prove that the special disciplinarian
did not always carry a discreet hand. Here, for example, is an
account given by Saint Simon:—
“The eldest son of the Marquis of Boufflers was fourteen years old.
He was handsome, well formed, was wonderfully successful, and full
of promise. He was a resident pupil of the Jesuits with the two sons
of d’Argenson. I do not know what indiscretion he and they were
guilty of. The Fathers wished to show that they neither feared nor
stood in awe of any one, and they flogged the boy, because, in fact,
they had nothing to fear of the Marquis of Boufflers; but they were
careful not to treat the two others in this way, though equally
culpable, because every day they had to count with d’Argenson, who
was lieutenant of police. The boy Boufflers was thrown into such
mental agony that he fell sick on the same day, and within four days
was dead.... There was a universal and furious outcry against the
Jesuits, but nothing ever came of it.”[116]
159. General Spirit of the Pedagogy of the Jesuits.—The general
principles of the doctrine of the Jesuits are completely opposed to
our modern ideas. Blind obedience, the suppression of all liberty and
of all spontaneity, such is the basis of their moral education.
“To renounce one’s own wishes is more meritorious than to raise
the dead;” “We must be so attached to the Roman Church as to hold
for black an object which she tells us is black, even when it is really
white;” “Our confidence in God should be strong enough to force us,
in the lack of a boat, to cross the ocean on a single plank;” “If God
should appoint for our master an animal deprived of reason, you
should not hesitate to render it obedience, as to a master and a
guide, for this sole reason, that God has ordered it thus;” “One must
allow himself to be governed by divine Providence acting through
the agency of the superiors of the Order, just as if he were a dead
body that could be put into any position whatever, and treated
according to one’s good pleasure; or as if one were a bâton in the
hands of an old man who uses it as he pleases.”
As to intellectual education, as they understand it, it is wholly
artificial and superficial. To find for the mind occupations that absorb
it, that soothe it like a dream, without wholly awakening it; to call
attention to words, and to niceties of expression, so as to reduce by
so much the opportunity for thinking; to provoke a certain degree of
intellectual activity, prudently arrested at the place where the
reflective reason succeeds an embellished memory; in a word, to
excite the spirit just enough to arouse it from its inertia and its
ignorance, but not enough to endow it with a real self-activity by a
manly display of all its faculties,—such is the method of the Jesuits.
“As to instruction,” says Bersot, “this is what we find with them:
history reduced to facts and tables, without the lesson derived from
them bearing on the knowledge of the world; even the facts
suppressed or altered when they say too much; philosophy reduced
to what is called empirical doctrine, and what de Maistre called the
philosophy of the nothing, without danger of one’s acquiring a liking
for it; physical science reduced to recreations, without the spirit of
research and liberty; literature reduced to the complaisant
explication of the ancient authors, and ending in innocent
witticisms.... With respect to letters, there are two loves which have
nothing in common save their name; one of them makes men, the
other, great boys. It is the last that we find with the Jesuits; they
amuse the soul.”
160. The Oratorians.—Between the Jesuits, their adversaries, and
the Jansenists, their friends, the Oratorians occupy an intermediate
place. They break already with the over-mechanical education, and
with the wholly superficial instruction which Ignatius Loyola had
inaugurated. Through some happy innovations they approach the
more elevated and more profound education of Port Royal. Founded
in 1614, by Bérulle, the Order of the Oratory soon counted quite a
large number of colleges of secondary instruction, and, in particular,
in 1638, the famous college of Juilly. While with the Jesuits it is rare
to meet the names of celebrated professors, several renowned
teachers have made illustrious the Oratory of the seventeenth
century. We note the Père Lamy, author of Entretiens sur les
Sciences (1683); the Père Thomassin, whom the Oratorians call the
“incomparable theologian,” and who published, from 1681 to 1690, a
series of Methods for studying the languages, philosophy, and
letters; Mascaron and Massillon, who taught rhetoric at the Oratory;
the Père Lecointe and the Père Lelong, who taught history there. All
these men unite, in general, some love of liberty to ardor of religious
sentiment; they wish to introduce more air and more light into the
cloister and the school; they have a taste for the facts of history and
the truths of science; finally, they attempt to found an education at
once liberal and Christian, religious without abuse of devotion,
elegant without refinement, solid without excess of erudition,
worthy, finally, to be counted as one of the first practical tentatives
of modern pedagogy.
The limits of this study forbid our entering into details. Let us
merely note a few essential points. That which distinguishes the
Oratorians, is, first, a sincere and disinterested love of truth.
“We love the truth,” says the Père Lamy; “the days do not suffice
to consult her as long as we would wish; or, rather, we never grow
weary of the pleasure we find in studying her. There has always
been that love for letters in this House: those who have governed it
have tried to nourish it. When there is found among us some
penetrating and liberally endowed spirit who has a rare genius for
the sciences, he is discharged from all other duties.”[117]
Nowhere have ancient letters been more loved than at the
Oratory.
“In his leisure hours the Père Thomassin read only the authors of
the humanities;” and yet French was not there sacrificed to Latin.
The use of the Latin language was not obligatory till after the fourth
year, and even then not for the lessons in history, which, till the end
of the courses, had to be given in French. History, so long neglected
even in the colleges of the University, particularly the history of
France, was taught to the pupils of the Oratory. Geography was not
separated from it; and the class-rooms were furnished with large
mural maps. On the other hand, the sciences had a place in the
course of study. A Jesuit father would not have expressed himself as
the Père Lamy has done:—
“It is a pleasure to enter the laboratory of a chemist. In the places
where I have happened to be, I did not miss an opportunity to
attend the anatomical lectures that were given, and to witness the
dissection of the principal parts of the human body.... I know of
nothing of greater use than algebra and arithmetic.”
Finally, philosophy itself,—the Cartesian philosophy, so mercilessly
decried by the Jesuits,—was in vogue at the Oratory. “If
Cartesianism is a pest,” wrote the regents of the College of Angers,
“there are more than two hundred of us who are infected with it.” ...
“They have forbidden the Fathers of the Oratory to teach the
philosophy of Descartes, and, consequently, the blood to circulate,”
wrote Madame de Sévigné, in 1673.
Let us also furnish proof of the progress and amelioration of the
discipline at the Oratory:—
“There are many other ways besides the rod,” says the Père Lamy;
“and, to lead pupils back to their duty, a caress, a threat, the hope
of a reward, or the fear of a humiliation, has greater efficiency than
whips.”
The ferule, it is true, and whips also, were not forbidden, but
made part of the legitima pœnarum genera. But it does not appear
that use was often made of them; either through a spirit of
mildness, or through prudence, and through the fear of exasperating
the child.
“There is needed,” says the Père Lamy again, “a sort of politics to
govern this little community,—to lead them through their
inclinations; to foresee the effect of rewards and punishments, and
to employ them according to their proper use. There are times of
stubbornness when a child would sooner be killed than yield.”
What made it easier at the Oratory to maintain the authority of
the master without resorting to violent punishments, is that the
same professor accompanied the pupils through the whole series of
their classes. The Père Thomassin, for example, was, in turn,
professor of grammar, rhetoric, philosophy, mathematics, history,
Italian, and Spanish,—a touching example, it must be allowed, of an
absolute devotion to scholastic labor. But this universality, somewhat
superficial, served neither the real interests of the masters nor those
of their pupils. The great pedagogical law is the division of labor.
161. Foundation of the Little Schools.—From the very organization
of their society, the Jansenists gave evidences of an ardent solicitude
for the education of youth. Their founder, Saint Cyran, said:
“Education is, in a sense, the one thing necessary.... I wish you
might read in my heart the affection I feel for children.... You could
not deserve more of God than in working for the proper bringing up
of children.” It was in this disinterested feeling of charity for the
good of the young, in this display of sincere tenderness for children,
that the Jansenists, in 1643, founded the Little Schools at Port Royal
in the Fields, in the vicinity, and then in Paris.[118] They received into
those schools only a small number of pupils, preoccupied as they
were, not with dominating the world and extending their influence,
but with doing modestly and obscurely the good they could.
Persecution did not long grant them the leisure to continue the work
they had undertaken. By 1660 the enemies of Port Royal had
triumphed; the Jesuits obtained an order from the king closing the
schools and dispersing the teachers. Pursued, imprisoned,
expatriated, the solitaries of Port Royal had but the opportunity to
gather up in memorable documents the results of their educational
experience all too short.[119]
162. The Teachers and the Books of Port Royal.—Singular destiny,—
that of those teachers whom a relentless fate permitted to exercise
their functions for only five years, yet who, through their works,
have remained perhaps the best authorized exponents of French
education! The first of these is Nicole, the moralist and logician, one
of the authors of the Port Royal Logic, who taught philosophy and
the humanities in the Little Schools, and who published in 1670,
under the title, The Education of a Prince, a series of reflections on
education, applicable, as he himself says, to children of all classes.
Another is Lancelot, the grammarian, the author of the Methods for
learning the Latin, Greek, Italian, and Spanish languages. Then there
is Arnauld, the great Arnauld, the ardent theologian, who worked on
the Logic, and the General Grammar, and who finally composed the
Regulation of Studies in the Humanities. In connection with these
celebrated names, we must mention other Jansenists not so well
known, such as De Sacy and Guyot, both of whom were the authors
of a large number of translations; Coustel, who published the Rules
for the Education of Children (1687); Varet, the author of Christian
Education (1668). Let us add to this list, still incomplete, the
Regimen for Children, by Jacqueline Pascal (1657), and we shall
have some idea of the educational activity of Port Royal.
163. The Study of the French Language.—As a general rule, we may
have a good opinion of the teachers who recommend the study of
the mother tongue. In this respect, the solitaries of Port Royal are in
advance of their time. “We first teach to read in Latin,” said the Abbé
Fleury, “because, compared with French, we pronounce it more as it
is written.”[120] A curious reason, which did not satisfy Fleury
himself; for he acknowledged the propriety of putting, as soon as
possible, into the hands of children, the French books that they can
understand. This was what was done at Port Royal. With their love
of exactness and clearness, with their disposition, wholly Cartesian,
to make children study only the things they can comprehend, the
Jansenists saw at once the great absurdity of choosing Latin works
as the first reading-books. “To learn Latin before learning the mother
tongue,” said Comenius, wittily, “is like wishing to mount a horse
before knowing how to walk.” And again, as Sainte-Beuve says, “It is
to compel unfortunate children to deal with the unintelligible in order
to proceed towards the unknown.” For these unintelligible texts, the
Jansenists substituted, not, it is true, original French works, but at
least good translations of Latin authors. For the first time in France,
the French language was made the subject of serious study. Before
being made to write in Latin, pupils were drilled in writing in French.
They were set to compose little narratives, little letters, the subjects
of which were borrowed from their recollections, by being asked to
relate on the spot what they had retained of what they had read.
164. New System of Spelling.—In their constant preoccupation to
make study easier, the Jansenists reformed the current method of
learning to read. “What makes reading more difficult,” says Arnauld
in Chapter VI. of the General Grammar, “is that while each letter has
its own proper name, it is given a different name when it is found
associated with other letters. For example, if the pupil is made to
read the syllable fry, he is made to say ef, ar, y, which invariably
confuses him. It is best, therefore, to teach children to know the
letters only by the names of their real pronunciation, to name them
only by their natural sounds.” Port Royal proposes, then, “to have
children pronounce only the vowels and the diphthongs, and not the
consonants, which they need not pronounce, except in the different
combinations which they form with the same vowels or diphthongs,
in syllables and words.”
This method has become celebrated under the name of the Port
Royal Method; and it appears, from a letter of Jacqueline Pascal, that
the original notion was due to Pascal himself.[121]
165. Discipline in Personal Reflection.—That which profoundly
distinguishes the method of the Jansenists from the method of the
Welcome to Our Bookstore - The Ultimate Destination for Book Lovers
Are you passionate about books and eager to explore new worlds of
knowledge? At our website, we offer a vast collection of books that
cater to every interest and age group. From classic literature to
specialized publications, self-help books, and children’s stories, we
have it all! Each book is a gateway to new adventures, helping you
expand your knowledge and nourish your soul
Experience Convenient and Enjoyable Book Shopping Our website is more
than just an online bookstore—it’s a bridge connecting readers to the
timeless values of culture and wisdom. With a sleek and user-friendly
interface and a smart search system, you can find your favorite books
quickly and easily. Enjoy special promotions, fast home delivery, and
a seamless shopping experience that saves you time and enhances your
love for reading.
Let us accompany you on the journey of exploring knowledge and
personal growth!
ebookgate.com

More Related Content

PDF
PDF Embedded Systems Design 2nd Edition Steve Heath download
PDF
Embedded Systems Design 2nd Edition Steve Heath
PDF
PC Based Instrumentation and Control 3rd Edition Mike Tooley Ba
PPT
Microprocessor Systems and Interfacing Slides
PPTX
Evolution of processors
PDF
DSP Applications Using C and the TMS320C6x DSK 1st Edition Chassaing
PPT
Microcontrollers and intro to real time programming 1
PPT
An Overview Study on AVR32UC3 MCU: AT32UC3A3256
PDF Embedded Systems Design 2nd Edition Steve Heath download
Embedded Systems Design 2nd Edition Steve Heath
PC Based Instrumentation and Control 3rd Edition Mike Tooley Ba
Microprocessor Systems and Interfacing Slides
Evolution of processors
DSP Applications Using C and the TMS320C6x DSK 1st Edition Chassaing
Microcontrollers and intro to real time programming 1
An Overview Study on AVR32UC3 MCU: AT32UC3A3256

Similar to Embedded Systems Design 2nd Edition Steve Heath (20)

PPT
Embedded System Basics
PPT
Introduction to intel 8086 part1
PDF
How to Select Hardware for Internet of Things Systems?
PDF
My Feb 2003 HPCA9 Keynote Slides - Billion Transistor Processor Chips
PPT
Unit 1
PPT
Introduction
PPTX
Chapter_01_See_Program_Running Yifeng Zhu
PDF
Full download Real Time Digital Signal Processing Implementation and Applicat...
PDF
[Application guide] IoT Protocol gateway
PDF
Tutorial Embedded System
PPT
Modbus.ppt
PPT
modbus.ppt
PPTX
Microcontoller and Embedded System
PDF
Realtime Digital Signal Processing Implementations And Applications 2nd Editi...
PPTX
Chapter_01_See_Program_Running.pptx
PPT
Cpu speed, wordlength.8
PPT
Micro processor
PDF
RAD Industrial Automation, Labs, and Instrumentation
PDF
Moxa Power Solution_by Eric Lo_03302012
DOC
CodeWarrior, Linux; OrCad and Hyperlynx; QMS Tools
Embedded System Basics
Introduction to intel 8086 part1
How to Select Hardware for Internet of Things Systems?
My Feb 2003 HPCA9 Keynote Slides - Billion Transistor Processor Chips
Unit 1
Introduction
Chapter_01_See_Program_Running Yifeng Zhu
Full download Real Time Digital Signal Processing Implementation and Applicat...
[Application guide] IoT Protocol gateway
Tutorial Embedded System
Modbus.ppt
modbus.ppt
Microcontoller and Embedded System
Realtime Digital Signal Processing Implementations And Applications 2nd Editi...
Chapter_01_See_Program_Running.pptx
Cpu speed, wordlength.8
Micro processor
RAD Industrial Automation, Labs, and Instrumentation
Moxa Power Solution_by Eric Lo_03302012
CodeWarrior, Linux; OrCad and Hyperlynx; QMS Tools
Ad

Recently uploaded (20)

PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
Sports Quiz easy sports quiz sports quiz
PDF
Pre independence Education in Inndia.pdf
PDF
O7-L3 Supply Chain Operations - ICLT Program
PPTX
Lesson notes of climatology university.
PPTX
Pharma ospi slides which help in ospi learning
PDF
TR - Agricultural Crops Production NC III.pdf
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
Classroom Observation Tools for Teachers
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
01-Introduction-to-Information-Management.pdf
PDF
Complications of Minimal Access Surgery at WLH
PDF
RMMM.pdf make it easy to upload and study
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
Basic Mud Logging Guide for educational purpose
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Sports Quiz easy sports quiz sports quiz
Pre independence Education in Inndia.pdf
O7-L3 Supply Chain Operations - ICLT Program
Lesson notes of climatology university.
Pharma ospi slides which help in ospi learning
TR - Agricultural Crops Production NC III.pdf
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Classroom Observation Tools for Teachers
2.FourierTransform-ShortQuestionswithAnswers.pdf
human mycosis Human fungal infections are called human mycosis..pptx
01-Introduction-to-Information-Management.pdf
Complications of Minimal Access Surgery at WLH
RMMM.pdf make it easy to upload and study
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Basic Mud Logging Guide for educational purpose
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Ad

Embedded Systems Design 2nd Edition Steve Heath

  • 1. Embedded Systems Design 2nd Edition Steve Heath download https://ebookgate.com/product/embedded-systems-design-2nd- edition-steve-heath/ Get Instant Ebook Downloads – Browse at https://ebookgate.com
  • 2. Get Your Digital Files Instantly: PDF, ePub, MOBI and More Quick Digital Downloads: PDF, ePub, MOBI and Other Formats Embedded Systems Architecture Programming and Design 2nd Edition Raj Kamal https://ebookgate.com/product/embedded-systems-architecture- programming-and-design-2nd-edition-raj-kamal/ Making Embedded Systems Design Patterns for Great Software 2nd Edition Elecia White https://ebookgate.com/product/making-embedded-systems-design- patterns-for-great-software-2nd-edition-elecia-white/ Fast and Effective Embedded Systems Design 1st Edition Rob Toulson https://ebookgate.com/product/fast-and-effective-embedded- systems-design-1st-edition-rob-toulson/ Design Patterns for Embedded Systems in C An Embedded Software Engineering Toolkit 1st Edition Bruce Powel Douglass https://ebookgate.com/product/design-patterns-for-embedded- systems-in-c-an-embedded-software-engineering-toolkit-1st- edition-bruce-powel-douglass/
  • 3. TCP IP Lean Web Servers for Embedded Systems 2nd Edition Jeremy Bentham https://ebookgate.com/product/tcp-ip-lean-web-servers-for- embedded-systems-2nd-edition-jeremy-bentham/ Real Time UML Workshop for Embedded Systems 2nd Edition Bruce Powel Douglass https://ebookgate.com/product/real-time-uml-workshop-for- embedded-systems-2nd-edition-bruce-powel-douglass/ Embedded System Design Third Edition Santanu Chattopadhyay https://ebookgate.com/product/embedded-system-design-third- edition-santanu-chattopadhyay/ Analog and Digital Filter Design 2nd ed Edition Steve Winder https://ebookgate.com/product/analog-and-digital-filter- design-2nd-ed-edition-steve-winder/ Programming embedded systems with C and GNU development tools 2nd Edition Michael Barr https://ebookgate.com/product/programming-embedded-systems-with- c-and-gnu-development-tools-2nd-edition-michael-barr/
  • 6. ii Contents By the same author VMEbus: a practical companion Newnes UNIX™ Pocket Book Microprocessor architectures: RISC, CISC and DSP Effective PC networking PowerPC: a practical companion The PowerPC Programming Pocket Book The PC and MAC handbook The Newnes Windows NT Pocket Book Multimedia Communications Essential Linux Migrating to Windows NT All books published by Butterworth-Heinemann About the author: Through his work with Motorola Semiconductors, the author has been involved in the design and development of microprocessor-based systems since 1982. These designs have included VMEbus systems, microcontrollers, IBM PCs, Apple Macintoshes, and both CISC- and RISC-based multiprocessor systems, while using operating systems as varied as MS-DOS, UNIX, Macintosh OS and real-time kernels. An avid user of computer systems, he has had over 60 articles and papers published in the electronics press, as well as several books.
  • 7. Embedded Systems Design Second edition Steve Heath OXFORD AMSTERDAM BOSTON LONDON NEW YORK PARIS SAN DIEGO SAN FRANCISCO SINGAPORE SYDNEY TOKYO
  • 8. iv Contents Newnes An imprint of Elsevier Science Linacre House, Jordan Hill, Oxford OX2 8DP 200 Wheeler Road, Burlington MA 01803 First published 1997 Reprinted 2000, 2001 Second edition 2003 Copyright © 2003, Steve Heath. All rights reserved The right of Steve Heath to be identified as the author of this work has been asserted in accordance with the Copyright, Designs and Patents Act 1988 No part of this publication may be reproduced in any material form (including photocopying or storing in any medium by electronic means and whether or not transiently or incidentally to some other use of this publication) without the written permission of the copyright holder except in accordance with the provisions of the Copyright, Designs and Patents Act 1988 or under the terms of a licence issued by the Copyright Licensing Agency Ltd, 90 Tottenham Court Road, London, England W1T 4LP. Applications for the copyright holder’s written permission to reproduce any part of this publication should be addressed to the publisher TRADEMARKS/REGISTERED TRADEMARKS Computer hardware and software brand names mentioned in this book are protected by their respective trademarks and are acknowledged British Library Cataloguing in Publication Data A catalogue record for this book is available from the British Library Library of Congress Cataloguing in Publication Data A catalogue record for this book is available from the Library of Congress ISBN 0 7506 5546 1 Typeset by Steve Heath
  • 9. Contents v Contents Preface xvii Acknowledgements xix 1 What is an embedded system? 1 Replacement for discrete logic-based circuits 2 Provide functional upgrades 3 Provide easy maintenance upgrades 3 Improves mechanical performance 3 Protection of intellectual property 4 Replacement for analogue circuits 4 Inside the embedded system 8 Processor 8 Memory 8 Peripherals 9 Software 10 Algorithms 10 Microcontroller 11 Expanded microcontroller 13 Microprocessor based 14 Board based 14 2 Embedded processors 15 8 bit accumulator processors 16 Register models 16 8 bit data restrictions 17 Addressing memory 18 System integrity 19 Example 8 bit architectures 19 Z80 19 Z80 programming model 21 MC6800 22 Microcontrollers 23 MC68HC05 23 MC68HC11 23 Architecture 25 Data processors 25 Complex instructions, microcode and nanocode 25 INTEL 80286 28 Architecture 28 Interrupt facilities 29 Instruction set 30 80287 floating point support 30 Feature comparison 30
  • 10. vi Contents INTEL 80386DX 30 Architecture 30 Interrupt facilities 32 Instruction set 32 80387 floating point coprocessor 33 Feature comparison 33 INTEL 80486 34 Instruction set 35 Intel 486SX and overdrive processors 35 Intel Pentium 36 Multiple branch prediction 38 Data flow analysis 38 Speculative execution 38 The MMX instructions 39 The Pentium II 40 Motorola MC68000 40 The MC68000 hardware 41 Address bus 41 Data bus 41 Function codes 42 Interrupts 43 Error recovery and control signals 44 Motorola MC68020 44 The programmer’s model 46 Bus interfaces 49 Motorola MC68030 50 The MC68040 51 The programming model 53 Integrated processors 54 RISC processors 57 The 80/20 rule 57 The initial RISC research 58 The Berkeley RISC model 59 Sun SPARC RISC processor 60 Architecture 60 Interrupts 60 Instruction set 61 The Stanford RISC model 62 The MPC603 block diagram 63 The ARM register set 65 Exceptions 66 The Thumb instructions 67 Digital signal processors 68 DSP basic architecture 69 Choosing a processor 72
  • 11. Contents vii 3 Memory systems 73 Memory technologies 74 DRAM technology 76 Video RAM 77 SRAM 77 Pseudo-static RAM 78 Battery backed-up SRAM 78 EPROM and OTP 78 Flash 79 EPROM 79 Memory organisation 79 By 1 organisation 80 By 4 organisation 81 By 8 and by 9 organisations 81 By 16 and greater organisations 81 Parity 81 Parity initialisation 82 Error detecting and correcting memory 82 Access times 83 Packages 83 Dual in line package 84 Zig–zag package 84 SIMM and DIMM 84 SIP 85 DRAM interfaces 85 The basic DRAM interface 85 Page mode operation 86 Page interleaving 86 Burst mode operation 87 EDO memory 87 DRAM refresh techniques 88 Distributed versus burst refresh 88 Software refresh 89 RAS only refresh 89 CAS before RAS (CBR) refresh 89 Hidden refresh 89 Memory management 90 Disadvantages of memory management 92 Segmentation and paging 93 Memory protection units 97 Cache memory 99 Cache size and organisation 100 Optimising line length and cache size 104 Logical versus physical caches 105 Unified versus Harvard caches 106 Cache coherency 106
  • 12. viii Contents Case 1: write through 108 Case 2: write back 109 Case 3: no caching of write cycles 110 Case 4: write buffer 110 Bus snooping 111 The MESI protocol 116 The MEI protocol 117 Burst interfaces 118 Meeting the interface needs 119 Big and little endian 121 Dual port and shared memory 122 Bank switching 123 Memory overlays 124 Shadowing 124 Example interfaces 125 MC68000 asynchronous bus 125 M6800 synchronous bus 127 The MC68040 burst interface 128 4 Basic peripherals 131 Parallel ports 131 Multi-function I/O ports 132 Pull-up resistors 133 Timer/counters 133 Types 134 8253 timer modes 134 Interrupt on terminal count 134 Programmable one-shot 134 Rate generator 136 Square wave rate generator 136 Software triggered strobe 136 Hardware triggered strobe 137 Generating interrupts 137 MC68230 modes 137 Timer processors 138 Real-time clocks 139 Simulating a real-time clock in software 140 Serial ports 140 Serial peripheral interface 142 I2 C bus 143 Read and write access 145 Addressing peripherals 146 Sending an address index 147 Timing 148
  • 13. Contents ix Multi-master support 149 M-Bus (Motorola) 150 What is an RS232 serial port? 151 Asynchronous flow control 154 Modem cables 155 Null modem cables 155 XON-XOFF flow control 158 UART implementations 158 8250/16450/16550 158 The interface signals 159 The Motorola MC68681 162 DMA controllers 163 A generic DMA controller 164 Operation 164 DMA controller models 166 Single address model 166 Dual address model 167 1D model 168 2D model 168 3D model 169 Channels and control blocks 169 Sharing bus bandwidth 171 DMA implementations 173 Intel 8237 173 Motorola MC68300 series 173 Using another CPU with firmware 174 5 Interfacing to the analogue world 175 Analogue to digital conversion techniques 175 Quantisation errors 176 Sample rates and size 176 Irregular sampling errors 177 Nyquist’s theorem 179 Codecs 179 Linear 179 A-law and µ-law 179 PCM 180 DPCM 180 ADPCM 181 Power control 181 Matching the drive 181 Using H bridges 183 Driving LEDs 184 Interfacing to relays 184 Interfacing to DC motors 185 Software only 186 Using a single timer 187 Using multiple timers 188
  • 14. x Contents 6 Interrupts and exceptions 189 What is an interrupt? 189 The spaghetti method 190 Using interrupts 191 Interrupt sources 192 Internal interrupts 192 External interrupts 192 Exceptions 192 Software interrupts 193 Non-maskable interrupts 193 Recognising an interrupt 194 Edge triggered 194 Level triggered 194 Maintaining the interrupt 194 Internal queuing 194 The interrupt mechanism 195 Stack-based processors 195 MC68000 interrupts 196 RISC exceptions 198 Synchronous precise 199 Synchronous imprecise 199 Asynchronous precise 199 Asynchronous imprecise 200 Recognising RISC exceptions 200 Enabling RISC exceptions 202 Returning from RISC exceptions 202 The vector table 202 Identifying the cause 203 Fast interrupts 203 Interrupt controllers 205 Instruction restart and continuation 205 Interrupt Latency 206 Do’s and Don’ts 209 Always expect the unexpected interrupt 209 Don't expect too much from an interrupt 209 Use handshaking 210 Control resource sharing 210 Beware false interrupts 211 Controlling interrupt levels 211 Controlling stacks 211 7 Real-time operating systems 212 What are operating systems? 212 Operating system internals 214 Multitasking operating systems 215 Context switching, task tables, and kernels 215 Time slice 223
  • 15. Contents xi Pre-emption 224 Co-operative multitasking 224 Scheduler algorithms 225 Rate monotonic 225 Deadline monotonic scheduling 227 Priority guidelines 227 Priority inversion 227 Disabling interrupts 227 Message queues 228 Waiting for a resource 229 VMEbus interrupt messages 229 Fairness systems 231 Tasks, threads and processes 231 Exceptions 232 Memory model 233 Memory allocation 233 Memory characteristics 234 Example memory maps 235 Memory management address translation 239 Bank switching 242 Segmentation 243 Virtual memory 243 Chossoing an operating system 244 Assembler versus high level language 245 ROMable code 245 Scheduling algorithms 245 Pre-emptive scheduling 246 Modular approach 246 Re-entrant code 247 Cross-development platforms 247 Integrated networking 247 Multiprocessor support 247 Commercial operating systems 248 pSOS+ 248 pSOS+ kernel 248 pSOS+m multiprocessor kernel 249 pREPC+ runtime support 249 pHILE+ file system 250 pNA+ network manager 250 pROBE+ system level debugger 250 XRAY+ source level debugger 250 OS-9 250 VXWorks 251 VRTX-32 251 IFX 252 TNX 252 RTL 252 RTscope 252 MPV 252 LynxOS-Posix conformance 252 Windows NT 254
  • 16. xii Contents Windows NT characteristics 255 Process priorities 256 Interrupt priorities 257 Resource protection 258 Protecting memory 258 Protecting hardware 258 Coping with crashes 259 Multi-threaded software 259 Addressing space 260 Virtual memory 261 The internal architecture 261 Virtual memory manager 262 User and kernel modes 262 Local procedure call (LPC) 263 The kernel 263 File system 263 Network support 264 I/O support 264 HAL approach 264 Linux 265 Origins and beginnings 265 Inside Linux 268 The Linux file system 269 The physical file system 270 Building the file system 271 The file system 272 Disk partitioning 274 The /proc file system 277 Data Caching 277 Multi-tasking systems 278 Multi-user systems 278 Linux software structure 279 Processes and standard I/O 280 Executing commands 281 Physical I/O 282 Memory management 283 Linux limitations 283 eLinux 284 8 Writing software for embedded systems 288 The compilation process 288 Compiling code 289 The pre-processor 290 Compilation 293 as assembler 295 Linking and loading 296 Symbols, references and relocation 296 ld linker/loader 297 Native versus cross-compilers 298 Run-time libraries 298 Processor dependent 298 I/O dependent 299
  • 17. Contents xiii System calls 299 Exit routines 299 Writing a library 300 Creating a library 300 Device drivers 306 Debugger supplied I/O routines 306 Run-time libraries 307 Using alternative libraries 307 Linking additional libraries 307 Linking replacement libraries 307 Using a standard library 307 Porting kernels 308 Board support 308 Rebuilding kernels for new configurations 309 configAll.h 310 config.h 310 usrConfig.c 310 pSOSystem+ 312 C extensions for embedded systems 313 #pragma interrupt func2 313 #pragma pure_function func2 314 #pragma no_side_effects func2 314 #pragma no_return func2 314 #pragma mem_port int2 314 asm and _ _asm 314 Downloading 316 Serial lines 316 EPROM and FLASH 317 Parallel ports 317 From disk 317 Ethernet 318 Across a common bus 318 9 Emulation and debugging techniques 321 Debugging techniques 321 High level language simulation 321 Low level simulation 322 Onboard debugger 323 Task level debugging 325 Symbolic debug 325 Emulation 327 Optimisation problems 328 Xray 332 The role of the development system 335 Floating point and memory management functions 335 Emulation techniques 336 JTAG 337 OnCE 337 BDM 338
  • 18. xiv Contents 10 Buffering and other data structures 339 What is a buffer? 339 Latency 341 Timing tolerance 341 Memory size 342 Code complexity 342 Linear buffers 342 Directional buffers 344 Single buffer implementation 344 Double buffering 346 Buffer exchange 348 Linked lists 349 FIFOs 350 Circular buffers 351 Buffer underrun and overrun 352 Allocating buffer memory 353 malloc() 353 Memory leakage 354 Stack frame errors 354 Failure to return memory to the memory pool 355 Housekeeping errors 355 Wrong memory specification 356 11 Memory and performance trade-offs 357 The effect of memory wait states 357 Scenario 1 — Single cycle processor with large external memory 358 Scenario 2 — Reducing the cost of memory access 360 Using registers 360 Using caches 361 Preloading caches 362 Using on-chip memory 363 Using DMA 363 Making the right decisions 363 12 Software examples 365 Benchmark example 365 Creating software state machines 368 Priority levels 372 Explicit locks 373 Interrupt service routines 373 Setting priorities 375
  • 19. Contents xv Task A highest priority 375 Task C highest priority 376 Using explicit locks 376 Round-robin 376 Using an ISR routine 377 13 Design examples 379 Burglar alarm system 379 Design goals 379 Development strategy 380 Software development 380 Cross-compilation and code generation 383 Porting to the final target system 385 Generation of test modules 385 Target hardware testing 385 Future techniques 385 Relevance to more complex designs 386 The need for emulation 386 Digital echo unit 387 Creating echo and reverb 387 Design requirements 390 Designing the codecs 391 Designing the memory structures 391 The software design 392 Multiple delays 394 Digital or analogue adding 395 Microprocessor selection 396 The overall system design 396 14 Real-time without a RTOS 398 Choosing the software environment 398 Deriving real time performance from a non-real time system 400 Choosing the hardware 401 Scheduling the data sampling 402 Sampling the data 405 Controlling from an external switch 406 Driving an external LED display 408 Testing 408 Problems 410 Saving to hard disk 410 Data size restrictions and the use of a RAM disk 410 Timer calculations and the compiler 411 Data corruption and the need for buffer flushing. 411 Program listing 413 Index 422
  • 21. Contents xvii Preface The term embedded systems design covers a very wide range of microprocessor designs and does not simply start and endwithasimplemicrocontroller.ItcanbeaPCrunningsoftware other than Windows and word processing software. It can be a sophisticated multiprocessor design using the fastest processors on the market today. The common thread to embedded systems design is an understanding of the interaction that the various components within the system have with each other. It is important to under- stand how the hardware works and the restraints that using a certainperipheralmayhaveontherestofthesystem.Itisessential to know how to develop the software for such systems and the effect that different hardware designs can have on the software and vice versa. It is this system design knowledge that has been captured in this book as a series of tutorials on the various aspects of embedded systems design. Chapter 1 defines what is meant by the term and in essence defines the scope of the rest of the book. The second chapter provides a set of tutorials on processor architectures explaining the different philosophies that were used in their design and creation. It covers many of the common processor architectures ranging from 8 bit microcontrollers through CISC and RISC processors and finally ending with digital signal processors and includes information on the ARM processor family. The third chapter discusses different memory types and their uses. This has been expanded in this edition to cover caches in more detail and the challenges associated with them for embed- ded design. The next chapter goes through basic peripherals such as parallel and serial ports along with timers and DMA control- lers. This theme is continued in the following chapter which covers analogue to digital conversion and basic power control. Interrupts are covered in great detail in the sixth chapter because they are so essential to any embedded design. The differ- ent types that are available and their associated software routines are described with several examples of how to use them and, perhaps more importantly, how not to use them. The theme of software is continued in the next two chapters which cover real-time operating systems and software develop- ment. Again, these have a tremendous effect on embedded de- signsbutwhosedesignimplicationsareoftennotwellunderstood or explained. Chapter 9 discusses debugging and emulation tech- niques.
  • 22. xviii Contents xviii Preface The remaining five chapters are dedicated to design exam- ples covering buffer and data structures, memory and processor performancetrade-offsandtechniques,softwaredesignexamples including using a real-time operating system to create state ma- chines and finally a couple of design examples. In this edition, an example real-time system design is described that uses a non-real- time system to create an embedded system. The C source code is provided so that it can be run and experimented with on a PC running MS-DOS. Steve Heath
  • 23. Contents xix Acknowledgements By the nature of this book, many hardware and software products are identified by their tradenames. In these cases, these designations are claimed as legally protected trademarks by the companies that make these products. It is not the author’s nor the publisher’s intention to use these names generically, and the reader is cautioned to investigate a trademark before using it as a generic term, rather than a reference to a specific product to which it is attached. Many of the techniques within this book can destroy data and such techniques must be used with extreme caution. Again, neitherauthornorpublisherassumeanyresponsibilityorliability for their use or any results. While the information contained in this book has been carefullycheckedforaccuracy,theauthorassumesnoresponsibil- ity or liability for its use, or any infringement of patents or other rights of third parties which would result. As technical characteristics are subject to rapid change, the datacontainedarepresentedforguidanceandeducationonly.For exact detail, consult the relevant standard or manufacturers’ data and specification.
  • 25. What is an embedded system? 1 1 What is an embedded system? Whenever the word microprocessor is mentioned, it con- juresupapictureofadesktoporlaptopPCrunninganapplication such as a word processor or a spreadsheet. While this is a popular application for microprocessors, it is not the only one and the fact is most people use them indirectly in common objects and appli- ances without realising it. Without the microprocessor, these products would not be as sophisticated or cheap as they are today. The embedding of microprocessors into equipment and consumer appliances started before the appearance of the PC and consumes the majority of microprocessors that are made today. In this way, embedded microprocessors are more deeply ingrained into everyday life than any other electronic circuit that is made. A large car may have over 50 microprocessors controlling functions such as the engine through engine management systems, brakes with electronic anti-lock brakes, transmission with traction con- trol and electronically controlled gearboxes, safety with airbag systems, electric windows, air-conditioning and so on. With a well-equipped car, nearly every aspect has some form of elec- tronic control associated with it and thus a need for a microproc- essor within an embedded system. A washing machine may have a microcontroller that con- tains the different washing programs, provides the power control for the various motors and pumps and even controls the display that tells you how the wash cycles are proceeding. Mobilephonescontainmoreprocessingpowerthanadesk- top processor of a few years ago. Many toys contain microproces- sorsandthereareevenkitchenappliancessuchasbreadmachines that use microprocessor-based control systems. The word control is very apt for embedded systems because in virtually every embedded system application, the goal is to control an aspect of a physical system such as temperature, motion, and so on using a variety of inputs. With the recent advent of the digital age replac- ing many of the analogue technologies in the consumer world, the dominance of the embedded system is ever greater. Each digital consumer device such as a digital camera, DVD or MP3 player all depend on an embedded system to realise the system. As a result, the skills behind embedded systems design are as diverse as the systems that have been built although they share a common heritage.
  • 26. 2 Embedded systems design What is an embedded system? There are many definitions for this but the best way to defineitistodescribeitintermsofwhatitisnotandwithexamples of how it is used. An embedded system is a microprocessor-based system that is built to control a function or range of functions and is not designed to be programmed by the end user in the same way that a PC is. Yes, a user can make choices concerning functionality but cannot change the functionality of the system by adding/replac- ing software. With a PC, this is exactly what a user can do: one minute the PC is a word processor and the next it’s a games machine simply by changing the software. An embedded system is designed to perform one particular task albeit with choices and different options. The last point is important because it differenti- ates itself from the world of the PC where the end user does reprogramitwheneveradifferentsoftwarepackageisboughtand run. However, PCs have provided an easily accessible source of hardware and software for embedded systems and it should be no surprise that they form the basis of many embedded systems. To reflect this, a very detailed design example is included at the end of this book that uses a PC in this way to build a sophisticated data logging system for a race car. If this need to control the physical world is so great, what is sospecialaboutembeddedsystemsthathasledtothewidespread useofmicroprocessors?Thereareseveralmajorreasonsandthese have increased over the years as the technology has progressed and developed. Replacement for discrete logic-based circuits The microprocessor came about almost by accident as a programmablereplacementforcalculatorchipsinthe1970s.Upto this point, most control systems using digital logic were imple- mented using individual logic integrated circuits to create the design and as more functionality became available, the number of chips was reduced. This was the original reason for a replacement for digital systems constructed from logic circuits. The microprocessor was originally developed to replace a mass of logic that was used to create the first electronic calculators in the early 1970s. For exam- ple, the early calculators were made from discrete logic chips and many hundreds were needed just to create a simple four function calculator. As the integrated circuit developed, the individual logic functions were integrated to create higher level functions. Instead of creating an adder from individual logic gates, a com- plete adder could be bought in one package. It was not long before complete calculators were integrated onto a single chip. This enabledthemtobebuiltataverylowcostcomparedtotheoriginal machines but any changes or improvements required that a new
  • 27. What is an embedded system? 3 chip be developed. The answer was to build a chip that had some form of programmable capability within it. Why not build a chip that took data in, processed it and sent it out again? In this way, instead of creating new functions by analysing the gate level logic and modifying it — a very time-consuming process — new products could be created by changing the program code that processed the information. Thus the microprocessor was born. Provide functional upgrades In the same way that the need to develop new calculator chips faster and with less cost prompted the development of the first microprocessors, the need to add or remove functionality from embedded system designs is even more important. With much of the system’s functionality encapsulated in the software that runs in the system, it is possible to change and upgrade systemsbychangingthesoftwarewhilekeepingthehardwarethe same. This reduces the cost of production even lower because many different systems can share the same hardware base. Insomecases,thisprocessisnotpossibleorworthwhilebut allows the manufacturer to develop new products far quicker and faster. Examples of this include timers and control panels for domestic appliances such as VCRs and televisions. In other cases, the system can be upgraded to improve functionality. This is frequently done with machine tools, tel- ephone switchboards and so on. The key here is that the ability to add functionality now no longer depends on changing the hard- ware but can be done by simply changing the software. If the system is connected to a communications link such as a telephone or PC network, then the upgrade can be done remotely without having to physically send out an engineer or technician. Provide easy maintenance upgrades The same mechanism that allows new functionality to be added through reprogramming is also beneficial in allowing bugs to be solved through changing software. Again it can reduce the need for expensive repairs and modifications to the hardware. Improves mechanical performance Foranyelectromechanicalsystem,theabilitytoofferafiner degreeofcontrolisimportant.Itcanpreventexcessivemechanical wear, better control and diagnostics and, in some cases, actually compensate for mechanical wear and tear. A good example of this istheenginemanagementsystem.Here,anembeddedmicroproc- essor controls the fuel mixture and ignition for the engine and will alter the parameters and timing depending on inputs from the engine such as temperature, the accelerator position and so on. In this way, the engine is controlled far more efficiently and can be configured for different environments like power, torque, fuel efficiency and so on. As the engine components wear, it can even
  • 28. 4 Embedded systems design adjust the parameters to compensate accordingly or if they are dramatically out of spec, flag up the error to the driver or indicate that servicing is needed. This level of control is demonstrated by the market in ‘chipped’ engine management units where third party companies modify the software within the control unit to provide more power or torque. The differences can range from 10% to nearly 50% for some turbo charged engines! All this from simply chang- ing a few bytes. Needless to say, this practice may invalidate any guaranteefromthemanufacturerandmayundulystressandlimit the engine’s mechanical life. In some cases, it may even infringe the original manufacturer’s intellectual property rights. Protection of intellectual property To retain a competitive edge, it is important to keep the design knowledge within the company and prevent others from understandingexactlywhatmakesaproductfunction.Thisknowl- edge, often referred to as IPR (intellectual property rights), be- comes all important as markets become more competitive. With a design that is completely hardware based and built from off-the- shelf components, it can be difficult to protect the IPR that was used in its design. All that is needed to do is to take the product, identifythechipsandhowtheyareconnectedbytracingthetracks on the circuit board. Some companies actually grind the part numbers off the integrated circuits to make it harder to reverse engineer in this way. With an embedded system, the hardware can be identified butthesoftwarethatreallysuppliesthesystem’sfunctionalitycan be hidden and more difficult to analyse. With self-contained microcontrollers, all that is visible is a plastic package with a few connections to the outside world. The software is already burnt intotheon-chipmemoryandiseffectivelyimpossibletoaccess.As a result, the IPR is much more secure and protected. Replacement for analogue circuits The movement away from the analogue domain towards digital processing has gathered pace recently with the advent of high performance and low cost processing. Tounderstandtheadvantagesbehinddigitalsignalprocess- ing, consider a simple analogue filter. The analogue implementa- tion is extremely simple compared to its digital equivalent. The analogue filter works by varying the gain of the operational amplifier which is determined by the relationship between ri and rf. In a system with no frequency component, the capacitor ci plays no part as its impedance is far greater than that of rf. As the frequency component increases, the capacitor impedance de- creases until it is about equal with rf where the effect will be to reduce the gain of the system. As a result, the amplifier acts as a
  • 29. What is an embedded system? 5 low pass filter where high frequencies will be filtered out. The equation shows the relationship where jωis the frequency compo- nent. These filters are easy to design and are cheap to build. By making the CR (capacitor-resistor) network more complex, differ- ent filters can be designed. y(t) x(t) = r f r i 1 + jω r c 1 f f y(t) Output to actuator x(t) Input from sensor t y(t) x(t) r i r f cf INPUT OUTPUT The required filtering The analogue circuit The mathematical function Analogue signal processing x(t) FIR filter Finite impulse response ∑ c(n) x (n-k) n k = 0 D/A A/D y(t) Low pass antialiasing filter Sampler and analogue to digital converter Digital signal processing operation Digital to analogue converter Reconstruction low pass filter Analogue out Analogue in x(n) y(n) Digital signal processing (DSP) The digital equivalent is more complex requiring several electronicstagestoconvertthedata,processitandreconstitutethe data. The equation appears to be more involved, comprising of a summation of a range of calculations using sample data multi- plied by a constant term. These constants take the place of the CR
  • 30. 6 Embedded systems design components in the analogue system and will define the filter’s transfer function. With digital designs, it is the tables of coeffi- cients that are dynamically modified to create the different filter characteristics. Giventhecomplexityofdigitalprocessing,whythenuseit? The advantages are many. Digital processing does not suffer from component ageing, drift or any adjustments which can plague an analogue design. They have high noise immunity and power supply rejection and due to the embedded processor can easily provide self-test features. The ability to dynamically modify the coefficients and therefore the filter characteristics allows complex filtersandotherfunctionstobeeasilyimplemented.However,the processing power needed to complete the ‘multiply–accumulate’ processing of the data does pose some interesting processing requirements. N instruction routine x(n) x(n+1) Ts=1/F A/D conversion Data sampling at frequency Fs D/A conversion Time to execute one instruction Fs Ts 1kHz 10 kHz 100 kHz 1MHz 1 ms 100 µs 10 µs 1 µs 1kHz 10 kHz 100 kHz 1MHz 1 ms 100 µs 10 µs 1 µs No.of instructions between two samples 1000 100 10 1 10000 1000 100 10 1 µs x(n) 100 µs y(n) DSP processing requirements The diagram shows the problem. An analogue signal is sampled at a frequency fs and is converted by the A/D converter. This frequency will be first determined by the speed of this conversion. At every period, ts, there will be a new sample to process using N instructions. The table shows the relationship between sampling speed, the number of instructions and the
  • 31. What is an embedded system? 7 instruction execution time. It shows that the faster the sampling frequency, the more processing power is needed. To achieve the 1 MHz frequency, a 10 MIPS processor is needed whose instruction set is powerful enough to complete the processing in under 10 instructions.ThisanalysisdoesnottakeintoaccountA/Dconver- sion delays. For DSP algorithms, the sampling speed is usually twice the frequency of the highest frequency signal being proc- essed: in this case the 1 MHz sample rate would be adequate for signals up to 500 kHz. Onemajordifferencebetweenanalogueanddigitalfiltersis the accuracy and resolution that they offer. Analogue signals may have definite limits in their range, but have infinite values be- tween that range. Digital signal processors are forced to represent these infinite variations within a finite number of steps deter- mined by the number of bits in the word. With an 8 bit word, the increasesareinstepsof1/256oftherange.Witha16bitword,such steps are in 1/65536 and so on. Depicted graphically as shown, a 16 bit word would enable a low pass filter with a roll-off of about 90 dB. A 24 bit word would allow about 120 dB roll-off to be achieved. dB 0dB Frequency 16 bit 24 bit Word size and cutoff frequencies DSP can be performed by ordinary microprocessors, al- though their more general-purpose nature often limits perform- ance and the frequency response. However, with responses of only a few hundred Hertz, even simple microcontrollers can performsuchtasks.Assilicontechnologyimproved,specialbuild- ing blocks appeared allowing digital signal processors to be developed, but their implementation was often geared to a hard- wareapproachratherthandesigningaspecificprocessorarchitec- ture for the job. It is now common for processors to claim DSP
  • 32. 8 Embedded systems design support through enhanced multiply–accumulate operations or through special accelerators. It is clear though, that as general purposeprocessingincreasesincapability,whatwasoncethesole province of a DSP can now be achieved by a general purpose processor. Inside the embedded system Processor The main criteria for the processor is: can it provide the processing power needed to perform the tasks within the system? Thisseemsobviousbutitfrequentlyoccursthatthetasksareeither underestimated in terms of their size and/or complexity or that creeping elegance expands the specification to beyond the proces- sor’s capability. In many cases, these types of problems are compounded by theperformancemeasurementusedtojudgetheprocessor.Bench- marks may not be representative of the type of work that the systemisdoing.Theymayexecutecompletelyoutofcachememory andthusgiveanartificiallyhighperformancelevelwhichthefinal system cannot meet because its software does not fit in the cache. The software overheads for high level languages, operating sys- tems and interrupts may be higher than expected. These are all issues that can turn a paper design into failed reality. Whileprocessorperformanceisessentialandformsthefirst gating criterion, there are others such as cost — this should be system cost and not just the cost of the processor in isolation, power consumption, software tools and component availability and so on. These topics are discussed in more detail in Chapter 2. Memory Memory is an important part of any embedded system design and is heavily influenced by the software design, and in turn may dictate how the software is designed, written and developed. These topics will be addressed in more detail later on in this book. As a way of introduction, memory essentially per- forms two functions within an embedded system: • It provides storage for the software that it will run At a minimum, this will take the form of some non-volatile memory that retains its contents when power is removed. This can be on-chip read only memory (ROM) or external EPROM. The software that it contains might be the com- plete program or an initialisation routine that obtains the full software from another source within or outside of the system. This initialisation routine is often referred to as a bootstrap program or routine. PC boards that have embed- ded processors will often start up using software stored in anonboardEPROMandthenwaitforthefullsoftwaretobe downloaded from the PC across the PC expansion bus.
  • 33. What is an embedded system? 9 • It provides storage for data such as program variables and intermediate results, status information and any other data that might be created throughout the operation Software needs some memory to store variables and to manage software structures such as stacks. The amount of memory that is needed for variables is frequently less than that needed for the actual program. With RAM being more expensive than ROM and non-volatile, many embedded systems and in particular, microcontrollers, have small amounts of RAM compared to the ROM that is available for the program. As a result, the software that is written for such systems often has to be written to minimise RAM usage so that it will fit within the memory resources placed upon the design. This will often mean the use of compilers that produce ROMable code that does not rely on being resident in RAM to execute. This is discussed in more detail in Chapter 3. Peripherals An embedded system has to communicate with the outside world and this is done by peripherals. Input peripherals are usuallyassociatedwithsensorsthatmeasuretheexternalenviron- ment and thus effectively control the output operations that the embeddedsystemperforms.Inthisway,anembeddedsystemcan bemodelledonathree-stagepipelinewheredataandinformation input into the first stage of the pipeline, the second stage processes it before the third stage outputs data. Ifthismodelisthenappliedtoamotorcontroller,theinputs would be the motor’s actual speed and power consumption, and the speed required by the operator. The outputs would be a pulse width modulated waveform that controls the power to the motor and hence the speed and an output to a control panel showing the current speed. The middle stage would be the software that processed the inputs and adjusts the outputs to achieve the re- quired engine speed. The main types of peripherals that are used include: • Binary outputs These are simple external pins whose logic state can be controlled by the processor to either be a logic zero (off) or a logic one (on). They can be used individually or grouped together to create parallel ports where a group of bits can be input or output simultaneously. • Serial outputs These are interfaces that send or receive data using one or two pins in a serial mode. They are less complex to connect but are more complicated to program. A parallel port looks very similar to a memory location and is easier to visualise and thus use. A serial port has to have data loaded into a
  • 34. 10 Embedded systems design register and then a start command issued. The data may also be augmented with additional information as required by the protocol. • Analogue values While processors operate in the digital domain, the natural world does not and tends to orientate to analogue values. As a result, interfaces between the system and the external environment need to be converted from analogue to digital and vice versa. • Displays Displaysarebecomingimportantandcanvaryfromsimple LEDs and seven segment displays to small alpha-numeric LCD panels. • Time derived outputs Timersandcountersareprobablythemostcommonlyused functions within an embedded system. Software The software components within an embedded system often encompasses the technology that adds value to the system and defines what it does and how well it does it. The software can consist of several different components: • Initialisation and configuration • Operating system or run-time environment • The applications software itself • Error handling • Debug and maintenance support. Algorithms Algorithms are the key constituents of the software that makes an embedded system behave in the way that it does. They can range from mathematical processing through to models of the external environment which are used to interpret information from external sensors and thus generate control signals. With the digital technology in use today such as MP3 and DVD players, the algorithms that digitally encode the analogue data are defined by standards bodies. While this standardisation could mean that the importance of selecting an algorithm is far less than it might be thought, the reality is far different. The focus on getting the right implementa- tion is important since, for example, it may allow the same func- tion to be executed on cheaper hardware. As most embedded systems are designed to be commercially successful, this selection process is very important. Defining and implementing the correct algorithm is a critical operation and is described through several examples in this book.
  • 35. What is an embedded system? 11 Examples This section will go through some example embedded systems and briefly outline the type of functionality that each offers. Microcontroller Microcontrollers can be considered as self-contained sys- tems with a processor, memory and peripherals so that in many cases all that is needed to use them within an embedded system is to add software. The processors are usually based on 8 bit stack- based architectures such as the MC6800 family. There are 4 bit versions available such as the National COP series which further reduce the processing power and reduce cost even further. These are limited in their functionality but their low cost has meant that they are used in many obscure applications. Microcontrollers are usually available in several forms: • Devices for prototyping or low volume production runs These devices use non-volatile memory to allow the soft- ware to be downloaded and returned in the device. UV erasable EPROM used to be the favourite but EEPROM is also gaining favour. Some microcontrollers used a special package with a piggyback socket on top of the package to allow an external EPROM to be plugged in for prototyping. This memory technology replaces the ROM on the chip allowing software to be downloaded and debugged. The device can be reprogrammed as needed until the software reaches its final release version. The use of non-volatile memory also makes these devices suitable for low volume production runs or where the software may need customisation and thus preventing moving to a ROMed version. These devices are sometimes referred to as umbrella de- vices with a single device capable of providing prototyping support for a range of other controllers in the family. • Devices for low to medium volume production runs In the mid-1980s, a derivative of the prototype device appeared on the market called the one time programmable or OTP. These devices use EPROM instead of the ROM but instead of using the ceramic package with a window to allow the device to be erased, it was packaged in a cheaper plastic pack and thus was only capable of programming a single time — hence the name. These devices are cheaper than the prototype versions but still have the programming disadvantage. However, their lower cost has made them a suitable alternative to producing a ROM device. For low to medium production quantities, they are cost effective and offer the ability to customise software as necessary.
  • 36. 12 Embedded systems design 4144 bytes EPROM 176 bytes RAM 240 bytes Boot ROM HC05 processor core Clock Watch dog Baud rate generator 16 bit timer Port A Port B Port C Port D SCI SPI Internal bus Example microcontroller (Motorola MC68HC705C4A) • Devices for high volume production runs For high volumes, microcontrollers can be built already programmed with software in the ROM. To do this a customer supplies the software to the manufacturer who then creates the masks necessary to create the ROM in the device. This process is normally done on partly processed silicon wafers to reduce the turnaround time. The advan- tage for the customer is that the costs are much lower than using prototyping or OTP parts and there is no program- mingtimeoroverheadinvolved.Thedownsideisthatthere is usually a minimum order based on the number of chips thatawaferbatchcanproduceandanupfrontmaskcharge. The other major point is that once in ROM, the software cannot be changed and therefore customisation or bug fixing would have to wait until the next order or involve scrapping all the devices that have been made. It is possible tooffersomecustomisationbyincludingdifferentsoftware modules and selecting the required ones on the basis of a value read into the device from an external port but this does consume memory which can increase the costs. Some controllerscanprovidesomeRAMthatcanbeusedtopatch the ROM without the need for a new mask set.
  • 37. What is an embedded system? 13 MC68HC 705 MC68HC 705 EPROM prototyping OTP External EPROM (no chip) External EPROM (with chip) Prototype microcontrollers Expanded microcontroller The choice of memory sizes and partitioning is usually a major consideration. Some applications require more memory or peripherals than are available on a standard part. Most microcontroller families have parts that support external expan- sion and have an external memory and/or I/O bus which can allow the designer to put almost any configuration together. This is often done by using a parallel port as the interface instead of general-purpose I/O. Many of the higher performance microcontrollers are adopting this approach. Internal EPROM Internal RAM Internal ROM Processor core Clock Watch dog Baud rate generator 16 bit timer Port A Port B Port C Port D SCI SPI Internal bus External ROM External RAM An expanded microcontroller
  • 38. 14 Embedded systems design In the example shown on the previous page, the microcontroller has an expanded mode that allows the parallel ports A and B to be used as byte wide interfaces to external RAM and ROM. In this type of configuration, some microcontrollers disable access to the internal memory while others still allow it. Microprocessor based Microprocessor-based embedded systems originally took existing general-purpose processors such as the MC6800 and 8080 devices and constructed systems around them using external peripherals and memory. The use of processors in the PC market continued to provide a series of faster and faster processors such as the MC68020, MC68030 and MC68040 devices from Motorola and the 80286, 80386, 80486 and Pentium devices from Intel. These CISC architectures have been complemented with RISC proces- sors such as the PowerPC, MIPS and others. These systems offer more performance than is usually available from a traditional microcontroller. However, this is beginning to change. There has been the development of integrated microprocessors where the processor is combined with peripherals such as parallel and serial ports, DMAcontrollersandinterfacelogictocreatedevicesthataremore suitable for embedded systems by reducing the hardware design task and costs. As a result, there has been almost a parallel development of these integrated processors along with the desk- top processors. Typically, the integrated processor will use a processor generation that is one behind the current generation. The reason is dependent on silicon technology and cost. By using thepreviousgenerationwhichissmaller,itfreesupsiliconareaon the die to add the peripherals and so on. Board based So far, the types of embedded systems that we have consid- ered have assumed that the hardware needs to be designed, built and debugged. An alternative is to use hardware that has already been built and tested such as board-based systems as provided by PCs and through international board standards such as VMEbus. The main advantage is the reduced work load and the availability of ported software that can simply be utilised with very little effort. The disadvantages are higher cost and in some cases restrictions in the functionality that is available.
  • 39. Embedded processors 15 2 Embedded processors The development of processors for embedded system de- sign has essentially followed the development of microprocessors as a whole. The processor development has provided the process- ing heart for architecture which combined with the right software and hardware peripherals has become an embedded design. With the advent of better fabrication technology supporting higher transistor counts and lower power dissipation, the processor core has been integrated with peripherals and memory to provide standalone microcontrollers or integrated processors that only need the addition of external memory to provide a complete hardware system suitable for embedded design. The scope of this chapter is to explain the strengths and weaknesses of various architectures to provide a good understanding of the trade-offs involved in choosing and exploiting a processor family. Thereareessentiallyfourbasicarchitecturetypeswhichare usually defined as 8 bit accumulator, 16/32 bit complex instruc- tionsetcomputers(CISC),reducedinstructionsetcomputer(RISC) architectures and digital signal processors (DSP). Their develop- mentortobemoreaccurate,theiravailabilitytoembeddedsystem designers is chronological and tends to follow the same type of pattern as shown in the graph. MC6800 MC6800 MC6800 MC6800 MC6800 MC68000 MC68000 MC68000 MC68000 MC68020 MC68020 MC68020 MC68040 MC68040 MC68060 1975 1980 1984 1989 1993 Highest performance Medium performance Lowest performance Cost-effective performance End of life Processor life history However,itshouldberememberedthatinparallelwiththis life cycle, processor architectures are being moved into microcontroller and integrated processor devices so that the end of life really refers to the discontinuance of the architecture as a separateCPUplusexternalmemoryandperipheralsproduct.The MC6800 processor is no longer used in discrete designs but there are over 200 MC6801/6805 and 68HC11 derivatives that essen- tially use the same basic architecture and instruction set.
  • 40. 16 Embedded systems design 8 bit accumulator processors This category of processor first appeared in the mid-1970s as the first microprocessors. Devices such as the 8080 from Intel and the MC6800 from Motorola started the microprocessor revo- lution. They provided about 1 MIP of performance and were at their introduction the fastest processors available. Register models The programmer has a very simple register model for this type of processor. The model for the Motorola MC6800 8 bit processor is shown as an example but it is very representative of the many processors that appeared (and subsequently vanished). Ithastwo8bitaccumulatorsusedforstoringdataandperforming arithmetic operations. The program counter is 16 bits in size and two further 16 bit registers are provided for stack manipulations and address indexing. 7 0 15 Accumulator A Accumulator B Index register X Program counter Stack pointer Condition code The MC6800 programmer's model Onfirstinspection,themodelseemsquiteprimitiveandnot capable of providing the basis of a computer system. There do not seem to be enough registers to hold data, let alone manipulate it! Comparing this with the register laden RISC architectures that feature today, this is a valid conclusion. What is often forgotten is that many of the instructions, such as logical operations, can operateondirectmemoryusingtheindexregistertoactaspointer. This removes the need to bring data into the processor at the expense of extra memory cycles and the need for additional or widerregisters.Themainareawithinmemorythatisusedfordata storage is known as the stack. It is normally accessed using a special register that indexes into the area called the stack pointer.
  • 41. Embedded processors 17 Thisisusedtoprovidelocaldatastorageforprogramsandtostore informationfortheprocessorsuchasreturnaddressesforsubrou- tine jumps and interrupts. The stack pointer provides additional storage for the pro- grammer: it is used to store data like return addresses for subrou- tine calls and provides additional variable storage using a PUSH/ POP mechanism. Data is PUSHed onto the stack to store it, and POPed off to retrieve it. Providing the programmer can track where the data resides in these stack frames, it offers a good replacement for the missing registers. 8 bit data restrictions An 8 bit data value can provide an unsigned resolution of only 256 bits, which makes it unsuitable for applications where a higher resolution is needed. In these cases, such as financial, arithmetic, high precision servo control systems, the obvious solution is to increase the data size to 16 bits. This would give a resolution of 65536 — an obvious improvement. This may be acceptable for a control system but is still not good enough for a dataprocessingprogram,wherea32bitdatavaluemayhavetobe defined to provide sufficient integer range. While there is no difficulty with storing 8, 16, 32 or even 64 bits in external memory, even though this requires multiple bus accesses, it does prevent the direct manipulation of data through the instruction set. However, due to the register model, data larger than 8 bits cannot use the standard arithmetic instructions applicable to 8 bit data stored in the accumulator. This means that even a simple 16 bit addition or multiplication has to be carried out as a series of instructions using the 8 bit model. This reduces the overall effi- ciency of the architecture. Thecodeexampleisaroutineforperformingasimple16bit multiplication.Ittakestwounsigned16bitnumbersandproduces a 16 bit product. If the product is larger than 16 bits, only the least significant 16 bits are retained. The first eight or so instructions simply create a temporary storage area on the stack for the multiplicand, multiplier, return address and loop counter. Com- pared to internal register storage, storing data in stack frames is not as efficient due the increased external memory access. Accessing external data consumes machine cycles which could be used to process data. Without suitable registers and the 16 bit wide accumulator, all this information must be stored externally on the stack. The algorithm used simply performs a succession of arithmetic shifts on each half of the multiplicand stored in the A and B accumulators. Once this is complete, the 16 bitresultissplitbetweenthetwoaccumulatorsandthetemporary storage cleared off the stack. The operation takes at least 29 instructions to perform with the actual execution time totally dependant on the values being multiplied together. For compari- son, most 16/32 bit processors such as the MC68000 and 80x86 families can perform the same operation with a single instruction!
  • 42. 18 Embedded systems design MULT16 LDX #5 CLEAR WORKING REGISTERS CLR A LP1 STA A U-1,X DEX BNE LP1 LDX #16 INITIAL SHIFT COUNTER LP2 LDA A Y+1 GET Y(LSBIT) AND A #1 TAB SAVE Y(LSBIT) IN ACCB EOR A FF CHECK TO SEE IF YOU ADD BEQ SHIFT OR SUBTRACT TST B BEQ ADD LDA A U+1 LDA B U SUB A XX+1 SBC B XX STA A U+1 STA B U BRA SHIFT NOW GOTO SHIFT ROUTINE ADD LDA A U+1 LDA B U ADD A XX+1 ADC B XX STA A U+1 STA B U SHIFT CLR FF SHIFT ROUTINE ROR Y ROR Y+1 ROL FF ASR U ROR U+1 ROR U+2 ROR U+3 DEX BNE LP2 RTS FINISH SUBROUTINE END M6800 code for a 16 bit by 16 bit multiply Addressing memory When the first 8 bit microprocessors appeared during the middle to late 1970s, memory was expensive and only available in very small sizes: 256 bytes up to 1 kilobyte. Applications were small, partly due to their implementation in assembler rather than a high level language, and therefore the addressing range of 64 kilobytes offered by the 16 bit address seemed extraordinarily large. It was unlikely to be exceeded. As the use of these early microprocessors became more widespread, applications started to grow in size and the use of operating systems like CP/M and high level languages increased memory requirements until the address range started to limit applications. Various techniques like bank switching and program overlays were developed to help.
  • 43. Embedded processors 19 System integrity Another disadvantage with this type of architecture is its unpredictability in handling error conditions. A bug in a software application could corrupt the whole system, causing a system to either crash, hang up or, even worse, perform some unforeseen operations. The reasons are quite simple: there is no partitioning between data and programs within the architecture. An applica- tion can update a data structure using a corrupt index pointer which overwrites a part of its program. start finish Address pointer New data start finish System memory Address pointer System Memory New data Valid pointer address Invalid pointer address System corruption via an invalid pointer Data are simply bytes of information which can be inter- preted as instruction codes. The processor calls a subroutine withinthisarea,startstoexecutethedataascodeandsuddenlythe whole system starts performing erratically! On some machines, certain undocumented code sequences could put the processor in atestmodeandstartcyclingthroughtheaddressrangesetc.These attributes restricted their use to non-critical applications. Example 8 bit architectures Z80 TheZ80microprocessorisan8bitCPUwitha16bitaddress bus capable of direct access to 64k of memory space. It was designedbyZilogandrapidlygainedalotofinterest.TheZ80was based on the Intel 8080 but has an extended instruction set and many hardware improvements. It can run 8080 code if needed by its support of the 8080 instruction set. The instruction set is essential based around an 8 bit op code giving a maximum of 256 instructions. The 158 instructions that are specified — the others
  • 44. 20 Embedded systems design are reserved — include 78 instructions from the 8080. The instruc- tion set supports the use of extension bytes to encode additional information. In terms of processing power, it offered about 1 MIP at 4 MHz clock speed with a minimum instruction time of 1 µs and a maximum instruction time of 5.75 µs. Pin Signal Pin Signal 1 A11 21 RD 2 A12 22 WR 3 A13 23 BUSAK 4 A14 24 WAIT 5 A15 25 BUSRQ 6 CLOCK 26 RESET 7 D4 27 M1 8 D3 28 RFSH 9 D5 29 GND 10 D6 30 A0 11 Vcc 31 A1 12 D2 32 A2 13 D7 33 A3 14 D0 34 A4 15 D1 35 A5 16 INT 36 A6 17 NMI 37 A7 18 HALT 38 A8 19 MREQ 39 A9 20 IORQ 40 A10 The Z80 signals Signal Description A0 - A15 Address bus output tri-state D0 - D7 Data bus bidirectional tri-state CLOCK CPU clock input RFSH Dynamic memory refresh output HALT CPU halt status output RESET Reset input INT Interrupt request input (active low) NMI Non-maskable interrupt input (active low) BUSRQ Bus request input (active low) BUSAK Bus acknowledge output (active low) WAIT Wait request input (active low) RD, WR Read and write signals IORQ I/O operation status output MREQ Memory refresh output M1 Output pulse on instruction fetch cycle Vcc +5 volts GND 0 volts The Z80 pinout descriptions The programming model includes an accumulator and six 8 bit registers that can be paired together to create three 16 bit registers. In addition to the general registers, a stack pointer, program counter, and two index (memory pointers) registers are provided.ItusesexternalRAMforitsstack.Whilenotaspowerful today as a PowerPC or Pentium, it was in its time a very powerful
  • 45. Embedded processors 21 processorandwasusedinmanyoftheearlyhomecomputerssuch as the Amstrad CPC series. It was also used in many embedded designs partly because of its improved performance and also for its built-in refresh circuitry for DRAMs. This circuitry greatly simplified the external glue logic that was needed with DRAMs. The Z80 was originally packaged in a 40 pin DIP package and ran at 2.5 and 4 MHz. Since then other packages and speeds have become available including low power CMOS versions — theoriginalwasmadeinNMOSanddissipatedabout1watt.Zilog now use the processor as a core within its range of Z800 microcontrollerswithvariousconfigurationsofon-chipRAMand EPROM. Z80 programming model The Z80 programming model essential consists of a set of 8 bit registers which can be paired together to create 16 bit versions for use as data storage or address pointers. There are two register sets within the model: the main and alternate. Only one set can be usedatanyonetimeandtheswitchanddatatransferisperformed by the EXX instruction. The registers in the alternate set are designated by a ´ suffix. BC DE HL A F B C D E H L A’ F’ B’ C’ D’ E’ H’ L’ Program counter PC Index register IX Index register IY Stack pointer SP IV MR Main register set Alternate register set BC’ DE’ HL’ The Z80 programming model The model has an 8 bit accumulator A and a flags register known as F. This contains the status information such as carry, zero, sign and overflow. This register is also known as PSW (program status word) in some documentation. Registers B, C, D, E, H and L are 8 bit general-purpose registers that can be paired to create 16 registers known as BC, DE and HL. The remaining registers are the program counter PC, two index registers IX and IY and a stack pointer SP. All these four registers are 16 bits in size and can access the whole 64 kbytes of external memory that the
  • 46. 22 Embedded systems design Z80 can access. There are two additional registers IV and MR which are the interrupt vector and the memory refresh registers. The IV register is used in the interrupt handling mode 2 to point to the required software routine to process the interrupt. In mode 1, the interrupt vector is supplied via the external data bus. The memory refresh register is used to control the on-chip DRAM refresh circuitry. Unlike the MC6800, the Z80 does not use memory mapped I/O and instead uses the idea of ports, just like the 8080. The lower 8 bits of the address bus are used along with the IORQ signal to access any external peripherals. The IORQ signal is used to differ- entiatetheaccessfromanormalmemorycycle.TheseI/Oaccesses are similar from a hardware perspective to a memory cycle but only occur when an I/O port instruction (IN, OUT) is executed. In some respects, this is similar to the RISC idea of load and store instructionstobringinformationintotheprocessor,processitand then write out the data. This system gives 255 ports and is usually sufficient for most embedded designs. MC6800 The MC6800 was introduced in the mid-1970s by Motorola and is as an architecture the basis of several hundred derivative processors and microcontrollers such as the MC6809, MC6801, MC68HC05, MC68HC11, MC68HC08 families. The processor architecture is 8 bits and uses a 64 kbyte memory map. Its programming model uses two 8 bit accumula- tors and a single 16 bit index register. Later derivatives such as the MC68HC11 added an additional index register and allowed the two accumulators to be treated as a single 16 bit accumulator to provide additional support for 16 bit arithmetic. 7 0 15 Accumulator A Accumulator B Index register X Program counter Stack pointer Condition code The MC6800 programmer‘s model Its external bus was synchronous with separate address and data ports and the device operated at either 1, 1.5 or 2 MHz. The instruction set was essentially based around an 8 bit instruc-
  • 47. Embedded processors 23 tion with extensions for immediate values, address offsets and so on. It supported both non-maskable and software interrupts. These type of processors have largely been replaced today by the microcontroller versions which have the same or advanced processor architectures and instruction sets but have the added advantageofgluelessinterfacestomemoryandperipheralsincor- porated onto the chip itself. Discrete processors are still used but these tend to be the higher performance devices such as the MC68000 and 80x86 processors. But even with these faster and higher performance devices, the same trend of moving to inte- grated microcontroller type of devices is being followed as even higher performance processors such as RISC devices become available. Microcontrollers The previous section has described the 8 bit processors. While most of the original devices are no longer available, their architecturesliveonintheformofmicrocontrollers.Thesedevices do not need much processing power — although this is now undergoing a radical change as will be explained later — but instead have become a complete integrated computer system by integrating the processor, memory and peripherals onto a single chip. MC68HC05 The MC68HC05 is microcontroller family from Motorola that uses an 8 bit accumulator-based architecture as its processor core. This is very similar to that of the MC6800 except that it only has a single accumulator. It uses memory mapping to access any on-chip peripherals and has a 13 bit program counter and effectively a 6 bit stack pointer. These reduced size registers — with many other 8 bit processors such as the Z80/8080 or MC6800, they are 16 bits is size — are used to reduce the complexity of the design. The microcontroller uses on-chip memory and therefore it does not make sense to define registers that can address memory that doesn’t exist on the chip. The MC68HC05 family is designed for low cost applications where superfluous hardware is removed to reduce the die size, its power consumption and cost. As a result, the stack pointer points to the start of the on-chip RAM and can only use 64 bytes, and the program counter is reduced to 13 bits. MC68HC11 The MC68HC11 is a powerful 8 bit data, 16 bit address microcontroller from Motorola that was on its introduction one of the most powerful and flexible microcontrollers available. It was originally designed in conjunction with General Motors for use withinenginemanagementsystems.Asaresult,itsinitialversions had built-in EEPROM/OTPROM, RAM, digital I/O, timers,
  • 48. 24 Embedded systems design 4144 bytes EPROM 176 bytes RAM 240 bytes Boot ROM HC05 processor core Clock Watch dog Baud rate generator 16 bit timer Port A Port B Port C Port D SCI SPI Internal bus Example microcontroller (Motorola MC68HC705C4A) 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 11 10 9 8 12 7 6 5 4 3 2 1 0 11 10 9 8 12 1 1 0 0 0 0 0 7 6 5 4 3 2 1 0 1 1 1 H I N Z C Accumulator (A) Index register (X) Stack pointer (SP) Program counter (PC) Condition code register (CCR) Half-carry flag Interrupt mask Negative flag Zero flag Carry/borrow flag 68HC05 programming model
  • 49. Discovering Diverse Content Through Random Scribd Documents
  • 50. investigation of truth. The laws of scientific induction might become the laws for the education of the soul. No more setting out with abstract principles, imposed by authority; but facts intuitively apprehended, gathered by observation and verified by experiment; the order of nature faithfully followed; a cautious progression from the simplest and most elementary ideas to the most difficult and most complex truths; the knowledge of things instead of an analysis of words,—such was to be the character of the new system of instruction. In other terms, it was possible to make the child follow, in order to lead him to know and to comprehend the capitalized truths that constitute the basis of elementary instruction, the same method that Bacon recommended to scholars for the discovery of unknown truths.[99] It is this conversion, or, as we might say, this translation, of the maxims of the Baconian logic into pedagogical rules, that Comenius attempted, and this is why he has been called “the father of the intuitive method.” He was nourished, intellectually, by the reading of Bacon, whom he resembles, not only in his ideas, but also in his figurative and often allegorical language. Even the title of one of his books, Didactica Magna, recalls the title of Bacon’s Instauratio Magna. 137. The Life of Comenius.—To know Comenius and the part he played in the seventeenth century, to appreciate this grand educational character, it would be necessary to begin by relating his life; his misfortunes; his journeys to England, where Parliament invoked his aid; to Sweden, where the Chancellor Oxenstiern employed him to write manuals of instruction; especially his relentless industry, his courage through exile, and the long persecutions he suffered as a member of the sect of dissenters, the Moravian Brethren; and the schools he founded at Fulneck, in Bohemia, at Lissa and at Patak, in Poland. But it would require too much of our space to follow in its incidents and catastrophes that troubled life, which, in its sudden trials, as in the firmness that supported them, recalls the life of Pestalozzi.[100]
  • 51. 138. His Principal Works.—Comenius wrote a large number of books in Latin, in German, and in Czech; but of these only a few are worthy to engage the attention of the educator. In his other works he allows himself to go off on philosophic excursions, and to indulge in mystic reveries, led by his ardor to find what he called pansophia, wisdom or universal knowledge. In this wilderness of publications destined to oblivion, we shall notice only three works, which contain the general principles of the pedagogy of Comenius, and the applications which he has made of his method:— 1. The Didactica Magna, the Great Didactics (written in Czech at about 1630, and rewritten in Latin at about 1640). In this work Comenius sets forth his principles, his general theories on education, and also his peculiar views on the practical organization of schools. It is to be regretted that a French translation has not yet popularized this important book, that would be worthy a place beside the Thoughts of Locke and the Émile of Rousseau.[101] 2. The Janua linguarum reserata, the Gate of Tongues Unlocked (1631). In the thought of the author, this was a new method of learning the languages. Comenius, led astray on this point by his religious prejudices, wished to banish the Latin authors from the schools, “for the purpose,” he said, “of reforming studies in the true spirit of Christianity.” Consequently, in order to replace the classical authors, which he repudiated for this further reason, that the reading of them is too difficult, and to make a child study them “is to wish to push out into the vast ocean a tiny bark that should be allowed only to sport on a little lake,” he had formed the idea of composing a collection of phrases distributed into a hundred chapters. These phrases, to the number of a thousand, at first very simple, and of a single member, then longer and more complicated, were formed of two thousand words, chosen from among the most common and the most useful. Moreover, the hundred chapters of the Janua taught the child, in succession and in a methodical order, all the things in the universe,—the elements, the metals, the stars, the
  • 52. animals, the organs of the body, the arts and trades, etc., etc. In other terms, the Janua linguarum is a nomenclature of ideas and words designed to fix the attention of the child upon everything he ought to know of the world. Divested of the Latin text that accompanies it, the Janua is a first reading-book, very defective doubtless, but it gives proof of a determined effort to adapt to the intelligence of the child the knowledge that he ought to acquire. 3. The Orbis sensualium pictus, the Illustrated World of Sensible Objects, the most popular of the author’s works (1658). It is the Janua linguarum accompanied with pictures, in lieu of real objects, representing to the child the things that he hears spoken of, as fast as he learns their names. The Orbis pictus, the first practical application of the intuitive method, had an extraordinary success, and has served as a model for the innumerable illustrated books which for three centuries have invaded the schools.
  • 53. Geometria. Die Erdmesskunst. (Facsimile of illustration in the Orbis Pictus of Comenius.)
  • 54. (Facsimile of page of text of the Orbis Pictus.) 139. The Four Grades of Instruction.—We must not require a man of the seventeenth century to abjure Latin studies. Comenius prizes them highly; but at least he is wise enough to put them in their
  • 55. place, and does not confound them, as Luther did, with elementary studies. Nothing could be more exact, more clearly cut, than the scholastic organization proposed by Comenius. We shall find in it what the experience of three centuries has finally sanctioned and established, the distribution of schools into these grades,—infant schools, primary schools, secondary schools, and higher schools. The first grade of instruction is the maternal school, the school by the mother’s knee, materni gremii, as Comenius calls it. The mother is the first teacher. Up to the age of six the child is taught by her; he is initiated by her into those branches of knowledge that he will pursue in the primary school. The second grade is the elementary public school. All the children, girls and boys, enter here at six, and leave at twelve. The characteristic of this school is that the instruction there given is in the mother tongue, and this is why Comenius calls it the “common” school, vernacula, a term given by the Romans to the language of the people. The third grade is represented by the Latin school or gymnasium. Thither are sent the children from twelve to eighteen years of age for whom has been reserved a more complete instruction, such as we would now call secondary instruction. Finally, to the fourth grade correspond the academies, that is, institutions of higher instruction, opened to young men from eighteen to twenty-four years of age. The child, if he is able, will traverse these four grades in succession; but, in the thought of Comenius, the studies should be so arranged in the elementary schools, that in leaving them, the pupil shall have a general education which makes it unnecessary for him to go farther, if his condition in life does not destine him to pursue the courses of the Latin School. “We pursue,” says Comenius, “a general education, the teaching to all men of all the subjects of human concern.... The purpose of
  • 56. the people’s school shall be that all children of both sexes, from the tenth to the twelfth or the thirteenth year, may be instructed in that knowledge which is useful during the whole of life.” This was an admirable definition of the purpose of the primary school. A thing not less remarkable is that Comenius establishes an elementary school in each village:— “There should be a maternal school in each family; an elementary school in each district; a gymnasium in each city; an academy in each kingdom, or even in each considerable province.” 140. Elementary Initiation into All the Studies.—One of the most novel and most original ideas of the great Slavic educator is the wish that, from the earliest years of his life, the child may acquire some elementary notions of all the sciences that he is to study at a later period. From the cradle, the gaze of the infant, guided by the mother, should be directed to all the objects that surround him, so that his growing powers of reflection will be brought into play in working on these sense intuitions. “Thus, from the moment he begins to speak, the child comes to know himself, and, by his daily experience, certain general and abstract expressions; he comes to comprehend the meaning of the words something, nothing, thus, otherwise, where, similar, different; and what are generalizations and the categories expressed by these words but the rudiments of metaphysics? In the domain of physics, the infant can learn to know water, earth, air, fire, rain, snow, etc., as well as the names and uses of the parts of his body, or at least of the external members and organs. He will take his first lesson in optics in learning to distinguish light, darkness, and the different colors; and in astronomy, in noticing the sun, the moon, and the stars, and in observing that these heavenly bodies rise and set every day. In geography, according to the place where he lives, he will be shown a mountain, a valley, a plain, a river, a village, a hamlet, a city, etc. In chronology, he will be taught what an hour is, a day, a week, a year, summer, winter, yesterday, the day before yesterday, to-morrow, the day after to-morrow, etc. History, such as his age will allow him to conceive,
  • 57. will consist in recalling what has recently passed, in taking account of it, and in noting the part that this one or that has taken in such or such an affair. Arithmetic, geometry, statistics, mechanics, will not remain strangers to him. He will acquire the elements of these sciences in distinguishing the difference between little and much, in learning to count up to ten, in observing that three is more than two; that one added to three makes four; in learning the sense of the words great and small, long and short, wide and narrow, heavy and light; in drawing lines, curves, circles, etc.; in seeing goods measured with a yard-stick; in weighing an object in a balance; in trying to make something or to take it to pieces, as all children love to do. “In this impulse to construct and destroy, there is but the effort of the little intelligence to succeed in making or building something for himself; so that, instead of opposing the child in this, he should be encouraged and guided.” “The grammar of the first period will consist in learning to pronounce the mother tongue correctly. The child may receive elementary notions even of politics, in observing that certain persons assemble at the city hall, and that they are called councillors; and that among these persons there is one called mayor, etc.”[102] 141. The People’s School.—Divided into six classes, the people’s school should prepare the child either for active life or for the higher courses. Comenius sends here not only the sons of peasants and workmen, but the sons of the middle class or of the nobility, who will afterwards enter the Latin school. In other terms, the study of Latin is postponed till the age of twelve; and up to that period all children must receive a thorough primary education, which will comprise, with the mother tongue, arithmetic, geometry, singing, the salient facts of history, the elements of the natural sciences, and religion. The latest reforms in secondary instruction, which, only within a very late period, have postponed the study of Latin till the sixth year,[103] and which till then keep the pupil upon the subjects of primary
  • 58. instruction,—what are they but the distant echo of the thought of Comenius? Let it be noted, too, that the plan of Comenius gave to its primary school a complete encyclopædic course of instruction, which was sufficient for its own ends, but which, while remaining elementary, was a whole, and not a beginning.[104] Surely, the programme of studies devised by Comenius did not fail in point of insufficiency; we may be allowed, on the contrary, to pronounce it too extended, too crowded, conformed rather to the generous dreams of an innovator than to a prudent appreciation of what is practically possible; and we need not be astonished that, to lighten in part the heavy burden that is imposed on the teacher, Comenius had the notion of dividing the school into sections which assistants, chosen from among the best pupils, should instruct under the supervision of the master. 142. Site of the School.—One is not a complete educator save on the condition of providing for the exterior and material organization of the school, as well as for its moral administration. In this respect, Comenius is still deserving of our encomiums. He requires a yard for recreation, and demands that the school-house have a gay and cheerful aspect. The question had been discussed before him by Vives (1492-1540). “There should be chosen,” says the Spanish educator, “a healthful situation, so that the pupils may not one day have to take their flight, dispersed by the fear of an epidemic. Firm health is necessary to those who would heartily and profitably apply themselves to the study of the sciences. And the place selected should be isolated from the crowd, and especially at a distance from occupations that are noisy, such as those of smiths, stone-masons, machinists, wheelwrights, and weavers. However, I would not have the situation too cheerful and attractive, lest it might suggest to the scholars the taking of too frequent walks.” But these considerations that do honor to Vives and to Comenius, were scarcely in harmony with the resources then at the disposal of
  • 59. the friends of instruction. There was scarcely occasion seriously to consider how school-houses should be constructed and situated, at a period when the most often there were no school-houses existing. “In winter,” says Platter, “we slept in the school-room, and in summer in the open air.”[105] 143. Sense Intuitions.—If Comenius has traced with a master hand the general organization of the primary school, he has no less merit in the matter of methods. When they recommend the observation of sensible things as the first intellectual exercise, modern educators do but repeat what Comenius said three centuries ago. “In the place of dead books, why should we not open the living book of nature? ... To instruct the young is not to beat into them by repetition a mass of words, phrases, sentences, and opinions gathered out of authors; but it is to open their understanding through things.... “The foundation of all knowledge consists in correctly representing sensible objects to our senses, so that they can be comprehended with facility. I hold that this is the basis of all our other activities, since we could neither act nor speak wisely unless we adequately comprehended what we were to do and say. Now it is certain that there is nothing in the understanding that was not first in the senses, and, consequently, it is to lay the foundation of all wisdom, of all eloquence, and of all good and prudent conduct, carefully to train the senses to note with accuracy the differences between natural objects; and as this point, important as it is, is ordinarily neglected in the schools of to-day, and as objects are proposed to scholars that they do not understand because they have not been properly represented to their senses or to their imagination, it is for this reason, on the one hand, that the toil of teaching, and on the other, that the pain of learning, have become so burdensome and so unfruitful....
  • 60. “We must offer to the young, not the shadows of things, but the things themselves, which impress the senses and the imagination. Instruction should commence with a real observation of things, and not with a verbal description of them.” We see that Comenius accepts the doctrine of Bacon, even to his absolute sensationalism. In his pre-occupation with the importance of instruction through the senses, he goes so far as to ignore that other source of knowledge and intuitions, the inner consciousness. 144. Simplification of Grammatical Study.—The first result of the experimental method applied to instruction, is to simplify grammar and to relieve it from the abuse of abstract rules. “Children,” says Comenius, “need examples and things which they can see, and not abstract rules.” And in the Preface of the Janua linguarum, he dwells upon the faults of the old method employed for the study of languages. “It is a thing self-evident, that the true and proper way of teaching languages has not been recognized in the schools up to the present time. The most of those who devoted themselves to the study of letters grew old in the study of words, and upwards of ten years was spent in the study of Latin alone; indeed, they even spent their whole life in the study, with a very slow and very trifling profit, which did not pay for the trouble devoted to it.”[106] It is by use and by reading that Comenius would abolish the abuse of rules. Rules ought to intervene only to aid use and give it surety. The pupil will thus learn language, either in speaking, or in reading a book like the Orbis Pictus, in which he will find at the same time all the words of which the language itself is composed, and examples of all the constructions of its syntax. 145. Necessity of Drill and Practice.—Another essential point in the new method, is the importance attributed by Comenius to practical exercises: “Artisans,” he said, “understand this matter perfectly well. Not one of them will give an apprentice a theoretical course on his
  • 61. trade. He is allowed to notice what is done by his master, and then the tool is put in his hands: it is in smiting that one becomes a smith.”[107] It is no longer the thing to repeat mechanically a lesson learned by heart. There must be a gradual habituation to action, to productive work, to personal effort. 146. General Bearing of the Work of Comenius.—How many other new and judicious ideas we shall have to gather from Comenius! The methods which we would be tempted to consider as wholly recent, his imagination had already suggested to him. For example, preceding the Orbis Pictus, we find an alphabet, where to each letter corresponds the cry of an animal, or else a sound familiar to the child. Is not this already the very essence of the phononimic processes[108] brought into fashion in these last years? But what is of more consequence with Comenius than a few happy discoveries in practical pedagogy, is the general inspiration of his work. He gives to education a psychological basis in demanding that the faculties shall be developed in their natural order: first, the senses, the memory, the imagination, and lastly the judgment and the reason. He is mindful of physical exercises, of technical and practical instruction, without forgetting that in the primary schools, which he calls the “studios of humanity,” there must be trained, not only strong and skilful artisans, but virtuous and religious men, imbued with the principles of order and justice. If he has stepped from theology to pedagogy, and if he permits himself sometimes to be borne along by his artless bursts of mysticism, at least he does not forget the necessities of the real condition, and of the present life of men. “The child,” he says, “shall learn only what is to be useful to him in this life or in the other.” Finally, he does not allow himself to be absorbed in the minute details of school management. He has higher views,— he is working for the regeneration of humanity. Like Leibnitz, he would freely say: “Give me for a few years the direction of education, and I agree to transform the world!”
  • 62. [147. Analytical Summary.—1. Decisive changes in human opinion, political, religious, or scientific, involve corresponding changes in the purposes and methods of education. 2. The Reformation was a breaking with authority in matters of religion, as the Baconian philosophy was a breaking with authority in matters of science; and their joint effect on education was to subject matters of opinion, belief, and knowledge to the individual reason, experience, and observation. 3. In holding each human being responsible for his own salvation, the Reformation made it necessary for every one to read, and the logical consequence of this was to make instruction universal; and as schools were multiplied, the number of teachers must be increased, and their grade of competence raised. 4. The conception that ignorance is an evil, and a constant menace to spiritual and temporal safety, led to the idea of compulsory school-attendance. 5. In the recoil from the intuitions of the intellect sanctioned by Socrates, to the intuitions of the senses sanctioned by Bacon, education passed from an extreme dependence on reflection and reason, to an extreme dependence on sense and observation; so that inference has been thrown into discredit, and the verdict of the senses has been made the test of knowledge. 6. In adapting the conception of universal education to the social conditions of his time, Comenius was led to a gradation of schools that underlies all modern systems of public instruction.]
  • 63. FOOTNOTES: [95] Dittes, op. cit. p. 127. [96] Luther’s argument for compulsion should not be omitted: “It is my opinion that the authorities are bound to force their subjects to send their children to school.... If they can oblige their able-bodied subjects to carry the lance and the arquebuse, to mount the ramparts, and to do complete military service, for a much better reason may they, and ought they, to force their subjects to send their children to school, for here it is the question of a much more terrible war with the devil.” (P.) [97] Names for treatises on grammar and philosophy respectively. Donatus was a celebrated grammarian and rhetorician who taught at Rome in the middle of the fourth century A.D.; and Alexander, a celebrated Greek commentator on the writings of Aristotle, who taught the Peripatetic philosophy at Athens in the end of the second and the beginning of the third centuries A.D. (P.) [98] Michelet, Nos fils, p. 175 et seq. [99] This is, perhaps, the earliest appearance of the conception that learning should be a process of discovery or of re-discovery. Condillac (1715-1780) has elaborated this idea in the introduction to his Grammaire, and Spencer (Education, p. 122) makes it a fundamental law of teaching. If this assumed principle were to be rigorously applied, as, fortunately, it cannot be, progress in human knowledge would be impossible. Mr. Bain’s comment on this doctrine (Education as a Science, p. 94) is as follows: “This bold fiction is sometimes put forward as one of the regular arts of the teacher; but I should prefer to consider it as an extraordinary device, admissible only on special occasions.” (P.) [100] It may not be generally known that Comenius was once solicited to become the President of Harvard College. The following is a quotation from Vol. II., p. 14, of Cotton Mather’s Magnalia: “That brave old man, Johannes Amos Commenius, the fame of whose worth hath been trumpetted as far as more than three languages (whereof every one is indebted unto his Janua) could carry it, was indeed agreed withal, by our Mr. Winthrop in
  • 64. his travels through the low countries, to come over into New England, and illuminate this Colledge and country, in the quality of a President, which was now become vacant. But the solicitations of the Swedish Ambassador diverting him another way, that incomparable Moravian became not an American.” This was on the resignation of President Dunster, in 1654. (P.) [101] The most complete account ever written of Comenius and his writings is, “John Amos Comenius,” by S. S. Laurie (Boston: 1885). It is an invaluable contribution to the philosophy and the history of education. (P.) [102] Buisson’s Dictionnaire de Pédagogie, Article Comenius. [103] In the French Lycées and Colleges the grades are named as follows, beginning with the lowest: “ninth, eighth, seventh, sixth, fifth, fourth, third, second, rhetoric, philosophy, preparatory mathematics, elementary mathematics, special mathematics.” Latin was formerly begun in an earlier grade. [104] The public school of the European type may be represented by a series of (3) pyramids, the second higher than the first, and the third higher than the second, each independent and complete in itself; while the public school of the American type is represented by a single pyramid in three sections. While in an English, French, or German town, public education is administered in three separate establishments, in an American town there is a single graded school that fulfills the same functions. (P.) [105] Platter, a Swiss teacher of the sixteenth century (1499- 1582). [106] For this quotation, as for all those which we borrow from the preface of the Janua linguarum, a French edition of which (in three languages: Latin, German, and French) appeared in 1643, we copy from the authentic text. [107] There is a misleading fallacy in all such illustrations. What analogy is there between the learning of history or geology and the learning of a trade like carpentry? Should a physician and a blacksmith be educated on the same plan? In every case knowledge should precede practice; and the liberal arts are best learned by first learning their correlative sciences. (P.) [108] “A process of instruction which consists in placing beside the elements of human speech thirty-three onomatopoetic
  • 65. gestures, which recall to the sight the same ideas that the sounds and the articulations of the voice recall to the ear.”—Grosselin. (P.)
  • 66. CHAPTER VII. T H E T E A C H I N G C O N G R E G AT I O N S.—J E S U I T S A N D J A N S E N I S T S. THE TEACHING CONGREGATIONS; JESUITS AND JANSENISTS; FOUNDATION OF THE SOCIETY OF JESUS (1540); DIFFERENT JUDGMENTS ON THE EDUCATIONAL MERITS OF THE JESUITS; AUTHORITIES TO CONSULT; PRIMARY INSTRUCTION NEGLECTED; CLASSICAL STUDIES; LATIN AND THE HUMANITIES; NEGLECT OF HISTORY, OF PHILOSOPHY, AND OF THE SCIENCES IN GENERAL; DISCIPLINE; EMULATION ENCOURAGED; OFFICIAL DISCIPLINARIAN; GENERAL SPIRIT OF THE PEDAGOGY OF THE JESUITS; THE ORATORIANS; THE LITTLE SCHOOLS; STUDY OF THE FRENCH LANGUAGE; NEW SYSTEM OF SPELLING; THE MASTERS AND THE BOOKS OF PORT ROYAL; DISCIPLINE IN PERSONAL REFLECTION; GENERAL SPIRIT OF THE INTELLECTUAL EDUCATION AT PORT ROYAL; NICOLE; MORAL PESSIMISM; EFFECTS ON DISCIPLINE; FAULTS IN THE DISCIPLINE OF PORT ROYAL; GENERAL JUDGMENT ON PORT ROYAL; ANALYTICAL SUMMARY. 148. The Teaching Congregations.[109]—Up to the French Revolution, up to the day when the conception of a public and national education was embodied in the legislative acts of our assembled rulers, education remained almost exclusively an affair of the Church. The universities themselves were dependent in part on religious authority. But especially the great congregations assumed a monopoly of the work of teaching, the direction and control of which the State had not yet claimed for her right. Primary instruction, it is true, scarcely entered at first into the settled plans of the religious orders. The only exception to this statement that can properly be made, is the congregation of the Christian Doctrine, which a humble priest, Cæsar de Bus, founded at
  • 67. Avignon in 1592, the avowed purpose of which was the religious education of the children of the company.[110] But, on the other hand, secondary instruction provoked the greatest educational event of the sixteenth century, the founding of the company of Jesus, and this movement was continued and extended in the seventeenth century, either in the colleges of the Jesuits, ever growing in number, or in other rival congregations. 149. Jesuits and Jansenists.—Among the religious orders that have consecrated their efforts to the work of teaching, the first place must be assigned to the Jesuits and the Jansenists. Different in their statutes, their organization, and their destinies, these two congregations are still more different in their spirit. They represent, in fact, two opposite, and, as it were, contrary phases of human nature and of the Christian spirit. For the Jesuits, education is reduced to a superficial culture of the brilliant faculties of the intelligence; while the Jansenists, on the contrary, aspire to develop the solid faculties, the judgment, and the reason. In the colleges of the Jesuits, rhetoric is held in honor; while in the Little Schools of Port Royal, it is rather logic and the exercise of thought. The shrewd disciples of Loyola adapt themselves to the times, and are full of compassion for human weakness; the solitaries of Port Royal are exacting of others and of themselves. In their suppleness and cheerful optimism, the Jesuits are almost the Epicureans of Christianity; with their austere and somewhat sombre doctrine, the Jansenists would rather be the Stoics. The Jesuits and the Jansenists, those great rivals of the seventeenth century, are still face to face as enemies at the present moment. While the inspiration of the Jesuits tries to maintain the old worn-out exercises, like Latin verse, and the abuse of the memory, the spirit of the Jansenists animates and inspires the reformers, who, in the teaching of the classics, break with tradition and routine, to substitute for exercises aimed at elegance, and for a superficial instruction, studies of a greater solidity and an education that is more complete.
  • 68. The merit of institutions ought not always to be measured by their apparent success. The colleges of the Jesuits, during three centuries, have had a countless number of pupils; the Little Schools of Port Royal did not live twenty years, and during their short existence they enrolled at most only some hundreds of pupils. And yet the methods of the Jansenists have survived the ruin of their colleges and the dispersion of the teachers who had applied them. Although the Jesuits have not ceased to rule in appearance, it is the Jansenists who triumph in reality, and who to-day control the secondary instruction of France. 150. Foundation of the Society of Jesus.—In organizing the Society of Jesus, Ignatius Loyola, that compound of the mystic and the man of the world, purposed to establish, not an order devoted to monastic contemplation, but a real fighting corps, a Catholic army, whose double purpose was to conquer new provinces to the faith through missions, and to preserve the old through the control of education. Solemnly consecrated by the Pope Paul III., in 1540, the congregation had a rapid growth. As early as the middle of the sixteenth century, it had several colleges in France, particularly those of Billom, Mauriac, Rodez, Tournon, and Pamiers. In 1561 it secured a footing in Paris, notwithstanding the resistance of the Parliament, of the university, and of the bishops themselves. A hundred years later it counted nearly fourteen thousand pupils in the province of Paris alone. The college of Clermont, in 1651, enrolled more than two thousand young men. The middle and higher classes assured to the colleges of the society an ever-increasing membership. At the end of the seventeenth century, the Jesuits could inscribe on the roll of honor of their classes a hundred illustrious names, among others, those of Condé and Luxembourg, Fléchier and Bossuet, Lamoignon and Séguier, Descartes, Corneille, and Molière. In 1710 they controlled six hundred and twelve colleges and a large number of universities. They were the real masters of education, and they maintained this educational supremacy till the end of the eighteenth century.
  • 69. 151. Different Judgments on the Educational Merits of the Jesuits.— Voltaire said of these teachers: “The Fathers taught me nothing but Latin and nonsense.” But from the seventeenth century, opinions are divided, and the encomiums of Bacon and Descartes must be offset by the severe judgment of Leibnitz. “In the matter of education,” says this great philosopher, “the Jesuits have remained below mediocrity.”[111] Directly to the contrary, Bacon had written: “As to whatever relates to the instruction of the young, we must consult the schools of the Jesuits, for there can be nothing that is better done.”[112] 152. Authorities to Consult.—The Jesuits have never written anything on the principles and objects of education. We must not demand of them an exposition of general views, or a confession of their educational faith. But to make amends, they have drawn up with precision, with almost infinite attention to details, the rules and regulations of their course of study. Already, in 1559, the Constitutions, probably written by Loyola himself, devoted a whole book to the organization of the colleges of the society.[113] But in particular, the Ratio Studiorum, published in 1599, contains a complete scholastic programme, which has remained for three centuries the invariable educational code of the congregation. Without doubt, the Jesuits, always ready to make apparent concessions to the spirit of the times, without sacrificing anything of their own spirit, and without renouncing their inflexible purpose, have introduced modifications into their original rules; but the spirit of their educational practice has remained the same, and, in 1854, Beckx, the actual general of the order, could still declare that the Ratio is the immutable rule of Jesuit education. 153. Primary Instruction Neglected.—A permanent and characteristic feature of the educational policy of the Jesuits is, that, during the whole course of their history, they have deliberately neglected and disdained primary instruction. The earth is covered with their Latin colleges; and wherever they have been able, they have put their
  • 70. hands on the institutions for university education; but in no instance have they founded a primary school. Even in their establishments for secondary instruction, they entrust the lower classes to teachers who do not belong to their order, and reserve to themselves the direction of the higher classes. Must we believe, as they have declared in order to explain this negligence, that the only reason for their reserve and their indifference is to be sought for in the insufficiency of their teaching force? No; the truth is that the Jesuits neither desire nor love the instruction of the people. To desire and to love this, there must be faith in conscience and reason; there must be a belief in human equality. Now the Jesuits distrust the human intelligence, and administer only the aristocratic education of the ruling classes, whom they hope to retain under their own control. They wish to train amiable gentlemen, accomplished men of the world; they have no conception of training men. Intellectual culture, in their view, is but a convenience, imposed on certain classes of the nation by their rank. It is not a good in itself; it may even become an evil. In certain hands it is a dangerous weapon. The ignorance of a people is the best safeguard of its faith, and faith is the supreme end. So we shall not be astonished to read this in the Constitutions: — “None of those who are employed in domestic service on account of the society, ought to learn to read and write, or, if they already know these arts, to learn more of them. They shall not be instructed without the consent of the General, for it suffices for them to serve with all simplicity and humility our Master, Jesus Christ.” 154. Classical Studies: Latin and the Humanities.—It is only in secondary instruction that the Jesuits have taken position with marked success. The basis of their teaching is the study of Latin and Greek. Their purpose is to monopolize classical studies in order to make them serve for the propagation of the Catholic faith. To write in Latin is the ideal which they propose to their pupils. The first consequence of this is the proscription of the mother tongue. The Ratio forbids the use of French even in conversation; it permits it
  • 71. only on holidays. Hence, also, the importance accorded to Latin and Greek composition, to the explication of authors, and to the study of grammar, rhetoric, and poetry. It is to be noted, besides, that the Jesuits put scarcely more into the hands of their pupils than select extracts, expurgated editions. They wish, in some sort, to efface from the ancient books whatever marks the epoch and characterizes the time. They detach fine passages of eloquence and beautiful extracts of poetry; but they are afraid, it seems, of the authors themselves; they fear lest the pupil find in them the old human spirit,—the spirit of nature. Moreover, in the explication of authors, they pay more attention to words than to things. They direct the pupil’s attention, not to the thoughts, but to the elegancies of language, to the elocutionary effect; in a word, to the form, which, at least, has no religious character, and can in nowise give umbrage to Catholic orthodoxy. They fear to awaken reflection and individual judgment. As Macaulay has said, they seem to have found the point up to which intellectual culture can be pushed without reaching intellectual emancipation. 155. Disdain of History, of Philosophy, and of the Sciences in General. —Preoccupied before all else with purely formal studies, and exclusively devoted to the exercises which give a training in the use of elegant language, the Jesuits leave real and concrete studies in entire neglect. History is almost wholly banished from their programme. It is only with reference to the Greek and Latin texts that the teacher should make allusion to the matters of history which are necessary for the understanding of the passage under examination. No account is made of modern history, nor of the history of France. “History,” says a Jesuit Father, “is the destruction of him who studies it.” This systematic omission of historical studies suffices to put in its true light the artificial and superficial pedagogy of the Jesuits, admirably defined by Beckx, who expresses himself thus:— “The gymnasia will remain what they are by nature, a gymnastic for the intellect, which consists far less in the assimilation of real
  • 72. matter, in the acquisition of different knowledges, than in a culture of pure form.” The sciences and philosophy are involved in the same disdain as history. Scientific studies are entirely proscribed in the lower classes, and the student enters his year in philosophy,[114] having studied only the ancient languages. Philosophy itself is reduced to a barren study of words, to subtile discussions, and to commentaries on Aristotle. Memory and syllogistic reasoning are the only faculties called into play; no facts, no real inductions, no care for the observation of nature. In all things the Jesuits are the enemies of progress. Intolerant of everything new, they would arrest the progress of the human mind and make it immovable. 156. Discipline.—Extravagant statements have been made relative to the reforms in discipline introduced by the Jesuits into their educational establishments. The fact is, that they have caused to prevail in their colleges more of order and of system than there was in the establishments of the University. On the other hand, they have attempted to please their pupils, to gild for them, so to speak, the bars of the prison which confined them. Theatrical representations, excursions on holidays, practice in swimming, riding, and fencing,— nothing was neglected that could render their residence at school endurable. But, on the other hand, the Jesuits have incurred the grave fault of detaching the child from the family. They wish to have absolute control of him. The ideal of the perfect scholar is to forget his parents. Here is what was said by a pupil of the Jesuits, who afterwards became a member of the Order, J. B. de Schultaus:— “His mother paid him a visit at the College of Trent. He refused to take her hand, and would not even raise his eyes to hers. The mother, astonished and grieved, asked her son the cause of such a cold greeting. ‘I refuse to notice you,’ said the pupil, ‘not because you are my mother, but because you are a woman.’ And the biographer adds: ‘This was not excessive precaution; woman
  • 73. preserves to-day the faults she had at the time of our first father; it is always she who drives man from Paradise.’ When the mother of Schultaus died, he did not show the least emotion, having long ago adopted the Holy Virgin for his true mother.” 157. Emulation Encouraged.—The Jesuits have always considered emulation as one of the essential elements of discipline. “It is necessary,” says the Ratio, “to encourage an honorable emulation; it is a great stimulus to study.” Superior on this point, perhaps on this alone, to the Jansenists, who through mistrust of human nature feared to excite pride by encouraging emulation, the Jesuits have always counted upon the self-love of the pupil. The Ratio multiplies rewards,—solemn distributions of prizes, crosses, ribbons, decorations, titles borrowed from the Roman Republic, such as decurions and prætors; all means, even the most puerile, were invented to nourish in pupils an ardor for work, and to incite them to surpass one another. Let us add that the pupil was rewarded, not only for his own good conduct, but for the bad conduct of his comrades if he informed against them. The decurion or the prætor was charged with the police care of the class, and, in the absence of the official disciplinarian, he himself chastised his comrades; in the hands of his teacher, he became a spy and an informer. Thus a pupil, liable to punishment for having spoken French contrary to orders, will be relieved from his punishment if he can prove by witnesses that one of his comrades has committed the same fault on the same day. 158. Official Disciplinarian.—The rod is an element, so to speak, of the ancient pedagogical régime. It holds a privileged place both in the colleges and in private education. Louis XIV. officially transmits to the Duke of Montausier the right to correct his son. Henry IV. wrote to the governor of Louis XIII.: “I complain because you did not inform me that you had whipped my son; for I desire and order you to whip him every time that he shall be guilty of obstinacy or of anything else that is bad; for I well know that there is nothing in the world that can do him more good than that. This I know from the
  • 74. lessons of experience, for when I was of his age, I was soundly flogged.”[115] The Jesuits, notwithstanding their disposition to make discipline milder, were careful not to renounce a punishment that was in use even at court. Only, while the Brethren of the Christian Schools, according to the regulations of La Salle, chastised the guilty pupil themselves, the Jesuits did not think it becoming the dignity of the master to apply the correction himself. They reserved to a laic the duty of handling the rods. An official disciplinarian, a domestic, a porter, was charged in all the colleges with the functions of chief executioner. And while the Ratio Studiorum recommends moderation, certain witnesses prove that the special disciplinarian did not always carry a discreet hand. Here, for example, is an account given by Saint Simon:— “The eldest son of the Marquis of Boufflers was fourteen years old. He was handsome, well formed, was wonderfully successful, and full of promise. He was a resident pupil of the Jesuits with the two sons of d’Argenson. I do not know what indiscretion he and they were guilty of. The Fathers wished to show that they neither feared nor stood in awe of any one, and they flogged the boy, because, in fact, they had nothing to fear of the Marquis of Boufflers; but they were careful not to treat the two others in this way, though equally culpable, because every day they had to count with d’Argenson, who was lieutenant of police. The boy Boufflers was thrown into such mental agony that he fell sick on the same day, and within four days was dead.... There was a universal and furious outcry against the Jesuits, but nothing ever came of it.”[116] 159. General Spirit of the Pedagogy of the Jesuits.—The general principles of the doctrine of the Jesuits are completely opposed to our modern ideas. Blind obedience, the suppression of all liberty and of all spontaneity, such is the basis of their moral education. “To renounce one’s own wishes is more meritorious than to raise the dead;” “We must be so attached to the Roman Church as to hold
  • 75. for black an object which she tells us is black, even when it is really white;” “Our confidence in God should be strong enough to force us, in the lack of a boat, to cross the ocean on a single plank;” “If God should appoint for our master an animal deprived of reason, you should not hesitate to render it obedience, as to a master and a guide, for this sole reason, that God has ordered it thus;” “One must allow himself to be governed by divine Providence acting through the agency of the superiors of the Order, just as if he were a dead body that could be put into any position whatever, and treated according to one’s good pleasure; or as if one were a bâton in the hands of an old man who uses it as he pleases.” As to intellectual education, as they understand it, it is wholly artificial and superficial. To find for the mind occupations that absorb it, that soothe it like a dream, without wholly awakening it; to call attention to words, and to niceties of expression, so as to reduce by so much the opportunity for thinking; to provoke a certain degree of intellectual activity, prudently arrested at the place where the reflective reason succeeds an embellished memory; in a word, to excite the spirit just enough to arouse it from its inertia and its ignorance, but not enough to endow it with a real self-activity by a manly display of all its faculties,—such is the method of the Jesuits. “As to instruction,” says Bersot, “this is what we find with them: history reduced to facts and tables, without the lesson derived from them bearing on the knowledge of the world; even the facts suppressed or altered when they say too much; philosophy reduced to what is called empirical doctrine, and what de Maistre called the philosophy of the nothing, without danger of one’s acquiring a liking for it; physical science reduced to recreations, without the spirit of research and liberty; literature reduced to the complaisant explication of the ancient authors, and ending in innocent witticisms.... With respect to letters, there are two loves which have nothing in common save their name; one of them makes men, the other, great boys. It is the last that we find with the Jesuits; they amuse the soul.”
  • 76. 160. The Oratorians.—Between the Jesuits, their adversaries, and the Jansenists, their friends, the Oratorians occupy an intermediate place. They break already with the over-mechanical education, and with the wholly superficial instruction which Ignatius Loyola had inaugurated. Through some happy innovations they approach the more elevated and more profound education of Port Royal. Founded in 1614, by Bérulle, the Order of the Oratory soon counted quite a large number of colleges of secondary instruction, and, in particular, in 1638, the famous college of Juilly. While with the Jesuits it is rare to meet the names of celebrated professors, several renowned teachers have made illustrious the Oratory of the seventeenth century. We note the Père Lamy, author of Entretiens sur les Sciences (1683); the Père Thomassin, whom the Oratorians call the “incomparable theologian,” and who published, from 1681 to 1690, a series of Methods for studying the languages, philosophy, and letters; Mascaron and Massillon, who taught rhetoric at the Oratory; the Père Lecointe and the Père Lelong, who taught history there. All these men unite, in general, some love of liberty to ardor of religious sentiment; they wish to introduce more air and more light into the cloister and the school; they have a taste for the facts of history and the truths of science; finally, they attempt to found an education at once liberal and Christian, religious without abuse of devotion, elegant without refinement, solid without excess of erudition, worthy, finally, to be counted as one of the first practical tentatives of modern pedagogy. The limits of this study forbid our entering into details. Let us merely note a few essential points. That which distinguishes the Oratorians, is, first, a sincere and disinterested love of truth. “We love the truth,” says the Père Lamy; “the days do not suffice to consult her as long as we would wish; or, rather, we never grow weary of the pleasure we find in studying her. There has always been that love for letters in this House: those who have governed it have tried to nourish it. When there is found among us some penetrating and liberally endowed spirit who has a rare genius for the sciences, he is discharged from all other duties.”[117]
  • 77. Nowhere have ancient letters been more loved than at the Oratory. “In his leisure hours the Père Thomassin read only the authors of the humanities;” and yet French was not there sacrificed to Latin. The use of the Latin language was not obligatory till after the fourth year, and even then not for the lessons in history, which, till the end of the courses, had to be given in French. History, so long neglected even in the colleges of the University, particularly the history of France, was taught to the pupils of the Oratory. Geography was not separated from it; and the class-rooms were furnished with large mural maps. On the other hand, the sciences had a place in the course of study. A Jesuit father would not have expressed himself as the Père Lamy has done:— “It is a pleasure to enter the laboratory of a chemist. In the places where I have happened to be, I did not miss an opportunity to attend the anatomical lectures that were given, and to witness the dissection of the principal parts of the human body.... I know of nothing of greater use than algebra and arithmetic.” Finally, philosophy itself,—the Cartesian philosophy, so mercilessly decried by the Jesuits,—was in vogue at the Oratory. “If Cartesianism is a pest,” wrote the regents of the College of Angers, “there are more than two hundred of us who are infected with it.” ... “They have forbidden the Fathers of the Oratory to teach the philosophy of Descartes, and, consequently, the blood to circulate,” wrote Madame de Sévigné, in 1673. Let us also furnish proof of the progress and amelioration of the discipline at the Oratory:— “There are many other ways besides the rod,” says the Père Lamy; “and, to lead pupils back to their duty, a caress, a threat, the hope of a reward, or the fear of a humiliation, has greater efficiency than whips.” The ferule, it is true, and whips also, were not forbidden, but made part of the legitima pœnarum genera. But it does not appear that use was often made of them; either through a spirit of
  • 78. mildness, or through prudence, and through the fear of exasperating the child. “There is needed,” says the Père Lamy again, “a sort of politics to govern this little community,—to lead them through their inclinations; to foresee the effect of rewards and punishments, and to employ them according to their proper use. There are times of stubbornness when a child would sooner be killed than yield.” What made it easier at the Oratory to maintain the authority of the master without resorting to violent punishments, is that the same professor accompanied the pupils through the whole series of their classes. The Père Thomassin, for example, was, in turn, professor of grammar, rhetoric, philosophy, mathematics, history, Italian, and Spanish,—a touching example, it must be allowed, of an absolute devotion to scholastic labor. But this universality, somewhat superficial, served neither the real interests of the masters nor those of their pupils. The great pedagogical law is the division of labor. 161. Foundation of the Little Schools.—From the very organization of their society, the Jansenists gave evidences of an ardent solicitude for the education of youth. Their founder, Saint Cyran, said: “Education is, in a sense, the one thing necessary.... I wish you might read in my heart the affection I feel for children.... You could not deserve more of God than in working for the proper bringing up of children.” It was in this disinterested feeling of charity for the good of the young, in this display of sincere tenderness for children, that the Jansenists, in 1643, founded the Little Schools at Port Royal in the Fields, in the vicinity, and then in Paris.[118] They received into those schools only a small number of pupils, preoccupied as they were, not with dominating the world and extending their influence, but with doing modestly and obscurely the good they could. Persecution did not long grant them the leisure to continue the work they had undertaken. By 1660 the enemies of Port Royal had triumphed; the Jesuits obtained an order from the king closing the schools and dispersing the teachers. Pursued, imprisoned, expatriated, the solitaries of Port Royal had but the opportunity to
  • 79. gather up in memorable documents the results of their educational experience all too short.[119] 162. The Teachers and the Books of Port Royal.—Singular destiny,— that of those teachers whom a relentless fate permitted to exercise their functions for only five years, yet who, through their works, have remained perhaps the best authorized exponents of French education! The first of these is Nicole, the moralist and logician, one of the authors of the Port Royal Logic, who taught philosophy and the humanities in the Little Schools, and who published in 1670, under the title, The Education of a Prince, a series of reflections on education, applicable, as he himself says, to children of all classes. Another is Lancelot, the grammarian, the author of the Methods for learning the Latin, Greek, Italian, and Spanish languages. Then there is Arnauld, the great Arnauld, the ardent theologian, who worked on the Logic, and the General Grammar, and who finally composed the Regulation of Studies in the Humanities. In connection with these celebrated names, we must mention other Jansenists not so well known, such as De Sacy and Guyot, both of whom were the authors of a large number of translations; Coustel, who published the Rules for the Education of Children (1687); Varet, the author of Christian Education (1668). Let us add to this list, still incomplete, the Regimen for Children, by Jacqueline Pascal (1657), and we shall have some idea of the educational activity of Port Royal. 163. The Study of the French Language.—As a general rule, we may have a good opinion of the teachers who recommend the study of the mother tongue. In this respect, the solitaries of Port Royal are in advance of their time. “We first teach to read in Latin,” said the Abbé Fleury, “because, compared with French, we pronounce it more as it is written.”[120] A curious reason, which did not satisfy Fleury himself; for he acknowledged the propriety of putting, as soon as possible, into the hands of children, the French books that they can understand. This was what was done at Port Royal. With their love of exactness and clearness, with their disposition, wholly Cartesian,
  • 80. to make children study only the things they can comprehend, the Jansenists saw at once the great absurdity of choosing Latin works as the first reading-books. “To learn Latin before learning the mother tongue,” said Comenius, wittily, “is like wishing to mount a horse before knowing how to walk.” And again, as Sainte-Beuve says, “It is to compel unfortunate children to deal with the unintelligible in order to proceed towards the unknown.” For these unintelligible texts, the Jansenists substituted, not, it is true, original French works, but at least good translations of Latin authors. For the first time in France, the French language was made the subject of serious study. Before being made to write in Latin, pupils were drilled in writing in French. They were set to compose little narratives, little letters, the subjects of which were borrowed from their recollections, by being asked to relate on the spot what they had retained of what they had read. 164. New System of Spelling.—In their constant preoccupation to make study easier, the Jansenists reformed the current method of learning to read. “What makes reading more difficult,” says Arnauld in Chapter VI. of the General Grammar, “is that while each letter has its own proper name, it is given a different name when it is found associated with other letters. For example, if the pupil is made to read the syllable fry, he is made to say ef, ar, y, which invariably confuses him. It is best, therefore, to teach children to know the letters only by the names of their real pronunciation, to name them only by their natural sounds.” Port Royal proposes, then, “to have children pronounce only the vowels and the diphthongs, and not the consonants, which they need not pronounce, except in the different combinations which they form with the same vowels or diphthongs, in syllables and words.” This method has become celebrated under the name of the Port Royal Method; and it appears, from a letter of Jacqueline Pascal, that the original notion was due to Pascal himself.[121] 165. Discipline in Personal Reflection.—That which profoundly distinguishes the method of the Jansenists from the method of the
  • 81. Welcome to Our Bookstore - The Ultimate Destination for Book Lovers Are you passionate about books and eager to explore new worlds of knowledge? At our website, we offer a vast collection of books that cater to every interest and age group. From classic literature to specialized publications, self-help books, and children’s stories, we have it all! Each book is a gateway to new adventures, helping you expand your knowledge and nourish your soul Experience Convenient and Enjoyable Book Shopping Our website is more than just an online bookstore—it’s a bridge connecting readers to the timeless values of culture and wisdom. With a sleek and user-friendly interface and a smart search system, you can find your favorite books quickly and easily. Enjoy special promotions, fast home delivery, and a seamless shopping experience that saves you time and enhances your love for reading. Let us accompany you on the journey of exploring knowledge and personal growth! ebookgate.com