100% found this document useful (1 vote)
19 views

Intermediate C Programming for the PIC Microcontroller: Simplifying Embedded Programming Hubert Henry Ward download

The document is a promotional and informational piece for the book 'Intermediate C Programming for the PIC Microcontroller: Simplifying Embedded Programming' by Hubert Henry Ward, which covers various topics related to embedded programming using C for PIC microcontrollers. It includes details about the book's content, chapters, and additional resources related to programming in C and other languages for embedded systems. The document also provides links to other related books and resources available for download.

Uploaded by

tuqkdsyehp7447
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
19 views

Intermediate C Programming for the PIC Microcontroller: Simplifying Embedded Programming Hubert Henry Ward download

The document is a promotional and informational piece for the book 'Intermediate C Programming for the PIC Microcontroller: Simplifying Embedded Programming' by Hubert Henry Ward, which covers various topics related to embedded programming using C for PIC microcontrollers. It includes details about the book's content, chapters, and additional resources related to programming in C and other languages for embedded systems. The document also provides links to other related books and resources available for download.

Uploaded by

tuqkdsyehp7447
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 65

Intermediate C Programming for the PIC

Microcontroller: Simplifying Embedded


Programming Hubert Henry Ward download

https://textbookfull.com/product/intermediate-c-programming-for-
the-pic-microcontroller-simplifying-embedded-programming-hubert-
henry-ward/

Download full version ebook from https://textbookfull.com


We believe these products will be a great fit for you. Click
the link to download now, or visit textbookfull.com
to discover even more!

Programming PIC Microcontrollers with XC8 1st Edition


Armstrong Subero

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

Stm32 Arm Programming for Embedded Systems 1st Edition


Muhammad Ali Mazidi

https://textbookfull.com/product/stm32-arm-programming-for-
embedded-systems-1st-edition-muhammad-ali-mazidi/

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/

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/
C# Programming for Absolute Beginners Radek Vystav■l

https://textbookfull.com/product/c-programming-for-absolute-
beginners-radek-vystavel/

Learning embedded Android N programming 1st Edition


Ivan Morgillo

https://textbookfull.com/product/learning-embedded-android-n-
programming-1st-edition-ivan-morgillo/

C++ Programming D. S

https://textbookfull.com/product/c-programming-d-s/

C Programming For Dummies (For Dummies (Computer/Tech))


Gookin

https://textbookfull.com/product/c-programming-for-dummies-for-
dummies-computer-tech-gookin/

Swift Programming The Big Nerd Ranch Guide 3rd Edition


Mikey Ward

https://textbookfull.com/product/swift-programming-the-big-nerd-
ranch-guide-3rd-edition-mikey-ward/
TECHNOLOGY IN AC TION™

Intermediate
C Programming
for the PIC
Microcontroller
Simplifying Embedded
Programming

Hubert Henry Ward
Intermediate
C Programming
for the PIC
Microcontroller
Simplifying Embedded
Programming

Hubert Henry Ward


Intermediate C Programming for the PIC Microcontroller: Simplifying
Embedded Programming
Hubert Henry Ward
Leigh, UK

ISBN-13 (pbk): 978-1-4842-6067-8 ISBN-13 (electronic): 978-1-4842-6068-5


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

Copyright © 2020 by Hubert Henry Ward


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: Natalie Pao
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
[email protected], 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 [email protected]; for
reprint, paperback, or audio rights, please e-mail [email protected].
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 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-6067-8. For more detailed information, please visit www.apress.com/source-code.
Printed on acid-free paper
Table of Contents
About the Author���������������������������������������������������������������������������������ix

About the Technical Reviewer�������������������������������������������������������������xi


Introduction���������������������������������������������������������������������������������������xiii

Chapter 1: Creating a Header File���������������������������������������������������������1


Creating a Header File������������������������������������������������������������������������������������������2
Creating a Project in MPLABX��������������������������������������������������������������������������3
Including the Header File�������������������������������������������������������������������������������18
Creating the Project Source File��������������������������������������������������������������������19
Creating a Global Header File������������������������������������������������������������������������23
The PICSetUp.h Header File���������������������������������������������������������������������������26
Analysis of Listing 1-1�����������������������������������������������������������������������������������28
Synopsis��������������������������������������������������������������������������������������������������������46
Answer to Exercise����������������������������������������������������������������������������������������46

Chapter 2: Controlling a Seven-­Segment Display�������������������������������47


Controlling a Seven-Segment Display�����������������������������������������������������������������47
Common Anode Seven-Segment Display������������������������������������������������������49
Common Cathode Seven-Segment Display���������������������������������������������������50
Controlling the Display with the PIC��������������������������������������������������������������52
The Seven-Segment Display Program�����������������������������������������������������������53
The Listing for the Seven-Segment Display Program������������������������������������57
The Analysis of Listing 2-1����������������������������������������������������������������������������59

iii
Table of Contents

Improving the Seven-Segment Display Program�������������������������������������������71


The Problem with the Program����������������������������������������������������������������������71
Arrays������������������������������������������������������������������������������������������������������������72
Using Pointers�����������������������������������������������������������������������������������������������72
Analysis of The Pointer Example�������������������������������������������������������������������73
The Improved Program����������������������������������������������������������������������������������74
Synopsis��������������������������������������������������������������������������������������������������������79
Answers to the Exercises������������������������������������������������������������������������������79

Chapter 3: The 24-Hour Clock�������������������������������������������������������������81


The Seven-Segment Display�������������������������������������������������������������������������������82
The Algorithm for the 24-Hour Clock Using Seven-Segment Displays���������������82
The Initialization of the PIC���������������������������������������������������������������������������������86
Analysis of Listing 3-1����������������������������������������������������������������������������������������93
A 24-Hour Clock with the LCD Display��������������������������������������������������������������104
Analysis of the Header File for the LCD�������������������������������������������������������121
The Analysis of Listing 3-2��������������������������������������������������������������������������133
Improvements for the 24-Hour Clock LCD Program������������������������������������145
Using Switch and Case Keywords���������������������������������������������������������������������147
Analysis of the New Subroutine������������������������������������������������������������������149
Synopsis������������������������������������������������������������������������������������������������������151

Chapter 4: Creating a Square Wave��������������������������������������������������153


Why Create a Square Wave?�����������������������������������������������������������������������������153
Musical Notes���������������������������������������������������������������������������������������������������154
The Speed of the Simple DC Motor�������������������������������������������������������������������156
Pulse Width Modulation������������������������������������������������������������������������������������156
Creating a Square Wave with the PWM Mode���������������������������������������������������158

iv
Table of Contents

Creating a 500Hz Square Wave�������������������������������������������������������������������������162


The Mark Time or Duty Cycle����������������������������������������������������������������������������164
Analysis of Listing 4-1��������������������������������������������������������������������������������������166
Creating Two Square Wave Outputs������������������������������������������������������������������169
Setting the Speed of a DC Motor�����������������������������������������������������������������������172
Driving the Motor����������������������������������������������������������������������������������������������175
Creating a Three-Speed DC Motor Program������������������������������������������������������176
Using a Variable Input Voltage to Change the Speed of a DC Motor�����������������179
Analysis of Listing 4-5��������������������������������������������������������������������������������������180
Creating a Musical Note������������������������������������������������������������������������������������186
Creating the Middle C Note�������������������������������������������������������������������������������187
Creating a Musical Keyboard����������������������������������������������������������������������������191
The Analysis Of Listing 4-7�������������������������������������������������������������������������������194
Summary����������������������������������������������������������������������������������������������������������196
Answers to the Exercises����������������������������������������������������������������������������������196

Chapter 5: DC Motors������������������������������������������������������������������������199


The Stepper Motor��������������������������������������������������������������������������������������������199
The Servo Motor������������������������������������������������������������������������������������������������209
Using the CCPM to Produce the Pulse Train Signal�������������������������������������210
Controlling the Positions of the Servo Motor with a Variable Resistor��������212
Improving The Servo Motor Program�����������������������������������������������������������215
The Algorithm for the Improved Program����������������������������������������������������216
Summary�����������������������������������������������������������������������������������������������������223
Solution to the Exercise�������������������������������������������������������������������������������224

v
Table of Contents

Chapter 6: Interrupts������������������������������������������������������������������������225
What Are Interrupts?�����������������������������������������������������������������������������������������225
The Fetch and Execute Cycle����������������������������������������������������������������������������226
The Program Counter����������������������������������������������������������������������������������������226
The Sources of Interrupts���������������������������������������������������������������������������������230
The Process for a Simple Interrupt with No Priorities���������������������������������231
Setting Up the PIC to Respond to the Interrupts������������������������������������������232
The PIE1 Register����������������������������������������������������������������������������������������237
The Algorithm for the Interrupt Test Program����������������������������������������������239
Compiler Software Version Issue�����������������������������������������������������������������240
The Analysis of Listing 6-1��������������������������������������������������������������������������243
Using the Compare Function of the CCP Module����������������������������������������������251
The Algorithm for the Compare Function�����������������������������������������������������253
The Analysis Of Listing 6-2��������������������������������������������������������������������������256
Using Priority Enabled Interrupts����������������������������������������������������������������������260
The Algorithm for the High/Low Priority Program����������������������������������������260
Analysis of Listing 6-3���������������������������������������������������������������������������������265
Explanation of How the High/Low Priority Program Works��������������������������270
Summary����������������������������������������������������������������������������������������������������������272

