100% found this document useful (2 votes)
10 views

Programming With STM32: Getting Started With the Nucleo Board and C/C++ - eBook PDFpdf download

The document is an overview of various eBooks related to programming with different microcontrollers and development boards, including STM32, Intel Galileo, Arduino, and Raspberry Pi. It provides links for downloading these eBooks and includes a brief introduction to the author, Donald J. Norris, who has extensive experience in embedded systems and software development. Additionally, the document outlines the contents of a specific book focused on STM32 microcontrollers, detailing the chapters and topics covered.

Uploaded by

erhumakassun
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
10 views

Programming With STM32: Getting Started With the Nucleo Board and C/C++ - eBook PDFpdf download

The document is an overview of various eBooks related to programming with different microcontrollers and development boards, including STM32, Intel Galileo, Arduino, and Raspberry Pi. It provides links for downloading these eBooks and includes a brief introduction to the author, Donald J. Norris, who has extensive experience in embedded systems and software development. Additionally, the document outlines the contents of a specific book focused on STM32 microcontrollers, detailing the chapters and topics covered.

Uploaded by

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

Programming With STM32: Getting Started With the

Nucleo Board and C/C++ - eBook PDF download

https://ebookluna.com/download/programming-with-stm32-getting-
started-with-the-nucleo-board-and-c-c-ebook-pdf/

Download more ebook from https://ebookluna.com


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

Programming the Intel Galileo: Getting Started with the Arduino -


Compatible Development Board 1st Edition - eBook PDF

https://ebookluna.com/download/programming-the-intel-galileo-getting-
started-with-the-arduino-compatible-development-board-ebook-pdf/

Programming Arduino: Getting Started with Sketches 2nd Edition - eBook PDF

https://ebookluna.com/download/programming-arduino-getting-started-with-
sketches-tab-ebook-pdf/

Programming the Photon: Getting Started with the Internet of Things 1st
edition - eBook PDF

https://ebookluna.com/download/programming-the-photon-getting-started-with-
the-internet-of-things-ebook-pdf/

Programming the Raspberry Pi, Third Edition: Getting Started with Python
Simon Monk - eBook PDF

https://ebookluna.com/download/programming-the-raspberry-pi-third-edition-
getting-started-with-python-ebook-pdf/
Programming Arduino: Getting Started with Sketches 3rd Edition Simon Monk -
eBook PDF

https://ebookluna.com/download/programming-arduino-getting-started-with-
sketches-ebook-pdf/

Programming the Photon: Getting Started with the Internet of Things (Tab)
1st Edition - eBook PDF

https://ebookluna.com/download/programming-the-photon-getting-started-with-
the-internet-of-things-tab-ebook-pdf/

(eBook PDF) Programming, Problem Solving and Abstraction with C

https://ebookluna.com/product/ebook-pdf-programming-problem-solving-and-
abstraction-with-c/

Readings from Programming with C++ 1st Edition Kyla Mcmullen - eBook PDF

https://ebookluna.com/download/readings-from-programming-with-c-ebook-
pdf-2/

Readings from Programming with C++ 1st Edition Kyla Mcmullen - eBook PDF

https://ebookluna.com/download/readings-from-programming-with-c-ebook-pdf/
Copyright © 2018 by McGraw-Hill Education. All rights reserved. Except as
permitted under the United States Copyright Act of 1976, no part of this
publication may be reproduced or distributed in any form or by any means, or
stored in a database or retrieval system, without the prior written permission of
the publisher.

ISBN: 978-1-26-003132-4
MHID: 1-26-003132-2

The material in this eBook also appears in the print version of this title: ISBN:
978-1-26-003131-7, MHID: 1-26-003131-4.

eBook conversion by codeMantra


Version 1.0

All trademarks are trademarks of their respective owners. Rather than put a
trademark symbol after every occurrence of a trademarked name, we use names
in an editorial fashion only, and to the benefit of the trademark owner, with no
intention of infringement of the trademark. Where such designations appear in
this book, they have been printed with initial caps.

McGraw-Hill Education eBooks are available at special quantity discounts to use


as premiums and sales promotions or for use in corporate training programs. To
contact a representative, please visit the Contact Us page at
www.mhprofessional.com.

Information contained in this work has been obtained by McGraw-Hill


Education from sources believed to be reliable. However, neither McGraw-Hill
Education nor its authors guarantee the accuracy or completeness of any
information published herein, and neither McGraw-Hill Education nor its
authors shall be responsible for any errors, omissions, or damages arising out of
use of this information. This work is published with the understanding that
McGraw-Hill Education and its authors are supplying information but are not
attempting to render engineering or other professional services. If such services
are required, the assistance of an appropriate professional should be sought.
TERMS OF USE

This is a copyrighted work and McGraw-Hill Education and its licensors reserve
all rights in and to the work. Use of this work is subject to these terms. Except as
permitted under the Copyright Act of 1976 and the right to store and retrieve one
copy of the work, you may not decompile, disassemble, reverse engineer,
reproduce, modify, create derivative works based upon, transmit, distribute,
disseminate, sell, publish or sublicense the work or any part of it without
McGraw-Hill Education’s prior consent. You may use the work for your own
noncommercial and personal use; any other use of the work is strictly prohibited.
Your right to use the work may be terminated if you fail to comply with these
terms.

THE WORK IS PROVIDED “AS IS.” McGRAW-HILL EDUCATION AND


ITS LICENSORS MAKE NO GUARANTEES OR WARRANTIES AS TO
THE ACCURACY, ADEQUACY OR COMPLETENESS OF OR RESULTS
TO BE OBTAINED FROM USING THE WORK, INCLUDING ANY
INFORMATION THAT CAN BE ACCESSED THROUGH THE WORK VIA
HYPERLINK OR OTHERWISE, AND EXPRESSLY DISCLAIM ANY
WARRANTY, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
TO IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR
A PARTICULAR PURPOSE. McGraw-Hill Education and its licensors do not
warrant or guarantee that the functions contained in the work will meet your
requirements or that its operation will be uninterrupted or error free. Neither
McGraw-Hill Education nor its licensors shall be liable to you or anyone else for
any inaccuracy, error or omission, regardless of cause, in the work or for any
damages resulting therefrom. McGraw-Hill Education has no responsibility for
the content of any information accessed through the work. Under no
circumstances shall McGraw-Hill Education and/or its licensors be liable for any
indirect, incidental, special, punitive, consequential or similar damages that
result from the use of or inability to use the work, even if any of them has been
advised of the possibility of such damages. This limitation of liability shall apply
to any claim or cause whatsoever whether such claim or cause arises in contract,
tort or otherwise.
About the Author

