Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
100% found this document useful (1 vote)
24 views

Instant download Programming Microcontrollers with Python: Experience the Power of Embedded Python 1st Edition Armstrong Subero pdf all chapter

Programming

Uploaded by

pondelatb
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
24 views

Instant download Programming Microcontrollers with Python: Experience the Power of Embedded Python 1st Edition Armstrong Subero pdf all chapter

Programming

Uploaded by

pondelatb
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 65

Experience Seamless Full Ebook Downloads for Every Genre at textbookfull.

com

Programming Microcontrollers with Python:


Experience the Power of Embedded Python 1st
Edition Armstrong Subero

https://textbookfull.com/product/programming-
microcontrollers-with-python-experience-the-power-of-
embedded-python-1st-edition-armstrong-subero-2/

OR CLICK BUTTON

DOWNLOAD NOW

Explore and download more ebook at https://textbookfull.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

Programming Microcontrollers with Python: Experience the


Power of Embedded Python 1st Edition Armstrong Subero

https://textbookfull.com/product/programming-microcontrollers-with-
python-experience-the-power-of-embedded-python-1st-edition-armstrong-
subero-2/
textboxfull.com

Programming PIC Microcontrollers with XC8 1st Edition


Armstrong Subero

https://textbookfull.com/product/programming-pic-microcontrollers-
with-xc8-1st-edition-armstrong-subero/

textboxfull.com

Programming with MicroPython Embedded Programming with


Microcontrollers and Python 1st Edition Nicholas H.
Tollervey
https://textbookfull.com/product/programming-with-micropython-
embedded-programming-with-microcontrollers-and-python-1st-edition-
nicholas-h-tollervey/
textboxfull.com

Programming with MicroPython embedded programming with


Microcontrollers and Python First Edition Nicholas H.
Tollervey
https://textbookfull.com/product/programming-with-micropython-
embedded-programming-with-microcontrollers-and-python-first-edition-
nicholas-h-tollervey/
textboxfull.com
MicroPython for the Internet of Things: A Beginner’s Guide
to Programming with Python on Microcontrollers 2nd Edition
Bell
https://textbookfull.com/product/micropython-for-the-internet-of-
things-a-beginners-guide-to-programming-with-python-on-
microcontrollers-2nd-edition-bell/
textboxfull.com

Learning Scientific Programming with Python 1st Edition


Christian Hill

https://textbookfull.com/product/learning-scientific-programming-with-
python-1st-edition-christian-hill/

textboxfull.com

Introduction to Scientific Programming with Python Joakim


Sundnes

https://textbookfull.com/product/introduction-to-scientific-
programming-with-python-joakim-sundnes/

textboxfull.com

Programming with Python for Social Scientists 1st Edition


Phillip Brooker

https://textbookfull.com/product/programming-with-python-for-social-
scientists-1st-edition-phillip-brooker/

textboxfull.com

Learning Scientific Programming With Python 2nd Edition


Christian Hill

https://textbookfull.com/product/learning-scientific-programming-with-
python-2nd-edition-christian-hill/

textboxfull.com
Programming
Microcontrollers
with Python
Experience the Power of
Embedded Python

Armstrong Subero
Programming
Microcontrollers with
Python
Experience the Power
of Embedded Python

Armstrong Subero
Programming Microcontrollers with Python: Experience the Power of
Embedded Python
Armstrong Subero
Basse Terre, Moruga, Trinidad and Tobago

ISBN-13 (pbk): 978-1-4842-7057-8 ISBN-13 (electronic): 978-1-4842-7058-5


https://doi.org/10.1007/978-1-4842-7058-5

Copyright © 2021 by Armstrong Subero


This work is subject to copyright. All rights are reserved by the Publisher, whether the whole
or part of the material is concerned, specifically the rights of translation, reprinting, reuse of
illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical
way, and transmission or information storage and retrieval, electronic adaptation, computer
software, or by similar or dissimilar methodology now known or hereafter developed.
Trademarked names, logos, and images may appear in this book. Rather than use a
trademark symbol with every occurrence of a trademarked name, logo, or image we use the
names, logos, and images only in an editorial fashion and to the benefit of the trademark
owner, with no intention of infringement of the trademark.
The use in this publication of trade names, trademarks, service marks, and similar terms,
even if they are not identified as such, is not to be taken as an expression of opinion as to
whether or not they are subject to proprietary rights.
While the advice and information in this book are believed to be true and accurate at the
date of publication, neither the authors nor the editors nor the publisher can accept any
legal responsibility for any errors or omissions that may be made. The publisher makes no
warranty, express or implied, with respect to the material contained herein.
Managing Director, Apress Media LLC: Welmoed Spahr
Acquisitions Editor: Susan McDermott
Development Editor: James Markham
Coordinating Editor: Jessica Vakili
Distributed to the book trade worldwide by Springer Science+Business Media New York, 1
NY Plaza, New York, NY 10004. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail
orders-ny@springer-sbm.com, or visit www.springeronline.com. Apress Media, LLC is a
California LLC and the sole member (owner) is Springer Science + Business Media Finance
Inc (SSBM Finance Inc). SSBM Finance Inc is a Delaware corporation.
For information on translations, please e-mail booktranslations@springernature.com; for
reprint, paperback, or audio rights, please e-mail bookpermissions@springernature.com.
Apress titles may be purchased in bulk for academic, corporate, or promotional use. eBook
versions and licenses are also available for most titles. For more information, reference our
Print and eBook Bulk Sales web page at http://www.apress.com/bulk-sales.
Any source code or other supplementary material referenced by the author in this book is
available to readers on GitHub via the book’s product page, located at www.apress.com/
978-­1-­4842-­7057-­8. For more detailed information, please visit http://www.apress.com/
source-­code.
Printed on acid-free paper
To all those who tinker to keep the world running
Table of Contents
About the Author��������������������������������������������������������������������������������xv
About the Technical Reviewer����������������������������������������������������������xvii
Acknowledgments�����������������������������������������������������������������������������xix

Chapter 1: Getting Ready����������������������������������������������������������������������1


Introduction to Microcontrollers����������������������������������������������������������������������������1
Firmware, Memory, and Clock Speed��������������������������������������������������������������������3
8-Bit vs. 32-Bit������������������������������������������������������������������������������������������������������4
Microcontroller Programming Languages�������������������������������������������������������5
Assembly Language����������������������������������������������������������������������������������������������5
C����������������������������������������������������������������������������������������������������������������������������6
C++�����������������������������������������������������������������������������������������������������������������������6
BASIC��������������������������������������������������������������������������������������������������������������������7
Rust�����������������������������������������������������������������������������������������������������������������������7
Python�������������������������������������������������������������������������������������������������������������������8
Selecting a Development Board����������������������������������������������������������������������������9
Adafruit Metro M0 Express���������������������������������������������������������������������������������10
Adafruit Feather M0 Express������������������������������������������������������������������������������12
Adafruit Metro M4 Express���������������������������������������������������������������������������������13
Adafruit Grand Central M4 Express���������������������������������������������������������������������14
The Arduino Zero�������������������������������������������������������������������������������������������������15

v
Table of Contents

The STM32F746ZG Nucleo����������������������������������������������������������������������������������16


Device Comparison���������������������������������������������������������������������������������������������17
The Component List��������������������������������������������������������������������������������������������18
The Mu Editor������������������������������������������������������������������������������������������������������21
Other Serial Communication Tools����������������������������������������������������������������25
Setting Up Your Own Board���������������������������������������������������������������������������������29
Conclusion����������������������������������������������������������������������������������������������������������35

Chapter 2: Electronics Primer������������������������������������������������������������37


Electrical Wires���������������������������������������������������������������������������������������������������40
The Breadboard��������������������������������������������������������������������������������������������������42
Electronic Schematics�����������������������������������������������������������������������������������44
Passive Components�������������������������������������������������������������������������������������������48
Resistors�������������������������������������������������������������������������������������������������������������48
Capacitors�����������������������������������������������������������������������������������������������������������51
Polarized Capacitors�������������������������������������������������������������������������������������������52
Non-polarized Capacitors�����������������������������������������������������������������������������������53
Capacitor Schematic Symbols�����������������������������������������������������������������������54
Inductors�������������������������������������������������������������������������������������������������������������55
Semiconductors��������������������������������������������������������������������������������������������������57
Diode�������������������������������������������������������������������������������������������������������������59
Light-Emitting Diode�������������������������������������������������������������������������������������������60
Transistor������������������������������������������������������������������������������������������������������������61
Metal-Oxide-Semiconductor Field-Effect Transistors�����������������������������������������64
Integrated Circuits�����������������������������������������������������������������������������������������66
Digital Logic���������������������������������������������������������������������������������������������������67
Logic Level Conversion���������������������������������������������������������������������������������������70

vi
Table of Contents

Flip-Flop��������������������������������������������������������������������������������������������������������������72
Registers and the Shift Register�������������������������������������������������������������������������73
Multiplexers and Demultiplexers������������������������������������������������������������������������75
Conclusion����������������������������������������������������������������������������������������������������������76

Chapter 3: Embedded Systems Overview�������������������������������������������77


An Overview of Embedded Systems�������������������������������������������������������������������77
Microcontroller vs. Application Processor����������������������������������������������������������78
Embedded Systems Structure����������������������������������������������������������������������������79
The Hardware System�����������������������������������������������������������������������������������������82
The Software System������������������������������������������������������������������������������������������83
The Toolchain������������������������������������������������������������������������������������������������������84
Software Testing�������������������������������������������������������������������������������������������������85
Embedded Software Architecture�����������������������������������������������������������������������86
The Driver Layer��������������������������������������������������������������������������������������������������87
Hardware Abstraction Layer (HAL)����������������������������������������������������������������������88
Board Support Package (BSP)�����������������������������������������������������������������������������88
Middleware���������������������������������������������������������������������������������������������������������89
Software Framework������������������������������������������������������������������������������������������90
Code Generator���������������������������������������������������������������������������������������������������92
Platform��������������������������������������������������������������������������������������������������������������92
Embedded Systems Constraints�������������������������������������������������������������������������93
Cost���������������������������������������������������������������������������������������������������������������������93
Performance�������������������������������������������������������������������������������������������������������94
Energy Budget�����������������������������������������������������������������������������������������������������95
Embedded Systems Classification����������������������������������������������������������������������96
Small-Scale Systems������������������������������������������������������������������������������������������96

vii
Table of Contents