Chapter 7: Frequency Measurement and the EEPROM���������������������273


Using the Capture Function of the CCP�������������������������������������������������������������273
Setting the CCP to the Capture Mode����������������������������������������������������������������274
What the CCP Captures in the Capture Mode����������������������������������������������������274
The Algorithm for the Frequency Measurement Program���������������������������������276
Example Frequency Measurement��������������������������������������������������������������������278
The Program to Measure the 500Hz Square Wave��������������������������������������������280

vi
Table of Contents

Analysis of Listing 7-1��������������������������������������������������������������������������������������283


Using the EEPROM Inside the 18f4525�������������������������������������������������������������296
Analysis of Listing 7-3��������������������������������������������������������������������������������������304
Simulation of the EEPROM Program Using MPLABX�����������������������������������������312
Summary����������������������������������������������������������������������������������������������������������314

Appendix 1: Some Useful Definitions������������������������������������������������317

Appendix 2: Mathematical and Logic Operators�������������������������������319

Appendix 3: Keywords����������������������������������������������������������������������321

Appendix 4: Data Types��������������������������������������������������������������������323

Appendix 5: The ASCII Character Set������������������������������������������������325

 ppendix 6: Numbering Systems Within


A
Microprocessor-Based Systems�������������������������������������������������������327
B
 inary Numbers������������������������������������������������������������������������������������������������328
Converting Decimal to Binary���������������������������������������������������������������������������328
Converting from Binary to Decimal�������������������������������������������������������������������329
Adding and Subtracting Binary Numbers����������������������������������������������������������331
Subtracting Binary Numbers�����������������������������������������������������������������������������332
The Hexadecimal Number System��������������������������������������������������������������������334

Appendix 7:���������������������������������������������������������������������������������������337

 ppendix 8: The Frequency and Wavelength of the


A
Main Musical Notes��������������������������������������������������������������������������339

Index�������������������������������������������������������������������������������������������������345

vii
About the Author
Hubert Henry 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 Honours 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 MPLABX 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 the Skills Olympics in Seoul 2001, resulting in one of the
best outcomes to date for the UK in Mechatronics.

ix
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 build things that improve quality of life. You can find
his project portfolio at http://saiyamanoor.com.

xi
Introduction
This book looks at some useful aspects of the PIC microcontroller. It
explains how to write programs in C so that you can use the PIC micro to
control a variety of electronics and DC motors. After reading this book, you
will be well on your way to becoming an embedded programmer using the
C programming language.

The Aims and Objectives of This Book


The main aim of this book is to introduce you to some useful applications
of programming PIC micros such as

• Creating header files

• Controlling seven-segment displays

• Using an LCD display with two lines of 16 characters

• Pulse width modulation

• Using driver ICs such as the ULN2004A

• Controlling DC motors, including stepper motors and


servo motors

• Using every aspect of the Capture, Compare and PWM,


CCP module in the PIC

• Using interrupts

• Writing to the EEPROM

xiii
Introduction

The Objectives of This Book


After reading through this book, you should be able to program the PIC
to use all of the above. You should have a good understanding of some of
the advance programming techniques for PIC micros. You should be able
to download your programs to your PIC in a practical situation where you
have the ability to design and build some useful projects.

The Prerequisites
There are none really, but understanding the C programming language
will be useful. However, I will explain how each program works as we go
through them.
Also, if you understand the binary and hexadecimal number systems,
it will be an advantage but there is a section in the Appendix that will help
you with that.
However, to get the full use out of this book, you will need to install the
following software:

• MPLABX, which is the IDE from Microchip. The version


in the book is MPLABX Version 5.25. However, any
version later than 2.20 is OK.

• A C compiler for the 8-bit micro. I use XC8 (V2.10)


but with some programs I use XC8 (V1.35) compiler
software. However, you should be aware that some of
the later compilers are missing some useful libraries.
This is why I sometimes use version 1.35.

All of these programs are freely available from the Microchip web site.

xiv
Introduction

Another useful piece of software is a suitable ECAD (electronic


computer-aided design) software program that supports 8-bit micros.
The ECAD software I use is PROTEUS. However, it is not free, so as well as
showing you how to simulate the programs in PROTEUS, I will show you
how to use a suitable prototype board to run the programs in a practical
situation.
If you want to go down the practical route, you will need to purchase a
programming tool and a prototype board.
The tools I use are either the ICD3 can (Microchip has now moved
onto the ICD4 can) or the PICkit3 programmer to download the programs
from MPLABX to the PIC.
The prototype board I use is the picdem2 plus DEMO BOARD and
a prototype board from Matrix Multimedia (although Matrix no longer
produces the more versatile board that I use).
This book was written based around using MPLABX V5.25.
However, the principles of how to create projects and write programs
are transferable to earlier and later versions of MPLABX. There may be
some slight differences in the details, but they shouldn't cause too many
problems.
The PIC that this book is based around is the PIC18F4525. This is a
very versatile 8-bit micro that comes in a 40-pin dual-inline package. As
long as the PIC you want to use has the same firmware modules, then the
programs in the book can easily be used on other PIC micros with some
minor modifications. However, you should always refer to the data sheet
for the particular PIC you use because some of the SFRs (special function
registers) may differ. For example, the PIC18F4525 uses the ADCON0,
ADCON1, and ADCON2 SRFs to control the ADC module but the 16F88
uses the ANSEL, ADCON0, and ADCON1 registers.
Throughout the book, I include program listings and I go through an
analysis of any new instructions that the listings introduce. With respect to
the first listing, I will assume that all of the instructions are new to you, the
reader.

xv
Introduction

Before we move into the book for real, I think it will be useful to you if
I explained a bit about what MPLABX is. It is an industrial IDE created by
Microchip. The term IDE stands for integrated development environment.
It is actually a lot of programs collected together to create a programming
environment:

• There is an editor, which is slightly more than a simple


text editor. However, in my early days, I used to write
my programs in Notepad.

• There is also a compiler program that converts your


program instructions from C to the machine code that
all microprocessor-based systems use. In the very early
days of programming, the programmers used to write
in this machine code. This was a bit before my time,
although in my early days, I wrote all my programs
in assembler. Assembler is the closet language to the
actual machine code that all micros use.

• There is also a linker program that will bring together


any include files that we wish to use in our projects.

• As well as these programs, there are a range of


programs that we can use to help debug our programs
or simply simulate them.

So this IDE is a very large collection of programs that make our job of
writing code much more efficient. Yet it’s free; well, I use the free version,
which is not as efficient as the paid version but it is more than good
enough for us.
I therefore hope that you not only learn how to program the PIC micro
but you also enjoy going through my book and that you produce some
useful projects along the way.

xvi
CHAPTER 1

Creating a Header File


In an effort to reduce the amount of text in the program listings and reduce
the amount whereby I simply repeat myself, let’s create and use a series of
header files. Header files are used when your programs use the same series
of instructions in exactly the same way in all your projects and programs.
In this book, you will create three header files. The first will be
concerned with the configuration words you write for your projects.
The configuration words are used to configure how the PIC applies the
essential parameters of the PIC. They have to be written for every project
and program you create. Therefore, if you are going to write the same
configuration words for all of your projects, you should use a header file.
The second header file will be associated with setting up the PIC to
use the ports, the oscillator, the timers, etc. You will set them in exactly the
same way in all of your projects, so it’s useful to create a header file for this.
However, in some projects you may need to modify some of the settings, so
be careful when using this header file.
The third header file you will create will be used if your programs use
the LCD (liquid crystal display) in exactly the same way such that

• The LCD is always connected to PORTB.

• The LCD uses just four data lines instead of eight to


save I/O.

• The RS pin is always on Bit4 of PORTB and the E pin on


Bit5 of PORTB.

© Hubert Henry Ward 2020 1


H. H. Ward, Intermediate C Programming for the PIC Microcontroller,
https://doi.org/10.1007/978-1-4842-6068-5_1
Chapter 1 Creating a Header File

• The LCD always increments the cursor position after


each character has been displayed.

• The LCD always uses 2 lines of 16 characters.

• The actual characters are always on a 5 by 8 grid.

If this is all true, you should create a header file for the LCD.
These are the three header files you will create in this book. There are
many more examples of when you should create a header file. The process
of creating and using header files makes your program writing more
efficient.
Header files can be made available for all of your projects, like global
header files as opposed to local header files. Local header files are
available only to the project they were created in.
Also, you can split projects up so that different programmers can write
different sections of the programs and save them as header files to be used
in all projects by all of the company’s programmers.