Donald J. Norris has a degree in electrical engineering and an MBA


specializing in production management. He is currently an adjunct professor
teaching an Embedded Systems course in the College of Engineering,
Technology and Aeronautics, part of the Southern New Hampshire University
(SNHU). He has also taught many different undergrad and grad courses mainly
in the computer science and technology areas at SNHU and other regional
schools for the past 33 years. Don created and taught the initial robotics courses
at SNHU both on-campus and online.
Don retired from civilian government service with the U.S. Navy, where he
specialized in underwater acoustics related to nuclear submarines and associated
advanced digital signal processing systems. Since then, he has spent more than
23 years as a professional software developer using the C, C#, C++, Python,
Micro Python, Node.JS, JavaScript, PHP, and Java languages in varied
development projects. He also has been a certified IT security consultant for the
last six years.
He has written and had published seven books including three involving the
Raspberry Pi, one on how to build and fly your own drone, a book on the Intel
Edison, one on the Internet of Things, and one on Micro Python.
Don started a consultancy, Norris Embedded Software Solutions (dba NESS
LLC), which specializes in developing application solutions using
microcontrollers, sensors, and actuators. The business has also recently
completed several robotics projects for clients.
Don likes to think of himself as a perpetual hobbyist and geek and is
constantly trying out new technologies and out-of-box experiments. He is a
licensed private pilot, photography buff, amateur extra class operator, avid
runner, and most importantly, a proud grandfather of three great kids,
Evangeline, Hudson, and Holton.
This book is dedicated to Dr. Peter Kachavos, my son-in-law, who is a
remarkably intelligent man with an equally remarkable long medical career in
service to his patients and the community. Until recently, Peter was a practicing
internist with an office in Manchester, NH. He recently retired after 25 years
from that practice and soon will be pursuing other interesting opportunities in
the medical field.

Peter enjoys cooking, fine wine, traveling, and spending quality time with his
family. His wife is my daughter, Shauna, and their child is my two-year-old
granddaughter, Evangeline.

Peter and I have spent many hours discussing many topics ranging from ancient
Greek artifacts to the latest technologies impacting modern society. I always
look forward to those interesting and challenging discussions.
CONTENTS AT A GLANCE

1 Introduction to the STMicroelectronics Line of Microcontrollers

2 STM MCU Software

3 STM32CubeMX Application

4 STM Project Development

5 General-Purpose Input Output (GPIO) and the STM Hardware Abstraction


Layer (HAL)

6 Interrupts

7 Timers

8 Bit Serial Communications

9 Analog-to-Digital Conversion

10 Pulse Width Modulation (PWM)

11 Direct Memory Access (DMA) and the Digital-to-Analog Converter (DAC)

Index
CONTENTS

Preface

1 Introduction to the STMicroelectronics Line of Microcontrollers


Microcomputer vs Microcontroller
STM Nucleo Boards
Principal MCU Components
Bit Serial Ports
Nucleo-64 Board Options
Summary

2 STM MCU Software


Open-Source versus Commercial Proprietary Software
Bare Metal Development
Brief History of MCU
The MCU Toolchain
Configuring a STM32 Toolchain
Summary

3 STM32CubeMX Application
Pinout Tab
MCU Alternative Functions
Integrated Peripheral (IP) Tree Pane
Creating an Example Project using CubeMX
The main.c Code Listing
ARM Cortex Microcontroller Software Interface Standard (CMSIS)
CubeMX-Generated C Code
Compiling and Downloading the Project
Downloading the Hex Code
Summary

4 STM Project Development


Hello World Project
Creating the Hello Nucleo Project
Adding Functionality to the Program
Compiling and Executing the Modified Program
Simple Modification for the main.c Function
Complex Modification for the main.c File
Summary

5 General-Purpose Input Output (GPIO) and the STM Hardware


Abstraction Layer (HAL)
Memory-Mapped Peripherals
Core Memory Addresses
Peripheral Memory Addresses
HAL_GPIO Module
GPIO Pin Hardware
LED Test Demonstration
Enabling Multiple Outputs
Push-Button Test Demonstration
Clock Speed Demonstration
Setting the Pin Clock Speeds
Summary

6 Interrupts
Interrupts
NVIC Specifications
Interrupt Process
External Interrupts
Interrupt Demonstration
Summary

7 Timers
STM Timer Peripherals
STM Timer Configuration
Update Event Calculation
Polled or Non-interrupt Blink LED Timer Demonstration
Test Run
Interrupt-Driven Blink LED Timer Demonstration
Test Run
Multi-rate Interrupt-Driven Blink LED Timer Demonstration
Test Run
Modification to the Multi-rate Program
Test Run
Summary

8 Bit Serial Communications


UARTs and USARTs
USART Configuration
Windows Terminal Program
Enabling USART2
USART Transmit Demonstration Program
Test Run
USART Receive Demonstration Program
Test Run
Summary

9 Analog-to-Digital Conversion
ADC Functions
ADC Module with HAL
ADC Conversion Modes
Channels, Groups, and Ranks
ADC Demonstration
ADC Demonstration Software
Summary

10 Pulse Width Modulation (PWM)


General-Purpose Timer PWM Signal Generation
Timer Hardware Architecture
PWM Signals with HAL
Enabling the PWM Function
PWM Demonstration Software
Demonstration One
Demonstration Two
Demonstration Three
Demonstration Four
Adding Functional Test Code
Test Results
Summary

11 Direct Memory Access (DMA) and the Digital-to-Analog


Converter (DAC)
DMA
Basic Data Transfer Concepts
DMA Controller Details
Using HAL with DMA
Demonstration One
DAC Peripheral
DAC Principles
HAL Software for the DAC
Demonstration Two
Demonstration Three
Summary
PREFACE

