Introductory Programs with the 32-bit PIC Microcontroller: A Line-by-Line Code Analysis and Reference Guide for Embedded Programming in C 1st Edition Hubert Ward pdf download
Introductory Programs with the 32-bit PIC Microcontroller: A Line-by-Line Code Analysis and Reference Guide for Embedded Programming in C 1st Edition Hubert Ward pdf download
https://ebookmeta.com/product/c-programming-for-the-pic-
microcontroller-demystify-coding-with-embedded-programming-
hubert-henry-ward/
https://ebookmeta.com/product/lonely-planet-seoul-10th-edition-
thomas-omalley/
Let s Taco Bout Love 1st Edition Mcfadden Melrose
https://ebookmeta.com/product/let-s-taco-bout-love-1st-edition-
mcfadden-melrose/
https://ebookmeta.com/product/medical-microbiology-8th-edition-
michael-a-pfaller/
https://ebookmeta.com/product/shadow-hill-1st-edition-thomas-
kies/
https://ebookmeta.com/product/machine-learning-with-pyspark-with-
natural-language-processing-and-recommender-systems-pramod-singh/
https://ebookmeta.com/product/statistics-and-analysis-of-
scientific-data-graduate-texts-in-physics-3rd-edition-
massimiliano-bonamente/
Ultrashort Pulse Lasers and Ultrafast Phenomena 1st
Edition Takayoshi Kobayashi
https://ebookmeta.com/product/ultrashort-pulse-lasers-and-
ultrafast-phenomena-1st-edition-takayoshi-kobayashi/
MAKER
I N N O VAT I O N S
SERIES
Introductory
Programs with
the 32-bit PIC
Microcontroller
A Line-by-Line Code Analysis
and Reference Guide for Embedded
Programming in C
—
Hubert Ward
Introductory
Programs with the
32-bit PIC
Microcontroller
A Line-by-Line Code Analysis
and Reference Guide for
Embedded Programming in C
Hubert Ward
Introductory Programs with the 32-bit PIC Microcontroller: A Line-by-Line
Code Analysis and Reference Guide for Embedded Programming in C
Hubert Ward
Leigh, UK
Introduction���������������������������������������������������������������������������������������xxi
v
Table of Contents
vi
Table of Contents
vii
Table of Contents
Chapter 6: Communication���������������������������������������������������������������251
The 25LC256 EEPROM��������������������������������������������������������������������������������������256
What Is an EEPROM Device�������������������������������������������������������������������������������256
Writing to the EEPROM��������������������������������������������������������������������������������������258
Reading from the EEPROM��������������������������������������������������������������������������������260
viii
Table of Contents
ix
Table of Contents
Chapter 8: Interrupts������������������������������������������������������������������������365
Interrupts����������������������������������������������������������������������������������������������������������365
The Fetch and Execute Cycle����������������������������������������������������������������������������367
The Program Counter or “PC”����������������������������������������������������������������������367
Single Vectored Interrupts���������������������������������������������������������������������������368
Multivectored Interrupts������������������������������������������������������������������������������369
How Does the PIC Keep Track of Where It Must Go and Where It Must
Get Back To?������������������������������������������������������������������������������������������������369
The Stack and Its Main Use�������������������������������������������������������������������������370
The Sources of Interrupts in a 32-Bit PIC����������������������������������������������������������372
Analysis of Listing 8-1��������������������������������������������������������������������������������������380
Using More Than One Interrupt Source with Single Vector Mode���������������������391
Analysis of Listing 8-2��������������������������������������������������������������������������������������394
Interrupt Priority������������������������������������������������������������������������������������������������397
Multivectored Interrupts with Priority���������������������������������������������������������������398
Analysis of Listing 8-3��������������������������������������������������������������������������������������401
Summary����������������������������������������������������������������������������������������������������������404
x
Table of Contents
xi
Table of Contents
xii
Table of Contents
Appendix�������������������������������������������������������������������������������������������729
Appendix 4: Keywords����������������������������������������������������������������������737
Index�������������������������������������������������������������������������������������������������753
xiii
About the Author
Hubert Ward has nearly 25 years of experience as a college lecturer
delivering the BTEC, and now Pearson’s, Higher National Certificate and
Higher Diploma in Electrical and Electronic Engineering. Hubert has a 2.1
Honors Bachelor’s Degree in Electrical and Electronic Engineering. Hubert
has also worked as a consultant in embedded programming. His work has
established his expertise in the assembler and C programming languages,
within the MPLAB X IDE from Microchip, as well as designing electronic
circuits and PCBs using ECAD software. Hubert was also the UK technical
expert in Mechatronics for three years, training the UK team and taking
them to enter in the Skills Olympics in Seoul 2001, resulting in one of the
best outcomes to date for the UK in Mechatronics.
xv
About the Technical Reviewer
Mike McRoberts is the author of Beginning Arduino by Apress. He is
the winner of Pi Wars 2018 and a member of Medway Makers. He is an
Arduino and Raspberry Pi enthusiast.
xvii
The Aims and Objectives
of the Book
My main aim in writing this book is to introduce you to the 32-bit micro
and help you understand how to program them in the C programming
language. I also want to show you that you can program them and that you
can make a career as an embedded programmer. I hope that after reading
this book, you will have developed your understanding of C and that you
will have the confidence to go and develop your own programs.
The Objectives of the Book
After reading this book, you should be able to do some or all of the
following:
• Seven-segment displays
xix
The Aims and Objectives of the Book
xx
Introduction
This book will introduce you to the exciting world of embedded
programming. It will teach you how the main functions of C programming
work and how you can use them to control a 32-bit PIC microcontroller.
You might think that a 32-bit PIC is too far advanced to start with and
that you should try a simpler PIC first. Well, really, that’s not the case. You
can start with all the simple programs, such as simply turning on and off
an LED, using a simple delay, controlling a seven-segment display, and
writing a simple message to an LCD, with this 32-bit PIC. However, you can
progress to the more advanced programs that are out of reach with most of
the 8-bit PICs.
It really comes down to cost. I use the explorer 16 development
board with a plugin board for the 32-bit PIC. The development board,
shown in Figure 2, comes in at around £100, and the plugin 32-bit PIC,
shown in Figure 1, comes in at around £30. On top of that, you will need a
programming tool to download your programs to the PIC. I use the ICD3
can or the PICKIT3 tool. The ICD3 can costs around £70. However, this
is no longer available, and the ICD4 can is very expensive. They do have
the PICKIT4 which I believe programs 32-bit PICs, and that costs around
£70. So, you could possibly be looking at spending around £200 or more.
But you should see it as an investment in your career as an embedded
programmer. Working as an embedded programmer, one can earn around
£40 to £100 an hour if not more.
If you went down the 8-bit PIC route first, you would spend less, but
your programming experience could be greatly reduced.
xxi
Introduction
Prerequisites
As to any prerequisites you need before reading this book, there are none. I
will assume you are a complete novice, and I will explain every step as you
progress through the book. Every instruction will be analyzed to explain
how the C instruction works and how it achieves what we want from the
instructions. The only things you will definitely need to use this book are as
follows.
MPLAB X
This is the IDE, integrated development environment, from Microchip. I
will be using versions 5.25 and 5.40, but any version from 2.2 will be fine
as there will be only some minor differences. Also, as I know Microchip is
constantly updating its IDE, I am confident that the changes will only be
minor. This means the procedures for the IDE that you will learn from this
book will still stand you in good stead for any later versions of the IDE.
Compiler Software
You will need a 32-bit compiler software to compile your programs within
MPLAB X. I use v2.41, although for a lot of my programs, I use the older
version 1.32, as the newer versions have some of the libraries missing.
MPLAB X and the compiler software are freely available from the
Microchip website. You may have to search the archive section for some of
the older compiler versions. You could upgrade to the paid version of the
compiler software, but I have not done that for any of my programs. If you
were to make a career in embedded programming, then the paid version of
the compiler may have some advantages, such as more efficient code that
uses less memory.
xxii
Introduction
Simulation Software
MPLAB X does come with a simulation option for its PICs. This does mean
that you can try some of the programs without spending any money on
equipment. However, the simulation capabilities are not very extensive,
and they are used more for debugging your programs. I will take you
through using the simulation option within MPLAB X for some of the
programs in the book, but most will be carried out on the explorer 16
development board. However, simulating the programs will give you a
chance to see if you can enjoy programming these PICs. It is not just about
making money, as you will earn more if you enjoy what you do.
There are some ECAD (electronic computer-aided design) software
that you can use to simulate the programs. PROTEUS is one that I have
used for 8-bit PICs. Multisim is another one, but you must make sure that it
can support the PICs you want to use, and they are not free.
MPLAB Harmony
Microchip has invested a lot of time and money in creating its
programming environment named MPLAB Harmony. It is aimed at saving
a lot of time in developing PIC programs. If you just want to get something
working and are not really interested in learning how it works, then this
environment can be useful. However, be aware that once you go down
that route, you can become dependent upon the environment, as you are
not really learning how the programs work. That’s great for Microchip but
not for you. I believe this approach is counterproductive, as it does far
too much for you and doesn’t explain how it works. If you really want to
become a versatile and productive programmer, then you need to really
understand how every bit of your program works. Only then can you really
say you wrote it and not just cobbled together bits of code that you don’t
understand. My main aim in writing this book is to show that it is not too
xxiii
Introduction
difficult to learn how to program these PICs yourself. If you learn how PICs
work and how we can write C instructions to make them do what we want,
then you will become that versatile and experienced programmer that will
find an exciting and useful career as an embedded programmer.
Why am I writing this book and not working as that embedded
programmer? Well, really, I ventured into programming PICs a bit too
late in my life. I have been in education, teaching electrical and electronic
engineering at HND level, for over 25 years. So now I am ready to retire
and concentrate on trying to pass my knowledge and experience onto you
younger guys. I hope that in reading this book, you will learn enough to
become that versatile and productive embedded programmer.
xxiv
Introduction
The name of the PIC is quite a mouthful, but then that is Microchip for
you. Microchip does make an extensive range of PICs.
There is one big drawback with this PIC, compared to the PIC18F4525,
and that is, it is a surface mount device, whereas the PIC18F4525 comes in
a 40-pin dual in-line package. This does make the 32-bit PIC much more
difficult to use if you want to make simple circuit boards, on say some
veroboard. It is a 100-pin device, and it can be bought from Microchip on
a small self-contained board, as shown in Figure 1, that you could mount
on some veroboard, but you would have to create a 100-pin housing for the
PIC. The cost of this self-contained board with the PIC is around £30.
A simple way of using this type of PIC is to use the explorer 16
development board that I use. A picture of this is shown in Figure 2. When I
bought it, some eight years ago, it came with a 24-bit PIC already included
with it, so I had to buy the 32-bit PIC separately.
xxv
Introduction
This is a very useful board that has the following peripheral devices:
These are just a few of the devices that are available to you on the
explorer board. All these make the board a very useful addition to your
embedded programming equipment. This can easily justify the cost of
around £100.
You will need a programming tool to download your programs from
MPLAB X to your PIC. There are a couple of tools that you can use, such as
xxvi
Introduction
You could be spending around £250 plus, but you should find it a
useful investment as you can earn a high rate of pay as an embedded
programmer. There are cheaper tools you can use, but I can only write
about the ones I have used.
There are many other programming environments, but I know these
that I have shown you work and work well. Indeed, I have used my explorer
boards, with the plugin expansion slot, to control a sophisticated industrial
control system.
xxvii
Introduction
Curly Brackets
C programming uses brackets to define the confines of these loops. These
are what I call “curly brackets,” that is, the opening curly bracket “{“ and the
closing curly bracket “}”. These are used to group a series of instructions
together. For example:
void main ()
{
instructions go here
}
Normal Brackets
The C programming also uses what I call “normal brackets,” that is, the
opening normal bracket “(“ and the closing normal bracket “)”. These are
used in conjunction with subroutines and subroutine calls.
We will look at these brackets as we analyze the programs in the book.
xxviii
Introduction
xxix
Introduction
When the main loop calls these subroutines, it is done using the
general format:
subroutine name (send any variables that the subroutine may require)
For example: delay250(4);
This will call the subroutine called “delay250” and send the value “4” to
be copied into the subroutine’s local variable “t.”
xxx
Introduction
Summary
In this introduction, we have looked at MPLAB X, the IDE from Microchip,
and the possible development boards you may have to buy. I have tried to
explain the aims of this book, and I have detailed some of my experiences
in the hope of convincing you I do know enough about C programming for
PIC micros.
In the first chapter, we will learn how to create a project in MPLAB
X. We will look at creating a header file, within MPLAB X, and use it in our
programs. This header file will look at how we use the configuration words
to set the clocks of the PIC and some other important aspects of the PIC. I
hope you will find this book useful and it will help you get started on your
career as an embedded programmer.
xxxi
CHAPTER 1
What Is MPLAB X
MPLAB X is Microchip’s IDE, integrated development environment. It is a
collection of programs designed to make the development of programs for
the PIC microcontrollers an easy and enjoyable process. It uses a dedicated
text editor that has coloring for keywords and uses an IntelliSense that
works like predictive text on a mobile phone. It has a range of debugging
tools that aid the debugging of your programs. It also has a simulation
software that allows you to simulate most of your PIC programs. All
this and the required compilers are freely available from the Microchip
website.
2
Chapter 1 Creating Our First C Program
You should appreciate that when you create a project, a new folder will
be created on your hard drive, where all the files and directories for the
project will be stored.
To create a new project, simply click the word “File” in the main menu,
and then select “New Project” from the fly-out menu that appears. An
alternative approach would be to click the mouse on the small orange
box with the green cross in it, which is the second item from the left on
the second menu bar. The “Choose Project” window shown in Figure 1-2
should appear.
3
Chapter 1 Creating Our First C Program
In this window, we can select the actual PIC we will be using. In the
family slot, you should choose the 32-bit MCUs (PIC32) as shown in
Figure 1-3. Then, in the device slot, select the 32MX360F512L. Once you
are happy with your selections, you should click Next. If you are using a
different 32-bit PIC, then you should select it here.
This will move us onto the “Select Tool” window as shown in
Figure 1-4.
4
Chapter 1 Creating Our First C Program
Here, you can select the actual tool you are using to download the
program from MPLAB X to the PIC. In this case, we will simply use the
simulator option of MPLAB X. With this option, we don’t need an actual
PIC, as we will be using the PIC simulator from within MPLAB X.
Once you have selected your chosen tool, you should click Next to
move on to the “Select Compiler” window as shown in Figure 1-5.
5
Chapter 1 Creating Our First C Program
6
Chapter 1 Creating Our First C Program
With this window, you can give the project a name and decide where to
save the project. I have named the project “ourFirst32Bit,” and I am using
what is termed “Camel Font.” This is where we combine multiple words
to make one long word. The first letter of the first word is in lowercase,
and the first letter of all subsequent words is in uppercase. In this way, the
separate words of the newly created long word are still discernible.
I tend to save the projects on my root directory, but you must save it
where you want.
Once you are happy with your selection, you should click Finish, and
your project will be created.
The screen will now change to the main editing window as shown in
Figure 1-7.
7
Chapter 1 Creating Our First C Program
Before we finish this chapter, we will create the program file for this
first project. We will call it “ourFirst32BitProg.” To create the file, we will
need to expand the project tree that is shown on the left-side plane in
Figure 1-7. This is simply done by clicking the mouse on the small box
with the + sign in it, at the side of the “ourFirst32Bit” name in the project
tree, as shown in Figure 1-7. If the project tree is not shown, you can click
the mouse on the word “Window” on the main menu bar. You should
then simply click the first choice, which depicts the orange box and word
project. The project tree should then appear. You may have to move the
box with the project tree in it around the screen. This can be done by
clicking and dragging the mouse with the box selected. It will take some
time to master the moving of the different boxes around the screen, so I
will just leave it for you to practice.
Once the project tree is opened, you should right-click the mouse on
the phrase Source Files. Then click the mouse on the option “New” from
the fly-out menu. Then click the option “main_c” that appears. This is
shown in Figure 1-8.
8
Chapter 1 Creating Our First C Program
Once you do that, you will be presented with the “Name and Location”
for the source file as shown in Figure 1-9.
9
Chapter 1 Creating Our First C Program
Figure 1-9. The Name and Location for the Source File
Here, you can give your c file a suitable name. I have given it the name
“ourFirst32BitProg.” The extension for the file is c, as shown in the small
extension window. Once you are happy with the name, you should click
Finish to create the file.
When you do this, you will create a new file that will appear in the main
editing window. However, Microchip does insert a lot of text that you will
not need at this starting level, if ever. Therefore, to make sure we all have
the same window, I would ask you to delete all the text that is inserted in
the file. After deleting that material, you should now have a screen that
looks like that shown in Figure 1-10.
10
Chapter 1 Creating Our First C Program
We have now created our first project within MPLAB X. I suggest you
go through this process for every project you make. The more times you go
through this process, the easier it becomes.
11
Chapter 1 Creating Our First C Program
You will notice I have changed the font of the comments. This is to
make them clearer in the book. If you want to do this, then you should
select the word “Tools” on the main menu. Then select the word “Options”
from the fly-out menu, and you should then be presented with the window
shown in Figure 1-12. You will notice I have selected the term “Fonts &
Colors” from the menu.
You should then be able to change the comments to what you want.
Once you are happy with your changes, simply click OK to close the
window and apply the changes.
12
Chapter 1 Creating Our First C Program
13
Chapter 1 Creating Our First C Program
There are four sources of oscillators for the PIC. The two external
sources are shown as the primary oscillator with terminals OSCI (oscillator
in) and OSCO (oscillator out) and the secondary oscillator, shown as
SOSCO and SOSCI. The other two oscillator sources are the FRC (fast
resistor capacitor) and the LPRC (low-power resistor capacitor).
The primary oscillator and the FRC can be fed, unaltered, to produce
the clock signal, or they can be passed through a divider circuit, divider
one, then through a PLL (phase lock loop) circuit, where the frequency can
be multiplied, then through a final divider circuit, divider two, before being
used for the various clock signals.
14
Chapter 1 Creating Our First C Program
The secondary oscillator and the LPRC sources are used to generate
a relatively low frequency around 32kHz for the LPRC and an exact
32.768kHz from a crystal oscillator. Both of these can be used for the
system clocks. The secondary oscillator can be used as an accurate source
for timer1 and for the RTCC (Real-Time Clock Calendar). The LPRC can
be used as the source for the WDT (the Watch Dog Timer) and the PWRT
(Power Watch Reset Timer).
The FRC and LPRC are both internal oscillators, and the ability to use an
internal oscillator is useful if you were short of I/O, as with the PIC18F4525.
However, with this 32-bit PIC, I/O, the number of input and output pins, is
not really a problem. Also, as the RC oscillators are not as accurate as crystal
oscillators, I will use the external oscillator sources for my projects.
The primary oscillator on the explorer 16 development board is an
8MHz crystal. The board also has the 32.768kHz crystal as the secondary
source, which can be used to run the RTCC (Real-Time Clock and
Calendar). We have the option of increasing the frequency of the oscillator
to produce a faster clock signal, and to do this, we must run the 8MHz
crystal oscillator through the phase lock loop circuit. However, the phase
lock loop circuit requires an input frequency of 4MHz. That is why we
have the ability to run the oscillator through the divider one first. As we are
using the 8MHz crystal, we must set the first divider to divide by 2.
Once in the phase lock loop, we have the ability to multiply the signal
by a factor of 15 up to a factor of 24. At present time, the maximum clock
frequency for the 32-bit PIC is 72MHz; therefore, we will multiply the
4MHz signal by 18. This means that the output of the phase lock loop will
be a 72MHz clock signal. This means we don’t need to divide the clock
further, so set the divider two to divide by 1, that is, no change.
There is one final division we can make if we wanted to. This is to make
the peripheral bus clock, the PBCLK, run at a lower frequency than the
system clock, the CPU clock. We will choose to run the PBCLK at 36MHz.
This means we need to divide the CPU clock by 2 before applying it to
the PBCLK.
15
Chapter 1 Creating Our First C Program
The display will now show the configuration bits in the bottom half of
the editing window. This is shown in Figure 1-15.
16
Chapter 1 Creating Our First C Program
17
Another Random Scribd Document
with Unrelated Content
Slowly, his lips stiff, Joe took a pen from his pocket, wrote a note,
and left it on the desk:
He pushed back the chair and stood in thought beside the desk.
As slowly as he had taken the pen from his pocket he reached for
the telephone and called Vic Wylie’s office.
“Will you give Vic a message for me, Miss Robb? We’ve been
auditioning a cast and—I guess I can’t take it. Tell him Pop Bartell’s
been dropped from the Larry show. I’m throwing up my job.”
Miss Robb was dumfounded. “Tony told us he was pleased with
you....”
“I know,” Joe said wearily. “Vic’ll understand.”
Office buildings were emptying, and Royal Street was a packed,
shuffling, slow-moving canyon. Joe moved along with the mass until
he came to the Thomas Carlin store. It was almost the closing hour,
and a lone customer waited for a clerk to wrap a purchase. The
lights were on and facets of radiance gleamed from the polished
glass of show-cases and the polished wood of shelves. To-day Joe
saw the scene with a vision that had been cleaned and washed—its
bright cleanliness, its subdued brilliance of display, its subtle breath
of pride and courtesy and alertness. The faces of all the clerks—
strange that he had never noticed them before: friendly faces that
were not merely a friendly front. The lone customer left. “Hi, Joe.”
The clerks grinned at him. “Hi, boys.” He grinned at them.
“Some new books came in to-day, Joe,” Mr. Fairchild announced.
“Not now,” said Joe. He added an explanation. “Something on my
mind.”
“No!” Mr. Fairchild prodded his ribs. “They’ll toss you out of the
Jitterbug Union for that.”
It wasn’t a brilliant gag. As a gag, it would have been scorned by
any actor making the rounds. But it was good; it was homey.
The store closed, and Joe walked with his father to the parking
lot. The man pushed the key into the ignition lock and reached his
foot for the starter button.
“What is it, Joe? Trouble?”
“Not exactly.” Joe was still thinking of Pop Bartell. “I’m through at
the agency. I’d like to come into the store.”
Tom Carlin’s foot did not touch the button. Horns honked and cars
backed out of symmetrical lines as an attendant directed parking-lot
traffic. Silence, brittle and strange, lingered in the Carlin sedan.
“I—I thought you’d be glad,” Joe said uncertainly.
“Is that your reason for telling me?”
The boy was startled. “Don’t you want me?”
Tom Carlin stepped on the button. The attendant waved an arm
and he shook his head. The motor idled, warming.
“When you told me you wanted to be an actor,” the man said as
though he debated each word, “I let you have your fling. Was there
anything else for me to do? I was afraid of making you a round peg
in a square hole. You failed as an actor. But you still stayed in show
business and turned to production. That’s the rub, Joe.”
“What?” Joe demanded.
“Let me put it this way: After you’d failed—don’t get the idea I’m
rubbing that in; as I told you, I made a miserable failure of my first
job—had you come to me after that first failure, I’d have welcomed
you instantly. A lot of persons change their first desires. I couldn’t
ask for a better man than Fairchild; he started out to be a
mechanical engineer. But you made show business both your first
and second choices. You’ve made the store a very bad third choice.
You leave the impression that you’re coming to me now because
there’s no place else to go. That doesn’t set so well, Joe.”
Joe’s nerves were raw from a day of chafing, and this
disappointment was crushing. “You mean I needn’t come around?”
“I didn’t say that. I’ll have to think this over. I’m trying to see the
situation from your angle as well as from my own. What will it
benefit you in the long run to use the business as a door of escape?
If you come to the store as a place of last resort, you’re still a round
peg in a square hole. It might be better for you to get a job on your
own and try yourself out in somebody else’s business. For a while,
anyway.”
Disappointment and raw nerves united to make the boy stiff with
anger. “All right, Dad, if that’s how you want it.”
“That isn’t how I want it,” Tom Carlin said. “That’s how it seems to
be.”
They said little more to each other on the ride out to the
Northend. But they were talking as they entered the house, and talk
was a lively stream around the dinner table. Front, Joe thought,
wasn’t confined to show business; you could wear a front at home.
The meal over, he found that morning’s Journal and went to his
room.
Something that was part of this house worked its spell. His jagged
nerves relaxed and anger died in him. He began to see his father’s
point of view. He hadn’t been absolutely denied the store; it was
simply that his father questioned the wisdom of having him come in
now. After all, there was a lot to what his father had said. He had
made the store a third choice. He must look like an irresponsible
madcap, a harum-scarum who didn’t know his own mind. Well, he’d
have to prove himself. He could do that. He’d find an outside job and
make good at it. Then, after a year or two ... but a year or two
seemed so long.
He opened the Journal and studied the Help Wanted columns.
Christmas was approaching and all the large stores along Royal
Street were clamoring for packers, sales people, delivery men, and
cashiers. He could probably get a seasonal job at half a dozen
places; certainly, if you rolled up your sleeves and pitched in,
temporary employment might become permanent employment. But
he couldn’t, he thought with a fresh pang, get a job with his own
father.
There was a tap on the door and Tom Carlin walked in. “Joe,
Mother thinks I may have been hasty. Her reactions are usually right.
You’ve heard what I have to say, but I haven’t heard your side. Do
you mind telling me why you were fired?”
Joe stared. “Fired? I wasn’t fired. What gave you that idea? I quit.”
The man reached for a chair, took a pipe from his pocket, and sat
down slowly. “Why did you quit?”
Joe tried to tell him. The story used up a great many words, and
he felt that he was telling it badly.
“I might have made a good producer. Vic thought I would and
Tony told Vic I was doing well. But if I became a producer I’d always
be meeting the sordid side of show business. All I’d see would be
men and women wearing an artificial front. They’d make me a big
stop when I had a show coming up. They’d stay awake nights
planning to catch my attention as Mander caught Tony’s. They’d
audition and try to hide how much a part meant to them. I don’t
mean there isn’t struggle and uncertainty in every other line, but—
oh, show business is different. I’d know too much about small time.
I’d see too much: little corners of shabbiness, things that were mean
and grubby, fine people trying to hide worry and apprehension
behind a front. You get so you hate a front. I’d know they were
getting hard knocks to-day and would get the same hard knocks to-
morrow. I’d know that probably only one in a thousand would ever
make the big time, just as I couldn’t make it and for the same
reason. They’re good, but not good enough. Good enough for small
time, and sustaining shows that pay no salaries, but only good
enough for that. It got under my skin and did something to me. I
used to turn on a radio, and listen to a show, and think it was all
glamorous; there’s very little glamour in show business when you
get behind the scenes. You see too many of the wounds.”
Tom Carlin filled his pipe.
“And then, to-day, Pop Bartell. That finished me. Sooner or later
I’d have been finished, anyway. Vic says I feel too much. Maybe he’s
right. I’m not sorry I tried show business. If I hadn’t, I’d probably
always feel I’d thrown away a chance to see my name up in lights.”
Smoke was a thick cloud around Tom Carlin’s head. “Joe, I
apologize for what I said in the car. I didn’t understand.”
“Does what I told you make a difference?”
“All the difference in the world. Instead of being up in lights, your
name will some day be on a store window.”
“You mean I’m going into the store—now?”
“Any time you’re ready.”
Joe had never known it was possible to feel so good. “I’ll be ready
Monday.”
Tom Carlin knocked ashes from his pipe and refilled the bowl. “I
found a script in your bureau, Joe,” he said serenely.
Joe sat up straight.
“I had copies made and brought the script back. I saw no use
talking to you until I had something to talk about. I wrote to five
publishers—four in New York and one in Boston. Three are willing to
pay a fair share of the cost on a dramatization of their books. One is
doubtful, and one is definitely unfavorable.”
Joe’s voice was eager. “Are we going on the air?”
The man caught that “we.” “I’m more than half convinced we’ll
have a Carlin show next September.”
Joe went hot and cold. Not because this was radio, but because it
was Thomas Carlin Presents.
Tom Carlin puffed his contentment. “Every day we have customers
who telephone and ask to have some purchase delivered at once.
That forces me to take a clerk from behind the counter and send
him out. I’ve been thinking of hiring somebody to take care of some
light work and make these deliveries. This Pop Bartell. Do you think
he could fit into that job after forty years of show business?”
Joe was hot and cold again. “After what happened to-day, Dad,
he’d think somebody had given him a piece of Heaven.”
“Send him in to see me.”
“Perhaps,” said Joe, “I’ll run over a little later to where he lives.
He’ll sleep better to-night.”
After that they sat together in understanding silence.
A light step sounded in the hall and the door was pushed open
timidly. Kate Carlin stood on the threshold. Her eyes, clouded with
concern, went from her husband to her son and back to her
husband again.
“Come in, Kate.”
Suddenly her eyes were clear. She smiled. “This is a night you’ve
looked forward to, Tom, isn’t it?”
“Yes.” He held out his hand to her. “Come in, Kate, and sit with us.
Carlin and Son are in conference.”
*** END OF THE PROJECT GUTENBERG EBOOK YOU'RE ON THE
AIR ***
1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside
the United States, check the laws of your country in addition to
the terms of this agreement before downloading, copying,
displaying, performing, distributing or creating derivative works
based on this work or any other Project Gutenberg™ work. The
Foundation makes no representations concerning the copyright
status of any work in any country other than the United States.
1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if
you provide access to or distribute copies of a Project
Gutenberg™ work in a format other than “Plain Vanilla ASCII” or
other format used in the official version posted on the official
Project Gutenberg™ website (www.gutenberg.org), you must,
at no additional cost, fee or expense to the user, provide a copy,
a means of exporting a copy, or a means of obtaining a copy
upon request, of the work in its original “Plain Vanilla ASCII” or
other form. Any alternate format must include the full Project
Gutenberg™ License as specified in paragraph 1.E.1.
• You pay a royalty fee of 20% of the gross profits you derive
from the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”
• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.
1.F.
Most people start at our website which has the main PG search
facility: www.gutenberg.org.