Creating a Header File


Now that I have explained what header files are and why you would use
them, let’s create one. The first header file you will create will be for the
configuration words that you will use for most of the projects in this
book. It will also give me the chance to go through creating a project in
MPLABX for those readers who have never used MPLABX before. The
version I am using is MPLABX V5.25. It is one of the latest versions of the
IDE from Microchip. Microchip is always updating the software, but the
main concepts of creating a project and writing programs do not change.
You will be able to follow the process even if you have an earlier version of
MPLABX or a later version.

2
Chapter 1 Creating a Header File

Creating a Project in MPLABX


Assuming you have downloaded both the MPLABX software and the XC8
(V2.10) compiler software or XC8 (V1.35), when you open the software, the
opening screen will look like Figure 1-1.

Figure 1-1. The opening screen in MPLABX

The project window on the left-hand side may not be shown. If you
want it shown, you should select the word Window from the top menu
bar. Click the word Projects, with the orange boxes in front of it, and the
window should appear. You may have to move the window about to get it
in the position shown.
Now, assuming you are ready to create a project, you should either
click the word File, in the main menu bar, and select New project, or click
the orange box with the small green cross on the second menu bar. This is
the second symbol from the left-hand side of the second menu bar.
When you have selected the Create project option, you should see the
window shown in Figure 1-2.

3
Chapter 1 Creating a Header File

Figure 1-2. The New Project window

Most of the projects you will create are Microchip Embedded and
Standalone. Therefore, make sure these two options are highlighted and
then click the Next button. The Select Device window should now be
visible, as shown in Figure 1-3.

4
Chapter 1 Creating a Header File

Figure 1-3. The Select Device window

In this window, you can choose which PIC you want to use. Select the
Advanced 8-bit MCUs (PIC18) in the small box alongside Family, as shown
in Figure 1-3. Then, in the Device window, select the PIC18F4525. The result
is shown in Figure 1-3. To make these options visible, you need to click the
small downward pointing arrow in the respective box. The different options
should then become visible. If the device window is highlighted in blue, you
could simply type in the PIC number you want, such as PIC18F4525. Your
selected device should appear in the window below.
If you are using a different PIC, select it here.
Once you are happy with your selection, click the Next button.
The next window to appear is the Select Tool window. This is shown
in Figure 1-4. With this window you can select the programming tool you
want to use to download the program to your prototype board. There are a
range of tools you can use. I mainly use the ICD3 CAN or the PICkit3 tool.

5
Chapter 1 Creating a Header File

However, if I am only simulating the program, I use the simulator option.


Note that the MPLABX IDE comes with its own simulations for the PICs
you may use. It also has a wide range of tools that allow us to simulate
and test programs within MPLABX all without having a real PIC. You will
use the simulator in this project, so select the simulator option shown in
Figure 1-4.

Figure 1-4. The Select Tool window

Having selected the tool you want, click Next to move on to the next
window where you can select the compiler software you want to use,
assuming you have downloaded the appropriate compiler software (see
Figure 1-5).

6
Chapter 1 Creating a Header File

Figure 1-5. The Select Compiler window

You should select the XC8(V2.10) compiler software, although with


some later projects you will use V1.35, as shown in Figure 1-5. Then click
Next to move to the Select Project Name and Folder window shown in
Figure 1-6.

7
Chapter 1 Creating a Header File

Figure 1-6. The Select Project Name and Folder window

In this window, you will specify the name of the project and where you
want to save it. The software will create a new directory on your computer
with the project name you create here. It is recommended that you don’t
use long-winded, complicated path names for the new folder so I normally
save all my projects on the root directory of my laptop.
I have suggested a project name for this new project as
advanceProject1. Note that I am using camelcase, where two words,
or more, are combined together. The first letter of the first word is in
lowercase and the first letters of any subsequent words are in uppercase. In
this way multiple words can be combined together to make one long word.
As you type the name for your project, you should see that the folder is
created on the root drive, or wherever you have specified it should be. The
folder name will have a .X added to it.
It will be in this new folder that all the files associated with the project
will be saved as well as some important subdirectories that are created.

8
Chapter 1 Creating a Header File

Once you are happy with the naming of the project, simply click the
Finish button and the project will be created. The window will now go back
to the main window, as shown in Figure 1-7.

Figure 1-7. The main window with the project created

You should see the project window at the left-hand side of your screen,
as shown in Figure 1-7. Note that you may need to move the window about
to get it the same as that shown in Figure 1-7.
Now that you have the new project created, you need to create a
header file that you will use in all of your projects in this book.
To create the header file, right-click the subdirectory in the project tree
named Header Files. When you do this, the flyout menu will appear, as
shown in Figure 1-8.

9
Chapter 1 Creating a Header File

Figure 1-8. The flyout menu for the new header file

From that flyout menu, select New. From the second flyout menu,
select xc8_header.h, as shown in Figure 1-8.
The window shown in Figure 1-9 will appear.

10
Chapter 1 Creating a Header File

Figure 1-9. The name and location for the new header file

All you need to do here is give the file a name. I have chosen the name
conFigInternalOscNoWDTNoLVP as it gives a good description of what I
want to do in this header file, which is set these three main parameters of
the configuration words. Note the configuration words specify how you
want to configure and so use the PIC.
The main concern is that PICs have a wide variety of primary oscillator
sources and you need to tell the PIC which one you will be using. The
oscillator is the device or circuit that provides a signal from which the
clock signal, the signal that synchronizes the operations of the PIC,
is derived. I prefer to use the internal oscillator block as the primary
oscillator source. This saves buying an oscillator crystal. It also saves two
inputs that would be used if I used an external oscillator. This is because I
would connect the external oscillator to the PIC via those two input pins,
normally RA6 and RA7.

11
Chapter 1 Creating a Header File

The second major item I change is to turn off the WDT, which is the
watch dog timer. This is a timer that will stop the micro if nothing has
happened for a set period of time. This is a facility that you don’t want in
these programs, so you must turn it off. Note that the WDT is mainly used
in continuous production lines. In that situation, the fact that nothing has
happened for a set time usually means something has gone wrong so it’s
best to turn everything off.
The third item to turn off is the low voltage programming (LVP)
function. The low voltage programming affects some of the bits on
PORTB. Therefore, to keep the bits on PORTB available for general I/O, I
normally turn off the LVP.
So this explains the header file’s cryptic name. You should always give
your header files a name that relates to how you want to use the file.
Once you have named the header file, click Finish and the newly
created header file will be inserted into the main editing window in
the software. However, Microchip automatically inserts an awful lot of
comments and instructions that, at your level of programming, you don’t
really need. Therefore, simply select all that stuff and delete it so that you
have an empty file ready for you to insert the code that you really want.
Now that you have a clean file, you can control what goes into it. The
first thing you should do is put some comments in along the following
lines:

• You should tell everyone that you wrote this code.

• You should say what PIC you wrote it for and when you
wrote it.

• You should explain what you are trying to do with it.

12
Chapter 1 Creating a Header File

There are two types of comments in C programs, which are

• Single-line comments: They start with two forward