Medium-Scale Systems��������������������������������������������������������������������������������������97
High-Performance Systems��������������������������������������������������������������������������������98
Distributed Embedded Systems��������������������������������������������������������������������������99
Seven Steps to Developing an Embedded Product�������������������������������������������100
Step 1: Idea Creation�����������������������������������������������������������������������������������100
Step 2: Requirements Specifications�����������������������������������������������������������100
Step 3: Functional Design����������������������������������������������������������������������������101
Step 4: Rapid Prototyping����������������������������������������������������������������������������101
Step 5: Testing���������������������������������������������������������������������������������������������102
Step 6: Securing Your System���������������������������������������������������������������������103
Step 7: Bringing to Market���������������������������������������������������������������������������104
Conclusion��������������������������������������������������������������������������������������������������������105

Chapter 4: Python Programming������������������������������������������������������107


Writing Python Programs����������������������������������������������������������������������������������107
Whitespace�������������������������������������������������������������������������������������������������������110
Comments���������������������������������������������������������������������������������������������������������110
Variables and Constants�����������������������������������������������������������������������������������111
Data Types���������������������������������������������������������������������������������������������������������114
Operators����������������������������������������������������������������������������������������������������������115
Lists������������������������������������������������������������������������������������������������������������������116
Tuples����������������������������������������������������������������������������������������������������������������116
If Statement������������������������������������������������������������������������������������������������������117
else Statement��������������������������������������������������������������������������������������������������117
elif Statement���������������������������������������������������������������������������������������������������118
short if���������������������������������������������������������������������������������������������������������������118
for Loop�������������������������������������������������������������������������������������������������������������119
while Loop���������������������������������������������������������������������������������������������������������119

viii
Table of Contents

Functions����������������������������������������������������������������������������������������������������������120
Lambda Functions���������������������������������������������������������������������������������������������120
Exception Handling�������������������������������������������������������������������������������������������121
Object-Oriented Programming��������������������������������������������������������������������������121
Random and Time���������������������������������������������������������������������������������������������123
Python vs. CircuitPython�����������������������������������������������������������������������������������124
How Does My Python Program Run?����������������������������������������������������������������124
Conclusion��������������������������������������������������������������������������������������������������������125

Chapter 5: Digital Control�����������������������������������������������������������������127


I/O Pins��������������������������������������������������������������������������������������������������������������127
Output and Input on Microcontroller Hardware������������������������������������������������128
Going Deeper into Microcontroller I/O���������������������������������������������������������������132
Using Output: Lighting an LED��������������������������������������������������������������������������135
LED Control��������������������������������������������������������������������������������������������������136
Building the Circuit��������������������������������������������������������������������������������������136
Lighting an LED with CircuitPython�������������������������������������������������������������139
Blinking an LED�������������������������������������������������������������������������������������������������141
Using Input: Adding a Pushbutton���������������������������������������������������������������������143
Pull-Up vs. Pull-Down Resistors������������������������������������������������������������������143
Switch Debouncing��������������������������������������������������������������������������������������146
Input with MCU Schematic (Pull-Up)�����������������������������������������������������������147
Pushbutton Pull-Up Circuit Connection Tips������������������������������������������������������148
Pushbutton Pull-Up with CircuitPython Program�����������������������������������������150
Input with MCU Schematic (Pull-Down)������������������������������������������������������152
Pushbutton Pull-Down Circuit Connection Tips�������������������������������������������153
Pushbutton Pull-Down with CircuitPython Program������������������������������������155
Conclusion��������������������������������������������������������������������������������������������������������157

ix
Table of Contents

Chapter 6: Data Conversion��������������������������������������������������������������159


Analog to Digital Conversion�����������������������������������������������������������������������������159
ADC Hardware���������������������������������������������������������������������������������������������������161
Going Deeper into ADC��������������������������������������������������������������������������������������163
The Potentiometer���������������������������������������������������������������������������������������������164
Analog to Digital Conversion in CircuitPython���������������������������������������������������169
ADC with MCU Schematic���������������������������������������������������������������������������������169
ADC Circuit Connection Tips������������������������������������������������������������������������������170
CircuitPython with Potentiometer Program�������������������������������������������������������171
Photoresistor�����������������������������������������������������������������������������������������������������173
Photoresistor with MCU Schematic������������������������������������������������������������������174
Photoresistor Circuit Connection Tips���������������������������������������������������������������175
Photoresistor with CircuitPython Program��������������������������������������������������������176
Temperature Sensor������������������������������������������������������������������������������������������178
Temperature Sensor with MCU Schematic�������������������������������������������������������180
Temperature Sensor Circuit Connection Tips����������������������������������������������������181
Temperature Sensor with CircuitPython Program���������������������������������������������182
Conclusion��������������������������������������������������������������������������������������������������������184

Chapter 7: Communication Protocols�����������������������������������������������185


Microcontroller Communications����������������������������������������������������������������������185
USART Communications�����������������������������������������������������������������������������������186
Deeper into UART����������������������������������������������������������������������������������������������189
UART in CircuitPython���������������������������������������������������������������������������������������190
USB-UART with MCU Schematic�����������������������������������������������������������������������190
MCU with USB-UART Circuit Connection Tips���������������������������������������������������191
UART with CircuitPython Program���������������������������������������������������������������������193

x
Table of Contents

SPI Communications�����������������������������������������������������������������������������������������194
Deeper into SPI�������������������������������������������������������������������������������������������������196
SPI Circuit Connection���������������������������������������������������������������������������������������197
SPI with CircuitPython Program������������������������������������������������������������������������197
I2C Communications�����������������������������������������������������������������������������������������199
Deeper into I2C�������������������������������������������������������������������������������������������������200
I2C Support in CircuitPython�����������������������������������������������������������������������������201
The MPU6050����������������������������������������������������������������������������������������������������201
I2C with MCU Schematic�����������������������������������������������������������������������������������202
I2C Circuit Connection Tips�������������������������������������������������������������������������������203
I2C with CircuitPython Program������������������������������������������������������������������������204
Adding Libraries������������������������������������������������������������������������������������������������206
MPU6050 with CircuitPython Program��������������������������������������������������������������206
Conclusion��������������������������������������������������������������������������������������������������������208

Chapter 8: Display Interfacing����������������������������������������������������������209


The Liquid Crystal Display���������������������������������������������������������������������������������209
Using a GLCD����������������������������������������������������������������������������������������������������211
Monochrome GLCD Schematic��������������������������������������������������������������������������213
PCD8544 with CircuitPython�����������������������������������������������������������������������������215
Troubleshooting������������������������������������������������������������������������������������������������218
The Framebuffer�����������������������������������������������������������������������������������������������220
OLED�����������������������������������������������������������������������������������������������������������������222
Using an OLED���������������������������������������������������������������������������������������������������224
MCU with OLED Schematic�������������������������������������������������������������������������������225
CircuitPython with OLED Program���������������������������������������������������������������������227
Conclusion��������������������������������������������������������������������������������������������������������230

xi
Table of Contents

Chapter 9: Controlling DC Actuators�������������������������������������������������231


DC Motors���������������������������������������������������������������������������������������������������������231
Driving DC Motors���������������������������������������������������������������������������������������������232
Pulse Width Modulation������������������������������������������������������������������������������������235
PWM in CircuitPython����������������������������������������������������������������������������������������237
PWM with CircuitPython Program���������������������������������������������������������������������237
Controlling Motor Speed�����������������������������������������������������������������������������������238
The H-Bridge�����������������������������������������������������������������������������������������������������239
H-Bridge with MCU Schematic�������������������������������������������������������������������������242
H-Bridge with CircuitPython Program���������������������������������������������������������������245
Servo Motors�����������������������������������������������������������������������������������������������������247
Servo Motors in CircuitPython��������������������������������������������������������������������������249
Servo Motor with MCU Schematic��������������������������������������������������������������������249
Servo Motor with CircuitPython Program����������������������������������������������������������251
Stepper Motors�������������������������������������������������������������������������������������������������252
Stepper Motors in CircuitPython�����������������������������������������������������������������������256
Stepper Motor with MCU Schematic�����������������������������������������������������������������256
Stepper Motor with CircuitPython Program������������������������������������������������������258
Conclusion��������������������������������������������������������������������������������������������������������261

Chapter 10: Python MCU Interfacing������������������������������������������������263


RGB LED������������������������������������������������������������������������������������������������������������263
RGB LED with MCU Schematic��������������������������������������������������������������������������264
RGB LED Circuit Connection Tips����������������������������������������������������������������������265
Libraries We’ll Need������������������������������������������������������������������������������������������266
RGB LED with CircuitPython Program���������������������������������������������������������������266
HC-SR04������������������������������������������������������������������������������������������������������������268

xii
Table of Contents

HC-SR04 with MCU Schematic�������������������������������������������������������������������������270


HC-SR04 Circuit Connection Tips����������������������������������������������������������������������270
Libraries We’ll Need������������������������������������������������������������������������������������������271
HC-SR04 with CircuitPython Program���������������������������������������������������������������272
Piezo Speaker���������������������������������������������������������������������������������������������������274
Piezo with MCU Schematic�������������������������������������������������������������������������������274
Piezo Circuit Connection Tips����������������������������������������������������������������������������275
Libraries We’ll Need������������������������������������������������������������������������������������������276
Piezo with CircuitPython Program��������������������������������������������������������������������276
DHT11���������������������������������������������������������������������������������������������������������������277
DHT11 with MCU Schematic�����������������������������������������������������������������������������278
DHT11 Sensor Circuit Connection Tips��������������������������������������������������������������279
Libraries We’ll Need������������������������������������������������������������������������������������������280
DHT11 Sensor with CircuitPython Program������������������������������������������������������280
Conclusion��������������������������������������������������������������������������������������������������������283

Index�������������������������������������������������������������������������������������������������285

xiii
About the Author
Armstrong Subero started learning electronics at the age of 8. One of
the happiest memories in his childhood was when he finally figured out
how to make a light bulb. It took off from there as he taught himself more
advanced topics in electronics, before delving into computer architecture,
and eventually discovering the joys of microcontrollers and FPGAs.
He currently works for the Ministry of National Security in his country;
writes software; designs circuits, courses, and robots; writes books; and
blogs about technology on www.trinirobotics.com in his free time.
He is also a contributing author to Free Code Camp and has degrees in
Computer Science and Liberal Arts and Sciences from Thomas Edison
State University. He is the author of Programming PIC Microcontrollers
with XC8 and Codeless Data Structures and Algorithms both published by
Apress Media LLC.

xv
About the Technical Reviewer
Sai Yamanoor is an embedded systems engineer working for an industrial
gases company in Buffalo, NY. His interests, deeply rooted in DIY and
open source hardware, include developing gadgets that aid behavior
modification. He has published two books with his brother, and in his
spare time, he likes to contribute to build things that improve quality of
life. You can find his project portfolio at http://saiyamanoor.com.