This book will serve both as an introduction to the STMicroelectronics line


of STM32 microcontrollers (MCUs) and also as an easy-to-follow Getting
Started Guide for readers interested in developing with a STM MCU. I will be
using one of the very inexpensive STM Nucleo-64 development boards for all of
the book projects, which should make it inviting for most readers to become
involved with the hardware. In fact, doing the book demonstration projects is
really the only way you can really be assured that you have gained a good
comprehension of the material in this book.
I will state from the beginning that it is simply not possible to gain a total
understanding of how a STM MCU functions by only reading this book. The
manufacturer datasheets that describe individual STM MCUs are often over
1,000 pages in length, which describes the enormity of the task of trying to
master the voluminous amount of information that describes these devices.
Instead, the book contents focus on a few of the core components that make up a
STM MCU and how to program those components to accomplish fairly simple
tasks.
Some readers will have trepidation about starting to develop with what are
typically considered professional grade MCUs. I wish to allay that fear and state
that I have found that developing applications with at least one representative
sample STM MCU to be remarkably easy and straightforward. In fact, I will
state that in some aspects it is easier to develop with a STM MCU than with an
Arduino or Raspberry Pi, which many readers will already be quite familiar and
probably have already created projects with those boards.
Often, the single biggest issue with developing with MCUs is setting up a
stable development toolchain. I will describe how to do this in a simple to
follow, step-by-step process, which if you rigorously follow will guarantee that
you will be able to quickly and without much trouble generate working binary
programs. These programs will then be quickly downloaded into the
development board for execution.
1
Introduction to the
STMicroelectronics Line of
Microcontrollers

This chapter provides you with an introduction to the very comprehensive


STMicroelectronics (STM) line of microcontrollers (MCUs). I will be focusing
only on several specific controllers throughout the book, but that should provide
you with an adequate representation of the functions and capabilities of the full
line of STM MCUs.

Microcomputer vs Microcontroller
I believe at the start of this book that it must make very clear the differences
between a microcomputer and a MCU. The reason for this distinction is very
simple: STM is a company that designs and manufacturers MCUs, not
microcomputers. I think my following definition of a MCU is as good as any
that I have read:

A microcontroller is an integrated system containing a minimum of a


microprocessor, dynamic and non-volatile memory, and a set of peripherals
consistent with all design requirements.