slashes (//). Anything on the same line after the two
forward slashes is ignored by the compiler as they are
simply comments. For example,

//these words are just comments

• Multiple lines of comments or a paragraph of


comments: This is text inserted between the following
symbols: /* */. For example,

/* Your comments are written in here */

So insert a paragraph of comments as shown in Figure 1-10.

Figure 1-10. The comments for the header file

You should insert your own comments into the editor similar to those
shown in Figure 1-10.
You will notice that I changed the colour of my comments to black and
bold size 14. This is to try and make them more visible than the default
grey.
If you want to change the colour, you can do so by selecting the word
Options from the drop-down menu that appears when you select the
Tools choice on the main menu bar. You will get the window shown in
Figure 1-­11.

13
Chapter 1 Creating a Header File

Figure 1-11. Changing the font and colours

Click the tag for Fonts and Colours and then select what you want to
change. Once you are happy with your choice, click OK. I changed the
colour of the comments to black, as shown in Figure 1-11.
Now you need to create the configuration words for your header file.
As this is something you must do for all your projects, Microchip has
developed a simple process for writing to the configuration words. This
can be achieved using a special window in the MPLABX IDE. To open this
window, click the word Window on the main menu bar and then select
Target Memory Views from the drop-down menu that appears. Then select
Configuration Bits from the slide-out menu that appears. This process is
shown in Figure 1-12.

14
Chapter 1 Creating a Header File

Figure 1-12. Selecting the configuration bits

Once you have selected the configuration bits, your main window will
change to that shown in Figure 1-13.

Figure 1-13. The configuration bits

15
Random documents with unrelated
content Scribd suggests to you:
14th Regiment.
HISTORICAL RECORD
OF

THE FOURTEENTH,
OR

THE BUCKINGHAMSHIRE REGIMENT


OF

F O O T.

1685

In the summer of 1685 England was in a state of tranquillity; the


minds of men were not, however, at ease respecting the religion of
their king, James II., but they put the best construction on his
conduct, and manufactures and commerce were flourishing; when
suddenly James Duke of Monmouth invaded the western shores with
a few followers, and asserted his claim to the sovereignty of the
realm. The din of hostile preparation instantly resounded throughout
the kingdom, and thousands of His Majesty's subjects laid aside the
pursuits of industry, and arrayed themselves under the royal
standard, to oppose the invader and his adherents. At this juncture
Sir Edward Hales, Baronet, of Woodchurch, in the county of Kent,
stood forward in the support of the Crown, and raised a company of
one hundred musketeers and pikemen, for the king's service, at
Canterbury and in its vicinity. Companies were also raised by the
following loyal gentlemen:— —— Boynton, Esq., Robert Middleton,
Henry Vaughan, Richard Brewer[1], William Broom, John Gifford,
Thomas Gifford, Mark Talbot, John Chappell, and Rowland Watson,
and these companies were constituted a regiment, of which Sir
Edward Hales was appointed colonel, —— Boynton lieutenant-colonel,
and Robert Middleton major, by commissions dated the 22nd of
June, 1685; and the corps thus formed now bears the title of the
Fourteenth Regiment of Foot. The general rendezvous of the regiment
was at Canterbury; two companies had their rendezvous at
Rochester and Chatham, and others at Sittingbourne and
Feversham.
While the formation of the regiment was in progress, the rebel
army was defeated at Sedgemoor, and the Duke of Monmouth was
captured and beheaded. Sir Edward Hales's regiment was, however,
one of the corps which the King resolved to retain in his service; the
establishment was fixed at ten companies of sixty men each, and in
the middle of August the regiment was encamped on Hounslow-
heath, where it was reviewed by His Majesty; it afterwards marched
to Gravesend and Tilbury, detaching two companies to Jersey, one to
Guernsey, and two to Windsor.

1686

On the 1st of January, 1686, the establishment was estimated at


the following numbers and rates of pay, viz.:—
Sir Edward Hales's Regiment.
Pay per Day.
Staff. £ s d.
The Colonel, as Colonel 0 12 0
Lieut.-Colonel, as Lieut.-Colonel 0 7 0
Major, as Major 0 5 0
Chaplain 0 6 8
Chirurgeon, ivs., one mate iis. vid. 0 6 6
Adjutant 0 4 0
Quarter Master and Marshal 0 4 0
——————
2 5 2
——————

The Colonel's Company.


Pay per Day.
£ s d.
The Colonel, as Captain 0 8 0
Lieutenant 0 4 0
Ensign 0 3 0
2 Serjeants, xviiid. each 0 3 0
3 Corporals, xiid. each 0 3 0
1 Drummer 0 1 0
50 Soldiers, at viiid. each 1 13 4
——————
Total for 1 Company 2 15 4
——————
Nine Companies more at the same rate 24 18 0
——————
Total per day 29 18 6
——————
Per annum £10,922 12s. 6d.

1687

The regiment was again encamped on Hounslow-heath in the


summer of 1687, and a grenadier company was added to its
establishment. At this period the following officers were holding
commissions in the regiment, viz.:—
Captains. Lieutenants. Ensigns.
Sir Edw. Hales, (Col.) Thomas Butler Dudley Van Burgh
G. Barclay, (Lt.-Col.) Robert Seaton Austin Belson
John Gifford, (Major) Richard Boucher Thomas Heyward
John Chappell Gaven Talbot Philip Overton
Rowland Watson James Nicholson Dudley Van Colster
Thomas Weld Bryce Blair Clifford Brexton
George Latton William Carew George Blathwayt
Richard Brewer Nicholas Morgan Edward Hales
Thomas Gifford Edward Gifford Edward Pope
George Aylmer Augustin Gifford Cæsar Gage
{William Fielding }
Peter Shackerly Grenadier Company
{Francis Sanderson }
Chaplain, Nicholas Trapps.—Adjutant, James Nicholson.
Chirurgeon, John Ridley.—Quarter-Master, Edward Syng.

After passing in review before the King and Queen, and other
members of the royal family, the regiment struck its tents and
marched to Plymouth, where it was stationed during the winter.

1688

From Plymouth the regiment marched to London in June, 1688,


and took the duty at the Tower until the middle of August, when it
was relieved by the Royal Fusiliers, and marched to Canterbury, and
in September to Salisbury.
In the mean time the measures adopted by King James II. to
establish Papacy and arbitrary government had filled the country
with alarm. Among other proceedings the King claimed the power of
dispensing with the oaths, required by law, on appointment to office;
the colonel of the Fourteenth Regiment, Sir Edward Hales, had
espoused the Roman Catholic religion; he, therefore, could not take
the oaths, and was not eligible for his commission; he was
prosecuted and convicted at Rochester assizes; but he moved the
case into the Court of the King's Bench, and had judgment in his
behalf; eleven of the twelve judges taking part with the King against
the law. Many of the nobility solicited the Prince of Orange to aid
them in opposing the measures of the court, and when the Prince
arrived with a Dutch army, the King assembled his forces at
Salisbury. The result may be told in a few words:—the English army
refused to fight in the cause of Papacy and arbitrary government;
the King, accompanied by Colonel Sir Edward Hales, and Quarter-
Master Edward Syng, of this regiment, attempted to escape to
France in disguise; but they were apprehended on board of a
Custom-house vessel at Feversham, and Sir Edward Hales was
afterwards confined in the Tower of London. The King made a
second attempt, and arrived in France in safety. The Prince of
Orange issued orders for the regiment to occupy quarters at
Waltham, in Hampshire, and conferred the colonelcy on William
Beveridge, an officer of the English brigade in the Dutch service, by
commission dated the 31st of December, 1688.

1689

The accession of William Prince of Orange and his consort to the


throne was opposed in Scotland, and in the spring of 1689 the
regiment was ordered to march towards the north; it was stationed
a short time at Berwick, where it was inspected on the 14th of June
by the commissioners for re-modelling the army: in August it
received orders to march to Edinburgh.

1690
1691

The regiment was employed in various services in Scotland and


the north of England until the insurgent clans had lost all hope of
success, and in 1691 they tendered their submission to the
government of King William III.

1692

In the spring of 1692, the regiment embarked for Flanders, to take


part in the war in which the British monarch was engaged, to
preserve the liberties of Europe against the ambitious projects of the
court of France. Scarcely had it arrived at the seat of war, and taken
post in one of the fortified towns of West Flanders, when the French
monarch assembled his army near La Hogue, and prepared a fleet to
convey the troops to England, for the purpose of replacing King
James on the throne. The regiment was immediately ordered to
return, and having landed at Greenwich in the early part of May, it
was held in readiness to repel the invaders, should they venture to
land on the British shores; but while the menace of invasion was
producing considerable alarm in England, the French fleet sustained
a decisive defeat off La Hogue, and the danger instantly vanished:
the hopes of the Jacobites were frustrated, and the ascendancy of
Protestant principles insured. The regiment was afterwards
encamped near Portsmouth, and it formed part of an expedition
under the Duke of Leinster, afterwards Duke Schomberg, against the
coast of France; but the French naval force having been nearly
annihilated at the sea-fight off La Hogue, Louis XIV. expected a
descent, and had drawn so many troops from the interior to the
coast, that the Duke of Leinster did not venture to land. After
menacing the French shores at several points, to produce a diversion
in favour of the confederate army in the Netherlands, the fleet sailed
to the Downs, from whence it proceeded to Ostend, where the
troops landed: they took possession of and fortified the towns of
Furnes and Dixmude, and several regiments afterwards returned to
England.
On the 14th of November Colonel William Beveridge was killed in a
duel with one of the captains; and King William afterwards conferred
the colonelcy of the regiment on Lieutenant-Colonel John Tidcomb,
from the Thirteenth Foot.

1693

The Fourteenth was one of the regiments which remained in


Flanders, and it took the field in May, 1693, to serve the campaign of
that year with the confederate army, commanded by King William in
person, who took possession of the camp at Parck, near Louvain, to
prevent the designs of Louis XIV. on Brabant.
After taking part in several movements, the regiment was in
position at Landen, on the morning of the 19th of July, when the
French army, of very superior numbers, commanded by Marshal
Luxembourg, advanced to attack the forces under King William. On
this occasion the Fourteenth Regiment had its first opportunity of
proving its prowess in action with the enemy, and it gave presage of
that gallantry for which it afterwards became distinguished. The
French commenced the action with great spirit, but were repulsed
several times; their superior numbers enabled them to bring forward
fresh troops, and they eventually carried the village of Neer-Winden.
The King ordered a retreat, which was executed with difficulty, and
was attended with serious loss.
The Fourteenth Regiment had Captains Van Burgh, Cassin, and
Henriosa, and Lieutenant Worley, killed; Lieutenant Nicholson died of
his wounds; Captains Devaux and Stanwix, Lieutenants Campbell,
Forbes, and Pettitpiere, Ensigns Revison and Perrott, wounded;
Lieutenant-Colonel Graham taken prisoner: the number of non-
commissioned officers and soldiers of the regiment, killed and
wounded, has not been ascertained.
In the autumn, when the army separated for winter quarters, the
regiment marched into garrison at Bruges; at the same time parties
were sent to England to procure recruits, to replace the losses
sustained during this campaign.

1694

When the army took the field in the spring of 1694, the regiment
was left, with several other corps, under Brigadier-General Sir David
Collier, encamped near Ghent, to form a guard for the artillery, which
was conveyed by water to Malines. The regiment joined the army at
the camp near Louvain, on the 4th of June, and on the 6th it was
reviewed by His Majesty, who was pleased to express to Colonel
Tidcomb his high approbation of its appearance. The regiment was
afterwards employed in several movements, and it formed part of
the splendid body of troops encamped at Mont St. André, near the
village of Ramilies, where the forces of the confederate states were
assembled under King William III., and presented a magnificent
spectacle of war.
The Fourteenth was one of the corps which attempted, by a forced
march, to pass the enemy's fortified lines, and penetrate French
Flanders; but by extraordinary exertions the French gained the pass
first, and thus preserved their country from an invasion. The
regiment was subsequently encamped near Rousselaer, forming part
of the covering army during the siege of Huy. The vicinity of the
camp was infested by detachments of the enemy, and on one
occasion the waggons conveying the bread to the army were
attacked, when a detachment of the Fourteenth, forming part of the
guard, was engaged, and the regiment had Captain Sacheverel
mortally wounded, who was the only British officer killed by the
enemy during this campaign.
Having to remain in the field during cold and wet weather, the
soldiers erected huts of wood and straw, and on the 1st of October
the huts of the Fourteenth Regiment were accidentally set on fire,
and destroyed: the Second Foot Guards had experienced the same
misfortune a few days previously. The fortress of Huy having
surrendered, the army separated for winter quarters, and the
regiment returned to Bruges in the second week in October.

1695

From Bruges, the regiment marched, in May, 1695, to Dixmude,


where it pitched its tents, and remained several days. The Duke of
Wirtemberg took the command of the troops assembled at this
point, and advancing to the junction of the Loo and Dixmude canals,
encamped before the fortress of Kenoque, upon which an attack was
made for the purpose of drawing the French army that way, for the
protection of their lines in West Flanders. The Fourteenth Regiment
took part in this service; its grenadier company was engaged in
driving the French from the intrenchments and houses near the Loo
canal, and in repulsing the attempts of the enemy to regain
possession of them. A redoubt was afterwards taken, and a
lodgment effected in the works at the bridge, in which services the
regiment had several men killed and wounded. This demonstration
having produced the desired effect, the strong fortress of Namur
was exposed to an attack from the main army, and it was
accordingly invested, and the siege commenced.
The attack on Kenoque was then desisted in; the Fourteenth
Regiment was one of the corps withdrawn from West Flanders, and
joined the covering army, under the Prince of Vaudemont, at
Wouterghem.
From Wouterghem, the regiment marched towards Namur, to take
part in the siege of that important fortress, which was deemed
nearly impregnable, and was defended by a numerous garrison,
under the celebrated Marshal Boufflers. On arriving before Namur
the regiment pitched its tents at Templeux, from whence it advanced
and took its turn of duty in the trenches.
On the 8th of July, the regiment was on duty before Namur, and it
was ordered to support the attacks to be made that evening on the
covered-way near the hill of Bouge: the storming party was
commanded by Major-General Ramsay. About seven o'clock in the
evening, the signal for the attack was given, and the storming party
rushed forward with the most distinguished heroism. The Fourteenth
moved forward to support the attack, and mingling with the
combatants evinced signal intrepidity. The soldiers rushed up to the
enemy's palisades, and placing the muzzles of their muskets
between the staves, fired a volley, which put the French into some
confusion. The palisades were afterwards broken;—the supporting
corps joined in the assault,—the second covered-way was carried,
and the French overpowered, driven from their works, pursued
among the batteries on the brow of the hill, and many of them were
killed in the stone pits in which they took refuge. This post having
been thus captured, the Fourteenth Regiment retired, and being
relieved from duty in the trenches, it returned to its camp at
Templeux, a league and a half from Namur. Its loss was severe:—
Lieutenant Ravisson was killed; Captain Carew and Ensign Perott
died of their wounds; Captains Pope, Jackson, and Forbes, and
Ensign Cormach, were wounded, but afterwards recovered.
The regiment quitted its post at Templeux, took its station in the
lines of circumvallation, and mounted guard in the trenches, on the
10th of July; it was again on duty in the trenches on the 16th of July,
when it had Captain Forbes and several private soldiers killed.
A detachment of the grenadiers of the regiment was engaged, on
the 17th of July, in an attack upon the counterscarp; the assault was
made about five o'clock in the evening; the French disputed the post
with great bravery, defending the glacis for some time; but they
could not withstand the prowess of the British grenadiers, who
effected a lodgment, and obliged the enemy to abandon the
counterscarp. Lieutenant Williams of the grenadier company of the
regiment was killed, and Captain Devaux was wounded with the
working party.
The regiment was again on duty in the trenches on the 19th and
24th of July. On the following day the town surrendered, the
garrison retiring to the castle.
After the surrender of the town of Namur, the regiment quitted the
lines of circumvallation, and joined the covering army under the
Prince of Vaudemont, which encamped, on the 8th of August, near
the village of Waterloo, and afterwards took up a position near
Namur. A numerous French army commanded by Marshal Villeroy
advanced to raise the siege of the castle, but the covering army
occupied a position which was deemed too formidable to be
attacked, and the French Marshal withdrew without hazarding an
engagement.
A detachment from the grenadier company of the regiment quitted
the covering army, and was engaged, on the 20th of August, in
assaulting the breaches of the Terra Nova and Coharne, under the
command of Lord Cutts. This proved a desperate service, particularly
the assault of the Terra Nova, where the British grenadiers were
engaged, and a serious loss was sustained in consequence of the
regiments ordered to support the attack not advancing in time. The
Fourteenth Foot had several men killed and wounded, and Lieutenant
Sewell, who commanded the detachment from the grenadier
company, was also wounded.
Preparations were made for a second assault, when Marshal
Boufflers agreed to surrender on honorable terms, which were
granted. Thus was captured this important fortress, which the
French had boasted might be restored, but could not be taken; and
the achievement reflected great credit on the confederate arms; it
was the most important event of the war.
After the surrender of the castle of Namur, the regiment remained
a short time in the field, and subsequently marched into
cantonments in the villages near the Bruges canal.

1696

The French monarch not only found his career of conquest


arrested, by the efforts of the sovereign of Great Britain, but the
towns he had captured were also being re-taken, and it became a
point of great importance to him to detach England from the
confederacy, which could only be accomplished by re-placing King
James on the throne. For this purpose measures were privately
concerted for exciting a rebellion in England; the Duke of Berwick,
and several other English officers in the French service, were sent
across the Channel in disguise, and through their persuasions a
number of men were prepared to rise at a moment's notice; at the
same time a conspiracy was formed in London to assassinate King
William, and fifty men were engaged and prepared with arms to
commit the diabolical act: a French naval and land force was also
held in readiness for a descent on the English coast, and King James
was at Calais prepared to embark. At this juncture, the Fourteenth,
and a number of other regiments, received orders to return to
England, and they arrived at Gravesend in March, 1696. The
conspiracy was, however, discovered; a British fleet was sent to
blockade the French ports, and the designs of the King of France
being thus defeated, King William was left at liberty to prosecute the
war for the security of the civil and religious liberties of the nations
of Europe. Several of the corps which had arrived from Flanders
returned to the seat of war immediately; but the Fourteenth was one
of the regiments selected to remain on home service; it landed at
Gravesend on the 22nd of March, and proceeded to Canterbury and
Feversham, from whence it was removed to London in November,
and took the duty at the Tower.

1697

In 1697, King William saw his efforts for the preservation of


national independence attended with success; the French monarch
was humbled, and the treaty of Ryswick fixed the balance of power
in Europe.

1698

Soon after the restoration of peace, the regiment received orders


to proceed to Ireland, and it landed at Belfast and Cork in March,
1698; at the same time it was placed upon a peace establishment.

1701
1702

King James died in France in 1701, when Louis XIV. proclaimed


the Pretender King of Great Britain by the title of James III.; this
event, with the elevation of the Duke of Anjou, grandson of Louis
XIV., to the throne of Spain, in violation of solemn engagements,
was followed by a sanguinary war with France and Spain, during
which the continent of Europe, and the peninsula of Portugal and
Spain, became theatres for the display of British valour, but the
Fourteenth Regiment was selected to remain in Ireland. The
proclamation of the Pretender, and the death of King William III., in
March, 1702, revived the hopes of the partisans of the Stuart family,
who were conspiring to elevate the Pretender to the throne, and
Queen Anne deemed it expedient to detain a few trusty corps, of
approved devotion to the Protestant interest, in Ireland.
1703

Although the honorable distinction of being selected to remain in


Ireland, prevented the regiment acquiring laurels in the field, yet it
sent several drafts of men on foreign service, who had opportunities
of distinguishing themselves. In the autumn of 1703 it furnished a
draft of fifty men to complete Lord Montjoy's, and another draft of
the same strength for Colonel Brudenel's regiments, (afterwards
disbanded,) on their embarkation to accompany the Archduke
Charles of Austria to Portugal. The regiment was in garrison at
Dublin from the 7th of August to the 31st of December, 1703.