xvii
Acknowledgments
I want to thank my family.
I want to thank everyone who ever said anything positive to me or
taught me something. I heard it all, and it meant something.
I want to thank God most of all, because without God I wouldn’t be
able to do any of this.

xix
CHAPTER 1

Getting Ready
You have decided to learn about microcontrollers using Python. While it
would be nice to jump straight into developing cool stuff, there are a few
steps you must take to get ready first. If you have experience with software
development, you may be accustomed to just opening an editor and typing
code right away. However, microcontroller development is a little more
involved than that. After all, you will be writing programs for a separate
computer, so there is a lot more to set up. A microcontroller development
environment consists of not only software but an entire hardware
ecosystem that must be understood to unlock all the magic these devices
have to offer.
In this chapter, we will look at setting up an environment for
development. By the end of the chapter, you will be ready to select a
microcontroller board, and you’ll have the software tools and hardware
devices needed to begin your development with CircuitPython. Let’s get
started!

I ntroduction to Microcontrollers
In our modern world, computers are ubiquitous. They have become
smaller, easier to use, and more integrated into our daily lives. A few years
ago, to connect to the Internet and check your email, you would have
had to sit down at a large desktop device. Today, you can do the same
thing with a computer that fits in the palm of your hand and places all the
information in the world at your fingertips.
© Armstrong Subero 2021 1
A. Subero, Programming Microcontrollers with Python,
https://doi.org/10.1007/978-1-4842-7058-5_1
Chapter 1 Getting Ready

The advancements in technology that brought us smartphones and


tablets have given billions of people access to computers. However, these
handheld devices aren’t the only computers that exist. What if I told you
that the billions of smartphones in use pale when compared to another
kind of computing device that silently surrounds us? In fact, there are
probably a half dozen or more of these devices in the room with you right
now. These miniature computers are called microcontrollers, or MCUs, and
they can be found all around us.
Microcontrollers are small, intelligent, programmable computers that
we use to perform tasks that are repetitive or that require some level of
intelligent control without the need for human interaction. Microcontroller
devices have a fraction of the computing power of a device like your
smartphone or tablet, but they have many, many uses. Any device around
you that reacts to a button press, displays information, or makes sounds
when something is wrong is most likely controlled by a microcontroller.
From calculators to TVs to microwaves and dishwashers, almost every
household device you can think of contains a microcontroller.
If you are familiar with computers, you are sure to have heard of a
central processing unit (CPU) or a microprocessor: the brain behind your
computer. A microprocessor lets a computer perform many functions. One
day you might use your computer to type a document, the next to stream
your favorite movie, and so on. The microprocessor has a lot of supporting
circuitry, including memory and input and output chips, that allows it to
carry out all these tasks. These are usually part of the motherboard that
houses the microprocessor.
A microcontroller takes all the supporting chips that are required to
make a microprocessor work and places them on a single chip. This is
why a microcontroller is called a single-chip computer. A microcontroller
still operates like the microprocessor, but it is designed to only do
a single task and to do it as efficiently as possible. For this reason, a
microcontroller chip contains the minimum amount of processing power
required to do its task.

2
Chapter 1 Getting Ready

Firmware, Memory, and Clock Speed


Like general-purpose computers, microcontrollers work by running
programs. Because microcontrollers perform limited functions, the
programs written for them are not expected to change frequently. For that
reason, programs written for microcontrollers are called firmware. This
firmware is usually stored as a binary file (with a .bin file extension) or a
hex file which is a text-represented binary file (having a .hex file extension);
this file contains the memory content that is written on flash, and thus
it is ready to be run on the microcontroller. A special device called a
programmer loads this binary file into the microcontroller’s memory.
The memory consists of two parts: the main memory (sometimes
called program memory) and the random-access memory (RAM,
sometimes called data memory). The main memory is nonvolatile,
whereas RAM is volatile. This means that when the microcontroller is not
powered, the information contained in RAM will disappear, whereas the
information in the main memory will be retained. For this reason, the
main memory is also called read-only memory (ROM). Its contents are
designed to be mainly read, whereas RAM is designed to have its contents
changed by the user during runtime.
In a general-purpose computer system, usually a program is loaded
into RAM before it is executed. Microcontroller systems are a bit different.
In a microcontroller, the firmware is executed directly from ROM, and
RAM is used to do things such as to store temporary information that
aids in running the firmware (these are usually runtime variables and can
contain a stack or a heap, special memory structures).
Some microcontroller devices can have their ROM contents
programmed into them from the factory and cannot be changed by
the end user once they are put into a device. These are called one-­
time programmable (OTP) devices, and they are cheaper and easier to
manufacture. Usually though, the ROM is made of flash memory, meaning
that it can be programmed and changed after manufacturing.

3
Chapter 1 Getting Ready

Flash memory lets you program a device thousands of times, making


it useful for learning and product prototyping. If errors show up in
your firmware program, flash also allows you to fix errors by means of
an update, a process called patching. Updates usually take the form of
over-the-air (OTA) updates, which change the contents of the ROM via a
wireless connection. OTA updates are common for Internet of Things (IoT)
devices. Alternately, you can connect the device to a computer with a cable
to update the firmware.
A microcontroller executes the instructions in its firmware program
according to the speed of a clock that runs the device. The speed is
measured in hertz, or cycles per second. The faster the clock speed, the
faster the device will execute instructions. Microcontroller clock speeds
typically range from about 1 MHz (though for extremely low-cost, low-­
power applications, the clock speed can run as low as 32.768 kHz to about
and for fast systems up to 1 GHz.)

8-Bit vs. 32-Bit


The devices we will use in this book are quite powerful. They consist of a
32-bit microprocessor core which means that the number of bits of data
that can be processed by the microcontroller is comprised of 32 registers (a
register is a small storage location for data within the microcontroller; we’ll
talk about this more in the next chapter). For a long time, however, 8-bit
devices ruled the microcontroller market.
Historically, 32-bit devices were expensive and hard to program. Due
to advances in technology, the cost of 32-bit devices has been declining
to the point of where they can rival 8-bit devices for all but extremely
cost-sensitive applications. Meanwhile, thanks to the myriad of tools now
available to use with them, 32-bit devices have become amazingly easy
to program and control. While 8-bit microcontrollers are still alive and
relevant, a lot of their market share is being replaced by 32-bit devices.

4
Chapter 1 Getting Ready

For beginners, 32-bit devices are an especially useful learning tool


because they contain more memory and have greater memory addressing
capabilities. This allows for a higher level of abstraction, meaning
it is typically easier to program a 32-bit device without a thorough
understanding of its inner workings. By contrast, since 8-bit devices
have less processing power and memory, you need to have a deeper
understanding of the internals of the device to better manage memory
resources and write effective programs.

Microcontroller Programming Languages


In this section, we will look at some of the languages available for
programming microcontrollers. While there are several options to choose
from, microcontrollers have been mostly resistant to the overcrowded
zoo of programming languages that make up the modern software
development landscape. Historically, the microcontroller world has
been dominated by the C programming language. This is because
microcontrollers have traditionally only had a few bytes of memory and
run at a few tens of megahertz of clock speed, and C is particularly well
suited to working on memory-constrained systems. Nowadays, though,
you can find microcontroller devices that have multiple cores that run up a
gigahertz and possess several megabytes of memory, opening up space for
other languages to be used.

Assembly Language
At one point in time, microcontrollers were programmed exclusively in
assembly language. Today, assembly language is reserved for devices
with limited memory and for situations where the programmer needs to
squeeze every drop of performance out of the microcontroller. Assembly
language is useful in these situations because a lot of assembly instructions

5
Chapter 1 Getting Ready

translate directly into machine instructions on the microcontroller. This


means that there is less overhead in the execution of the instructions,
making code segments written in assembly language faster. While
assembly language is fast, it takes a lot of instructions to perform a simple
task on the device. Another limiting factor of assembly language is that for
each device you are programming, you must learn the assembly language
for that device. Given these limitations, the language has declined in
popularity for all but niche situations.

C
C has long been the language of choice in the embedded world. It was
made to run on memory-constrained devices such as microcontrollers. C
gives us the ability to control the underlying hardware efficiently – one C
instruction translates into several assembly language instructions – and
it can match the speed of assembly language for most applications. Since
C has been used for so long, a lot of the code that is written has been
battle tested and proven to work for the applications they are intended. C
users have access to a large code base with helpful information and code
snippets. However, the language requires a good understanding of the
hardware and is difficult for beginners to break into.

C++
As time progressed and embedded devices became more powerful, some
microcontroller manufacturers and software vendors began adding C++
support to their devices. C++ is slowly gaining traction in the professional
embedded space. In the hobbyist realm, however, C++ finds widespread
use on the Arduino platform. C++ is a large and difficult language to learn,
however. Many of the features that make C++ more effective to use than
C in general-purpose computing applications, sometimes cannot be

6
Chapter 1 Getting Ready

implemented on the resource-constrained microcontroller devices. This is


because while C++ can match the performance of C for most applications,
C++ tends to use more memory, a precious resource that is usually not
bountiful on microcontroller devices. For that reason, C++ is reserved for
the higher-end devices.

BASIC
In the early 2000s, if a beginner was getting started with microcontrollers
and did not fancy assembly, BASIC was the programming language to use.
BASIC stands for Beginners’ All-Purpose Symbolic Instruction Code and
is an easy programming language to use. There would usually be a BASIC
interpreter on the microcontroller chip to run the instructions.
BASIC eventually fell in popularity because the boards that ran it
cost a lot of money relative to what they were capable of. Additionally,
running the BASIC interpreter slowed the chips down and took up too
many resources on the already constrained 8-bit devices. Also, the tools
and software for the most popular BASIC devices were all closed source,
so people could not make their own BASIC devices. When open source
alternatives like the Arduino came around, devices like the BASIC Stamp
thus fell out of favor.

Rust
The Rust programming language is new compared to C (which is almost
half a century old) and is designed to upset the C and C++ hold on systems
programming, including embedded programming. As microcontrollers
become more powerful and factors like concurrency (the ability to carry
out multiple processes at once) start to matter, Rust’s advantages over C
begin to show. Rust is better suited to concurrency because it can handle
a data race, which is when two devices try to access the same location in
memory at the same time.

7
Chapter 1 Getting Ready

While Rust could replace C, there is no reason for the industry to