Right away, you can see from the definition that a MCU contains a
microprocessor which is sometimes referred to as a microcomputer. There also
must be both dynamic or volatile memory as well as nonvolatile or static
memory, where the latter holds any programs or scripts necessary to run the
Discovering Diverse Content Through
Random Scribd Documents
General offered her his arm. She took it very graciously, and was led
away. But before leaving the room she halted, turned round, and
stared very significantly at the two elderly ladies who were still
seated on the sofa, overwhelmed in surprise, horror, and indignation.
Infantry, who was only a lieutenant in his regiment, observing that
the General had recognised the social right of his wife, which she
had derived solely from him, instantly rushed up to Lady Gallopaway,
and offered her an arm (which she took), led her away in triumph,
leaving his own Colonel (Damzè) and old Mr. Revenue Board gasping
and gaping at each other in mutual disgust and consternation. Had a
shell burst in the building, had the powder magazine exploded and
shattered all the windows, the commotion could scarcely have been
greater than it was at that moment. No one could account for this
extraordinary conduct, or caprice, as it was termed, on the part of
the old General. Damzè, who had just been flattering him concerning
his wonderful achievements, now declared that "the old fool had
become half-witted since eighteen hundred and forty-seven," while
Revenue Board, who a quarter of an hour previously had, to the
General's face, held forth on the unflinching independence which
had marked his character through life, now protested—openly
protested—that he had been a time-server throughout his entire
career, and had some object in thus truckling before the son of an
influential peer! The ladies on the sofa stared at each other; now
commiseratingly and in silence for at least two minutes, then
simultaneously ejaculated: "What can it mean!"
"I thought it would have been me," said Mrs. Revenue Board.
"You?" said Mrs. Damzè.
"Yes; why not? My husband is a civilian of twenty years' standing."
"Is not my husband a Lieutenant-Colonel and a C.B.? If he were only
a Major and a C.B. he would take precedence of Mr. Revenue
Board."
"You are quite mistaken."
"Indeed not. Do you suppose a C.B. goes for nothing?"
"No; but——"
Here Lieutenant-Colonel Damzè and Mr. Revenue Board, who had
been discussing the same question, but in a calmer spirit than their
wives, approached, and, making common cause against the upstart
enemy (Infantry and his wife), formed a quartette and went into the
supper room; where, to their intense mortification, they heard little
Mrs. Infantry talking loudly, on purpose to attract the notice of all
present. What was even more mortifying still, the old General was
paying her marked attention.
The red party, that is to say, the military, were in very high spirits;
the black, the civilians, correspondingly depressed. The quartette,
consisting of Damzè and Revenue Board, and their wives, ate
voraciously, but evidently without appetite. They sipped their wine
with an absent formality, which was very entertaining to lookers-on,
who were in no way interested in the momentous question which
was preying on their very souls.
"It shall not end here," said Damzè, moodily fixing his eyes on the
chandelier.
"Not, indeed!" said Mr. Revenue Board.
"I shall put my case to the Governor-General direct," said Damzè.
"His Lordship is a near connexion of mine."
"I am perfectly aware of that," said Mr. Revenue Board; "but it is my
intention to submit my case to his Lordship through Mr. Bommerson,
the Lieutenant-Governor of these provinces, officially; and, if his
Lordship's opinion should be adverse, I shall have my appeal to the
Court of Directors, amongst whom, thank Heaven! I have several
relations and warm friends."
"And you will write, I hope, my dear," said Mrs. Revenue Board, "to
Sir John Bobgrouse, who is the President of the Board of Control,
and whose secretary married your first cousin—recollect!"
"We can write, too," said Mrs. Lieutenant-Colonel Damzè.
"You may write to anybody you please," said Mrs. Revenue Board,
defiantly and contemptuously; "but you will remember that the point
between us is this—that even if your husband, in consequence of
having got, no matter how, a C.B.ship, has the right to precede my
husband, a civilian of twenty years' standing—whether you have the
right to precede me? That is the question; and I hope, Revenue
dear, you will not fail to raise it."
Reader, the question was submitted in all its bearings for the
consideration of the Most Noble the Governor-General of India, who,
declining to take upon himself so fearful a responsibility, referred the
matter to the Home Government. Leadenhall-street had something
to say to it, and so had the Board of Control. While the case was
pending, the newspapers in every part of India literally teemed with
letters on the subject, and their editors were invited to give their
opinions thereon. Only one of the number was weak enough to do
this, and bitterly did he repent of his rashness; for, having decided in
favour of the C.B. and of Mrs. C.B., he lost (so he confessed to me)
no less than six-and-twenty civilians (each of twenty years' standing)
in his subscription-list. For more than eighteen months this
precedence question formed a leading topic, not only in the public
prints, but in private circles. It became, in short, a perfect nuisance.
At length the decision of the Home Government came out to India;
but, alas! they had only half done their work. They had given C.B.
the precedence over the civilian of twenty years' standing, but had
been silent about their wives! So, the matter was "referred back." A
clerk in the Private Secretary's office told me that he was occupied
for three hours in copying only the Governor-General's minute on the
Court's despatch, which was a very lengthy one, and signed by the
chairman for himself and the other directors, whose names were
given in full. He further informed me that the whole of the
documents connected with this weighty affair would, if put into type,
form a volume five times as bulky as Sir William Napier's Conquest
of Scinde!
How the matter was settled eventually I do not know; for, when I
left India, the question had not been decided. On the great point,
when it was referred for a second time to the Home Authorities,
there was a difference of opinion between the Court of Directors and
the Board of Control, and a long correspondence ensued on the
subject, between each of these departments of the Indian
Government and the Governor-General, who was required to have
the case laid before the Advocates-General of the Supreme Courts at
the various Presidencies. These gentlemen differed one with the
other in their views of the case, each alleging that the point lay in a
nutshell, and was as clear as possible. For all I know to the contrary,
it may be in the nutshell at this moment. Both Lieutenant-Colonel
Damzè and Mr. Revenue Board laid "cases" before the Calcutta
barristers, who pocketed their fees, and laconically expressed their
opinions respectively, that the parties who consulted them were in
the right—"there could be no doubt on the point," they said. Damzè
sent a copy of his case, and the opinion of his barrister thereon, to
Revenue Board, who rather triumphantly returned the compliment. I
regret to say, that this contest engendered in Agra a great deal of
what is called bad blood, and induced many ladies to descend to
very unseemly personalities. For instance, Mrs. Damzè one evening,
at the band-stand, told Mrs. Revenue Board, that when she (Mrs. R.
B.) returned to England, she would have no rank at all, as her
husband was not an esquire even—but a "mister" in his own country.
To which Mrs. Revenue Board replied:—
"And you, pray? Is not your husband in the Company's service?"
"Yes," rejoined Mrs. Damzè; "but you forget the C.B.!"
Let us now return to the Honourable Lieutenant Infantry. When that
officer came up, and led away Lady Gallopaway to supper, Damzè
was overheard to say, "I'll take the shine out of that young
gentleman." And, if taking the shine meant constantly bullying the
subaltern, Damzè certainly kept his word. And when the next hot
weather came, and the Lieutenant wished to accompany his sick
wife to the Hills, Damzè, when he forwarded the application for six
months' leave of absence, wrote privately to the Assistant Adjutant-
General, and recommended that it should not be granted. The
honourable subaltern, however, was rather too strong for his colonel,
in the way of interest. Presuming on the acquaintance which existed
between his father and the Commander-in-Chief, he wrote a letter to
that functionary, and a few days afterwards found himself in general
orders. The wrath of Damzè may be easily imagined, especially as
he had boasted to several of his officers of having put a spoke in the
Lieutenant's wheel. And by way of throwing salt upon the Colonel's
wounds, the Lieutenant called upon him, and, in the politest manner
possible, inquired if there was anything he could do for him at head-
quarters.

While at Agra, a Bengalee Baboo called upon me. Judging from his
appearance, I should have guessed his age to be about fifty years;
but he was upwards of seventy. He spoke English with marvellous
fluency and accuracy, and could read and write the language as well
and as elegantly as any educated European. He was, perhaps, the
cleverest Hindoo whom I encountered during my sojourn in the East.
His manners were peculiarly courteous and winning, and there was
an air of penitence about the man, which, apart from his abilities,
induced me to treat him with kindness and consideration. His name
was—let us say—Nobinkissen.
The history of Nobinkissen was simply this. He was a Brahmin of the
highest caste, and, at the age of eighteen, was a writer in the
service of the government, on a salary of ten rupees per month. He
ingratiated himself with every civilian under whom he served, and
gradually rose, step by step, until he became the Sheristadar, or
head clerk, of a circuit-judge of a court of appeal. In this office he
acquired riches, and was still adding to his store, when his official
career was brought prematurely to a close.
I must here inform the reader that not one civilian in a hundred, no
matter what his rank or grade, can read and write Hindostanee or
Persian, although the majority of them have some colloquial
knowledge of both those languages. Yet, as a matter of course, they
append their signatures to every document of which, on hearing it
read aloud to them by their native officials, they approve. Their
orders they dictate orally; those orders are transcribed by the
Sheristadar, who gives them to a native writer to copy. This done,
they are read aloud for correction or approval, and then signed in
English by the covenanted civilian. Before leaving office every day,
such civilian may have to sign fifty, sixty, or a hundred documents;
for the rule is, not to sign each of them when read, but to sign them
in a mass at the breaking-up of the court. Here Nobinkissen invented
his means of money making. Whenever the judge gave a decree in
any case of importance, he made a counterpart of such decree, and
when the signing time came, obtained, without any sort of trouble or
inquiry, the signature of the Sahib and the seal of the Court to both
documents. He was thus, to all intents and purposes—or, at all
events, for his own—in possession of something tantamount to the
fee-simple of the lands in dispute. He could arm either the appellant
or the respondent with the final decree of the Court, under the hand
and official seal of the judge. The only question with him now was,
which of the litigants would give the most money, and to each, in
private, and in the Sahib's name, he exhibited the documents. The
highest bidder, of course, gained the day, whereupon Nobinkissen
took the coin, handed over one of the decrees, and burnt the other.
It fell out that Nobinkissen was attacked with fever, and, in a state
bordering on delirium, he parted with, that is to say, sold, to both
respondent and appellant, a decree, under the hand and seal of the
judge, such decree arming the holder with the power to take
possession of a very large estate in Bengal. Each party, fearful of a
disturbance, which often occurs when possession of an estate is
sought for, applied to the magistrate of a district, under a certain
regulation of government, for assistance, in order to enable him to
carry out the judge's decree, which each, as a matter of course,
produced. The magistrate was naturally much perplexed, and made
a reference to the judge, who could only say he had signed but one
decree. There was then a report made to the government by the
magistrate. An investigation ensued, and the judge was, meanwhile,
suspended, for great suspicion lurked in the minds of many that he
was not so innocent as he affected to be. When Nobinkissen
recovered from his sickness, and saw the dilemma in which his
superior, the judge, was placed, he made a clean breast of it, and
confessed that the guilt was his, and his alone. Nobinkissen was
tried, convicted, and sentenced to be imprisoned in irons for the
term of his natural life. For nine years he was in the gaol at Alipore,
near Calcutta. At the expiration of that period he was called upon to
furnish some information of which he was possessed, in relation to
certain public affairs. He was brought from the prison, confronted
with several officials, amongst whom was a member of the council.
His altered appearance, his emaciated form, his attitude of despair,
and the intelligence and readiness with which he responded to the
questions put to him, touched the hearts of those by whom he was
examined, and the member of council, who has been since a
director of the East India Company, spoke to the Governor-General,
and eventually obtained Nobinkissen's pardon and release. The
Hindoos and Mussulmans in India (like the Arabs) do not regard
being guilty of a fraud or theft as a disgrace. The degrading part of
the business is, being convicted, and Nobinkissen, on being set at
liberty, could not face his countrymen in Bengal, and therefore
retired to the Upper Provinces, where he lived in comparative
obscurity, and in easy circumstances, for he had not disgorged his ill-
gotten gains. His wife had taken care of them during his captivity.
At the time that Nobinkissen called upon me, the government of
India were in considerable difficulty in respect to finance. A new loan
had been opened, but it did not fill, and the government had very
wisely determined upon closing it. Nobinkissen made this a topic of
conversation, and his views—albeit they came from a man who had
been convicted of a fraud—are, at the present time especially,
entitled to the very gravest consideration.
"Ah, sir!" he remarked, "it is a pitiful thing that the government of a
great empire like this should ever be in pecuniary difficulties and put
to their wits' end for a few millions annually, in order to make the
receipts square with the expenditure."
"But how can it be helped?" I asked.
"Easily, sir," he replied. "Why not make it expedient to do away with
the perpetual settlement of Lord Cornwallis, and resettle the whole
of Bengal? That is by far the most fertile province in the East; but it
is taxed lighter than even these poor lands of the Upper Provinces.
Look at the Durbungah Rajah. Nearly the whole of Tirhoot, the
garden of India, belongs to him, and he does not pay into the
government treasury half a lac (five thousand pounds) per annum,
while his collections amount to upwards of twenty lacs. These are
the men who get hold of the money and bury it, and keep it from
circulating."
"But all zemindarees (lands) are not so profitable in Bengal?"
"No; many are not worth holding—especially the smaller ones,
although the land is just as good, and just as well cultivated."
"But how is that?"
"They are so heavily taxed. You must know, sir, that in those days—
the days of Lord Cornwallis—the greatest frauds were committed, in
respect to the perpetual settlement. The natives who were about,
and under, the settlement officers all made immense fortunes, and
the zemindars from whom they took their bribes, have profited ever
since to the cost of the poorer zemindars, who could not or would
not bribe, and to the cost of the British government. It is a great
mistake to suppose that the whole of the landholders in Bengal
would cry out against a resettlement of that province. Only men
holding vast tracts of country, at a comparatively nominal rent,
would cry out."
"And tax the British government with a breach of faith?"
"Yes. But what need the government care for that cry, especially
when its act is not only expedient, but would be just withal? In
Bengal, all the great zemindars are rich, very rich men. In these
provinces, with very, very few exceptions, they are poor, so that the
whole of Upper India would be glad to see the perpetual settlement
done away with, and the land resettled."
"Why so?"
"That is only human—and, certainly, Asiatic—nature. Few of us like
to behold our neighbours better off than ourselves; so that the cry of
faith-breaking would not meet with a response in this part of the
world."
"Yes; but in Europe the cry would be too powerful to contend
against. The Exeter Hall orators and the spouters at the Court of
Proprietors would—"
"Ah, sir! India should either be governed in India or in England. It is
the number of wheels in the government that clogs the movement
of the machine."
"Very true."
"But who are these men—these zemindars with whom you are
required to keep an implicit faith? Are they your friends? If so, why
do they never come forward to assist you in your difficulties? Did a
single zemindar, when, after the battle of Ferozeshah, the empire
was shaking in the balance, lift a finger to help the government of
India? And, to-morrow, if your rule were at stake, and dependent on
their assistance, think you they would render it? Think you they
would furnish money if your treasury was exhausted? Not one pice!
Think you they would furnish men to protect your stations denuded
of troops? No! Although hundreds of them can each turn out a
thousand or two of followers, armed with iron-bound bludgeons,
swords, and shields, when they desire to intimidate an European
indigo-planter, or to fight a battle between themselves about a
boundary question. These are the men who, in your greatest need,
would remain neutral until, if it so happened, you were brought to
your last gasp, when, as one man, they would not fail to rise and
give you the final blow."
"Do you believe that? I do not."
"Sir, I know my own countrymen better than you do."
"If such a state of affairs were to come about, and these zemindars
remained neutral, of course the cry of breaking faith would be
absurd in the extreme. Neutrality, in such a case, would be almost as
bad as hostility."
[Nobinkissen's prophecy has been fulfilled to the letter. Our rule has
been at stake, in imminent peril, and not one of these men has
offered to assist us with men or money. The Rajahs of Durbungah
and Burdwan alone, to say nothing of the Newab of Moorshedabad,
between them could have furnished an army of, at the very least,
five thousand stalwart fighting-men, whereas they have looked upon
our difficulties in perfect apathy. It is from the coffers of men of this
stamp that large sums should be extracted annually towards keeping
up a vast—an overwhelming—European force in India. Faith with
such men as these! What claim have they to our faintest
consideration! What right to expect that we shall any longer forego
the collection of several extra millions annually—several extra
millions which, to every intent and purpose, is our just due?]
"There is a line in Shakespeare, sir," Nobinkissen continued, "which
the government of India should adopt as its motto, and act up to
consistently—

'Cæsar never does wrong without just cause.'"

Our conversation was here interrupted by a noise in the road. I went


to the window, and observing a great crowd, inquired of one of my
servants who was standing in the verandah:—
"What is the matter?"
"A bullock has fallen down, and they are trying to get him up—that
is all, Sahib," was the reply.
I rushed to the spot, followed by Nobinkissen, and there beheld a
scene which in no other country would have been tolerated by the
crowd assembled.
One of a pair of bullocks, drawing an over-laden cart, had from
weakness and fatigue, sank beneath the burden. The driver of the
animals (a Hindoo) had broken, by twisting it violently, the tail of the
poor beast, which was nothing but skin and bone, and was covered
with wounds from ill-treatment. Heavy blows and the tail breaking
having failed to make the jaded ox stand upon his legs, the driver—
heedless of my remonstrance—collected some straw and sticks and
lighted a fire all round him. The poor beast now struggled very hard,
but was unable to rise, and presently he resigned himself to be
scorched to death.
"I always thought that the cow was a sacred animal with Hindoos?"
said I to Nobinkissen.
"Yes," said he.
"And here is a Hindoo who works one of his gods till he drops down
with sheer fatigue, and then cruelly puts him to death!"
"Yes, that often happens," said Nobinkissen, smiling.
"Then, what an absurdity and inconsistency for the Hindoos at
Benares, and other holy places, to make such a noise if an European
only strikes a sacred animal with a whip! Why, it was only the other
day that a mob collected around the house of the magistrate and set
the authorities at defiance: all because the magistrate had ordered
that one of the bulls which crowd the streets should be shut up, on
the ground that he had gored several people."
"That is the doing of the Brahmins, who incite the people to such
acts; and every concession on the part of the government leads
those Brahmins to believe that they have great power, and leads the
people also to believe it. If a Mahommedan finds one of those bulls
in the way, and gives him a thrashing with a thick stick, or probes
him in the side with a sword, the Brahmins say nothing, nor do the
people of Benares."
"Why is that?"
"Because it would not be worth while. The strife would be profitless;
for, you see, sir, the Mahommedans are not the rulers of this country,
but the Sahibs are; and hence the jealousy with which they are
watched. In time, the Government of India will see the necessity of
forbidding Hindoo festivals in the public streets—abolishing them—
just as Suttee was abolished. It is only the dissolute rich and the
rabble who take any delight in these festivals, many of which are
indecent and disgusting. Sensible and respectable Hindoos take no
part in them; on the contrary, they avoid them, and think them a
nuisance. Hindooism will never become extinct, so long as this world
lasts; but the British Government has the power of doing away with
those obnoxious observances in the public thoroughfares, which only
disfigure the religion."
"Well, in that case, you would have to do away with the
Mahommedan festivals?"
"Most certainly—in the public streets. In private, the Mahommedans
as well as the Hindoos might be permitted to keep their festivals in
whatever way they thought proper. Do you suppose that the
Mahommedans, when in power, suffered the Hindoos to block up the
streets continually with their processions, as they do now? Think you
that they entertained the same consideration for the bulls and the
monkeys at Benares as the British now entertain? And when, in turn,
the Mahrattas overran this part of the country, think you that Agra
was ever deafened, as it now is, with the din of the Buckree Ede and
the Mohurrum?"
"Perhaps not. But then you see, Nobinkissen, we are a tolerant
people, and wish to convince both creeds that we have no desire to
interfere with their religious prejudices in any way whatsoever."
"Yes; but then you are inconsistent, and the consequence is, that
you not only get the credit of being insincere, but are imposed upon
to the utmost."
"How, inconsistent!"
"Why, you declare that you have no desire to interfere with the
religious prejudices of the Hindoo and the Mahommedan; but you,
nevertheless, encourage missionary gentlemen to go from station to
station to preach in the open air concerning the superiority of your
religion over all others. Believe me, sir, this does a great deal of
harm."
"Ah! but we make converts!"
"How many do you suppose?"
"I cannot say."
"I can. Take India from one end to the other, and you make,
annually, one out of fifty thousand."
"No more?"
"No more, sir! That is the result of preaching in the open air, all over
the country, and the distribution of thousands and hundreds of
thousands of tracts printed in the Hindostanee and Bengalee
languages.
"Well, that is something, Nobinkissen."
"And of what class of people are your converts?"
"Respectable men of all classes, I suppose."
"The dregs of both Hindoos and Mussulmans. The most debased and
degraded of Indians—men who only assume Christianity in the hope
of temporal advantage and preferment—and who fling aside their
newly put-on faith, and laugh and scoff at your credulity the moment
they find their hope frustrated. I could give you at least one hundred
instances; but one will suffice. Not long ago a Mussulman, named
Ally Khan, was converted by Mr. Jones, a missionary in Calcutta, and,
shortly after his conversion, obtained an appointment with a salary
of one hundred rupees a month, in the Baptist Missionary Society.
Here he contrived to embezzle sixteen hundred rupees, for which
offence he was indicted in the Supreme Court, found guilty, and
sentenced to a year's imprisonment in the Calcutta gaol. On hearing
the sentence he exclaimed: 'In the name of the devil, is this the
reward of renouncing my religion? Farewell, Christianity! From this
hour I am a Moslem again!'
"Another very flagrant case occurred in this very station. A civilian
took into his service a recently converted Hindoo, as a sirdar-bearer.
The fellow had charge of a money-bag, and ran off with it. And
where and how do you suppose he was apprehended? At Hurdwar,
taking an active part in the Hoolee Festival! The Roman Catholic
priests have long since left off asking the natives of India to become
Christians. Those who voluntarily present themselves, are, after a
strict examination, and a due warning that they must hope for no
temporal advantage, admitted into the Church."
"And do they have any applications?"
"Very very few, indeed; but those whom they admit do, really and
truly, become Christians."
These last words of Nobinkissen were scarcely pronounced, when a
palkee was brought up to my door, and out of it stepped a Roman
Catholic priest—an Italian gentleman, a Jesuit—whom I had met a
few evenings previously at the house of a mutual friend.
Nobinkissen, who appeared to know the reverend father intimately,
related to him the substance of the conversation we had just held,
or rather the latter part thereof, and the priest corroborated every
allegation that Nobinkissen had made.
"Yea," he added, "we now devote our attention, exclusively, to the
spiritual wants of the white man who requires our aid—convinced, as
we are, of the hopelessness of the task of converting the Hindoo and
the Mussulman to Christianity." And, in addition to the instances of
false converts afforded by Nobinkissen, he did not scruple to detail
several others of an equally atrocious character and complexion.
THE UPPER PROVINCES.
Having seen Agra, its edifices, ruins, society, European and native,
and having visited Secundra, Futteypore, Sickri, and Muttra, I
journeyed upwards to Delhi, where I was received by Mr. Joseph
Skinner, the eldest son of the late Colonel Skinner, renowned as the
founder and commandant of the famous Skinner's Horse. Mr. Joseph
Skinner's house was, at all times, open to all travellers. He was
without exception the most hospitable man that I ever met in any
part of the world. At his board were to be met daily, either at
luncheon or at dinner, civilians and military men of every rank and
grade in the service, as well as native gentlemen of position in India
—Hindoos and Mahommedans. Even the young princes, sons of the
King of Delhi and descendants of the Great Moghul, used frequently
to honour Mr. Skinner with their company. The title by which they
were usually greeted was Sahiban-i-Alum, signifying "Lords of the
World." But the most remarkable native that I ever met at Mr.
Skinner's hospitable board was the late Maharajah Hindoo-Rao, a
little, fat, round Mahratta chieftain, with small twinkling eyes, and a
countenance replete with fun and quiet humour. He was a pensioner
of the Gwalior State, and drew therefrom twelve thousand pounds a
year, which was guaranteed to him by the British Government. Large
as was this income, Hindoo-Rao contrived annually to spend more
than double the amount, trusting continually to fate to relieve him
from his pressing pecuniary difficulties; not that he ever suffered
them to prey upon his mind; on the contrary, he made them a
subject of jocularity. In addition to being as hospitable as his friend
Mr. Skinner, Hindoo-Rao was addicted to field sports on a large scale,
and kept up a very large establishment for the purpose of gratifying
this propensity. He was considered—and perhaps justly, by those
qualified to form an opinion—the best shot in all India, and with his
rifle he had destroyed several hundreds (some say thousands) of
tigers. Hindoo-Rao had another very expensive hobby. He desired to
possess himself of the Philosopher's Stone, by which he might
transmute metals—a mode by which he proposed to improve the
state of his finances and eventually pay his debts. On all other
points, Hindoo-Rao was sufficiently sensible and shrewd, but on this
point he was childish, if not insane. Thousands and thousands of
pounds were squandered by him in this absurd pursuit, for he was
constantly the victim of juggling forgers, swindlers, and rogues. His
house was on a hill immediately overhanging Delhi, and it has
recently been made famous throughout Europe as the position of
one of our batteries. Night after night in that house would furnaces
blaze, while some impostor, who pretended to have the secret, was
at work with his chemicals.
I ought to mention that this Mahratta chief was a near relation of
the royal family of Gwalior, and that he had been banished and
pensioned for having been engaged in some intrigues against the
Gwalior State.
The Maharajah Hindoo-Rao was a great gourmand, and those who
partook of his dinners never forgot them. It was not often that the
old chief could be induced to discuss politics, but on the occasion of
the 41st Regiment of Infantry having mutinied at Delhi—a mutiny
which, by the way, was hushed up—I heard him very energetically
exclaim: "Ah! if you go on humouring your native soldiers in this
way, they will never be satisfied until they govern the country!"
The late Sir Charles James Napier visited Delhi while I was there. He
came, not as ordinary commanders-in-chief usually come, with a
large suite and an escort covering a square mile of encamping
ground, but attended only by two aides-de-camp and a military
secretary. It was on the morning of his Excellency's arrival that the
mutiny in the 41st Regiment, to which I have just alluded, occurred.
Sir Charles reviewed the regiments then quartered at Delhi, including
the 41st, and complimented them en masse! The review over,
Hindoo-Rao, who was a great horseman, rode up to the commander-
in-chief on his spirited charger, and expressed the happiness it
afforded him to see an officer who had so distinguished himself in
the military annals of his country. Sir Charles appeared much pleased
with the open, frank manner and independent bearing of the old
Mahratta chieftain, and accepted, on behalf of himself and his staff,
an invitation to dine with him that evening. A large number of
gentlemen, European and native, assembled to meet his Excellency;
and when Sir Charles returned thanks for the honour that had been
paid to him in drinking his health, he made allusion to the pleasure
that it afforded him in seeing Christians, Hindoos, and Mussulmen on
such good terms, and living together in such amity and concord.
What a change since that evening, which to me seems but as
yesterday! Several of our party, on that occasion, have become
chiefs of the recent rebellion, and were accessory to the massacre of
English gentlemen and ladies.
Hindoo-Rao died in eighteen hundred and fifty-four. His funeral was
thus described to me by a friend who witnessed it: "They dressed up
the old gentleman's corpse in his most magnificent costume, covered
his arms with jewelled bracelets of gold, with costly necklaces of
pearls and diamonds hanging down to his waist, placed him in a
chair of state, sat him bolt upright—just as he used to sit when alive
—and thus, attended by his relations, friends, and suite he was
carried through Delhi to the banks of the Jumna, where the body
was burnt with the usual rites, and the ashes thrown into the river."
Mr. Skinner also is dead. He died in eighteen hundred and fifty-five.
When I think of him I am rejoiced that he did not survive to be
brutally massacred, as his brothers have been; or to see his house
(near the Cashmere Gate) which was always the scene of good-
fellowship and good-feeling, turned into a battery by the rebels; or
the church, built by his father, burned and destroyed by the people
who had for years and years paid, or affected to pay, unqualified
respect and devotion to his family.
I made the acquaintance of another personage at Delhi, for whom I
had a very great liking and regard. This was Mirza Futteh Allee Shah
Bahadoor, the heir apparent to the throne of Delhi. He was a very
amiable and intelligent prince, and had an extraordinary thirst for
knowledge. Amongst other things that he was curious to learn was
the history of steam power, railroads, and the electric telegraph. For
hours together he would encourage me—nay, importune me, to talk
with him on these matters. Apropos of this prince and his family—
while I was at Delhi the festival of the Eed came to pass, and there
was an omen which was variously interpreted. The King, in other
words the Great Moghul, sacrifices a camel. The King kills (or used
to kill) the camel with his own hand, by driving a spear into the
breast of the animal. On the occasion to which I now refer, the King,
being extremely old and feeble, was assisted by two attendants,
and, in attempting to drive the spear, it broke in two pieces. That
was the omen. The friends of Mirza Futteh Allee Shah Bahadoor
interpreted it as prognosticating the King's death and the speedy
succession of the heir apparent to the throne. Others, however, said
that it prognosticated the downfall of the King and of his throne for
ever. Mirza died about a year ago of an attack of cholera; and it may
not be premature perhaps to say that the throne of the Great
Moghul will not in future be recognised. There was another curious
prophecy connected with the throne of Delhi, and current for many
years in the Punjab. It was implicitly believed that the Sikh soldiery
would one day or other, and before long, sack Delhi; and, in
eighteen hundred and forty-five, when the Sikh army crossed our
frontier, Delhi was its destination. This prophecy has to some extent
been fulfilled. The Sikh soldiers have tasted of the plunder of Delhi.
But who could ever have dreamed that their entry into the city of the
Great Moghul would be in company with British soldiers? It is as
though, and quite as incredible as if, some one had predicted in
eighteen hundred and sixteen that, in eighteen hundred and fifty-
five, the Queen of England, a grand-daughter of George III., would
be a guest at the Tuileries of an Emperor of the French, and a
nephew of Napoleon Bonaparte; and that such Queen would be led
upon the arm of such Emperor to visit the tomb of the Prisoner of
St. Helena.
After leaving Delhi I crossed over to Meerut, which was then, as it
always has been since its formation, the favourite station in the
Upper Provinces of India. In eighteen hundred and forty-six and
forty-seven there were as many as ten thousand troops quartered at
Meerut, including two regiments of British foot, a regiment of
dragoons, and three troops of horse (European) artillery. Until lately,
it has always been deemed prudent to keep a very large European
force at Meerut in order to keep Delhi (only forty miles distant) in
check; for it was stipulated in one of our treaties with the family of
the Moghuls, that no British infantry or cavalry, or other European
troops, should ever be quartered in the Imperial City or its
immediate vicinity. When, however, the Punjab was annexed, the
European force at Meerut was lessened to meet the exigencies of
the times; and of late Meerut has not been, in respect to the number
of European troops, the station that it was formerly.
There are no ancient buildings to be seen at Meerut. All is of
European structure. The church, the barracks, the court-houses, the
treasury, the theatre, the bungalows of the civilians and military
officers, as well as those of the merchants and "others," are all of
brick and mortar, lath and plaster; and they were for the most part
thatched, so that the Sepoys had very little trouble in setting fire to
them. The reason why houses are commonly thatched instead of
tiled and shingled, is that the thatch keeps the interior of the
dwelling so very much cooler.
While at Meerut I was a guest of the editor of the journal which
used to issue from that station, and as my stay extended over six
weeks, during which period I frequently assisted the editor in his
work, I gained some knowledge of the practical working of the press
in the Upper Provinces. I am authorized to make any use I please of
this knowledge.
In the first place I may mention that the order of Government
forbidding civilians or military men corresponding with the press,
was, to every intent and purpose, a perfect farce and a dead letter.
On the staff of the Meerut paper were several gentlemen belonging
to each branch of the service. These gentlemen not only wrote, but
some of them wrote for pay—for so much per column; while the
correspondence columns were filled with letters from covenanted
civilians or commissioned officers, judges, and magistrates, and their
subordinates; brigadiers, colonels, majors, captains, and subalterns
contributed anonymously, whenever the spirit moved them. Ay! and
frequently the members of the staff of the Governor-General and of
the Commander-in-Chief would not only send items of news, but
comments thereon; and I have reason to know that this practice was
continued up to the date of the recent outbreak, and is still
continued. By the way, the late Major Thomas was virtually the
editor of the Mofussilite at Agra at the time he received his death
wound in the field of battle. The Delhi newspaper was also written
for by civilians and military men of all grades.
It was the press that introduced to the notice of the Government
many clever and able men, who had no other interest to help them.
I could mention scores of instances, but two will suffice. Herbert
Benjamin Edwardes, of the Bengal Fusiliers, the "Brahminee Bull" of
the Delhi Gazette, and Mr. Campbell, of the Civil Service, who was
"given up" to Lord Dalhousie as the "Delator" of the Mofussilite, and
promoted to an office of great responsibility. In the last-mentioned
paper there also appeared, in eighteen hundred and forty-seven,
forty-eight, and forty nine, a series of leading articles on military
reform and other matters, some of which attracted the notice of Sir
Charles Napier. They came from the pen of General (then Major)
Mansfield, of the Fifty-third Foot, and at present chief of the staff of
Sir Colin Campbell. It was not to silence these men, who displayed
their ability in the newspapers, that they were placed in staff
employ, or promoted. On the contrary, I know that they were
expected—and in some instances requested—to use their pens in
defence of certain Government measures; and that, on several
occasions, they did vigorous battle with their former literary chief,
the editor of the paper in which they first made their appearance in
print. I remember that on one occasion the editor, on being beaten
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!

ebookluna.com

You might also like