1705

In the autumn of 1704, and the spring of 1705, additional


detachments were sent to Portugal, to serve under General the Earl
of Galway; they were conducted thither by Captain Laffit, Ensigns
Schackford and Blount, and three serjeants, whose expenses,
amounting to 70l. 19s. 4½d., were directed to be paid by a warrant
dated the 5th of July, 1705. In August of the same year the regiment
furnished a captain, lieutenant, ensign, two serjeants, and fifty rank
and file towards completing the regiments of Charlemont, George,
and Caulfield, (afterwards disbanded,) on their embarkation with the
expedition under General the Earl of Peterborough, who captured
Barcelona, and had astonishing success in Catalonia and Valentia.

1706

The regiment was quartered at Dublin from March to November,


1706, and the private soldiers received a penny a day in addition to
their pay, granted by King William III. in 1699, to all regiments
employed on duty at Dublin. The Fourteenth had, however performed
the duty of two regiments for some time, and the allowance was
extended to all detachments, in consideration of the good conduct of
the corps.
1707
1712

The Fourteenth Regiment remained in Ireland during the whole of


the war, continuing to send detachments abroad from time to time,
particularly to Portugal and Spain, and its excellent conduct on home
service occasioned it to be held in high estimation by the
Government.

1713

On the 14th of June, 1713, Lieutenant-General Tidcomb died at