adopt it anytime soon. Embedded software is called firmware for a reason:
it doesn’t change all that often, and much of the code that has already
been written has no reason to change to a new language. C works and has
a lot of established toolchains and devices, and there are many skilled
developers comfortable with the language. However, there are already
tools available that allow Rust to be used on microcontrollers, and as time
progresses, Rust may gain some share in the embedded market.

Python
Python is a relative newcomer to the embedded space, and it could
become a major player in the field. Python is a lot simpler than C to learn
and is one of the most popular programming languages today. While
BASIC was also easier than C for beginners, Python has several advantages
over BASIC that make it better suited for use as an embedded language.
Notably, while the popular BASIC microcontrollers were closed source,
Python is open source, allowing you to run Python on your custom device
if you desire. Python files can also be compiled to make them smaller,
allowing you to create tight, memory-efficient programs.
Many people say that interpreted languages like Python are not
suited to the limitations of microcontrollers. This may have once been
true, but with today’s more powerful devices, it is entirely possible for
microcontrollers to run interpreted languages without hiccups like the
speed limitations experienced by older BASIC devices. For extremely
time-efficient computing, also called real-time computing, interpreted
languages are still not suitable. However, Python should have no problem
meeting the speed requirements of the majority of microcontroller
projects.

8
Chapter 1 Getting Ready

While Python is not as fast or efficient as C when running on


microcontrollers, its ease of use makes it worthwhile, especially if you are
now getting started with microcontrollers. Additionally, you can extend
Python code with C, which means you can leverage existing C code bases
that have been battle tested and refined over the decades.
The Python interpreter as it exists on general-purpose computers
cannot be directly implemented on a microcontroller with the same
available features. This is because the standard Python interpreter is a
large program that relies on features that would be given by the operating
system, particularly memory and hardware interfacing features, a luxury
nonexistent on microcontroller devices. Two modified forms of the
language interpreter, MicroPython and CircuitPython, bridge the gap
between the standard Python interpreter and the embedded space. Of the
two, MicroPython is targeted more toward professional developers and
precedes CircuitPython. CircuitPython, developed by Adafruit, is simpler
to use, making it an excellent learning tool for beginners as well as a
platform for professionals. The major feature of CircuitPython that makes
it user-friendly is that you do not need to compile a program before it can
run on the microcontroller. As soon as you save a program, it is run and
executed.
CircuitPython promises to be available for more resource-constrained
devices and is expected to remain well supported into the foreseeable
future. For these reasons, we will use it throughout this book.

Selecting a Development Board


To work on the projects in this book, you will need a development board
with a microcontroller that can run CircuitPython. A development board
contains a microcontroller as well as the connections required to power

9
Chapter 1 Getting Ready

the board and get it up and running. A development board allows you to
use, program, and prototype with the microcontroller without worrying
about the hardware setup.
At the time of writing, CircuitPython supports over 140 boards, and the
list keeps growing. You can view the list here on the CircuitPython website:
https://circuitpython.org/downloads. Any one of these compatible
boards will work with this book. You can also choose to create your
own custom device that supports CircuitPython, a process I will discuss
at the end of this chapter. For beginners, however, using a premade,
CircuitPython-­compatible board will always be a better choice. It will
ensure that the hardware is working and allow you to get started more
quickly with writing software for your device.
In this section, we will look at some preconfigured devices that can run
CircuitPython. Though many companies supply microcontroller boards
that are capable of running CircuitPython, Adafruit devices have the best
support since they originated the language and have an entire ecosystem
built around CircuitPython with their development environment.
We’ll look at some of the boards that they have available, along with
some popular boards from other manufacturers that can be used with
CircuitPython. This list is not exhaustive, but the boards presented here
will be compatible with the examples discussed in this book.

Adafruit Metro M0 Express


The first board we will look at is the Adafruit Metro M0 Express, pictured
in Figure 1-1. This board is an ideal choice to be used with the examples
in this book, as it is powered by a SAMD21G18A microcontroller. This
board also has the Arduino form factor; this means that it can be used
with existing Arduino shields. Thus, the powerful Arduino ecosystem
can be used to easily prototype with Arduino shields in Python. The
SAMD21G18A represents the “ideal minimum” that is required to run

10
Chapter 1 Getting Ready

CircuitPython. Its features allow it to run the interpreter without any


hiccups. The SAMD21G18A has a 48 MHz clock, 256KB of flash memory,
and 32KB of RAM. (For comparison, boards powered by the ATmega328
microcontroller, like the Arduino Uno, offered 8 times less flash and 16
times less RAM.) The Metro M0 Express also has 2MB of flash storage that
can be used to store programs and other files. You may be able to run the
CircuitPython interpreter with less memory or less processing power than
the SAMD21G18A offers, but the experience may not be seamless.
The SAMD21G18A microcontroller was one of the first devices to
support CircuitPython, and boards built around this device are usually
among the first to receive the newest versions of the interpreter. In
particular, the Metro M0 Express was the first Adafruit Metro board
designed to use CircuitPython. It is considered the standard board for
running CircuitPython, and it will be able to run the programs in this book
decently.

Figure 1-1. Adafruit Metro M0 Express [Credit: Adafruit,


adafruit.com]

11
Chapter 1 Getting Ready

Adafruit Feather M0 Express


If you want a more minimalist approach to development, you can grab
the Feather M0 Express from Adafruit, shown in Figure 1-2. Because it
is also built around the SAMD21G18A processor, this board has all the
capabilities of the Metro M0 Express: the same 48 MHz clock, 256KB of
flash, and 32KB of RAM. It also has the same onboard 2MB of flash storage.
However, it is more compact than the Metro, and it has 5 fewer I/O pins –
20 rather than 25.
A cool feature of this board that the Metro M0 Express lacks is the little
prototyping area in the front. When you have become acquainted with the
Metro M0 Express and you want a board to embed into your own projects,
then you can use this smaller, cheaper board. There is also the QT Py board
from Adafruit which is even more compact than the M0 Express should
you need an even smaller board for your projects.

Figure 1-2. Adafruit Feather M0 Express [Credit: Adafruit,


adafruit.com]

12
Chapter 1 Getting Ready

Adafruit Metro M4 Express


If you need a little more oomph than the Metro M0 Express offers, then you
can grab the Metro M4 Express, shown in Figure 1-3. The board is powered
by the SAMD51J19 microcontroller, which offers better performance than
the SAMD21G18A-based devices discussed earlier. At 120 MHz, it runs at
more than double the clock speed of the SAMD21G18A-based boards, and
it features 512KB of flash memory, 192KB of RAM, and an additional 2MB
of onboard flash storage.
These enhanced features provide better support for digital signal
processing (DSP) and floating-point processing applications. If you want to
use your board for applications like audio processing, or if you’re looking
for better security capability or general performance improvement, then
this is a good board to use. However, the heightened performance comes
with a trade-off. The Metro M4 Express’s processor will consume more
power than the boards discussed earlier. Depending on your application,
this may not be much of a factor, though, as the board is still power
efficient.

Figure 1-3. Adafruit M4 Metro Express [Credit: Adafruit,


adafruit.com]

13
Other documents randomly have
different content
now seeking further light on the cause of gravitation; we are
interested in seeing what would really be involved in a complete
explanation of anything physical.
Einstein’s law in its analytical form is a statement that in empty
space certain quantities called potentials obey certain lengthy
differential equations. We make a memorandum of the word
“potential” to remind us that we must later on explain what it
means. We might conceive a world in which the potentials at every
moment and every place had quite arbitrary values. The actual world
is not so unlimited, the potentials being restricted to those values
which conform to Einstein’s equations. The next question is, What
are potentials? They can be defined as quantities derived by quite
simple mathematical calculations from certain fundamental
quantities called intervals. (MEM. Explain “interval”.) If we know the
values of the various intervals throughout the world definite rules
can be given for deriving the values of the potentials. What are
intervals? They are relations between pairs of events which can be
measured with a scale or a clock or with both. (MEM. Explain “scale”
and “clock”.) Instructions can be given for the correct use of the
scale and clock so that the interval is given by a prescribed
combination of their readings. What are scales and clocks? A scale is
a graduated strip of matter which.... (MEM. Explain “matter”.) On
second thoughts I will leave the rest of the description as “an
exercise to the reader” since it would take rather a long time to
enumerate all the properties and niceties of behaviour of the
material standard which a physicist would accept as a perfect scale
or a perfect clock. We pass on to the next question, What is matter?
We have dismissed the metaphysical conception of substance. We
might perhaps here describe the atomic and electrical structure of
matter, but that leads to the microscopic aspects of the world,
whereas we are here taking the macroscopic outlook. Confining
ourselves to mechanics, which is the subject in which the law of
gravitation arises, matter may be defined as the embodiment of
three related physical quantities, mass (or energy), momentum and
stress. What are “mass”, “momentum” and “stress”? It is one of the
most far-reaching achievements of Einstein’s theory that it has given
an exact answer to this question. They are rather formidable looking
expressions containing the potentials and their first and second
derivatives with respect to the co-ordinates. What are the potentials?
Why, that is just what I have been explaining to you!
The definitions of physics proceed according to the method
immortalised in “The House that Jack built”: This is the potential,
that was derived from the interval, that was measured by the scale,
that was made from the matter, that embodied the stress, that....
But instead of finishing with Jack, whom of course every youngster
must know without need for an introduction, we make a circuit back
to the beginning of the rhyme: ... that worried the cat, that killed the
rat, that ate the malt, that lay in the house, that was built by the
priest all shaven and shorn, that married the man.... Now we can go
round and round for ever.
But perhaps you have already cut short my explanation of
gravitation. When we reached matter you had had enough of it.
“Please do not explain any more, I happen to know what matter is.”
Very well; matter is something that Mr. X knows. Let us see how it
goes: This is the potential that was derived from the interval that
was measured by the scale that was made from the matter that Mr.
X knows. Next question, What is Mr. X?
Well, it happens that physics is not at all anxious to pursue the
question, What is Mr. X? It is not disposed to admit that its elaborate
structure of a physical universe is “The House that Mr. X built”.
Fig. 8
It looks upon Mr. X—and more particularly the part of Mr. X that
knows—as a rather troublesome tenant who at a late stage of the
world’s history has come to inhabit a structure which inorganic
Nature has by slow evolutionary progress contrived to build. And so
it turns aside from the avenue leading to Mr. X—and beyond—and
closes up its cycle leaving him out in the cold.
From its own point of view physics is entirely justified. That
matter in some indirect way comes within the purview of Mr. X’s
mind is not a fact of any utility for a theoretical scheme of physics.
We cannot embody it in a differential equation. It is ignored; and the
physical properties of matter and other entities are expressed by
their linkages in the cycle. And you can see how by the ingenious
device of the cycle physics secures for itself a self-contained domain
for study with no loose ends projecting into the unknown. All other
physical definitions have the same kind of interlocking. Electric force
is defined as something which causes motion of an electric charge;
an electric charge is something which exerts electric force. So that
an electric charge is something that exerts something that produces
motion of something that exerts something that produces ... ad
infinitum.
But I am not now writing of pure physics, and from a broader
standpoint I do not see how we can leave out Mr. X. The fact that
matter is “knowable to Mr. X” must be set down as one of the
fundamental attributes of matter. I do not say that it is very
distinctive, since other entities of physics are also knowable to him;
but the potentiality of the whole physical world for awaking
impressions in consciousness is an attribute not to be ignored when
we compare the actual world with worlds which, we fancy, might
have been created. There seems to be a prevalent disposition to
minimise the importance of this. The attitude is that “knowableness
to Mr. X” is a negligible attribute, because Mr. X is so clever that he
could know pretty much anything that there was to know. I have
already urged the contrary view—that there is a definitely selective
action of the mind; and since physics treats of what is knowable to
mind[43] its subject-matter has undergone, and indeed retains
evidences of, this process of selection.