Bath; and Queen Anne conferred the colonelcy of the regiment on
Colonel Jasper Clayton, from the half-pay of a newly-raised corps
which was disbanded a short time previously.

1714
1715

The decease of Queen Anne, and the accession of King George I.,
in 1714, was followed by renewed efforts on the part of the
partisans of the Pretender to procure his elevation to the throne;
these exertions began to assume an alarming appearance in the
summer of 1715, when the well-known attachment of the Fourteenth
Regiment to the Protestant succession, occasioned it to be recalled
from Ireland, and ordered to Scotland, where the Jacobites were
numerous, and it landed at Saltcoats in Ayrshire early in the summer.
In the autumn the Earl of Mar assembled his vassals, erected the
standard of the Pretender in the Highlands, and summoned the clans
to take arms. The royal forces in Scotland were encamped at Stirling
under Major-General Wightman; the Fourteenth Regiment joined the
camp in October, and the Duke of Argyle assumed the command;
but his Grace had not four thousand men to confront ten thousand
under the Earl of Mar.
When the rebel army advanced towards the Firth, the King's
troops quitted the camp at Stirling and proceeded towards
Dumblain; and on the morning of the 13th of November the hostile
forces confronted each other on Sheriffmuir: the Fourteenth foot
were posted in the left wing of the royal army. The rebels advanced
to commence the engagement, and at that moment it was deemed
necessary to make some alteration in the position of the royal
forces; as the left wing was taking up the new alignment, it was
attacked by a body of the clans of very superior numbers, and put
into some confusion: at the same time the right wing of the royal
army overpowered the left wing of the rebel host, and drove it from
the field; each commander having one wing triumphant and one
wing defeated. The Fourteenth, and several other corps on the left,
resisted the charge of the clans a short time, but being attacked in
the act of forming, and engaged by very superior numbers, they fell
back a short distance; they thus became separated from the
remainder of the army, and retiring beyond Dumblain, took
possession of the passes to prevent the clans penetrating towards
Stirling. Both armies retained their position during the day, and the
rebels, being defeated in their design of penetrating southward,
afterwards retired; when the King's troops returned to their camp at
Stirling.
The Fourteenth Foot had one lieutenant and six rank and file killed;
fourteen rank and file wounded; Captain Barlow, Lieutenant Griffin,
and several private soldiers were made prisoners.
The Pretender arrived in Scotland soon afterwards, and his
presence appeared to give new life to his adherents.

1716

Additional forces joined the army under the Duke of Argyle: the
Fourteenth was formed in brigade with the Third, Twenty-first, and
Thirty-sixth regiments, under Brigadier-General Morrison; and in
January, 1716, the royal troops advanced, marching through snow,
over ice, and exposed to severe weather, when the Pretender
retreated, and losing all hope of success he escaped, with the
leaders of the rebellion, to France: the Highlanders, finding
themselves deserted by their commanders, dispersed. After pursuing
the insurgents some distance, the Fourteenth was quartered a short
time at Dunkeld.

1717
1718

The rebellion being suppressed, the regiment was stationed in


garrison at Fort William, which was built in the reign of King William
III., in a plain, on a navigable arm of the sea called Loch Eil, near
the influx of the Lochy and Nevis, in the shire of Inverness. At this
place the regiment was stationed during the year 1717, and in 1718
it marched from thence to Perth, and afterwards to Inverness, where
it remained until June of the following year.

1719

In the mean time Scotland had not enjoyed a state of tranquillity;


but the minds of the people had been constantly agitated by the
projects of the friends of the Pretender. When the Earl of Mar's
rebellion was suppressed, the King of Sweden made preparations for
a descent in favour of the Pretender; and when that project failed,
the King of Spain fitted out an armament to place the Pretender on
the throne. The Spanish fleet was dispersed by a storm; but two
ships arrived on the coast of Scotland, in April, 1719, and four
hundred Spaniards, with about a hundred Scots and English
gentlemen, landed at Kintail, on the main within Skye, and
encamped opposite the castle of Donan, where they were joined by
about fifteen hundred men of the clans. To oppose this force the
Fourteenth left Inverness on the 5th of June, and being united with
three troops of the Scots Greys, the Eleventh and Fifteenth
Regiments, under Major-General Wightman, arrived about four
o'clock on the afternoon of the 10th of June at Glenshiel, when the
Spaniards and Highlanders retreated and formed for battle on the
romantic mountain scenery of the pass of Straichell. The King's
troops advanced, and at five o'clock the signal for battle was given,
when the infantry climbed the rocky crags and opened a sharp fire
of musketry, which was re-echoed in the hollows beneath; at the
same time the Greys charged along the road to force the pass. The
enemy returned the fire, but soon gave way, and were chased from
rock to rock for some time; on gaining the top of the hill they made
a momentary stand, but the King's infantry sent forward a shower of
bullets and advanced at a running pace to charge with bayonets,
when the Spaniards and Highlanders fled in every direction. The
soldiers passed the night in the hills; the Spaniards surrendered on
the following day; the Highlanders dispersed; and the Marquis of
Tullibardine, the Earl of Seaforth, and other rebel leaders, fled to the
continent.

1721

After this service the regiment marched to the castle of Bran, near
Kainloch-Benchven, Inverness-shire; and in 1721 it proceeded to
Edinburgh.

1722

The regiment quitted Scotland in May, 1722, and marched to


Hungerford: in the summer it was encamped, with several other
corps, on Salisbury-plain, where it was reviewed by King George I.
on the 30th of August, and afterwards returned to Hungerford.

1723

Early in 1723 the regiment marched to Reading and Windsor; it


was subsequently encamped in Hyde-park, and in the autumn
marched to Bristol.

1725
1726
1727

In May, 1725, the regiment commenced its march for Berwick; in


July, 1726, it was removed to Lancashire; and in January, 1727, it
marched to Canterbury, from whence four companies were detached
to Dover, Ashford, Sandwich, and Feversham.
At this period the Spaniards had commenced the siege of
Gibraltar, which fortress had been captured by a British and Dutch
armament in 1704, and had been ceded to Great Britain at the treaty
of Utrecht, in 1713. The colonel of the Fourteenth, Jasper Clayton,
was Lieutenant-Governor of Gibraltar; he proceeded thither in
January, 1727, and took the command of the garrison, which opened
its fire on the Spanish troops on the 21st of February; and in March
the regiment embarked to take part in the defence of that important
fortress, where it arrived on the 21st of April, together with a
battalion of Foot Guards, and the Governor, General the Earl of
Portmore. The regiment landed immediately, and it had the honor to
take an active share in the successful defence of this valuable
entrepôt to the Mediterranean. The Spaniards continued the siege
until many men had perished in the attempt, and the tremendous
fire of their artillery had produced little effect besides the bursting
and damaging of their own cannon. In the early part of June the fire
slackened, and on the 18th of that month hostilities ceased.

1729

The regiment was afterwards selected to form part of the garrison


of Gibraltar, where it was stationed during the following fifteen
years. Previously to quitting England, two companies were added to
its establishment; these companies remained on home service; they
were stationed in the south of England until 1729, when they were
disbanded.

1739
1740
1742

War between Great Britain and Spain was resumed in 1739; and
the claims of the Elector of Bavaria on the kingdoms of Bohemia and
Hungary, which were attempted to be enforced after the death of
the Emperor, Charles VI., in 1740, involved Great Britain in hostilities
with France and Bavaria. King George II. resolved to support the
House of Austria; the garrison of Gibraltar was reinforced, and the
Fourteenth Regiment, having been relieved from duty at that fortress,
arrived at Portsmouth in September, 1742. After reposing a few days
in barracks at Portsmouth, the regiment marched into quarters in
Yorkshire, the head-quarters being at York.

1743

In the summer of this year, His Majesty sent an army to Flanders


to support the House of Austria, and on the 16th of June, 1743, the
colonel of the Fourteenth Foot, Lieutenant-General Jasper Clayton,
who was employed on the staff of the British army in Flanders, was
killed at the battle of Dettingen; he was an officer of distinguished
merit; his fall was regretted by the King and the whole army, and his
remains were interred, with great solemnity, in the Chapel of Prince
George of Hesse. The King conferred the command of the regiment
on Colonel Joseph Price, from the Fifty-seventh, now Forty-sixth Foot,
by commission dated the 22nd of June, 1743.

1744

From Yorkshire the regiment marched into Northumberland, and


was stationed at Berwick; in 1744, it marched to Dunstable and
afterwards to Colchester.

1745

Immediately on the receipt of the news of the loss of the battle of


Fontenoy, on the 30th of April, 1745, the regiment received orders to
proceed to Flanders, to join the allied army commanded by His Royal
Highness the Duke of Cumberland; it embarked at Tilbury, on the
15th of May, landed in West Flanders, and joined the camp on the
plain of Lessines, before the end of the month. The regiment took
part in several operations; it was encamped at Grammont, and
afterwards on the Brussels' canal, in order to cover Dutch Brabant;
but the French had so great a superiority of numbers, that it was
found impossible to prevent their capturing several fortified towns.
In the mean time, Charles Edward, eldest son of the Pretender,
had arrived in Scotland, and being guided by desperate and
designing men, and joined by a number of the clans, he resolved on
the romantic enterprise of attempting to dethrone a beloved
monarch, to overturn the constitution of a brave and free people,
and to establish the authority of a dynasty which had been removed
for arbitrary attacks on the established religion and laws. The
Fourteenth was one of the regiments ordered home on this occasion;
it arrived in the north of England, and formed part of the army
assembled by Field-Marshal Wade, at Newcastle, to prevent the
rebels penetrating into South Britain; and, in the second week of
November, it was detached to Berwick, where it arrived in time to
prevent the rebels capturing that town. The regiment afterwards
marched to Scotland, and when the clans made a precipitate retreat
from Derby, back to Scotland, it took up its quarters in the city of
Edinburgh.

1746

The young Pretender was joined by some new levies, and he


procured a supply of artillery and ammunition, which enabled him to
commence the siege of Stirling Castle: and Lieutenant-General
Hawley, who commanded the King's troops at Edinburgh, resolved to
attempt to raise the siege. For this purpose, the Fourteenth, and
several other corps, advanced from Edinburgh on the 13th of
January, 1746, under Major-General Huske, and drove a body of the
rebels out of Linlithgow; on the following day another division
marched to Borrowstounness; and on the 16th of January, the army
encamped near Falkirk.
About mid-day on the 17th of January, the rebel army was seen
moving towards some high ground on Falkirk-moor, and the King's
troops quitted their camp-ground to engage the clans. Passing some
rugged grounds, the soldiers diverged on the moor, and formed two
lines; the Fourth and Fourteenth Regiments constituted Brigadier-
General Cholmondeley's brigade, and were posted in the first line. As
the King's troops advanced to battle a tremendous hurricane, with a
heavy shower of rain, beat violently in their faces, and nearly blinded
them; at the same time it beat on the backs of the clans, and
caused them little annoyance; the soldiers could not see to take aim,
very few muskets would give fire, and, under these circumstances,
some confusion took place, and several regiments quitted the field;
but the Fourth and Fourteenth Regiments under Brigadier-General
Cholmondeley made a determined stand, and they withstood the
fury of the charging Highland host with astonishing firmness,
evincing the most heroic valour under circumstances of peculiar
danger and difficulty. They were joined by the second battalion of
the Royals, the Third and Forty-eighth Regiments; Major-General
Huske assumed the command; and these five corps repulsed one
wing of the rebel army, and maintained their post, on the field of
battle, until night, when no enemy could be seen, and the soldiers
being wet, and the night cold and stormy, they retired.
The King's troops retreated to Edinburgh, where His Royal
Highness the Duke of Cumberland arrived, and assumed the
command, and on the 31st of January the army again advanced,
when the rebels raised the siege of Stirling Castle, and made a
precipitate retreat towards Inverness. The royal army pursued the
rebels as far as Perth, where it halted in consequence of severe
weather; the march was resumed on the 20th of February; but
heavy rains occasioned the army to make another halt at Aberdeen.
The troops were again in motion in the early part of April, and on
the 16th of that month, as they advanced in three columns towards
Inverness, the rebel army was discovered in order of battle on
Culloden-moor, when the royal forces formed three lines, the
Fourteenth Foot taking post in the centre of the first line, under
Lieut.-General the Earl of Albemarle. After a sharp cannonade,
several clans rushed forward, with loud shouts, to attack the King's
troops sword in hand; but they were assailed by a destructive fire of
musketry, received on the point of the bayonet, and driven back with
severe loss. The royal cavalry galloped forward, completed the rout
and discomfiture of the clans, and pursued them with great
slaughter several miles. This victory transformed the young
Pretender from an imaginary monarch to an humble fugitive, and
after wandering for some time in disguise in the isles, and among
the mountains, he escaped to the continent.
The loss of the regiment at the battle of Culloden was limited to
Captain Grosette, and one private soldier killed; Captain Simpson
and nine rank and file wounded[2].
After returning from the pursuit of the rebels, the troops
encamped near Inverness, from whence they advanced in May, and
pitched their tents in a valley, surrounded by lofty mountains, near
Fort Augustus. The Fourteenth Regiment was employed in guarding
prisoners taken after the battle, and was afterwards stationed at
Stirling, from whence it was removed to Glasgow.

1747

In June, 1747 the regiment marched from Glasgow to Perth, and


in September to Inverness.
The colonel of the regiment, Brigadier-General Price, commanded
a brigade in the Netherlands, and highly distinguished himself at the
battle of Val, on the 2nd of July, 1747; he died at Breda in November
of the same year; when King George II. conferred the colonelcy on
the Honourable William Herbert, fifth son of Thomas, eighth Earl of
Pembroke, from captain and lieutenant-colonel in the Second Foot
Guards.

1749
1750

The regiment remained in Scotland; in 1749 it was stationed at


Fort William; and in 1750 at Glasgow, from whence it marched to
Carlisle and Newcastle.

1751

In 1751 a royal warrant was issued regulating the clothing,


colours, and standards of the several regiments of the army. In this
warrant the first, or King's colour, of the Fourteenth Regiment, is
directed to be the great union: the second, or regimental colour, to
be of buff silk, with the union in the upper canton; in the centre of
the colours XIV. in gold Roman characters, within a wreath of roses
and thistles on the same stalk.
The uniform of the regiment at this period, was black three-
cornered cocked hats, bound with white lace; scarlet coats faced
with yellow, yellow cuffs and white lace; scarlet waistcoats and
breeches; white gaiters, and white cravats; buff belts, and buff
pouches. The drummers wore buff coats faced with scarlet. The
grenadiers wore cloth caps with the king's cipher and crown in front;
the "white horse," with the motto "Nec aspera terrent," on the flap;
and the number of the regiment behind.
In August of this year orders were issued for the regiment to
march to the south of England, and to furnish detachments on the
coast of Sussex, to assist the officers of the revenue in the
prevention of smuggling.

1752

The regiment called in its detachments in the beginning of April,


1752, and marching to Portsmouth, embarked for Gibraltar, where it
was stationed during the following seven years.

1753

Colonel the Honorable William Herbert was removed to the Second


Dragoon Guards in 1753, and was succeeded in the colonelcy of the
Fourteenth Regiment by Colonel Edward Braddock, from lieutenant-
colonel in the Second Foot Guards.

1755

In 1755, some disputes occurred between England and France,


respecting the extent of the British dominions in America, and Major-
General Braddock was mortally wounded at Fort du Quesne: he was
succeeded by Lieutenant-General Fowke, governor of Gibraltar, from
the Second Foot, by commission dated the 12th of November, 1755.