Actuality. “Knowableness to mind” is moreover a property which


differentiates the actual world of our experience from imaginary
worlds in which the same general laws of Nature are supposed to
hold true. Consider a world—Utopia, let us say—governed by all the
laws of Nature known and unknown which govern our own world,
but containing better stars, planets, cities, animals, etc.—a world
which might exist, but it just happens that it doesn’t. How can the
physicist test that Utopia is not the actual world? We refer to a piece
of matter in it; it is not real matter but it attracts any other piece of
(unreal) matter in Utopia according to the law of gravitation. Scales
and clocks constructed of this unreal matter will measure wrong
intervals, but the physicist cannot detect that they are wrong unless
he has first shown the unreality of the matter. As soon as any
element in it has been shown to be unreal Utopia collapses; but so
long as we keep to the cycles of physics we can never find the
vulnerable point, for each element is correctly linked to the rest of
the cycle, all our laws of Nature expressed by the cycle being obeyed
in Utopia by hypothesis. The unreal stars emit unreal light which falls
on unreal retinas and ultimately reaches unreal brains. The next step
takes it outside the cycle and gives the opportunity of exposing "the
whole deception. Is the brain disturbance translated into
consciousness? That will test whether the brain is real or unreal.
There is no question about consciousness being real or not;
consciousness is self-knowing and the epithet real adds nothing to
that. Of the infinite number of worlds which are examples of what
might be possible under the laws of Nature, there is one which does
something more than fulfil those laws of Nature. This property,
which is evidently not definable with respect to any of the laws of
Nature, we describe as “actuality”—generally using the word as a
kind of halo of indefinite import. We have seen that the trend of
modern physics is to reject these indefinite attributions and to define
its terms according to the way in which we recognise the properties
when confronted by them. We recognise the actuality of a particular
world because it is that world alone with which consciousness
interacts. However much the theoretical physicist may dislike a
reference to consciousness, the experimental physicist uses freely
this touchstone of actuality. He would perhaps prefer to believe that
his instruments and observations are certified as actual by his
material sense organs; but the final guarantor is the mind that
comes to know the indications of the material organs. Each of us is
armed with this touchstone of actuality; by applying it we decide
that this sorry world of ours is actual and Utopia is a dream. As our
individual consciousnesses are different, so our touchstones are
different; but fortunately they all agree in their indication of actuality
—or at any rate those which agree are in sufficient majority to shut
the others up in lunatic asylums.
It is natural that theoretical physics in its formulation of a general
scheme of law should leave out of account actuality and the
guarantor of actuality. For it is just this omission which makes the
difference between a law of Nature and a particular sequence of
events. That which is possible (or not “too improbable”) is the
domain of natural science; that which is actual is the domain of
natural history. We need scarcely add that the contemplation in
natural science of a wider domain than the actual leads to a far
better understanding of the actual.
From a broader point of view than that of elaborating the
physical scheme of law we cannot treat the connection with mind as
merely an incident in a self-existent inorganic world. In saying that
the differentiation of the actual from the non-actual is only
expressible by reference to mind I do not mean to imply that a
universe without conscious mind would have no more status than
Utopia. But its property of actuality would be indefinable since the
one approach to a definition is cut off. The actuality of Nature is like
the beauty of Nature. We can scarcely describe the beauty of a
landscape as non-existent when there is no conscious being to
witness it; but it is through consciousness that we can attribute a
meaning to it. And so it is with the actuality of the world. If actuality
means “known to mind” then it is a purely subjective character of
the world; to make it objective we must substitute “knowable to
mind”. The less stress we lay on the accident of parts of the world
being known at the present era to particular minds, the more stress
we must lay on the potentiality of being known to mind as a
fundamental objective property of matter, giving it the status of
actuality whether individual consciousness is taking note of it or not.
In the diagram Mr. X has been linked to the cycle at a particular
point in deference to his supposed claim that he knows matter; but a
little reflection will show that the point of contact of mind with the
physical universe is not very definite. Mr. X knows a table; but the
point of contact with his mind is not in the material of the table.
Light waves are propagated from the table to the eye; chemical
changes occur in the retina; propagation of some kind occurs in the
optic nerves; atomic changes follow in the brain. Just where the final
leap into consciousness occurs is not clear. We do not know the last
stage of the message in the physical world before it became a
sensation in consciousness. This makes no difference. The physical
entities have a cyclic connection, and whatever intrinsic nature we
attribute to one of them runs as a background through the whole
cycle. It is not a question whether matter or electricity or potential is
the direct stimulus to the mind; in their physical aspects these are
equally represented as pointer readings or schedules of pointer
readings. According to our discussion of world building they are the
measures of structure arising from the comparability of certain
aspects of the basal relations—measures which by no means
exhaust the significance of those relations. I do not believe that the
activity of matter at a certain point of the brain stimulates an activity
of mind; my view is that in the activity of matter there is a metrical
description of certain aspects of the activity of mind. The activity of
the matter is our way of recognising a combination of the measures
of structure; the activity of the mind is our insight into the complex
of relations whose comparability gives the foundation of those
measures.

“What is Mr. X?” In the light of these considerations let us now see
what we can make of the question, What is Mr. X? I must undertake
the inquiry single-handed; I cannot avail myself of your collaboration
without first answering or assuming an answer to the equally
difficult question, What are you? Accordingly the whole inquiry must
take place in the domain of my own consciousness. I find there
certain data purporting to relate to this unknown X; and I can (by
using powers which respond to my volition) extend the data, i.e. I
can perform experiments on X. For example I can make a chemical
analysis. The immediate result of these experiments is the
occurrence of certain visual or olfactory sensations in my
consciousness. Clearly it is a long stride from these sensations to any
rational inference about Mr. X. For example, I learn that Mr. X has
carbon in his brain, but the immediate knowledge was of something
(not carbon) in my own mind. The reason why I, on becoming aware
of something in my mind, can proceed to assert knowledge of
something elsewhere, is because there is a systematic scheme of
inference which can be traced from the one item of knowledge to
the other. Leaving aside instinctive or commonsense inference—the
crude precursor of scientific inference—the inference follows a
linkage, which can only be described symbolically, extending from
the point in the symbolic world where I locate myself to the point
where I locate Mr. X.
One feature of this inference is that I never discover what carbon
really is. It remains a symbol. There is carbon in my own brain-mind;
but the self-knowledge of my mind does not reveal this to me. I can
only know that the symbol for carbon must be placed there by
following a route of inference through the external world similar to
that used in discovering it in Mr. X; and however closely associated
this carbon may be with my thinking powers, it is as a symbol
divorced from any thinking capacity that I learn of its existence.
Carbon is a symbol definable only in terms of the other symbols
belonging to the cyclic scheme of physics. What I have discovered is
that, in order that the symbols describing the physical world may
conform to the mathematical formulae which they are designed to
obey, it is necessary to place the symbol for carbon (amongst
others) in the locality of Mr. X. By similar means I can make an
exhaustive physical examination of Mr. X and discover the whole
array of symbols to be assigned to his locality.
Will this array of symbols give me the whole of Mr. X? There is
not the least reason to think so. The voice that comes to us over the
telephone wire is not the whole of what is at the end of the wire.
The scientific linkage is like the telephone wire; it can transmit just
what it is constructed to transmit and no more.
It will be seen that the line of communication has two aspects. It
is a chain of inference stretching from the symbols immediately
associated with the sensations in my mind to the symbols descriptive
of Mr. X; and it is a chain of stimuli in the external world starting
from Mr. X and reaching my brain. Ideally the steps of the inference
exactly reverse the steps of the physical transmission which brought
the information. (Naturally we make many short cuts in inference by
applying accumulated experience and knowledge.) Commonly we
think of it only in its second aspect as a physical transmission; but
because it is also a line of inference it is subject to limitations which
we should not necessarily expect a physical transmission to conform
to.
The system of inference employed in physical investigation
reduces to mathematical equations governing the symbols, and so
long as we adhere to this procedure we are limited to symbols of
arithmetical character appropriate to such mathematical equations.
[44] Thus there is no opportunity for acquiring by any physical
investigation a knowledge of Mr. X other than that which can be
expressed in numerical form so as to be passed through a
succession of mathematical equations.
Mathematics is the model of exact inference; and in physics we
have endeavoured to replace all cruder inference by this rigorous
type. Where we cannot complete the mathematical chain we confess
that we are wandering in the dark and are unable to assert real
knowledge. Small wonder then that physical science should have
evolved a conception of the world consisting of entities rigorously
bound to one another by mathematical equations forming a
deterministic scheme. This knowledge has all been inferred and it
was bound therefore to conform to the system of inference that was
used. The determinism of the physical laws simply reflects the
determinism of the method of inference. This soulless nature of the
scientific world need not worry those who are persuaded that the
main significances of our environment are of a more spiritual
character. Anyone who studied the method of inference employed by
the physicist could predict the general characteristics of the world
that he must necessarily find. What he could not have predicted is
the great success of the method—the submission of so large a
proportion of natural phenomena to be brought into the prejudged
scheme. But making all allowance for future progress in developing
the scheme, it seems to be flying in the face of obvious facts to
pretend that it is all comprehensive. Mr. X is one of the recalcitrants.
When sound-waves impinge on his ear he moves, not in accordance
with a mathematical equation involving the physical measure
numbers of the waves, but in accordance with the meaning that
those sound-waves are used to convey. To know what there is about
Mr. X which makes him behave in this strange way, we must look not
to a physical system of inference, but to that insight beneath the
symbols which in our own minds we possess. It is by this insight that
we can finally reach an answer to our question, What is Mr. X?
[41] A good illustration of such substitution is afforded by
astronomical observations of a certain double star with two
components of equal brightness. After an intermission of
observation the two components were inadvertently interchanged,
and the substitution was not detected until the increasing
discrepancy between the actual and predicted orbits was inquired
into.
[42] For example, we should most of us assume (hypothetically)
that the dynamical quality of the world referred to in chapter V is
characteristic of the whole background. Apparently it is not to be
found in the pointer readings, and our only insight into it is in the
feeling of “becoming” in our consciousness. “Becoming” like
“reasoning” is known to us only through its occurrence in our own
minds; but whereas it would be absurd to suppose that the latter
extends to inorganic aggregations of atoms, the former may be
(and commonly is) extended to the inorganic world, so that it is
not a matter of indifference whether the progress of the inorganic
world is viewed from past to future or from future to past.
[43] This is obviously true of all experimental physics, and must
be true of theoretical physics if it is (as it professes to be) based
on experiment.
[44] The solitary exception is, I believe, Dirac’s generalisation
which introduces -numbers (p. 210). There is as yet no approach
to a general system of inference on a non-numerical basis.
Chapter XIII
REALITY
The Real and the Concrete. One of our ancestors, taking arboreal
exercise in the forest, failed to reach the bough intended and his
hand closed on nothingness. The accident might well occasion
philosophical reflections on the distinctions of substance and void—
to say nothing of the phenomenon of gravity. However that may be,
his descendants down to this day have come to be endowed with an
immense respect for substance arising we know not how or why. So
far as familiar experience is concerned, substance occupies the
centre of the stage, rigged out with the attributes of form, colour,
hardness, etc., which appeal to our several senses. Behind it is a
subordinate background of space and time permeated by forces and
unconcrete agencies to minister to the star performer.
Our conception of substance is only vivid so long as we do not
face it. It begins to fade when we analyse it. We may dismiss many
of its supposed attributes which are evidently projections of our
sense-impressions outwards into the external world. Thus the colour
which is so vivid to us is in our minds and cannot be embodied in a
legitimate conception of the substantial object itself. But in any case
colour is no part of the essential nature of substance. Its supposed
nature is that which we try to call to mind by the word “concrete”,
which is perhaps an outward projection of our sense of touch. When
I try to abstract from the bough everything but its substance or
concreteness and concentrate on an effort to apprehend this, all
ideas elude me; but the effort brings with it an instinctive tightening
of the fingers—from which perhaps I might infer that my conception
of substance is not very different from my arboreal ancestor’s.
So strongly has substance held the place of leading actor on the
stage of experience that in common usage concrete and real are
almost synonymous. Ask any man who is not a philosopher or a
mystic to name something typically real; he is almost sure to choose
a concrete thing. Put the question to him whether Time is real; he
will probably decide with some hesitation that it must be classed as
real, but he has an inner feeling that the question is in some way
inappropriate and that he is being cross-examined unfairly.
In the scientific world the conception of substance is wholly
lacking, and that which most nearly replaces it, viz. electric charge,
is not exalted as star-performer above the other entities of physics.
For this reason the scientific world often shocks us by its appearance
of unreality. It offers nothing to satisfy our demand for the concrete.
How should it, when we cannot formulate that demand? I tried to
formulate it; but nothing resulted save a tightening of the fingers.
Science does not overlook the provision for tactual and muscular
sensation. In leading us away from the concrete, science is
reminding us that our contact with the real is more varied than was
apparent to the ape-mind, to whom the bough which supported him
typified the beginning and end of reality.
It is not solely the scientific world that will now occupy our
attention. In accordance with the last chapter we are taking a larger
view in which the cyclical schemes of physics are embraced with
much besides. But before venturing on this more risky ground I have
to emphasise one conclusion which is definitely scientific. The
modern scientific theories have broken away from the common
standpoint which identifies the real with the concrete. I think we
might go so far as to say that time is more typical of physical reality
than matter, because it is freer from those metaphysical associations
which physics disallows. It would not be fair, being given an inch, to
take an ell, and say that having gone so far physics may as well
admit at once that reality is spiritual. We must go more warily. But in
approaching such questions we are no longer tempted to take up
the attitude that everything which lacks concreteness is thereby self-
condemned.
The cleavage between the scientific and the extra-scientific
domain of experience is, I believe, not a cleavage between the
concrete and the transcendental but between the metrical and the
non-metrical. I am at one with the materialist in feeling a
repugnance towards any kind of pseudo-science of the extra-
scientific territory. Science is not to be condemned as narrow
because it refuses to deal with elements of experience which are
unadapted to its own highly organised method; nor can it be blamed
for looking superciliously on the comparative disorganisation of our
knowledge and methods of reasoning about the non-metrical part of
experience. But I think we have not been guilty of pseudo-science in
our attempt to show in the last two chapters how it comes about
that within the whole domain of experience a selected portion is
capable of that exact metrical representation which is requisite for
development by the scientific method.

Mind-Stuff. I will try to be as definite as I can as to the glimpse of