1756

War commenced between Great Britain and France in 1756, when


a French armament attacked the island of Minorca, which was
captured in 1708, and ceded to the British crown at the peace of
Utrecht in 1713. Lieutenant-General Fowke received orders to send a
detachment from Gibraltar, to reinforce the garrison of Port Mahon;
but he called a council of war, which passed a resolution against
sending the detachment. He was sentenced to be suspended for
nine months, for disobeying the order, and King George II. dismissed
him from the service. His Majesty afterwards conferred the colonelcy
of the Fourteenth Regiment on Colonel Charles Jefferies, from
colonel-commandant of the third battalion of the Sixtieth Regiment,
who had distinguished himself in the defence of Port Mahon.

1759
1760
1761

In December, 1759, the regiment was relieved from garrison duty


at Gibraltar, and embarking for England, arrived, in January, 1760, at
Plymouth, from whence it marched to Canterbury, and in the
summer it was encamped, with the Nineteenth and Twenty-first
Regiments, on Barham Downs under Lieutenant-General Campbell.
In October the Fourteenth struck their tents, and marched to Dover
Castle, where they remained during the following year.

1762
1763

The regiment marched to Maidstone, and furnished a guard over


French prisoners of war at Sissinghurst in October, 1762; in
December it proceeded to Exeter; from whence it was removed in
March, 1763, to Plymouth.
1764

Leaving Plymouth in March, 1764, the regiment proceeded to the


vicinity of London, and was reviewed on Wimbledon Common: on
the 7th of May it was reviewed in Hyde Park by King George III.,
who was pleased to express his high approbation of its appearance
and discipline; after the review it marched to Chatham and Dover.

1765

Major-General Jefferies died in May, 1765, and the King conferred


the colonelcy of the regiment on Major-General the Honorable
William Keppel, fourth son of William Anne, second Earl of
Albemarle, from the Fifty-sixth Foot.
At this period, three companies of the regiment were employed on
duty at Windsor and Hampton Court, and their good conduct
attracted the attention of the King, George III., who was always
ready to confer marks of his royal approbation on corps and
individuals. His Majesty made some alterations in the clothing, and
directed the "white horse," with the motto "Nec aspera terrent," to
be placed on the black bear-skin caps to be worn by the grenadiers,
and on the white caps to be worn by the drummers[3].

1766

Towards the end of May, 1766, the regiment marched into village
quarters near Hounslow Heath, where it was reviewed on the 4th of
June by the King, who was graciously pleased to express his royal
approbation of its appearance and movements in the field. After the
review the regiment marched to Salisbury and adjacents.

1771

In June the regiment embarked at Portsmouth for North America,


and was stationed in Nova Scotia and Canada until 1771, when it
embarked from Halifax for the West Indies, to take part in reducing
to submission to the British government, the refractory Caribbees in
St. Vincent's.

1772
1773

The island of St. Vincent's was captured from the French in 1762,
and was ceded to Great Britain at the peace in 1763; it was found to
contain two tribes of natives called the red and black Caribs, the
former being the Aborigines, and the latter having sprung from a
cargo of African slaves, who escaped from a vessel which was
wrecked on the island. The Caribbees were devoted to the French
interest; they were dangerous and troublesome neighbours to the
English planters, and it was found necessary to restrain their
conduct, and enforce obedience to a few salutary regulations. They
were, however, of a determined spirit, possessed many thickly-
wooded fastnesses, and so resolutely resisted all attempts to restrain
their roving propensities and mode of life, that it was found
necessary to augment the military force on the island. The
Fourteenth Foot were employed against the refractory Caribbees in
1772 and 1773; numerous skirmishes occurred among the thickly-
wooded parts of the country, and several soldiers were killed and
wounded, in the bush fighting, which took place daily for some time.
At length the Caribbees were reduced to submission: and the
regiment returned to North America, leaving a number of sick men
and others in the West Indies.

1774
1775

The regiment was stationed at Virginia in North America, when the


misunderstanding between Great Britain and these prosperous and
wealthy colonies, produced open hostilities. The spirit which the
colonists evinced in resisting the acts of the British parliament, for
raising a revenue in their country, assumed a serious aspect in the
years 1773 and 1774, and in 1775 hostilities commenced in the state
of Massachusetts. The Fourteenth Regiment remained in the state of
Virginia for some time afterwards; it was, consequently, not at
Bunker's Hill; but it lost two promising officers at that battle, on the
17th of June, 1775, who were attending Major-General Howe during
the engagement: viz., Lieutenant and Adjutant Bruce, who was
killed, and Ensign Hesketh mortally wounded.
On the 18th of October, 1775, the colonelcy of the regiment was
conferred on Major-General Robert Cunninghame, from the Fifty-
eighth Foot, in succession to Lieutenant-General the Honorable
William Keppel, removed to the Twelfth Dragoons.
The regiment was stationed at Norfolk, in Virginia, from whence a
detachment of one hundred and twenty men, under Captain
Fordyce, advanced at midnight on the 8th of December, against the
American entrenchments at Great Bridge. At day-break the
detachment crossed the bridge, and the grenadiers moved forward
with great gallantry to storm the works, Lieutenant Batut being at
the head of the leading section; but as they approached the
entrenchments, a body of Americans, of very superior numbers,
assailed them with a destructive fire of musketry: Captain Fordyce
and twelve men were killed within a few yards of the breast-work;
Lieutenant Batut and sixteen soldiers were wounded and taken
prisoners, and the remainder of the detachment retreated across the
bridge to a British fort, garrisoned by a detachment under Captain
Leslie. The Americans buried Captain Fordyce with military honors.

1776

The American troops afterwards increased in numbers so fast, that


the royal forces were withdrawn from Virginia, and the Fourteenth
Foot proceeded to the army under General Sir William Howe, at New
York, where they were joined by a detachment which had been left
at Nova Scotia on the embarkation of the regiment for the West
Indies. After arriving at New York, part of the regiment was
stationed on Staten Island, and the remainder was employed in the
general operations of the army.
1777

The regiment had sustained a serious loss at St. Vincent's, and


being weak in numbers, it was directed to draft the private soldiers
fit for duty to other corps, and return to England, where it arrived in
the summer of 1777, and active measures were adopted to recruit
its ranks.

1778
1779

During the year 1778 the regiment was stationed in the south of
England; and in the summer of 1779 it pitched its tents on
Coxheath, where a camp was formed of the Sixth, Fourteenth,
Fiftieth, Sixty-fifth, and Sixty-ninth Regiments, with sixteen
battalions of militia, under Lieutenant-General Pierson.

1780
1781

The regiment marched to Gosport in 1780, and pitched its tents at


Stokes-bay, furnishing working parties at Fort Monkton, and a guard
over the French, Spanish, and American prisoners of war, at Forton
prison. In July the regiment embarked as marines on board the
Channel fleet commanded by Admiral Darby, who, in 1781, relieved
Gibraltar, which fortress was besieged by a combined French and
Spanish force.

1782

Having completed its recruiting, and attained a state of efficiency,


the regiment embarked from Portsmouth, in January, 1782, for
Jamaica; it was on board of transports in the harbour of St. Lucia,
during Admiral Rodney's engagement with the French fleet under
Count de Grasse, on the 12th of April, and afterwards mounted
guard over the Count, when a prisoner on that island.
The regiment proceeded to Jamaica, and was formed to receive
Prince William Henry, (afterwards King William IV.,) then a
midshipman, on his landing at Spanish Town, and mounted guard at
his quarters during his stay on the island.
Soon after its arrival at Jamaica, the regiment received orders,
dated the 31st of August, 1782, to assume the title of the
"Fourteenth, or Bedfordshire Regiment of Foot," and to cultivate a
connection with that county, so as to create a mutual attachment
between the inhabitants of Bedfordshire and the regiment, which
might, at all times, be useful towards recruiting the corps.

1787

On the 4th of April, 1787, Lieutenant-General Robert Cunninghame


was removed to the Fifth Royal Irish Dragoons, and was succeeded
in the colonelcy of the Fourteenth Foot, by Lieutenant-General John
Douglas, who had commanded the Twenty-first Light Dragoons,
which corps was disbanded in 1783.

1788

The Fourteenth Regiment attended the funeral of the Honorable


Captain Chetwynd, of His Majesty's ship "Europa," in November,
1788, at which the Governor of Jamaica,—His Royal Highness Prince
William Henry (then a captain of the Royal Navy),—the officers of
the squadron, and a number of gentlemen in carriages, were
present. The regiment marched at the head of the procession in
funeral order, the band playing the Dead March; and the remains of
this distinguished officer were interred in the chancel of the church
at Spanish Town.

1789

Lieutenant-General Douglas having been removed to the Fifth


Dragoon Guards, His Majesty conferred the colonelcy of the
Fourteenth Foot on Colonel George Earl Waldegrave, by commission,
dated the 27th of August, 1789. Earl Waldegrave died about six
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