reality which we seem to have reached. Only I am well aware that in
committing myself to details I shall probably blunder. Even if the
right view has here been taken of the philosophical trend of modern
science, it is premature to suggest a cut-and-dried scheme of the
nature of things. If the criticism is made that certain aspects are
touched on which come more within the province of the expert
psychologist, I must admit its pertinence. The recent tendencies of
science do, I believe, take us to an eminence from which we can
look down into the deep waters of philosophy; and if I rashly plunge
into them, it is not because I have confidence in my powers of
swimming, but to try to show that the water is really deep.
To put the conclusion crudely—the stuff of the world is mind-
stuff. As is often the way with crude statements, I shall have to
explain that by “mind” I do not here exactly mean mind and by
“stuff” I do not at all mean stuff. Still this is about as near as we can
get to the idea in a simple phrase. The mind-stuff of the world is, of
course, something more general than our individual conscious
minds; but we may think of its nature as not altogether foreign to
the feelings in our consciousness. The realistic matter and fields of
force of former physical theory are altogether irrelevant—except in
so far as the mind-stuff has itself spun these imaginings. The
symbolic matter and fields of force of present-day theory are more
relevant, but they bear to it the same relation that the bursar’s
accounts bear to the activity of the college. Having granted this, the
mental activity of the part of the world constituting ourselves
occasions no surprise; it is known to us by direct self-knowledge,
and we do not explain it away as something other than we know it
to be—or, rather, it knows itself to be. It is the physical aspects of
the world that we have to explain, presumably by some such
method as that set forth in our discussion on world-building. Our
bodies are more mysterious than our minds—at least they would be,
only that we can set the mystery on one side by the device of the
cyclic scheme of physics, which enables us to study their
phenomenal behaviour without ever coming to grips with the
underlying mystery.
The mind-stuff is not spread in space and time; these are part of
the cyclic scheme ultimately derived out of it. But we must presume
that in some other way or aspect it can be differentiated into parts.
Only here and there does it rise to the level of consciousness, but
from such islands proceeds all knowledge. Besides the direct
knowledge contained in each self-knowing unit, there is inferential
knowledge. The latter includes our knowledge of the physical world.
It is necessary to keep reminding ourselves that all knowledge of our
environment from which the world of physics is constructed, has
entered in the form of messages transmitted along the nerves to the
seat of consciousness. Obviously the messages travel in code. When
messages relating to a table are travelling in the nerves, the nerve-
disturbance does not in the least resemble either the external table
that originates the mental impression or the conception of the table
that arises in consciousness.[45] In the central clearing station the
incoming messages are sorted and decoded, partly by instinctive
image-building inherited from the experience of our ancestors, partly
by scientific comparison and reasoning. By this very indirect and
hypothetical inference all our supposed acquaintance with and our
theories of a world outside us have been built up. We are acquainted
with an external world because its fibres run into our consciousness;
it is only our own ends of the fibres that we actually know; from
those ends we more or less successfully reconstruct the rest, as a
palaeontologist reconstructs an extinct monster from its footprint.
The mind-stuff is the aggregation of relations and relata which
form the building material for the physical world. Our account of the
building process shows, however, that much that is implied in the
relations is dropped as unserviceable for the required building. Our
view is practically that urged in 1875 by W. K. Clifford—
“The succession of feelings which constitutes a man’s
consciousness is the reality which produces in our minds the
perception of the motions of his brain.”
That is to say, that which the man himself knows as a succession
of feelings is the reality which when probed by the appliances of an
outside investigator affects their readings in such a way that it is
identified as a configuration of brain-matter. Again Bertrand Russell
writes—[46]
What the physiologist sees when he examines a brain
is in the physiologist, not in the brain he is examining.
What is in the brain by the time the physiologist examines
it if it is dead, I do not profess to know; but while its
owner was alive, part, at least, of the contents of his brain
consisted of his percepts, thoughts, and feelings. Since his
brain also consisted of electrons, we are compelled to
conclude that an electron is a grouping of events, and that
if the electron is in a human brain, some of the events
composing it are likely to be some of the “mental states”
of the man to whom the brain belongs. Or, at any rate,
they are likely to be parts of such “mental states”—for it
must not be assumed that part of a mental state must be
a mental state. I do not wish to discuss what is meant by
a “mental state”; the main point for us is that the term
must include percepts. Thus a percept is an event or a
group of events, each of which belongs to one or more of
the groups constituting the electrons in the brain. This, I
think, is the most concrete statement that can be made
about electrons; everything else that can be said is more
or less abstract and mathematical.
I quote this partly for the sake of the remark that it must not be
assumed that part of a mental state must necessarily be a mental
state. We can no doubt analyse the content of consciousness during
a short interval of time into more or less elementary constituent
feelings; but it is not suggested that this psychological analysis will
reveal the elements out of whose measure-numbers the atoms or
electrons are built. The brain-matter is a partial aspect of the whole
mental state; but the analysis of the brain-matter by physical
investigation does not run at all parallel with the analysis of the
mental state by psychological investigation. I assume that Russell
meant to warn us that, in speaking of part of a mental state, he was
not limiting himself to parts that would be recognised as such
psychologically, and he was admitting a more abstract kind of
dissection.
This might give rise to some difficulty if we were postulating
complete identity of mind-stuff with consciousness. But we know
that in the mind there are memories not in consciousness at the
moment but capable of being summoned into consciousness. We are
vaguely aware that things we cannot recall are lying somewhere
about and may come into the mind at any moment. Consciousness is
not sharply defined, but fades into subconsciousness; and beyond
that we must postulate something indefinite but yet continuous with
our mental nature. This I take to be the world-stuff. We liken it to
our conscious feelings because, now that we are convinced of the
formal and symbolic character of the entities of physics, there is
nothing else to liken it to.
It is sometimes urged that the basal stuff of the world should be
called “neutral stuff” rather than “mind-stuff”, since it is to be such
that both mind and matter originate from it. If this is intended to
emphasise that only limited islands of it constitute actual minds, and
that even in these islands that which is known mentally is not
equivalent to a complete inventory of all that may be there, I agree.
In fact I should suppose that the self-knowledge of consciousness is
mainly or wholly a knowledge which eludes the inventory method of
description. The term “mind-stuff” might well be amended; but
neutral stuff seems to be the wrong kind of amendment. It implies
that we have two avenues of approach to an understanding of its
nature. We have only one approach, namely, through our direct
knowledge of mind. The supposed approach through the physical
world leads only into the cycle of physics, where we run round and
round like a kitten chasing its tail and never reach the world-stuff at
all.
I assume that we have left the illusion of substance so far behind
that the word “stuff” will not cause any misapprehension. I certainly
do not intend to materialise or substantialise mind. Mind is—but you
know what mind is like, so why should I say more about its nature?
The word “stuff” has reference to the function it has to perform as a
basis of world-building and does not imply any modified view of its
nature.
It is difficult for the matter-of-fact physicist to accept the view
that the substratum of everything is of mental character. But no one
can deny that mind is the first and most direct thing in our
experience, and all else is remote inference—inference either
intuitive or deliberate. Probably it would never have occurred to us
(as a serious hypothesis) that the world could be based on anything
else, had we not been under the impression that there was a rival
stuff with a more comfortable kind of “concrete” reality—something
too inert and stupid to be capable of forging an illusion. The rival
turns out to be a schedule of pointer readings; and though a world
of symbolic character can well be constructed from it, this is a mere
shelving of the inquiry into the nature of the world of experience.
This view of the relation of the material to the spiritual world
perhaps relieves to some extent a tension between science and
religion. Physical science has seemed to occupy a domain of reality
which is self-sufficient, pursuing its course independently of and
indifferent to that which a voice within us asserts to be a higher
reality. We are jealous of such independence. We are uneasy that
there should be an apparently self-contained world in which God
becomes an unnecessary hypothesis. We acknowledge that the ways
of God are inscrutable; but is there not still in the religious mind
something of that feeling of the prophets of old, who called on God
to assert his kingship and by sign or miracle proclaim that the forces
of Nature are subject to his command? And yet if the scientist were
to repent and admit that it was necessary to include among the
agents controlling the stars and the electrons an omnipresent spirit
to whom we trace the sacred things of consciousness, would there
not be even graver apprehension? We should suspect an intention to
reduce God to a system of differential equations, like the other
agents which at various times have been introduced to restore order
in the physical scheme. That fiasco at any rate is avoided. For the
sphere of the differential equations of physics is the metrical cyclic
scheme extracted out of the broader reality. However much the
ramifications of the cycles may be extended by further scientific
discovery, they cannot from their very nature trench on the
background in which they have their being—their actuality. It is in
this background that our own mental consciousness lies; and here, if
anywhere, we may find a Power greater than but akin to
consciousness. It is not possible for the controlling laws of the
spiritual substratum, which in so far as it is known to us in
consciousness is essentially non-metrical, to be analogous to the
differential and other mathematical equations of physics which are
meaningless unless they are fed with metrical quantities. So that the
crudest anthropomorphic image of a spiritual deity can scarcely be
so wide of the truth as one conceived in terms of metrical equations.
The Definition of Reality. It is time we came to grips with the loose
terms Reality and Existence, which we have been using without any
inquiry into what they are meant to convey. I am afraid of this word
Reality, not connoting an ordinarily definable characteristic of the
things it is applied to but used as though it were some kind of
celestial halo. I very much doubt if any one of us has the faintest
idea of what is meant by the reality or existence of anything but our
own Egos. That is a bold statement, which I must guard against
misinterpretation. It is, of course, possible to obtain consistent use
of the word “reality” by adopting a conventional definition. My own
practice would probably be covered by the definition that a thing
may be said to be real if it is the goal of a type of inquiry to which I
personally attach importance. But if I insist on no more than this I
am whittling down the significance that is generally assumed. In
physics we can give a cold scientific definition of reality which is free
from all sentimental mystification. But this is not quite fair play,
because the word “reality” is generally used with the intention of
evoking sentiment. It is a grand word for a peroration. “The right
honourable speaker went on to declare that the concord and amity
for which he had unceasingly striven had now become a reality (loud
cheers).” The conception which it is so troublesome to apprehend is
not “reality” but “reality (loud cheers)”.
Let us first examine the definition according to the purely
scientific usage of the word, although it will not take us far enough.
The only subject presented to me for study is the content of my
consciousness. You are able to communicate to me part of the
content of your consciousness which thereby becomes accessible in
my own. For reasons which are generally admitted, though I should
not like to have to prove that they are conclusive, I grant your
consciousness equal status with my own; and I use this second-hand
part of my consciousness to “put myself in your place”. Accordingly
my subject of study becomes differentiated into the contents of
many consciousnesses, each content constituting a view-point.
There then arises the problem of combining the view-points, and it is
through this that the external world of physics arises. Much that is in
any one consciousness is individual, much is apparently alterable by
volition; but there is a stable element which is common to other
consciousnesses. That common element we desire to study, to
describe as fully and accurately as possible, and to discover the laws
by which it combines now with one view-point, now with another.
This common element cannot be placed in one man’s consciousness
rather than in another’s; it must be in neutral ground—an external
world.
It is true that I have a strong impression of an external world
apart from any communication with other conscious beings. But
apart from such communication I should have no reason to trust the
impression. Most of our common impressions of substance, world-
wide instants, and so on, have turned out to be illusory, and the
externality of the world might be equally untrustworthy. The
impression of externality is equally strong in the world that comes to
me in dreams; the dreamworld is less rational, but that might be
used as an argument in favour of its externality as showing its
dissociation from the internal faculty of reason. So long as we have
to deal with one consciousness alone, the hypothesis that there is an
external world responsible for part of what appears in it is an idle
one. All that can be asserted of this external world is a mere
duplication of the knowledge that can be much more confidently
asserted of the world appearing in the consciousness. The
hypothesis only becomes useful when it is the means of bringing
together the worlds of many consciousnesses occupying different
view-points.
The external world of physics is thus a symposium of the worlds
presented to different view-points. There is general agreement as to
the principles on which the symposium should be formed.
Statements made about this external world, if they are
unambiguous, must be either true or false. This has often been
denied by philosophers. It is quite commonly said that scientific
theories about the world are neither true nor false but merely
convenient or inconvenient. A favourite phrase is that the gauge of
value of a scientific theory is that it economises thought. Certainly a
simple statement is preferable to a circumlocutory one; and as
regards any current scientific theory, it is much easier to show that it
is convenient or that it economises thought than that it is true. But
whatever lower standards we may apply in practice we need not
give up our ideals; and so long as there is a distinction between true
and false theories our aim must be to eliminate the false. For my
part I hold that the continual advance of science is not a mere
utilitarian progress; it is progress towards ever purer truth. Only let
it be understood that the truth we seek in science is the truth about
an external world propounded as the theme of study, and is not
bound up with any opinion as to the status of that world—whether
or not it wears the halo of reality, whether or not it is deserving of
“loud cheers”.
Assuming that the symposium has been correctly carried out, the
external world and all that appears in it are called real without
further ado. When we (scientists) assert of anything in the external
world that it is real and that it exists, we are expressing our belief
that the rules of the symposium have been correctly applied—that it
is not a false concept introduced by an error in the process of
synthesis, or a hallucination belonging to only one individual
consciousness, or an incomplete representation which embraces
certain view-points but conflicts with others. We refuse to
contemplate the awful contingency that the external world, after all
our care in arriving at it, might be disqualified by failing to exist;
because we have no idea what the supposed qualification would
consist in, nor in what way the prestige of the world would be
enhanced if it passed the implied test. The external world is the
world that confronts that experience which we have in common, and
for us no other world could fill the same rôle, no matter how high
honours it might take in the qualifying examination.
This domestic definition of existence for scientific purposes
follows the principle now adopted for all other definitions in science,
namely, that a thing must be defined according to the way in which
it is in practice recognised and not according to some ulterior
significance that we imagine it to possess. Just as matter must shed
its conception of substantiality, so existence must shed its halo,
before we can admit it into physical science. But clearly if we are to
assert or to question the existence of anything not comprised in the
external world of physics, we must look beyond the physical
definition. The mere questioning of the reality of the physical world
implies some higher censorship than the scientific method itself can
supply.
The external world of physics has been formulated as an answer
to a particular problem encountered in human experience. Officially
the scientist regards it as a problem which he just happened across,
as he might take up a cross-word problem encountered in a news-
paper. His sole business is to see that the problem is correctly
solved. But questions may be raised about a problem which play no
part and need not be considered in connection with the solving of
the problem. The extraneous question naturally raised about the
problem of the external world is whether there is some higher
justification for embarking on this world-solving competition rather
than on other problems which our experience might suggest to us.
Just what kind of justification the scientist would claim for his quest
is not very clear, because it is not within the province of science to
formulate such a claim. But certainly he makes claims which do not
rest on the aesthetic perfection of the solution or on material
benefits derived from scientific research. He would not allow his
subject to be shoved aside in a symposium on truth. We can scarcely
say anything more definite than that science claims a “halo” for its
world.
If we are to find for the atoms and electrons of the external
world not merely a conventional reality but “reality (loud cheers)” we
must look not to the end but to the beginning of the quest. It is at
the beginning that we must find that sanction which raises these
entities above the mere products of an arbitrary mental exercise.
This involves some kind of assessment of the impulse which sets us
forth on the voyage of discovery. How can we make such
assessment? Not by any reasoning that I know of. Reasoning would
only tell us that the impulse might be judged by the success of the
adventure—whether it leads in the end to things which really exist
and wear the halo in their own right; it takes us to and fro like a
shuttle along the chain of inference in vain search for the elusive
halo. But, legitimately or not, the mind is confident that it can
distinguish certain quests as sanctioned by indisputable authority.
We may put it in different ways the impulse to this quest is part of
our very nature; it is the expression of a purpose which has
possession of us. Is this precisely what we meant when we sought
to affirm the reality of the external world? It goes some way towards
giving it a meaning but is scarcely the full equivalent. I doubt if we
really satisfy the conceptions behind that demand unless we make
the bolder hypothesis that the quest and all that is reached by it are
of worth in the eyes of an Absolute Valuer.
Whatever justification at the source we accept to vindicate the
reality of the external world, it can scarcely fail to admit on the same
footing much that is outside physical science. Although no long
chains of regularised inference depend from them we recognise that
other fibres of our being extend in directions away from sense-
impressions. I am not greatly concerned to borrow words like
“existence” and “reality” to crown these other departments of the
soul’s interest. I would rather put it that any raising of the question
of reality in its transcendental sense (whether the question
emanates from the world of physics or not) leads us to a perspective
from which we see man not as a bundle of sensory impressions, but
conscious of purpose and responsibilities to which the external world
is subordinate.
From this perspective we recognise a spiritual world alongside
the physical world. Experience—that is to say, the self cum
environment—comprises more than can be embraced in the physical
world, restricted as it is to a complex of metrical symbols. The
physical world is, we have seen, the answer to one definite and
urgent problem arising in a survey of experience; and no other
problem has been followed up with anything like the same precision
and elaboration. Progress towards an understanding of the non-
sensory constituents of our nature is not likely to follow similar lines,
and indeed is not animated by the same aims. If it is felt that this
difference is so wide that the phrase spiritual world is a misleading
analogy, I will not insist on the term. All I would claim is that those
who in the search for truth start from consciousness as a seat of
self-knowledge with interests and responsibilities not confined to the
material plane, are just as much facing the hard facts of experience
as those who start from consciousness as a device for reading the
indications of spectroscopes and micrometers.

Physical Illustrations. If the reader is unconvinced that there can be


anything indefinite in the question whether a thing exists or not, let
him glance at the following problem. Consider a distribution of
matter in Einstein’s spherical “finite but unbounded” space. Suppose
that the matter is so arranged that every particle has an exactly
similar particle at its antipodes. (There is some reason to believe
that the matter would necessarily have this arrangement in
consequence of the law of gravitation; but this is not certain.) Each
group of particles will therefore be exactly like the antipodal group
not only in its structure and configuration but in its entire
surroundings; the two groups will in fact be indistinguishable by any
possible experimental test. Starting on a journey round the spherical
world we come across a group , and then after going half round
we come to an exactly similar group indistinguishable by any
test; another half circle again brings us to an exactly similar group,
which, however, we decide is the original group . Now let us
ponder a little. We realise that in any case by going on far enough
we come back to the same group. Why do we not accept the
obvious conclusion that this happened when we reached ;
everything was exactly as though we had reached the starting-point
again? We have encountered a succession of precisely similar
phenomena but for some arbitrary reason have decided that only the
alternate ones are really the same. There is no difficulty in
identifying all of them; in that case the space is “elliptical” instead of
“spherical”. But which is the real truth? Disregard the fact that I
introduced and to you as though they were not the same
particles, because that begs the question; imagine that you have
actually had this adventure in a world you had not been told about.
You cannot find out the answer. Can you conceive what the question
means? I cannot. All that turns on the answer is whether we shall
provide two separate haloes for and or whether one will
suffice.
Descriptions of the phenomena of atomic physics have an
extraordinary vividness. We see the atoms with their girdles of
circulating electrons darting hither and thither, colliding and
rebounding. Free electrons torn from the girdles hurry away a
hundred times faster, curving sharply round the atoms with side slips
and hairbreadth escapes. The truants are caught and attached to
the girdles and the escaping energy shakes the aether into vibration.
X-rays impinge on the atoms and toss the electrons into higher
orbits. We see these electrons falling back again, sometimes by
steps, sometimes with a rush, caught in a cul-de-sac of
metastability, hesitating before “forbidden passages”. Behind it all
the quantum regulates each change with mathematical precision.
This is the sort of picture that appeals to our understanding—no
insubstantial pageant to fade like a dream.
The spectacle is so fascinating that we have perhaps forgotten
that there was a time when we wanted to be told what an electron
is. The question was never answered. No familiar conceptions can be
woven round the electron; it belongs to the waiting list. Similarly the
description of the processes must be taken with a grain of salt. The
tossing up of the electron is a conventional way of depicting a
particular change of state of the atom which cannot really be
associated with movements in space as macroscopically conceived.
Something unknown is doing we don’t know what—that is what our
theory amounts to. It does not sound a particularly illuminating
theory. I have read something like it elsewhere—

The slithy toves


Did gyre and gimble in the wabe.
There is the same suggestion of activity. There is the same
indefiniteness as to the nature of the activity and of what it is that is
acting. And yet from so unpromising a beginning we really do get
somewhere. We bring into order a host of apparently unrelated
phenomena; we make predictions, and our predictions come off. The
reason—the sole reason—for this progress is that our description is
not limited to unknown agents executing unknown activities, but
numbers are scattered freely in the description. To contemplate
electrons circulating in the atom carries us no further; but by
contemplating eight circulating electrons in one atom and seven
circulating electrons in another we begin to realise the difference
between oxygen and nitrogen. Eight slithy toves gyre and gimble in
the oxygen wabe; seven in nitrogen. By admitting a few numbers
even “Jabberwocky” may become scientific. We can now venture on
a prediction; if one of its toves escapes, oxygen will be
masquerading in a garb properly belonging to nitrogen. In the stars
and nebulae we do find such wolves in sheep’s clothing which might
otherwise have startled us. It would not be a bad reminder of the
essential unknownness of the fundamental entities of physics to
translate it into “Jabberwocky”; provided all numbers—all metrical
attributes—are unchanged, it does not suffer in the least. Out of the
numbers proceeds that harmony of natural law which it is the aim of
science to disclose. We can grasp the tune but not the player.
Trinculo might have been referring to modern physics in the words,
“This is the tune of our catch, played by the picture of Nobody”.
[45] I mean, resemble in intrinsic nature. It is true (as Bertrand
Russell has emphasised) that the symbolic description of structure
will be identical for the table in the external world and for the
conception of the table in consciousness if the conception is
scientifically correct. If the physicist does not attempt to
penetrate beneath the structure he is indifferent as to which of
the two we imagine ourselves to be discussing.
[46] Analysis of Matter, p. 320.
Chapter XIV
CAUSATION
In the old conflict between freewill and predestination it has seemed
hitherto that physics comes down heavily on the side of
predestination. Without making extravagant claims for the scope of
natural law, its moral sympathy has been with the view that
whatever the future may bring forth is already foretold in the
configurations of the past—

Yea, the first Morning of Creation wrote


What the Last Dawn of Reckoning shall read.

I am not so rash as to invade Scotland with a solution of a


problem which has rent her from the synod to the cottage. Like most
other people, I suppose, I think it incredible that the wider scheme
of Nature which includes life and consciousness can be completely
predetermined; yet I have not been able to form a satisfactory
conception of any kind of law or causal sequence which shall be
other than deterministic. It seems contrary to our feeling of the
dignity of the mind to suppose that it merely registers a dictated
sequence of thoughts and emotions; but it seems equally contrary to
its dignity to put it at the mercy of impulses with no causal
antecedents. I shall not deal with this dilemma. Here I have to set
forth the position of physical science on this matter so far as it
comes into her territory. It does come into her territory, because that
which we call human will cannot be entirely dissociated from the
consequent motions of the muscles and disturbance of the material
world. On the scientific side a new situation has arisen. It is a
consequence of the advent of the quantum theory that physics is no
longer pledged to a scheme of deterministic law. Determinism has
dropped out altogether in the latest formulations of theoretical
physics and it is at least open to doubt whether it will ever be
brought back.
The foregoing paragraph is from the manuscript of the original
lecture delivered in Edinburgh. The attitude of physics at that time
was one of indifference to determinism. If there existed a scheme of
strictly causal law at the base of phenomena the search for it was
not at present practical politics, and meanwhile another ideal was
being pursued. The fact that a causal basis had been lost sight of in
the new theories was fairly well known; many regretted it, and held
that its restoration was imperative.[47]
In rewriting this chapter a year later I have had to mingle with
this attitude of indifference an attitude more definitely hostile to
determinism which has arisen from the acceptance of the Principle of
Indeterminacy (p. 220). There has been no time for more than a
hurried examination of the far-reaching consequences of this
principle; and I should have been reluctant to include “stop-press”
ideas were it not that they appear to clinch the conception towards
which the earlier developments were leading. The future is a
combination of the causal influences of the past together with
unpredictable elements—unpredictable not merely because it is
impracticable to obtain the data of prediction, but because no data
connected causally with our experience exist. It will be necessary to
defend so remarkable a change of opinion at some length.
Meanwhile we may note that science thereby withdraws its moral
opposition to freewill. Those who maintain a deterministic theory of
mental activity must do so as the outcome of their study of the mind
itself and not with the idea that they are thereby making it more
conformable with our experimental knowledge of the laws of
inorganic nature.

Causation and Time’s Arrow. Cause and effect are closely bound up
with time’s arrow; the cause must precede the effect. The relativity
of time has not obliterated this order. An event Here-Now can only
cause events in the cone of absolute future; it can be caused by
events in the cone of absolute past; it can neither cause nor be
caused by events in the neutral wedge, since the necessary
influence would in that case have to be transmitted with a speed
faster than light. But curiously enough this elementary notion of
cause and effect is quite inconsistent with a strictly causal scheme.
How can I cause an event in the absolute future, if the future was
predetermined before I was born? The notion evidently implies that
something may be born into the world at the instant Here-Now,
which has an influence extending throughout the future cone but no
corresponding linkage to the cone of absolute past. The primary
laws of physics do not provide for any such one-way linkage; any
alteration in a prescribed state of the world implies alterations in its
past state symmetrical with the alterations in its future state. Thus in
primary physics, which knows nothing of time’s arrow, there is no
discrimination of cause and effect; but events are connected by a
symmetrical causal relation which is the same viewed from either
end.
Primary physics postulates a strictly causal scheme, but the
causality is a symmetrical relation and not the one-way relation of
cause and effect. Secondary physics can distinguish cause and effect
but its foundation does not rest on a causal scheme and it is
indifferent as to whether or not strict causality prevails.
The lever in a signal box is moved and the signal drops. We can
point out the relation of constraint which associates the positions of
lever and signal; we can also find that the movements are not
synchronous, and calculate the time-difference. But the laws of
mechanics do not ascribe an absolute sign to this time-difference; so
far as they are concerned we may quite well suppose that the drop
of the signal causes the motion of the lever. To settle which is the
cause, we have two options. We can appeal to the signalman who is
confident that he made the mental decision to pull the lever; but this
criterion will only be valid if we agree that there was a genuine
decision between two possible courses and not a mere mental
registration of what was already predetermined. Or we can appeal to
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

textbookfull.com

You might also like