0% found this document useful (0 votes)
29 views86 pages

Stm32 Iot Projects For Beginners A Handson Guide To Connecting Sensors Programming Embedded Systems Build Iot Devices With Stm32 1st Edition Aharen San PDF Download

Ebook

Uploaded by

liakotjichen
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
0% found this document useful (0 votes)
29 views86 pages

Stm32 Iot Projects For Beginners A Handson Guide To Connecting Sensors Programming Embedded Systems Build Iot Devices With Stm32 1st Edition Aharen San PDF Download

Ebook

Uploaded by

liakotjichen
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/ 86

Stm32 Iot Projects For Beginners A Handson Guide

To Connecting Sensors Programming Embedded


Systems Build Iot Devices With Stm32 1st Edition
Aharen San download
https://ebookbell.com/product/stm32-iot-projects-for-beginners-a-
handson-guide-to-connecting-sensors-programming-embedded-systems-
build-iot-devices-with-stm32-1st-edition-aharen-san-51738696

Explore and download more ebooks at ebookbell.com


Here are some recommended products that we believe you will be
interested in. You can click the link to download.

Stm32 Arm Programming For Embedded Systems 1st Edition Muhammad Ali
Mazidi

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

Stm32 Baremetal Embeddedc Drivers Mini Cookbook 14 Israel Gbati

https://ebookbell.com/product/stm32-baremetal-embeddedc-drivers-mini-
cookbook-14-israel-gbati-48890276

Beginning Stm32 Developing With Freertos Libopencm3 And Gcc Maker


Innovations Series 2nd Edition Gay

https://ebookbell.com/product/beginning-stm32-developing-with-
freertos-libopencm3-and-gcc-maker-innovations-series-2nd-edition-
gay-56073762

Beginning Stm32 Developing With Freertos Libopencm3 And Gcc Warrengay

https://ebookbell.com/product/beginning-stm32-developing-with-
freertos-libopencm3-and-gcc-warrengay-7032414
Mastering Stm32 Cubemx Unlock The Power Of Stm32 With Cubeide For
Embedded System Development Huang

https://ebookbell.com/product/mastering-stm32-cubemx-unlock-the-power-
of-stm32-with-cubeide-for-embedded-system-development-huang-85655836

Beginning Stm32 Developing With Freertos Libopencm3 And Gcc Warren Gay

https://ebookbell.com/product/beginning-stm32-developing-with-
freertos-libopencm3-and-gcc-warren-gay-56073774

Mastering Stm32 2nd Edition 2nd Edition Carmine Noviello

https://ebookbell.com/product/mastering-stm32-2nd-edition-2nd-edition-
carmine-noviello-42278384

Mastering Stm32 A Stepbystep Guide To The Most Complete Arm Cortexm


Platform Using The Official Stm32cube Development Environment 2nd
Edition 2nd Edition Carmine Noviello

https://ebookbell.com/product/mastering-stm32-a-stepbystep-guide-to-
the-most-complete-arm-cortexm-platform-using-the-official-stm32cube-
development-environment-2nd-edition-2nd-edition-carmine-
noviello-43787992

Mastering Stm32 018 Carmine Noviello

https://ebookbell.com/product/mastering-stm32-018-carmine-
noviello-5658976
STM32 IOT PROJECTS FOR
BEGINNERS
A Hands-On Guide to Connecting Sensors,
Programming Embedded Systems, Build IoT
Devices with STM32

By
Aharen-san

TABLE OF CONTENTS
BME280 WITH STM32 I2C TEMP PRESSURE HUMIDITY
EXAMPLE DUMMY CODE
CORONA DISPLAY METER USING STM32 ESP8266 OLED LCD16X2
EXAMPLE DUMMY CODE
DAC IN STM32 SINE WAVE HAL CUBEIDE
EXAMPLE DUMMY CODE
DATA LOGGER USING STM32 ESP8266 THINGSPEAK
EXAMPLE DUMMY CODE
DF PLAYER MINI AND STM32
EXAMPLE DUMMY CODE
GPS MODULE AND STM32 NEO 6M GET COORDINATES DATE TIME
SPEED
EXAMPLE DUMMY CODE
HCSR04 AND STM32 USING INPUT CAPTURE PULSE WIDTH CUBEIDE
EXAMPLE DUMMY CODE
INCREMENTAL ENCODER AND SERVO ANGLE CONTROL IN STM32 PWM
EXAMPLE DUMMY CODE
INPUT CAPTURE USING DMA MEASURE HIGH FREQUENCIES AND LOW
WIDTH
EXAMPLE DUMMY CODE
JOYSTICK MODULE WITH STM32 ADC MULTI CHANNEL HAL
NEXTION GUAGE AND PROGRESS BAR STM32
NUMBERS FLOATS QR CODE HOTSPOTS IN NEXTION DISPLAY STM32
PRINTF DEBUGGING USING SEMIHOSTING IN STM32 SW4STM LIVE
VARIABLE CHANGE
QSPI IN STM32 BOOT FROM EXT MEMORY XIP N25Q
QSPI IN STM32 WRITE AND READ N25Q
RIVERDI STM32 DISPLAY HOW TO CONTROL LED USING BUTTONS ON
THE DISPLAY
RIVERDI STM32 DISPLAY HOW TO SEND DATA FROM UART TO UI
ROTARY ANGLE SENSOR AND STM32 ADC
SD CARD USING SDIO IN STM32 UART RING BUFFER 4-BIT MODE
CUBEMX
SD CARD USING SPI IN STM32 CUBE-IDE FILE HANDLING UART
SDRAM IN STM32 MT48LC4
SLEEP MODE IN STM32F103 CUBEIDE LOW POWER MODE CURRENT
CONSUMPTION
SSD1306 OLED AND STM32 128X64 SW4STM CUBEMX
ST7735 TFT DISPLAY AND STM32 HAL
STANDBY MODE IN STM32 LOW POWER MODES CUBEIDE
STEPPER MOTOR AND STM32 ANGLE RPM AND DIRECTION CONTROL
CUBEIDE
STOP MODE IN STM32 CUBEIDE LOW POWER MODE
STORE DATA INTO SD CARD FREERTOS STM32 ADC DHT
UART RING BUFFER USING HEAD AND TAIL IN STM32 CUBEIDE
USE STM32 AS A KEYBOARD F103C8 USB DEVICE HID
USING PRINTF DEBUGGING SWV TRACE IN CUBEIDE ITM SWV
BME280 WITH STM32 I2C
TEMP PRESSURE
HUMIDITY
We will see how to interface BM e 280 sensor with STM 32. This
sensor can measure the temperature, pressure and relative humidity.
I have written a library for it, which I will upload on the GitHub and
you can get it from there. As we progress along the project, I will also
explain the code and how you can write one yourself using the
datasheet. The library covers a lot of things, but there are still few
things which you need to manually implement. So watch the project
carefully as you might need to make changes in the library based on
what requirements you have from the sensor. This is the datasheet
for the device. Here I have highlighted few important things that I will
cover in today's project. I will leave the link to this data sheet in the
description.
Let's start with cube ID and create a new project I am using STM 32
F 103 controller give some name to the project and click finish first
of all I am enabling the external crystal for the clock. The blue pill
have eight megahertz crystal on board and I want the system to run
at maximum 72 megahertz clock. Enable the serial wire debug. The
sensor can use both the eye to C and SPI for communication. You
can use either of those but I am going to go with the eye to see
enable the eye to see interface and leave everything to default. We
have the two pins for data and clock. Before going any further in the
project. Let's see the sensor and the connection with blue pill. Here
is the BM e 280. And as you can see it has the pinout for both SPI
and eye to see. Here I am connecting it with the blue pill. It's
powered with 3.3 volts and there are two pull up resistors each 4700
ohms connected between the clock and data pins and the 3.3 volts.
Poor resistors must be used while using the eye to see
communication. Also one very important thing I have grounded the
SDO pin. Keep this in mind as it will be used in the addressing of the
device. Now connect the PV six to the clock pin and PV seven to the
SDI pin that is data pin.
That completes the connection. Let's generate the project now. First
thing we will do is copy the library files into our project. So copy the
C file into the source directory and header file into the include
directory. Let's take a look at the source file. Here first we have to
define the eye to see we are using as I set up the i two c one so I am
leaving it unchanged. The next thing is the 64 bit support. If your
configuration supports 64 bit integers, then leave this as one or else
to use the 32 bit integers uncomment the 32 bit support and
comment out 64 bit the next is the address of the device. As
mentioned in the datasheet the seven bits of the address are these.
Here x depends on the SDO pin. And if you remember I grounded
the pin and therefore the X is zero in my case the slave address will
consist of these seven address bits along with the read or write bit.
So the address will be 11101100 which makes up zero Crossy see.
These variables will store the corresponding values and they are
externally defined here. So you should define them in the main file.
The rest of the code should be unchanged for default configuration
Let me explain how this works.
The sensor can work with three different modes. in sleep mode, no
measurements are performed, but the registers are accessible and
therefore, you can wake the sensor and perform the measurement.
Then comes the forced mode. Here the sensor performs a single
measurement and goes into the sleep mode. For the next
measurement, you need to wake the sensor again, I have added a
function for this you need to call this wakeup function before doing
the measurement. This is useful in situations like weather
monitoring, where the data does not need to be read very frequently.
Basically, it will measure all three parameters and then go back to
sleep mode. The next is the normal mode.
Here the sensor does the measurement and goes into the standby.
The data rate depends on the measurement time and standby time,
the current consumption will obviously be higher, but it allows you to
continuously monitor the data. In this tutorial, I will be using the
normal mode. There are few important things to note about the
measurements, the humidity measurement have a fixed resolution of
16 bits. The resolution for the temperature and pressure depends on
the fact that if you are using the IR filter or not, if using the filter, then
the resolution will be 20 bits. Otherwise, it depends on the
oversampling setting as shown here. IR filter can be used to avoid
the fluctuations in the pressure and temperature measurements. I
will be using the IR filter in this tutorial. And this library does not
support the measurements without filter, at least for now. Then we
have some examples for the settings which we will see later. Let's
check the source file again. Here the first function is the trim read.
This reads the trimming values that are stored in the non volatile
memory of the sensor. Every sensor comes pre programmed with
these values, and they don't change with reset or anything. We need
to read these values and then use them in the calculations ahead as
shown in the datasheet we must read the values from these
registers. And I am going to name them same as its named here.
Also note that some of these are unsigned and others are signed
values. So that's why I have defined them separately. Then we start
reading from zero by 88 address and we burst read 25 registers.
This means we read up to zero XA one which is Digg h one. Again,
we have to read from E one to E seven. This is done here we are
reading seven bytes from E one. And finally we will arrange the data
just how it's arranged in the data sheet. Then comes the
configuration which we will see later. Next is the reading of raw data.
It's mentioned in the datasheet that we must first read the data in
order to avoid the possible mix ups between the measurements. We
will read the registers F seven to f e. This is done here. We are
reading from this register. It is defined in the header file and its
addresses F seven and we will read eight bytes from here which will
include the registers up to F E. As I mentioned in the beginning, this
library is using the filter and this is why the pressure and temperature
are 20 bits in resolution. We will calculate the row values for all three
parameters using the registers we just read.

After this, we have the compensation formulas on page 25 of the


datasheet. These formulas uses the row values for temperature,
pressure and humidity and gives us the refined results. We need to
use them exactly in the same way. So this is what that is, I just
copied them from the datasheet and put them here. Notice that the
pressure uses the 64 bit integer here. But in case your machine
doesn't support it, there is a 32 bit alternative also, I have included
that in the library. So all you need to do is define the support as I
mentioned in the beginning. All right, now we will take a look at the
registers. The first register is the ID register, it's a read only register,
and it returns the ID of the device, which should be zero by 60. I
have included it in the code. Before reading the raw values, the code
checks for the ID. If the ID is zero by 60, only, then it goes for the
measurement. The next register is reset. If we write zero XP six to
this register, the device will soft reset. The next register is for the
humidity control. Here we need to select the oversampling for the
humidity. If you want to skip the humidity calculation, just set the
oversampling to zero. This configuration is controlled by the BM e
280 config function. Here are the parameters or the oversampling
settings for all three parameters. Then we have the mode, the
standby time and finally the filter configuration. First of all, we will
read the trimming parameters as it only needs to be done once and
then I am performing the soft reset then write the oversampling data
for the humidity these oversampling parameters are defined in the
header file and you can use them instead of writing a hexadecimal
value. After writing the data, we will read the same register to make
sure the changes were done in the register. The next register is
control measure register. It controls the oversampling of temperature
and pressure along with the mode of the sensor. Here I am shifting
the temperature data by five the pressure data by two and the first
two bits are for the mode.
The next register is the config register. It controls the standby time
for the normal mode along with the filter coefficients for the IR filter.
You can also use three wire SPI and enable it from here below the
tables for both standby time and filter coefficients. I have defined
them in the header file also. And at last, we have the data registers
where we read the data from the pressure, temperature and humidity
has mentioned here. This is how the 20 bit data is arranged in these
registers. This is enough explaining I hope let's write the code now
that I have defined these configurations as per my setup, I am using i
two c one and also my system supports 64 bit variables. Let's copy
this in the main file, we will include the BM e 280 header file, and
now define the variables to store the data. Inside the main function
we will call the BM e 280 config function. There are some examples
provided in the datasheet. For example, for weather monitoring, we
can use the Force mode with one sample per minute the pressure,
temperature and humidity oversampling all should be set to one.
Similarly there are other examples but in this tutorial, I will use the
indoor navigation. Here I will use the normal mode With standby time
of 0.5 milliseconds, the pressure oversampling is 16. And that for
temperature is two and one for humidity. So let's set the temperature
over sampling to to pressure to 16 and humidity to one the mode
should be set to normal mode, the standby time is set to 0.5. And at
last the filter coefficient is 16. With this configuration, the output data
rate is 25 Hertz. inside the while loop, we will call the BM e 280
Measure function. This will handle all the measurement and store the
values in the variables that we defined earlier. All right, everything is
done. Now build the code and debug it. Let's run it you can see the
values of temperature in degree Celsius pressure in Pascal's and
relative humidity as a percentage, I am going to put my finger on the
sensor see the value of the temperature rising. I kept the sensor in
the refrigerator for a while and see the temperature and humidity
values. The temperature is rising and humidity is decreasing. They
both are slowly tending towards the room condition. This is it for this
project.
EXAMPLE DUMMY CODE
I can provide you with an example code snippet
for interfacing the BME280 sensor with an
STM32 microcontroller using the I2C interface.
This code assumes you have already set up the
necessary hardware connections for the I2C
communication. Here's a basic example using
the STM32 HAL (Hardware Abstraction Layer)
library:
C
#include "stm32f4xx_hal.h"
#include "bme280.h" // BME280 library header
I2C_HandleTypeDef hi2c1; // I2C handle
BME280_HandleTypedef hbme280; // BME280
handle
void SystemClock_Config(void);
static void MX_GPIO_Init(void);
static void MX_I2C1_Init(void);
int main(void)
{
HAL_Init();
SystemClock_Config();
MX_GPIO_Init();
MX_I2C1_Init();
// Initialize BME280 sensor
hbme280.i2c_handle = &hi2c1;
BME280_Init(&hbme280);
while (1)
{
float temperature, pressure, humidity;
// Read sensor data
BME280_ReadTemperature(&hbme280,
&temperature);
BME280_ReadPressure(&hbme280,
&pressure);
BME280_ReadHumidity(&hbme280,
&humidity);
// Process and use sensor data as needed
HAL_Delay(1000); // Delay for 1 second
}
}
void SystemClock_Config(void)
{
// Configure the system clock here
}
static void MX_I2C1_Init(void)
{
// Initialize I2C1 peripheral here
}
void HAL_I2C_MspInit(I2C_HandleTypeDef*
i2cHandle)
{
// Initialize I2C MSP (GPIO, NVIC, etc.) here
}
void HAL_I2C_MspDeInit(I2C_HandleTypeDef*
i2cHandle)
{
// Deinitialize I2C MSP here
}
Please note that you need to include the
appropriate BME280 library and modify the
code according to your specific STM32
microcontroller and development environment.
Also, make sure that you have configured the
I2C peripheral and corresponding GPIO pins
correctly in the MX_I2C1_Init and
HAL_I2C_MspInit functions.
Remember to refer to the BME280 datasheet
and STM32 reference manual for accurate pin
mappings, register settings, and other details.
CORONA DISPLAY
METER USING STM32
ESP8266 OLED LCD16X2
I will also demonstrate this on LCD 16 cross two. Let's start by
creating a project in cube ID I am using STM 32 F 446 R E but you
can use any other controller to First thing first I am selecting external
crystal for the clock select our to see for connecting the displays we
need to use the fast mode for OLED display LCD display can work in
either mode.

Next select the UART in asynchronous mode and enable the


interrupt next the clock setup I am selecting external crystal which is
eight megahertz and I want the system to run at 100 megahertz also
I am changing these pins for convenience click Save to generate the
project this is our main file let's see the connections first. This is how
E SP is connected to the controller connector our x pins a TX and TX
two RX connect Vcc and C H P d to the five volts and ground to
ground Oh led is connected straight forward now we need to copy
these library files. You can get them after you download the code
from the link in the description.

Copy the C files in the source directory and header files in the
include directory. Now include the functions dot h file and SSD 1306
dot h file. If you are using any other eye to see you need to update it
here also update the UART if you are using any other let's copy this
function and we will paste it in the interrupt file also change the
UART interrupt handler. These are all the basic setup we have used
in previous projects two functions file only have two functions. This is
to initialize the E SP. You need to enter your Wi Fi credentials here.
This function is to get the data it requires the API key to get it, go to
thingspeak.com and create an account. After logging into your
account, go to Apps thing HTTP new thing HTTP give some name to
this now we have to get data from somewhere go to well domitor dot
info select your country. Now copy this address and paste it in the
thingspeak URL. Leave everything as it is go back to well domitor
Right click on the total cases click Inspect Right Click here, copy,
copy XPath and paste this in the past string remove the span and
click Save. That's it now let's write the main program. Initialize the
OLED display. print some data to show the status. Initialize the ESP
and enter the Wi Fi credentials, clear the display in the while loop,
print some info.

Now we will get the data copy the API key from the thingspeak and
paste it here we also need to create some arrays to save this data
to enter the arrays to their respective positions. And now we will
print this results on the OLED This will print the total number of
cases deaths and recovered cases let's build this and flush it into the
board you can see the data being displayed to show that it's working
properly I will change the country here you can see the data is also
updated let's change it again and data is updated again. I will
change this back to my country. If you are using LCD we need to
copy the LCD related files into the source and include folders in
code include the ITU c l c, d dot h file now we will initialize the LCD.
print some string to display status initialize the ESP eight to six six.
get data from the server and print it on the LCD.
EXAMPLE DUMMY CODE
It seems you're asking for an example code that
combines a STM32 microcontroller, an ESP8266
module, and an OLED LCD 16x2 display to
create a corona display meter. However, there
might be a mix-up in your question. The STM32
microcontroller and ESP8266 are two separate
components.
Assuming you want to create a corona display
meter using an STM32 microcontroller and an
OLED LCD 16x2, I'll provide you with an
example code snippet for interfacing the STM32
and OLED display to create a simple meter-like
animation. If you're specifically looking to
integrate an ESP8266 into the project, you'd
need to modify the code accordingly to
communicate with the ESP8266.
C
#include "stm32f4xx_hal.h"
#include "ssd1306.h" // OLED library header
I2C_HandleTypeDef hi2c1; // I2C handle
SSD1306_HandleTypeDef holed1; // OLED
handle
void SystemClock_Config(void);
static void MX_GPIO_Init(void);
static void MX_I2C1_Init(void);
static void SSD1306_Init(void);
int main(void)
{
HAL_Init();
SystemClock_Config();
MX_GPIO_Init();
MX_I2C1_Init();
SSD1306_Init();
uint8_t progress = 0; // Progress of the corona
display
while (1)
{
SSD1306_ClearBuffer(&holed1);
// Draw the corona meter
for (int i = 0; i < progress; i++) {
SSD1306_DrawPixel(&holed1, i, 15,
SSD1306_COLOR_WHITE);
}
SSD1306_UpdateScreen(&holed1);
progress++;
if (progress > 128) {
progress = 0;
}
HAL_Delay(100); // Adjust delay for
animation speed
}
}
void SystemClock_Config(void)
{
// Configure the system clock here
}
static void MX_I2C1_Init(void)
{
// Initialize I2C1 peripheral here
}
void HAL_I2C_MspInit(I2C_HandleTypeDef*
i2cHandle)
{
// Initialize I2C MSP (GPIO, NVIC, etc.) here
}
void HAL_I2C_MspDeInit(I2C_HandleTypeDef*
i2cHandle)
{
// Deinitialize I2C MSP here
}
static void SSD1306_Init(void)
{
// Initialize the OLED display here using the
SSD1306 library
}
This code uses the SSD1306 OLED library
(assumed to be named ssd1306.h) to
communicate with the OLED display. The loop
increments a progress variable, which is used
to draw the corona meter-like animation on the
OLED screen.
Please make sure to set up the I2C
communication and the SSD1306 OLED
initialization according to your hardware
configuration. If you need to integrate an
ESP8266 for any specific purpose, you'll need
to adapt the code to manage the ESP8266
communication and functionality as well.
DAC IN STM32 SINE
WAVE HAL CUBEIDE
We will create a sine wave using D AC and STM 32. digital to analog
converters are basically opposite to ADC, they convert the digital
signal to the analog signal and as the sine wave is the best
representation of an analog signal, that's what we will create today.
Let's start with the cube Id first I am using STM 32 F 446 R E, F 103
ca turns of Da C so I have to use this one let's set up the cube mix.

First things first I am using the external crystal for the clock. Next
select the DSC configuration as you can see here, the pin PA four is
selected as the ACF pin. By default output buffer is enabled and
there is no trigger we will keep it like this for the first part of this
project. Next, set up the clock and once done click Save to generate
the code. Here is the generated main dot c file. Before starting let's
see the document provided by st on da C as you can see the
formula here to calculate the D AC output the ref is 3.3 volts D O R is
the value that we don't know Max digital values are given below
depends on what resolution you use.

Let's
start programming now first of all I am creating a variable 0.2 is
going to be the output voltage that is d AC output value. We need to
create another variable to store the respective digital value inside the
main function first start the D AC. In this while loop, I am going to do
the conversion from voltage to the digital value. To do so, we need to
make do our as the subject of this formula. Once done, we need to
set this value to the DA see and then increment value this process
will continue with some delay remember that the value can't be more
than reference voltage and that is 3.3 volts looks like we got some
errors let's compile it again.
So, the code compiled successfully time to flash it to the board just
create a debug configuration observe the reading on the voltmeter
and on the oscilloscope the voltage output from the pin is changing
every 750 milliseconds and it doesn't go higher than three volts let's
increase the time delay so that you can observe the change
properly here we go the voltage is increasing every two seconds
now so, this was the basic idea about how to use the D AC and
STM 32. Now, we will create a sine wave using the same this
process is mentioned in the same note but before this we need to
make some changes to our setup first we need to select a trigger
timer I am using timer to also we will use DMA for this entire
process this will keep the CPU free Next, go to the timer setting that
you chose. This setup will decide the frequency of the wave and
therefore is critical. I am using timer two which is connected to the
APB one clock and this is running at 90 megahertz. I am selecting
the prescaler as 90 This will reduce the timer clock to one megahertz
using a Rs 100 will further divide the clock to 10 kilo hertz I will
explain this particular setup in a while.
Select Update events here. This is it for the setup. Let's generate the
code now. include math dot h, so that we can use the sine function I
am creating an array to store the digital values of 100 samples of
sine function we need pi value this function here will do the
conversion let's take a look at the PDF again this is the formula that
we are going to use number of samples is going to be 100 in our
case f f f is for the 12 bit resolution now in the main function, we
first need to start the timer and then start the DA C with D M A. Now
let's talk about the frequency of this wave as I mentioned he APB
clock is at 90 megahertz and using a prescaler of 90 We'll divide that
clock by 90 making it one megahertz using the ARR value 100 will
further divide the clock by 100 making it 10,000 hertz according to
this application note the frequency of the sine wave is equal to time a
frequency divided by number of samples. In our case we have to
further divide this value by 100 Because we are doing 100 samples
which gives us a frequency of 100 hertz This is the frequency that I
am expecting for the sine wave to have. Oh sorry, I forgot to include
the function to convert the values to digital form Let's build and run
the code you can see the sine wave being produced with the
frequency of 100 hertz let's increase the frequency now. I am
dividing it by 10 that will increase the frequency by multiple of 10.
EXAMPLE DUMMY CODE
Here's an example code snippet for generating a sine
wave using the STM32's DAC (Digital-to-Analog
Converter) module, HAL (Hardware Abstraction Layer)
library, and CubeIDE. This example generates a sine
wave using a lookup table and outputs it through one
of the DAC channels. Please note that this example
assumes you have configured your hardware and
peripherals properly in CubeIDE.
#include "main.h"
#include "math.h"
#define DAC_CHANNEL DAC_CHANNEL_1
#define DAC_TRIGGER DAC_TRIGGER_NONE
#define SINE_WAVE_SAMPLES 128
DAC_HandleTypeDef hdac;
// Sine wave lookup table
const uint16_t sineWave[SINE_WAVE_SAMPLES] = {
2048, 2447, 2831, 3185, 3495, 3750, 3939, 4056,
4095, 4056, 3939, 3750, 3495, 3185, 2831, 2447,
2048, 1648, 1264, 910, 600, 345, 156, 39,
0, 39, 156, 345, 600, 910, 1264, 1648,
2048
};
void SystemClock_Config(void);
static void MX_DAC_Init(void);
int main(void)
{
HAL_Init();
SystemClock_Config();
MX_DAC_Init();
while (1)
{
for (uint16_t i = 0; i < SINE_WAVE_SAMPLES; i++)
{
HAL_DAC_SetValue(&hdac, DAC_CHANNEL,
DAC_ALIGN_12B_R, sineWave[i]);
HAL_Delay(10); // Adjust delay for desired
frequency
}
}
}
void SystemClock_Config(void)
{
// Configure the system clock here
}
static void MX_DAC_Init(void)
{
hdac.Instance = DAC;
if (HAL_DAC_Init(&hdac) != HAL_OK)
{
Error_Handler();
}
DAC_ChannelConfTypeDef sConfig = {0};
sConfig.DAC_SampleAndHold =
DAC_SAMPLEANDHOLD_DISABLE;
sConfig.DAC_Trigger = DAC_TRIGGER;
sConfig.DAC_HighFrequency =
DAC_HIGH_FREQUENCY_INTERFACE_MODE_DISABL
E;
sConfig.DAC_OutputBuffer =
DAC_OUTPUTBUFFER_ENABLE;
if (HAL_DAC_ConfigChannel(&hdac, &sConfig,
DAC_CHANNEL) != HAL_OK)
{
Error_Handler();
}
}
In this code, a sine wave lookup table is defined,
containing 128 samples for a half cycle of a sine wave.
The code then loops through these samples and sets
the DAC output value accordingly. The delay inside the
loop controls the frequency of the generated sine
wave. Adjust the delay value as needed to achieve the
desired frequency.
Please note that this example assumes you've
configured the DAC peripheral and corresponding
GPIO pins correctly in the CubeIDE interface. Also,
remember to configure the system clock appropriately
using the SystemClock_Config function.
DATA LOGGER USING
STM32 ESP8266
THINGSPEAK
We will see how to use STM 32 to log data to the thingspeak server
using ESP H 266. Let's first start by creating the project in cube ID I
am using nuclear 446 R E for this project give some name and click
finish here is our cube MX, first I am selecting external crystal for
the clock next, I am selecting an ADC which will be used to read the
potentiometer data changing the resolution to 10 bits even if you
don't enable continuous conversion, it should be fine because I am
going to use the pole for conversion method. So continuous
conversion is not required. Leave everything else to default now,
enable the UART with the interrupt. This is where the ESP 8266 will
be connected. Let's set up the clock now.
I have eight megahertz Crystal and I want the system to run at
maximum frequency click Save to generate the project let's include
the libraries first. I am going to use the ring buffer library and data
logger library. Put the source and the header files in the respective
folders click Refresh and you can see the files here in our project.
Let's take a look at the ring buffer dot c file. Here you can change the
URL that you are using copy this function from here and paste it in
the interrupt dot c file also we need to modify UART handler and
comment out the original one. Let's take a look at the data logger
dot c file now ESP and its text the SSID and password as the
parameter ESP send data sends the data to a particular filed label.
The parameters are self explanatory here. Here you have to give the
label of the field such as either one or two or three etc. This is the
one I am going to use. It sends data to multiple fields at once. Let's
first go to the things register yourself or log in. Click on channels
then click New Channel give some name to this channel. I am going
to use four fields in this channel we can modify these names also. I
will quickly modify others too. You can see the modified names.

Remember that field label number is the one that we need while
sending data Let's start include the data logger dot h i will write a
function to get the ADC value this includes start ADC pole for
conversion, get the value and stop ADC. Let's define the variables
that we are going to use also a buffer to store the four values inside
the main function. First of all initialize the ESP with the SSID and
password now in the while loop, we will get the value of ADC, then
convert this value to the voltage and at last increment the count
variable now, we will store these values in the respective position in
value buffer and send these values to the server. Now here we need
the API key go to your channel, click API key and copyright API key I
have four number of fields so, enter four here and pass the value
buffer give a delay of 15 seconds minimum things speed server will
not update the data if we send it within 15 seconds let's build and
debug our program I am adding the variables in the live expression
let's run it now. You can see the first entry in the thingspeak Now I
am rotating the potentiometer so the ADC value will change you can
see the new entries now also note the values of count and count
times two. Everything is as par with the values we have in the live
expression this data will keep updating every 15 seconds.
EXAMPLE DUMMY CODE
Below is an example code for creating a data
logger using an STM32 microcontroller and an
ESP8266 module to send data to ThingSpeak. This
example assumes that you have set up the STM32
microcontroller, ESP8266, and the necessary
sensors for data measurement.
#include "stm32f4xx_hal.h"
#include <string.h>
#include <stdio.h>
UART_HandleTypeDef huart2; // UART handle for
ESP8266 communication
// Configure your ThingSpeak channel and API key
#define
THINGSPEAK_CHANNEL_ID "YOUR_CHANNEL_I
D"
#define
THINGSPEAK_API_KEY "YOUR_API_KEY"
// Function to send data to ThingSpeak
void SendDataToThingSpeak(float temperature,
float humidity)
{
char buffer[128];
sprintf(buffer, "GET /update?
api_key=%s&field1=%.2f&field2=%.2f\r\n",
THINGSPEAK_API_KEY, temperature, humidity);
HAL_UART_Transmit(&huart2, (uint8_t*)buffer,
strlen(buffer), HAL_MAX_DELAY);
}
int main(void)
{
HAL_Init();
SystemClock_Config();
MX_USART2_UART_Init();
// Initialize sensors and other peripherals here
while (1)
{
// Read temperature and humidity from sensors
float temperature = ReadTemperature();
float humidity = ReadHumidity();
// Send data to ThingSpeak
SendDataToThingSpeak(temperature, humidity);
HAL_Delay(10000); // Send data every 10
seconds
}
}
void SystemClock_Config(void)
{
// Configure the system clock here
}
void MX_USART2_UART_Init(void)
{
// Initialize USART2 peripheral for ESP8266
communication here
}
void HAL_UART_MspInit(UART_HandleTypeDef*
huart)
{
// Initialize UART MSP (GPIO, NVIC, etc.) here
}
void HAL_UART_MspDeInit(UART_HandleTypeDef*
huart)
{
// Deinitialize UART MSP here
}
// Implement functions to read temperature and
humidity from sensors
// and other necessary hardware initialization as
needed
This code demonstrates a basic data logging
functionality where it reads temperature and
humidity data from sensors (you need to
implement the functions ReadTemperature() and
ReadHumidity()), then sends the data to
ThingSpeak using the ESP8266 module through
UART communication. Remember to initialize and
configure your UART communication with the
ESP8266 properly.
Before using this code, make sure to replace
"YOUR_CHANNEL_ID" and "YOUR_API_KEY" with
your actual ThingSpeak channel ID and API key.
Please note that this is a simplified example, and
you may need to adapt it to your specific STM32
microcontroller, ESP8266 module, sensors, and
overall project requirements. Additionally, ensure
that you have the necessary libraries and drivers
set up in your STM32 project.
DF PLAYER MINI AND
STM32
D F player works with very simple commands which needs to be
transmitted using UART let's start by creating a project in cube Id
first I am using STM 32 F 103 For this purpose give some name to
the project and click finish here is our cube MX I am selecting
external crystal for the clock select serial wire debug I am using you
f1 To send commands make sure the baud rate is 9600 bits per
second I am going to use three buttons to control the playlist.

That's why I am selecting these pins as input. Let's go to the clock


setup now I have eight megahertz external Crystal and I want the
controller to run at 72 mega hertz click Save to generate the project
first of all we need to copy the library files. So copy the C file to
source and header file to include directory click Refresh and you
can see the files in the project. Let's take a look at the data sheet
first. As you can see here, it supports fat 16 Fat 32 formats for the
SD card there are 30 levels of volume and other things are there too
you can read them as mentioned here, the default baud rate is 9600.
And now the very important thing the standby current is 20 milliamp
pairs I will tell you more about this in a while this is the diagram of
DF player mini we are going to use only this side let's take a look
connection now. I am using external power supply for the DF player.
RX pin from the DF is connected to Tx pin of the controller which is
pin PA nine and Tx pin from the DF is connected to Rx pin of the
controller which is pin p a 10. Speaker One and speaker two pins are
connected to the positive and negative of the speaker these three
buttons are connected to pin PA one pa two and Pa three This
button is for previous selection. This one is for pause or play and this
is for next song selection.

Coming back to the external power supply. While testing I found that
DF player needs around 25 milliamp pair of current during the song
is playing F 103 was not able to supply this much current even with
the USB connected. So I switched to the external power supply.
Even in the datasheet it's mentioned that it takes 20 milli amperes of
idle current. Let's go back to our main file we need to include the
library in our main file let's see the DF player dot c file now. Here
you can change the URL According to the one UI using the source is
defined as from the SD card I will get back to this in a while define
the pins that you are using for the buttons let's see these defines
now stalked by two zero cross seven e and Vita zero cross E FF, the
command sent to the DF player have a sequence and that is staff
byte version command length command feedback Parameter one
Parameter 216 Vic checksum and the end bite command length is
six as mentioned here, because it does not count the start checksum
and the end bytes we are not going to use feedback. So, I have
defined it zero here send command function will send the commands
to the DF player it first calculates the checksum the command
sequence is same here too we have staffed by its version command
length command feedback Parameter one Parameter to check some
high byte lower byte and the end byte and then it sends this array to
the UART DF in it is to initialize the player and it takes volume as
the parameter basically we send zero cross three F with the
parameters you can see here this is the commands to initialize the
player and we need to send the parameters also if you scroll down
the example is provided in the datasheet This is the sequence of
commands need to be sent for the TF card we have command
feedback parameter one and parameter to the parameter two is zero
cross 02 for the TF card that's why I have defined it as source here
you can change it and see the other parameters in the data sheet.
Then it sets the volume zero cross 06 is the command to set the
volume along with the parameter which acts as a level of the volume
the F next function is to play the next song this command does not
need any parameter. This is commands to play previous song we
have pause and play also. Check key function checks if the key is
pressed. If the song is playing, then it will be paused or if it is paused
then it will resume the play. Then we have a button for previous and
a button for next song. Now let's start programming. Initialize the def
player. I am keeping the volume as 10 stop the play from the first
song in the while loop. We will keep checking for the button pressed.
Let's build and debug this before starting I want to show you my SD
card. There are six mp3 files. You should also number them like I
have done it here.
EXAMPLE DUMMY CODE
Below is an example code for interfacing a
DFPlayer Mini MP3 module with an STM32
microcontroller. This code demonstrates how to
control the DFPlayer Mini to play specific MP3 files
using UART communication. Make sure you have
the necessary connections between the STM32
and the DFPlayer Mini (TX-RX and RX-TX).
C
#include "stm32f4xx_hal.h"
UART_HandleTypeDef huart2; // UART handle for
DFPlayer Mini communication
void SystemClock_Config(void);
static void MX_USART2_UART_Init(void);
void SendCommand(uint8_t cmd, uint8_t param1,
uint8_t param2)
{
uint8_t buffer[10];
buffer[0] = 0x7E; // Start byte
buffer[1] = 0xFF; // Version
buffer[2] = 0x06; // Command length
buffer[3] = cmd; // Command
buffer[4] = 0x00; // Feedback
buffer[5] = param1;
buffer[6] = param2;
buffer[7] = 0xEF; // End byte
HAL_UART_Transmit(&huart2, buffer, 8,
HAL_MAX_DELAY);
}
void PlayTrack(uint16_t trackNumber)
{
SendCommand(0x03, highByte(trackNumber),
lowByte(trackNumber));
}
int main(void)
{
HAL_Init();
SystemClock_Config();
MX_USART2_UART_Init();
while (1)
{
// Play a specific track when a condition is
met
if (/* your condition here */) {
PlayTrack(1); // Play track number 1
HAL_Delay(2000); // Delay to avoid
continuous triggering
}
}
}
void SystemClock_Config(void)
{
// Configure the system clock here
}
static void MX_USART2_UART_Init(void)
{
huart2.Instance = USART2;
huart2.Init.BaudRate = 9600;
huart2.Init.WordLength =
UART_WORDLENGTH_8B;
huart2.Init.StopBits = UART_STOPBITS_1;
huart2.Init.Parity = UART_PARITY_NONE;
huart2.Init.Mode = UART_MODE_TX_RX;
huart2.Init.HwFlowCtl =
UART_HWCONTROL_NONE;
huart2.Init.OverSampling =
UART_OVERSAMPLING_16;
if (HAL_UART_Init(&huart2) != HAL_OK)
{
Error_Handler();
}
}
void HAL_UART_MspInit(UART_HandleTypeDef*
huart)
{
// Initialize UART MSP (GPIO, NVIC, etc.) here
}
void
HAL_UART_MspDeInit(UART_HandleTypeDef*
huart)
{
// Deinitialize UART MSP here
}
uint8_t lowByte(uint16_t x) {
return x & 0xFF;
}
uint8_t highByte(uint16_t x) {
return (x >> 8) & 0xFF;
}
Please note that this is a simplified example and
you may need to adapt it to your specific STM32
microcontroller model, hardware connections, and
requirements. The provided SendCommand
function prepares and sends the necessary
commands to the DFPlayer Mini over UART.
Ensure that you have the UART communication
properly configured and connected between the
STM32 and the DFPlayer Mini. Also, replace the
condition in the loop with the logic that determines
when to play the desired track.
GPS MODULE AND
STM32 NEO 6M GET
COORDINATES DATE
TIME SPEED
I brought to you another project on the GPS module where we will
interface the module with the STM 32 micro controller. As many of
you might be using the Neo GPS modules, I have also switched to
Neo six M for this project, but it does not matter. As I have
mentioned before, the output from all the GPS modules is pretty
much the same. They all outputs the data in the NME a format and
that is why you can use this method for pretty much every GPS
module out there. If you remember from my previous project, this is
the output of the GPS module in the NME of format. Before starting
this project, I would want you guys to get familiar with the ring buffer
code. If you've got the ring buffer code to work, you can go ahead
with this one or else first try to make that work.
Like I said I have switched to Neo six M and I have connected it with
the ft 232 UART TTL device you can see the connection the LED on
the six M is blinking this means that we have the fix on the signal the
TX pin from the six M is connected to the RX pin of the ft 232. It's
also connected to the RX pin of the UART one of the blue pill but for
now let's focus on the ft 232. The module is powered with five volts
supply from the blue pill you can see the data it is transmitting via the
UART it's basically the same format as the previous GPS module.
Now I am going to connect the module to 3.3 volts supply and we will
see the UART output you can see the output if you are getting
something like this make sure you provide proper voltage supply to
the module. Here I have switched back to five volts and the
transmission begins again. Let's keep these things in mind and
create a new STM 32 project I am going to use STM 32 F 103
controller for this give some name to the project and click Finish
enable the external high speed crystal for the clock. Also we need to
enable the serial wire debug. There is eight megahertz crystal
onboard and let's run the system at maximum 72 megahertz clock
All right, now we will enable the UART since the data incoming is of
uncertain length, we need to use some circular or ring buffer for the
UART I already did a project on it few years ago and if you have
made it work, you are good to go with this tutorial.

Also, I would recommend that you watch that project first. If you
haven't did it yet, as this code will heavily depend on that project.
Let's enable the UART interrupts now. Nero six M works with 9600
baud by default. I am relocating the UART pins for my convenience.
PV seven is the RX pin and PV six is the TX pin. This is it click Save
to generate the project this here is the ring buffer code that I am
going to use. Here are the steps provided for this particular code to
work. I have already downloaded the ringbuffer files and now we will
copy them into the project along with the NN e files I have created
specifically for this tutorial put the C files into the source directory
and header files into the include directory let's see the ring buffer dot
c file, we need to put this in the interrupt file first include the UART
ring buffer header file. Now define the UART is our function as extern
we need to also define the timeout as external variable.
This is needed for the timeout feature to work inside the SysTick
interrupt handler, decrease the timeout value. And finally, inside the
UART interrupt handler, replace the interrupt handler with UART is
our function. Make sure you update the correct UART instance you
are using. I have modified the RX buffer size to 512 Bytes as there is
large data in the incoming buffer. Other than this, the ring buffer code
is pretty much untouched. Let's include the UART ring buffer header
file also include the n n e a header file in the main file. This is how
the nm e a header file looks like. Notice that it only have two
functions to decode G G, A and R MC. If you have watched my
previous project on GPS, you will know what these terms means.
These two gives enough information for now. All right, let's initialize
the ring buffer now and build the code to check for any errors. If
there are no errors, we can go ahead let's debug the code once.
This is to make sure if we are receiving the data in the RX buffer or
not, let's add the RX buffer to the live expression. Run the code
now. Let's see the buffer itself. Here you can see we got the RM C
Random documents with unrelated
content Scribd suggests to you:
my position, without being able to come to any positive decision. In
short, we saw the storm approaching, but knew not how to avoid it.
Some advised me to be circumspect; others spoke out plainly of the
probability of my being put into prison. But I laughed at them.
"Why do you not get away?" asked one of my best friends. "Do
you not know that already arrests are being made on every side? Do
you think it likely that they will spare you, who have rendered
yourself so obnoxious to the priests?"
"My dear friend," I replied, "the present government have but one
fault to charge me with, that of having abandoned the Church and
reformed my creed, and, as a natural consequence, if you will,
entered into matrimony. Now for this pretended crime I am only
responsible to the Inquisition. The civil tribunals have nothing
against me; I am no political offender. It is well known that ever
since I have returned to Rome I have lived as a private citizen, and
never held any office under the Republic; so that I am easy on that
score. As to the criminal courts, thank Heaven, I have no cause to
fear them; nor in that of the Vicar-General can any charge be laid
against me for immorality. But do you think that the Tribunal of the
Inquisition can ever be re-established? under the protection of
France too? It is not to be thought of. At any rate, without the Pope
and the Cardinals there can be no Inquisition in Rome, and they are
not likely to return just yet. Indeed, I shall not wait for them; I shall
be far away before they come back."
"Your reasoning is very good; but do you imagine justice will be
done to you? have you never heard the logic of priests? Stat pro
ratione voluntas: they have only to desire, and your ruin is certain."
"My dear friend, prudence is very desirable; but not so that
restless apprehension which takes possession of the mind, to the
exclusion of all other feelings, and leads us to imagine danger where
none exists. Our Lord authorized His disciples, when they should be
persecuted in one city, to flee unto another; but who, as yet, has
persecuted me? If I fly without such persecution, what answer shall
I give to the Lord, when he shall say to me: 'Shepherd, I had
entrusted a flock to your care, I had even given you my lambs to
feed, and to guide into the paths of salvation; you were their
guardian; and behold, you saw the wolf approach, and you fled. You
are not their true shepherd, but a hireling who careth not for the
sheep. Leave it to Pio Nono, who is no true shepherd, to desert his
flock; but you—' Ah! my friend, above all I should dread so terrible
and so just a reproof. I will only fly when the Lord, who has placed
me here, enjoins me to do so. Until He declares His will, I shall
remain where I am."
At this my friend shook his head, and said, "Since you are
resolved, may the Lord keep and protect you. He will either remove
the danger from you, or——but whatever be His pleasure, may His
gracious will be done."
"Amen," I answered.
Towards the end of July, I was informed that another case of
Bibles had arrived, directed to me, and was lying at the Custom-
house.
"Alas!" I exclaimed, "my poor Bibles have come too late!" The
Custom-house had returned to its old system; the inspector of books
was again upon the alert, on the part of the master of the Sacred
Palace; it would be impossible to get them out of his hands; still I
resolved to make the attempt; not indeed personally, but through
the mediation of others; and the attempt was fatal to me. My Bibles
were confiscated, and were turned into an evidence sufficient to
condemn me. The endeavour to introduce the Bible into Rome is a
crime not to be pardoned, "neither in this world nor in the next;"—it
is reckoned as the real sin against the Holy Roman Church; a more
direful one, in her estimation, than that against the Holy Ghost.
"Now, indeed," my friends observed, "there is cause for fear. This
case of Bibles is a body of crime: hasten out of Rome; delay not a
day."
I confess I did indeed feel a cold shudder, even to my very bones,
as I thought of it. I saw that my fate would be the same as that of
the books. If they were shut up, could I hope to remain at liberty?
This occurred on the 26th of July; I might have got away, but I had
always accustomed myself, especially in times of trouble, not to rely
on my own judgment, or act from my own will. As a believer in the
Divine providence, I desired in all things to be governed by the will
of God; and accordingly I sought in prayer His guidance, determined
to act as His influence should direct me. He appeared to require a
sacrifice of me; my testimony to Himself, and to our Blessed Saviour.
My flight would have characterised me as an apostate, a deserter
from my duty. Could I terminate my mission so unworthily? Should I,
by a single act, lose all that I had obtained with so much exertion? I
remembered the prayer I had offered up on entering Rome, "Lord,
as in this same city Thou didst send thine Apostle Paul to overthrow
idolatry, and to announce the glad tidings of salvation; and didst
ordain that he should remain for the space of two years within these
walls, so grant to me, thy servant, that being also sent here in thy
service, I may remain here at least for the term of one year, in the
continual exercise of my mission, through Jesus Christ our Lord."
This prayer, which I then offered up in faith, could not but be
granted; and divine favour is not given by halves. I therefore
considered that as I had yet only been six months in Rome, there
were six more that I had to remain, to do the Lord's will—it mattered
not under what circumstances I should be placed, I had still my
work to do. The Apostles even in prison continued their labours.
Whatever it pleases God to appoint for the future, it is my duty at
present to remain in Rome.
These reflections imparted so much comfort and satisfaction to my
mind, that I look back upon these days as the happiest of my life. I
regarded my dear companion with confidence and holy joy, and
more than once asked her if she too were not willing to do the will
of the Lord, and whether He sent us joy or tribulation, to bless His
holy name.
"Ah! yes," she replied, "have we not frequently promised it to each
other? Was it not our prayer when we were first betrothed, and was
it not renewed on the day of our marriage? I am ready to submit to
the will of the Lord."
This also was an inexpressible satisfaction to me. To see a beloved
wife, whom only one short month before I had received as a
precious gift from heaven, so well disposed to make the greatest
sacrifices for the love of God! Everything tended to confirm me in
the thought that it was my duty to wait with resignation the fate that
should be allotted to me.
From the 26th to the 29th I remained at home, distributing the
Bible and speaking of the Gospel of Christ, to all who came to me.
From an early hour in the morning until late in the evening I had a
perpetual throng of visitors. On the evening of the 29th I felt more
than usually tired, having been engaged in speaking the whole of
the day. My wife was not very well, and at about eleven o'clock we
retired to rest. At twelve, I heard a violent knocking at the front
door. It was the Inspector of the Police, with three officials from the
Inquisition, escorted by six of the chasseurs de Vincennes. Yes, the
soldiers of the French Republic, after having destroyed a government
as legitimate as their own, now lent their assistance to the tools of
the Pope, to execute the orders of the Inquisition!
These nocturnal visitants evidently came for the purpose of
arresting me. I asked by whose authority they acted. The Inspector,
Signor Volponi, replied, "By authority of the Prefect of Police," (at
that time an officer of the French Republic.) We exchanged but few
words. I commended my wife to the care of the Lord, leaving her
with her brother Henry and her sister Elizabeth, who at that time
were living with us, and allowed myself to be taken away to the
palace of the Governor.
The next morning the chief bailiff came to reconnoitre me; and
after some deceitful words and lying promises, on the part of the
Prefect of Police, sent me off, under an escort, to the Inquisition;
where I was placed in a cell wherein two priests were already
confined, on the charge of having taken part in the affairs of the
Republic. They knew me by sight, it appeared; though I did not
myself recollect having ever seen them before.
There were altogether in the prisons of the Holy Office, at that
time, about fifteen priests; not one of them was accused of any
pretended heresy, but all of having written, as well as spoken,
against the temporal power of the Pope.
My two fellow-prisoners soon became on friendly terms with me.
Their desire to hear me deliver my sentiments on religious matters
made them forget everything else; they were famishing after the
doctrines of the Truth, of the Word of God. I had not a Bible with
me; I had not been allowed to bring one; but I cited passages from
memory, and as I was well acquainted with the Vulgate edition, I
quoted the Latin text; and I frequently heard such remarks as, "Oh,
I was not aware of it!"—"Indeed! I never reflected on that
before!"—"You are quite right; your argument is undeniable."
The authority of the Church was the grand topic; we continually
returned to it; the Primacy of the Pope, as derived from the Apostle
Peter. What a surprise it was for them to hear themselves
contradicted in this belief, which they had regarded as an absolute
axiom; to be told that among the Apostles no one was head or chief;
that Jesus Christ never gave any distinct diploma to St. Peter; and
that on the contrary, He expressly declared that no one should be
lord or master over the others, since they were all brethren.
"But Peter," said they, "was always foremost in speaking; he
answered for the rest, without being called upon to do so, as one
having authority."
"St. Peter," I replied, "was characterised by his great boldness,
which indeed often amounted to presumption: his words to our Lord
were: 'Though all men should be offended because of thee, yet will I
never be offended;'[115] and, again, 'Though I should die with thee,
yet will I not deny thee!'[116] You know how this proud boasting
ended. He was also bold when he requested Jesus to enable him to
walk upon the water; but this daring soon gave place to fear, and he
began to sink. His presumption even went so far as to 'rebuke' his
Lord and Master, when He told His disciples 'that he must go unto
Jerusalem, and suffer many things ... and be killed.'[117] And did not
Peter well deserve the reproof he then received: 'Get thee behind
me, Satan, thou art an offence unto me: for thou savourest not the
things that be of God, but those that be of man'?[118] So much for
the authority of this Prince of Apostles, as he is called, and his claim
to supremacy, dignity, and infallibility in the Church! St. Paul, at any
rate, does not seem to admit it, when he says, 'But when Peter was
come to Antioch, I withstood him to the face, because he was to be
blamed.'[119] It is to be noted that this took place at Antioch, where,
according to the Church, of Rome, St. Peter established the first
pontifical chair, and, consequently, where he may be supposed to
have spoken ex cathedra."
My poor friends had no more to say. One of them was extremely
docile, and from the first was disposed to admit the authority of the
Bible. The other was equally desirous to understand the truth, but
he could not divest his mind of its old prejudices: he was pained to
see the idols of his temple destroyed. We discussed these subjects
every hour of the day, and during part of the night. An oppressive,
suffocating heat prevented our sleeping; what little breath we had
we employed in these discourses, and in occasional prayers. The
second day after my arrival, the least docile of my new friends
yielded to my arguments; both were now converted to my opinions.
Towards evening we were engaged on the important question, as to
the sole mediation of Jesus Christ, to the exclusion of that of the
Virgin Mary and of the saints, when suddenly the door of my prison
opened, and I was laid hold of by two of the officials of the
Inquisition, and by them taken out and delivered over to a party of
carbineers, to be conducted to the Castle of St. Angelo.
My two friends were in despair at seeing me removed; one of
them could scarcely refrain from tears. I shared in their emotion,
and invoked the blessing of Heaven in their behalf.
Arrived at the castle, I was confided to the guidance of a single
carbineer, who took me within side, and led the way to the upper
part of the fortress, where the secret prisons are situated.[120]
"Can you tell me, my friend," I inquired of the carbineer, who
seemed a good sort of a man, "why I am removed from the
Inquisition to this castle? Is it better or worse, with respect to
accommodation?"
"Pretty much the same," he replied. "As far as I can learn, it
appears that you have been removed from the Inquisition, because
the great wall that lately surrounded it is now destroyed, and the
prison is not considered sufficiently secure. I believe too, that it has
been deemed expedient to place you out of the way of the priests
who are confined there. You are looked upon with great mistrust in
consequence of your dealings about the Bible. You know it is
prohibited in Rome."
I was now locked up in the remotest part of the fortress, la
Gemella Seconda.
FOOTNOTES:
[101] Romans viii. 29.

[102]These walls were thrown down during the


Republic, so that at present the Inquisition can be
seen on every side.

[103] A third Edition of this work has been


recently published in London, by the Religious
Tract Society, for the benefit of the Italians in
England.

[104] Vide Appendix. Reply to the Allocution of


Pius IX., in the Consistory of Gaeta, 20th April,
1849, published at Rome during the last days of
the Republic, and circulated there after the entry
of the French troops.

[105] Mark x. 51.

[106] John v. 7.

[107] The Penitentiaries of the four principal


Basilicas of Rome hold a long rod or wand, in sign
of their extended power to absolve even the most
enormous crimes.

[108] Acts xvi. 31.

[109] Matt. xvi. 19.

[110] Matt. xviii. 21.

[111] Matt. xiii. 11.


[112] Matt. xviii. 18.

[113] John xx. 22, 23.

[114] 1 Tim. iv. 3.

[115] Matt. xxvi. 33.

[116] Matt. xxvi. 35.

[117] Matt. xvi. 21.

[118] Matt. xvi. 23.

[119] Galat. ii. 11.

[120] There are also dungeons underground, so


horrible that no one has been known to survive in
them more than a few days; they are like wells,
completely dark, and wet. But these are no longer
made use of.
CHAPTER XVI.
THE CASTLE OF ST. ANGELO.
Conducted into this cell, in which from some unseen cause there
was a most offensive odour, I was shown in one corner a mattress
that seemed to have served as a bed for dogs.
"There," said my gaoler, "you can take your rest when you like.
We cannot leave you any light, for it is altogether prohibited in your
case. It is a new regulation, which is not in force with respect to
prisoners for political offences. We do not know, at present, on what
charge you are brought here."
So saying the gaoler retired, closing the first and second doors;
and I remained in darkness in the middle of my dirty cell, oppressed
by the heated unwholesome air which I could scarcely breathe. I
was abandoned by man, but my God was with me. Hence, though
deprived of everything, I felt I was not utterly forsaken. Fatigued
and exhausted, I needed repose; but without food, which for three
days I had scarcely tasted, I could not sleep. I passed the night in
prayer to my God, and found comfort in the remembrance of the
sufferings my Saviour endured for our sakes.
Sometimes my thoughts reverted to my Christian brethren, and
particularly to those who, as I well knew, continued to love me.
"Oh!" said I to myself, "if they could know of my imprisonment, I
am certain they would put up their most fervent prayers to the
Almighty: my dear friends in England—brethren of the Evangelical
Alliance—friends in France and in Geneva! God, thou wilt listen to
the supplications of thy children, and grant their prayers!"
The following day, by the little light which glimmered through a
high narrow window, I could better examine my habitation; and
found the bad smell proceeded from the pavement, the bed, and still
more from a wooden box, placed at the outside of the window, as if
to obstruct both the air and the light, and that contained a quantity
of filth and rubbish, which there were no means of removing; as it
was fastened down at the outside, and had on the inner side an iron
grating, which, together with the bars of my window prevented any
access to it. My inviting mattress was to serve the double purpose of
bed and chair. The walls, on which my eyes must necessarily rest as
soon as I opened them, were scrawled over with monstrous figures
and dolorous inscriptions in charcoal, by those who had been
confined there. I thus learnt that this cell had contained thieves,
assassins, and amongst others the notorious Abate Abbo, of whose
horrible crimes and cruelties I have already made mention.
At a certain hour of the day I was visited by the gaoler, who said
to me courteously:
"I am sorry you should be treated in this manner. I know who you
are, and I know what you are accused of; you have cause to rejoice
in your alleged offence, but at present it is expedient that you
should resign yourself to this hard treatment; perhaps I may be able
in some measure to soften the rigour of it. Suffer patiently, and put
in practice what you teach others."
"My kind friend," I replied, "you have a heart formed for
compassion. The exhortations and professions that I hear from your
lips show me you intend to do all you can to cheer my
imprisonment; and even though you should not be permitted to offer
me any other charity, I shall always be grateful for this—that I
receive your sympathy. Oh! believe me it will be requited to you by
Him who has said through Jesus Christ, 'Whosoever shall give to
drink a cup of cold water only, in the name of a disciple, verily I say
unto you, he shall in no wise lose his reward.'"[121]
"And where is it that Jesus Christ says these words?"
"In the Gospel written by St. Matthew."
"I would willingly read it, if I understood Latin."
"It is to be had in Italian—good Italian; I will tell you where you
can procure it, by asking for it in my name."
This man in a very short time became my friend. I can now speak
of him without fear of doing him any injury by my disclosures,
because I have heard that he has given up his employment, and is
no longer in the Roman States.
He was not the only gaoler, but he was one of the chief amongst
them: he was nevertheless always in fear of his subalterns, who
watched him very closely, and informed against him whenever they
had any excuse for so doing; insomuch that however cautious he
might be, he was frequently reproved by the superior, for being too
indulgent.
These prisons were all filled with people thrown in for various
imputations, and consequently subject to various courts.
Eighteen different tribunals, some lay and some ecclesiastical,
were re-established in Rome, on the return of the priests; besides
these there were the Inquisition and the French court martial. The
greater part of the prisoners did not know under what judges they
would come, or what crime was to be imputed to them. Thus passed
away six months, and none of them yet knew by whom, or for what
offence, they were going to be tried. As to myself I was very soon
told on whose accusation I was placed there, without, however,
being informed upon what charge.
Captain Gennari, who had the custody of those detained in the
fort, came after a few days to tell me that I was under the tribunal
of the Inquisition;—that the Commissary of the Holy Office, Father
Cipolletti, had sent for him, to tell him I was to be watched with the
utmost vigilance, and treated with the greatest rigour; without
seeing any one, or communicating with a single individual, either
verbally or in writing: in short, without light in the evening, or
anything whatever beyond what was absolutely necessary to prolong
my existence. This official communication was sufficient to prevent
my flattering myself that I should meet with gentle treatment, or
even with common humanity, unless I obtained some indulgence
from the good nature of the gaoler.
Captain Gennari, when he spoke to any one of his mode of
acquitting himself in his office, used to say—"I do my duty as a
soldier, and if my own father were imprisoned here, from whatever
cause it might be, I should not treat him any better than the rest."
Nevertheless, this impartial man knew how to relax his severity
towards those who could afford to be generous.
My imprisonment continued with unabated rigour, and all the
consolation I found was in the comfort of the Holy Spirit, and the
kindness of the good gaoler. He redoubled his visits, and often came
twice during the day to condole with me.
"Tell me," said he, one day, "what I can do for you, to render your
confinement less irksome."
"You can do me one favour, which would be the greatest of all
under this heavy tribulation. You know my residence, where my wife
now is; go, and inquire for a book for me, the book that I constantly
read, and the not having it with me now is my greatest trouble—that
is, my Bible. In this way you may render me a double service. Tell
that dear creature, also, that I am in good health and perfect
tranquillity of mind."
"Yes," said he, "I can serve you so far, and I promise you I will."
On the morrow, he came back in high glee.
"Your wife and all the rest salute you, and she sends you the
book."
"God be thanked!"
My good gaoler offered to take care of my Bible for me, and asked
me to make him acquainted with its contents. No one can imagine
how I enjoyed the first time I read it to him; and he continually
contrived opportunities for availing himself of my instructions. I
spoke to him one day of the gaoler at Philippi, and how he was
called by God, and taught by the holy apostles. Another time I read
to him the parable of the Prodigal Son which touched him so much,
that he would read it again himself.
"Oh, what a noble book is this Bible!" he exclaimed; "but do the
priests believe that it contains the word of God?"
"They say they believe it," I replied, "but their actions contradict
their assertion; in fact, they neither read it themselves nor let others
read it."
"I understand why—this book does not approve all that they say.
If we were to read it attentively, could we afterwards believe in their
childish stories?"
Whenever I expounded the Scriptures to him, he seemed as if he
could not look at the pure doctrines of Christianity, without
confronting them with the corrupt practices of popery.
One time he did not visit me as usual, but another came in his
place.
"Is it true," said my new gaoler to me, "what they say of you, that
you are put into prison for reading the Bible? But how is that?—is it
prohibited? Is it not the book of God?"
"Yes, certainly it is the book of God; this the pope confesses;
nevertheless he does not wish it to be read, because he says that no
man but himself can understand what God says."
"Would God, then, have spoken not to be understood? Is it likely
that God would speak only to the pope, and a few others, like the
kings of the earth? I believe that God has spoken for all, and that
what is written, is written for all."
"My good friend, you show more intellect than the pope, and more
good sense than all his priests. Do not let them impose upon you.
Read the Bible, you will obtain one ... ask for it in my name, and it
will be given to you."
Three or four other gaolers came to me; all spoke, more or less,
the same language; these were all soldiers. Were they not more
worthy than cardinals? But of all these men the first was the one to
whom I was the most attached, and he, by the mercy of God, was
the most attached to me. I was his counsellor in his difficulties, his
consolation in his afflictions. I was, he said, a friend and a father to
him: and he was of great benefit to me, for he frequently was able
to temper the severity of my imprisonment.
"I know," said he one day, "why they do not wish you to hold any
communication with others. It is that you may not speak to them of
the Bible, of the Gospel, of Jesus Christ. I will not be the means,
however, of depriving those who would derive profit from it of this
opportunity. I will open the door that communicates with some other
cells, where several have already begged me to allow them to speak
to you; M. Gazola has often made the request. I know that you will
always do good, and never harm to any one; now I will willingly give
you an opportunity to do this good, and I trust that God will protect
us both from the power of our enemies."
"Oh! my dear friend," said I to him, "it is surely the Lord who has
inspired you; do not doubt that He will be with us, if we faithfully
serve Him."
After this time, the door of my prison was occasionally left
unfastened, so that I might communicate with those who were
confined in the same part with myself. Several that could not visit
me in the day-time came at night. I am sorry that I cannot at
present enter into more particular details, since, at the time I am
writing, the major part of my fellow-prisoners are still in
confinement, and the remainder are either in Rome or in the Papal
states, and consequently under the jurisdiction of the Inquisition. I
could otherwise relate many things which our good brethren would
be delighted to hear; I may however make the general remark, that
whenever I communicated with my fellow-prisoners, our
conversation invariably turned on religious matters; it was a subject
of rejoicing for us when our prison doors were opened, which each
day the gaoler was requested to do at as early an hour as possible. I
continued my lectures for the space of a month, and during that
time my Bible was in frequent circulation among them.
The treatment experienced in this prison is certainly not so bad, in
most cases, as it is in every other within the walls of Rome. The
Castle of St. Angelo is chiefly set apart for prisoners of distinction.
Cardinals and prelates who fall into disgrace with the pope are
confined in it. For this purpose there are a variety of apartments; in
one of them are shown the iron rings that had the honour of
securing the cord with which the celebrated Cardinals Caraffa,
Coscia, and others were hung. Pope Clement VII. was likewise a
prisoner in this fortress, at the time of its occupation by the Imperial
forces, which he himself had called into Rome. The records of this
edifice, which, as everybody knows, was originally the mausoleum of
the Emperor Adrian, would throw considerable light on the history of
the papacy, and unfold many of the evil deeds of the popes. It has
been the scene of the most unheard-of cruelties, as well as of the
most shameless and revolting obscenities. The well-known orgies of
Pope Alexander VI., which were celebrated partly in the gardens of
the Vatican, and partly in the Castle of St. Angelo, have left a stain
upon its walls that can never be effaced. Like the Pope's bulls, it
serves "ad perpetuam rei memoriam."[122] In one of the halls are
the notorious pictures by Julio Romano, of which it would be difficult
to decide whether the artistical skill they display be more admirable,
or the subjects they represent more grossly indecent and detestable.
Colonel Calandrelli, one of the most valiant defenders of the
republic, and a triumvirate, after Mazzini—a gentleman equally
learned in the history of his country as he has shown himself brave
in her service, has assured me that he has a work ready for
publication, in which the whole history of this celebrated castle is
unfolded from authentic documents.
My imprisonment was a source of much trouble and uneasiness to
the three cardinals whom the pope had commissioned to take the
reins of government. They frequently sent for Captain Gennari to
inquire concerning me, and to give fresh orders respecting my safe
incarceration. I remember on one occasion the good gaoler having
kindly opened for me the door of communication, hastily returned,
and with his hand made signs to me to re-enter my cell with all
speed, that he might again close the door. Another time, very early
in the morning, while I was yet lying on my before-described
mattress, the outer door was opened in a very unusual manner, and
I heard the voice of Captain Gennari, who loudly called out: "Here
he is; come in, Sir, and certify for yourself that Signor Achilli is here;"
then opening the door of my cell, he called to me by name, and on
my replying to him, observed to his companion, "You hear the voice
of Signor Achilli, do you not? Be assured the Cardinal's orders will be
duly attended to." Then putting his head into my cell, he whispered
to me, "He comes from the Cardinal-Vicar, with fresh orders as to
your more close confinement."
After this my poor gaoler began to take fright, and durst no longer
allow me to have my door opened as usual: he assured me that he
was alarmed for me, as well as for himself; as the first thing that
would be done, in case his indulgence was discovered, would be his
own removal, and the appointment of another in his place, who
would have orders to treat me with greater severity. I afterwards
learned that a new prisoner, who had been placed in a cell near my
own for some misconduct two or three days before, had informed
his father confessor that he had seen me go out and converse with
other prisoners; and from what he heard, it appeared to him that I
had preached Protestant doctrines to them, and that they had
become my followers. The confessor told all this to the cardinals,
but, fortunately for me, he had the reputation of being so great a
liar, that he obtained no credit with them for his statement, however
true it might be; so I heard no more of it.
In the midst of these apprehensions, and with the possibility of
finding myself put into irons, my courage never gave way, neither
did my zeal diminish in the cause of my friends. I continued, as often
as I could, my accustomed discourses, as if I were at liberty, and in
a land of freedom. I took no precaution as to whom I addressed
myself; my sole care was to render my subject intelligible, and to
impress on the mind of my hearers a lasting idea of its importance:
with the learned my arguments were more scientific; with the
uninstructed, more simple and familiar.
In this way my mission continued to progress even within the
walls of a prison. The cardinals, in ordering my incarceration,
imagined they had put a stop to my operations, whereas they only
accelerated them. We laughed, inside the castle, at the wise
precaution of sending me where many of the bravest and the best of
the Roman citizens were at that time confined. The city itself was a
desert in comparison with the prisons, which were full to
overflowing. Had I been allowed to remain unmolested in my own
house, I could not have obtained half the success I met with among
my fellow-prisoners. Unquestionably I suffered very much in my
confinement, separated from my dearest friends, and tormented by
the thought of the grief they must feel; but in the midst of these
sorrows, I derived consolation from the idea, that the grand work on
which I was engaged was, through the grace of God, and the
blessing of his Divine providence, steadily advancing. I rejoiced, too,
that it was carrying on in Rome, and at the very time, too, when,
through foreign compulsion, everything was returning to papacy, and
to Pio Nono; who had not only destroyed his own work of liberty, but
even the small remains of it that had existed under his predecessors.
At a period when the most horrible slavery was imposed on us
through the generosity and consistency of the French nation, I alone
remained free; I, the most hated of all, the most detested by the
pope and the cardinals, even more so than Mazzini himself, I had the
privilege granted me by the representatives of the two governments,
to make war against the pope and the papacy, with undiminished
advantage and success. And this was all they gained in shutting me
up in the fortress of St. Angelo.
Every time they renewed their persecution of me, I think my
power increased. I am not a man to be easily put down. In
considering myself as a servant of the Lord, I feel as a rock, on
which the tempestuous ocean spends its utmost fury in vain.
The severity of my imprisonment denied me the gratification of
seeing any of my friends who were at liberty, neither was it in the
power of my kind-hearted gaoler to be of service to me in the
matter. There were too many doors to pass through; each of them
had its own separate turnkey, and it was hopeless to think of
conciliating them all. The only person who had hitherto been allowed
to visit me was the English consul, Mr. Freeborn, who had, when I
was first taken, obtained permission to do so from the French
general; but the cardinals interfered afterwards, and gave orders
that no permission should be valid except what came from the
Inquisition or the pope, so that an end was soon put to his visits.
A deputation from the Evangelical Alliance, composed of my two
good friends, Mr. Tonna and M. Meyrueis, the one an English and the
other a French gentleman, who were sent to intercede in my behalf,
were also, on application to the cardinals, refused admittance. On
referring their petition to the pope they were again denied, and I
found that I was more rigorously treated after it; more closely
confined to my cell, and threatened with even greater severities.
Nevertheless, through the blessing of God, I never before enjoyed
such perfect tranquillity of mind; never in society had I been
conscious of more cheerfulness, and when I was drawn into
conversation I inspired others with the same feeling. I bade them
trust in the providence of God, who would restore to his people their
rightful liberty. Hence arose a long discussion on this divine attribute.
I let every one propose his objections, which it was a pleasure to me
to answer. Another time I was consoling one of my companions for
the injustice of the tribunal that judged him. "Oh, my friend," said I,
"you look for justice from men. Can you expect it from those who do
not fear God? Is not justice an attribute of the Deity? No man can be
just who departs from God. How then can justice be restored
amongst us? Only by regaining the knowledge and faith, the fear
and love of God. And what we say of justice may equally be said of
truth. There can be no truth among a people, where the pope is
exalted into the place of God. From the earliest times he has been a
liar, and his lies obtain credence even in other countries, because
they emanate from Rome. If we, then, no longer admit them, let us
be the first to denounce that popery by which Rome is oppressed
and dishonoured."
These discussions could not fail to produce their effect; which was
gradually to withdraw those who listened to them from popery, and
to lead them unto God, through Christ. The blessing of God is with
those who honour Him, and I hope myself to reap the fruits of what
I have sown. I relate these things, not to take pride in them as my
own work, but as proceeding from the bounty of the Lord. I should
not have come to prison by my own choice, but for wise ends it was
so decreed by Divine providence.
Whoever views my imprisonment merely as the work of man, sees
in it only injustice and cruelty; but those who regard it as the
permission of God, discern in it abundant proofs of his wisdom and
love. Many a time have I blessed God for the favour He showed me
in choosing me to commence the great work which will be
redemption to the Romans, and regeneration to all nations. It has
commenced, and is now in progress. To carry it on, God has chosen
persons who would not have been thought of by us, any more than
we should have thought of Galilean fishermen becoming the apostles
and promulgators of a doctrine which was to influence the whole
world.
The reformation of Rome is entrusted to Romans. On the
reformation of Rome depends that of Roman Catholicism. Those who
would concur and co-operate in this work must do it by succouring
the Romans.
"Do you think," said one of my companions in prison, one day,
"our reform will go on? Will Rome ever be reformed? Will Italy ever
become protestant?"
"I believe," replied I, "that Rome will be reformed one day, like
London, Berlin, Edinburgh and Geneva."
The question whether Italy will ever become protestant was
discussed by me one evening, with the Abate Gioberti, at Paris, in
December 1847. He referred me to some pages of his 'Modern
Jesuit,' in which it is maintained that Italy never will be protestant: I,
on the other hand, referred him to history, to the true history of our
country, which shows how great has been the tendency towards
protestantism in Italy, and what efforts have been made to promote
it. I agreed with the learned Abate that the title of Protestant, as
expressive of a division, or religious sect, should be avoided. The
Italians, and amongst them the Romans, profiting as they ought to
do by three centuries' experience of other nations who have
abandoned popery, could not properly denominate themselves
anything but Christians. Were they once to renounce the pope, none
else could impose upon them either doctrine, form, or name. The
questions which to this time have agitated protestantism, and which
now divide England into various parties—episcopalian and
presbyterian—baptist, methodist, &c. &c., would never disturb the
peace of Italy. On right principles the Italian church would be
organized with great simplicity, and every one left at full liberty to
worship God in the manner best suited to his own spiritual views.
What I now call the Italian church does not assume to be a national
church, with exclusively privileged forms of government; no, it
presents itself to Italy as its ancient church, in the unity of faith and
spirit; but in diversity of form, government, and modes of worship.
Being thus associated with all the Christian churches throughout the
world, it would have nothing exclusively Italian but the language.
In these conversations with my friends, I had the satisfaction to
think that what was said to few would be repeated to many. What I
uttered within the walls of the castle, in a secret cell, was quickly
circulated throughout Rome, and spread abroad, making an
impression that could not be effaced. In this manner five months of
my imprisonment had already passed away, and I was yet left in
ignorance of the crime by which it had been incurred.
I had forwarded my protest to the French government, and the
strongest remonstrances had been sent to Paris by my dear brethren
of the Evangelical Alliance, yet there appeared to be no prospect of
my release; but I may say, with sincerity, that since I have
consecrated my life to the Christian ministry, so long as I am
engaged in its service I am satisfied. I was now in the full exercise of
this ministry during my imprisonment, and no one who has heard my
narrative can doubt the satisfaction it gave me. Thus far, therefore, I
was contented with my situation; and if I could have supposed that
the Roman government would not alter it, but that I might continue
to pursue the same course, I should in truth have besought both
God and men to leave me in it; because I might perhaps have been
more useful, imprisoned in Rome, than at full liberty elsewhere.
But the priests were tired of enduring my boldness and audacity.
They took it as an insult to them, that I continued in prison to repeat
the very same offences for which I had been incarcerated. All my
friends declared to me, that I must either be released and sent out
of Rome, by the contrivance of foreigners, or that I should be put
out of the way altogether, by the priests themselves.
Reflecting on this idea, I began to think whether it was the will of
God my life should be sacrificed; but a voice within seemed to tell
me—no. I had done too little, as yet, to see my work so soon
crowned with success.
It was the 24th of December—a solemn day in Rome, full of kindly
feelings as well as of superstitious observances. On this day good
wishes are exchanged and presents made amongst friends; favours
are granted, and the boon that should then be asked it would be
deemed a sin to deny. We prisoners wished happiness to those who
opened our doors, and they cheerfully returned our salutations. My
good gaoler, full of benevolence, came to me before I had risen.
"Good morning," said he, "and better luck; I bring you good
news."
"What news?" said I.
"An order is come from the French general Baraguai d'Hilliers, to
let two gentlemen speak with you—undoubtedly two of your friends;
and what is still more satisfactory, it is with the consent of the
cardinals."
"Do you know the names of these friends of mine?"
"Only one of them, 'Doctor Bambozzi and companion,' so it is
written."
"My dear fellow, do you really believe these can be my friends? If
they were so, do you think the cardinals would let them speak to
me? They did not give this permission to those two who posted all
the way from England and France to obtain it. I do not know who
Doctor Bambozzi is, and I cannot imagine what he can want with
me."
"But if they be not friends, what can they be?"
"Enemies, assuredly. No person sent by the cardinals can have any
occasion for an order from a French general."
"It may be a trick—one of those tricks so frequently played off in
priestly Rome. Baraguai d'Hilliers does not know the priests; they
may be plotting together something to compromise him."
This visit, announced with so much ceremony on Christmas eve,
did not take place till the last day of the year. The supposed friends
were the Fiscal Judge of the Inquisition, Monsignor Bambozzi, and
his Secretary, Avvocato de Dominicis.
Monsignor Bambozzi is one of the most courteous of men. Those
who, hearing of the Fiscal Judge of the Inquisition, might picture to
themselves an austere man, with a crafty sinister air, would find they
were quite mistaken in their idea. No, he is a very polite little man, a
sacristan priest, paying compliments to everybody, always smiling,
with his snuff-box in his hand ever ready to offer a pinch. The other
was a poor needy-looking personage, with nothing unfavourable in
his aspect, and evidently following his occupation to earn his bread.
I was first desired to give an exact description of myself. The
prelate then made a sign to the other to write, and began to dictate
to him in Latin.
"A certain man (homo quidam) appeared before me declaring
himself to be—What is your name?"
I told him my name, my age, &c. He went on:—
"Giacinto Achilli, son of —— born at —— aged —— &c., dressed,"
(here followed the description of my dress from head to foot)
—"confined in this prison, &c.; being asked if he knows why he is
detained in prison, answers ——Answer this question.
"'It is what I wish to know. I have been six months confined here,
and have never yet been told, nor do I know the cause of my
imprisonment.'
"Interrogated whether he knows under what tribunal he is now
examined, answers—
"'It is what I wish to know.'
"And being told that he is examined by the magistrates of the Holy
Roman Universal Apostolical Inquisition, answers—
"'I am glad of it. Speak frankly.'
"Admonished to tell the truth, and to recognise in this fact the
justice of God and not the vengeance of man, he replied to the first
part—
"'I promise to tell the truth:' on the second he was silent."
At this juncture, Monsignor Bambozzi drew out a quire of paper,
covered with writing, and began to read the first page; from which I
perceived it was the minute taken down the second day of my
imprisonment, by a judge of the cardinal-vicar's: consisting of a
general interrogatory on the whole of my life—that is to say, my
education, my studies, my public functions, my occupations, my
journeys, and especially that to the Ionian Islands, Malta, England,
&c., till my return to Rome; what I had done during the Roman
Republic, and finishing with my imprisonment. All this confronted
anew with numerous questions, formed the subject of my first
interview with Monsignor Bambozzi and his companion.
In a moment the news resounded through St. Angelo, that the
judges of the Inquisition were come, with the special permission of
the French authorities, to take possession of me. The indignation
this intelligence excited was great; and was expressed in no very
measured terms, against both the priests and the French. I smiled
amidst the universal excitement; but I may safely say I was the only
one who did so.
Four days afterwards the judge and his companion were again
announced; and I had to submit to a fresh and very long
interrogatory, carried on like the former one in Latin.
First, as to why I had abandoned the Order of the Dominicans,
from which I had received, even up to the latest moment that I was
connected with it, the greatest proofs of esteem and good-will;
insomuch, that I had been promoted, whilst yet in my youth, to
posts so high and important that they were difficult to be obtained
even by the aged.
Secondly, why I had afterwards abandoned the ministry of the
Roman Church, my theological functions, the mass, and other
religious duties; thus showing myself thankless and ungrateful for
the education I had received, and for the interest taken in me at
Rome?
Thirdly, what complaint I had to make, if any, of the lenient
correction I received on my being summoned before the Inquisition
in 1842, the sole object of which was to recall me to the right path?
Fourthly, and lastly, why I had left Rome, and quitted Italy
altogether, to take refuge in Protestant countries; thus making
myself a public subject of conversation, to the scandal of my best
friends, and the fearful injury of my own soul?
To these questions I calmly and briefly replied—
First, that with regard to leaving the Dominicans I had been
induced to do so from motives of conscience, though I still retained
a grateful remembrance of all the kindnesses I had received from
them; and that what I had done was with the full permission and
licence of Pope Gregory XVI.
Secondly, that it was equally from motives of conscience I had left
the ministry of the Roman Church.
Thirdly, that far from bringing any complaint against the
Inquisition, I had quietly resigned to it all the charges of the
ministry, testifying thereby to every one who might be willing to
understand me, that from that time I intended no longer to be
connected with the Church of Rome in any way whatsoever,
regarding myself as subject to no one, in matters of faith, save God
alone.
Fourthly, that my leaving Rome, and Italy altogether, was the
natural result of the steps I had previously taken; that whether I
went to the English or Spanish dominions, or any other, could be a
matter of consequence to no one, provided I lived an upright life,
wherever I might be; and as I felt conscious that this had been the
case hitherto, I did not consider myself called upon to render an
account of my actions to any man.
I had reserved to myself a more lengthened and argumentative
conversation, when Monsignor Bambozzi should enter upon the
question of matters of faith; he not only, however, left that subject
untouched upon, but even turned it aside when I endeavoured to
lead his attention towards it: nay, he went so far as to order the
gaoler to let me take the air every day, for about a quarter of an
hour, on the terrace of the castle, saying that he was quite satisfied
with me, and that we were perfectly agreed. Yet how he could
imagine we were so, when my opinions had been diametrically
opposed to his, and all my answers a direct rebuff to his questions, I
cannot understand. The fact is, that the Inquisition has always been
about as anxious after truth, for its own sake, as Pontius Pilate was,
in the presence of the Lord.
Both my judge and his companion, however, upon taking leave of
me this second time, shook hands with me, saying, that I should see
them again shortly.
Eight days elapsed, when I was once more asked for. "It is
Bambozzi," cried my fellow-prisoners; and I went down stairs
laughing, in the expectation of seeing him again; but in his place I
beheld a priest of the Oratory, alone. He was full of compliments and
civilities, on our meeting; and I asked him at once his name, and the
cause of his visit; for as soon as he opened his mouth, I perceived
by his accent that he was not an Italian. He replied that he had
come to see me purely out of good-will; and showed me his name in
the title-page of a book: "Dr. Augustine Theiner, of Prussian Silesia,
Professor of Ecclesiastical History in the College of the Propaganda in
Rome." He went on to say that he was grieved to find me in such a
situation, but that still all might turn out for the best, if I would only
be teachable towards God, and the Holy Mother of the Roman
Catholic church. This at once brought us to the question, whether
the Roman church alone had a right to be called Catholic? I
maintained that it was a church, but not the church, and by logical
consequence could not be called universal, for the simple reason
that Rome was not the whole world:—that the Pope was Bishop of
the Roman church alone, and not of the Catholic church; the proof
being that many hundreds of bishops exist in the church, some
dependent upon, and others independent of Rome; without
reckoning all those Christian churches which pride themselves on
having no other bishop than Him mentioned by Peter: "For ye were
as sheep going astray, but are now returned unto the Shepherd and
Bishop of your souls."[123]
He asked me, smiling, what my church was? I told him it was that
of which St. Paul speaks:[124] "The general assembly and church of
the First-born which are written in heaven." To a few other questions
I replied to the same purport. He exhorted me to read his book,
printed by the Propaganda, in which he had shown me his name;
and then took his leave.
This book is a "History of the Reformation in Sweden," written, it
would appear, on purpose to blacken the fame of those staunch
Reformers, the good King Gustavus and the excellent Oloff Peterson;
and to have the opportunity of using every description of epithets,
the most offensive he could find, against Luther. It has had the
honour, as the author told me, of being translated into French by M.
de Montalembert, and into English by Dr. Newman, who is also
become a priest of the Oratory. A second and third visit from Dr.
Theiner, who came to me with other books of his own writing, which
he earnestly requested me to read, were occupied with continual
questions on the Roman church; he resting upon certain passages of
the holy Fathers, to prove that it is the Catholic church, and I upon
passages from the Fathers also, to show that what they called
Catholic, was the Roman church together with all others, those only
excepted which deviated from the teaching of the Holy Scriptures,
and from the faith of Christ,—the Roman Church being so different
in our days, and especially since the Council of Trent, from what it
was in those of the holy Fathers, that if they were now living they
would be the first to protest against it, and to separate from it; that
before the present Roman church could be called Christian, a
reformation in it was indispensable; the Jewish and the Pagan
elements being so mixed up with both its doctrines and worship,
that there hardly remains in it a shade of primitive Christianity: that
let but the pope undertake this reformation, we would be with him,
otherwise we must remain separated; nor should his threats terrify
us, nor his Inquisition rob the Christians of Italy of their faith or their
union; that I had shown an example to the brethren how to
propagate in this country the pure and simple doctrine of Christ; that
the Bible, and the Bible alone, was sufficient to destroy the whole
edifice of the pope; and that on the day when I saw reprinted in
Rome the New Testament in Italian, and moreover beheld the avidity
with which the Romans received it, I exclaimed, "The death-knell of
the Papacy is sounded."
My heart almost leaped out of my breast with joy, at having been
able, in the prisons of the Roman Inquisition, to render this
testimony to the truth and to the religion of Jesus Christ.
"I am as happy as possible now," I said to several of those good
friends who were with me in prison, and who asked me every time
they saw me how I got on with the papal theologian. "I am only
afraid that, feeling how firm I am, Padre Theiner may discontinue his
visits, and tell the cardinals and the pope that every attempt to bring
me back to the Roman church is useless."
He had in fact, at his second visit, shown me a letter of the
Cardinal-Vicar, in which he appointed him, by the pope's desire, to
come to me under the guise of a visitor, to hold conferences with
me, and to discover some way of recovering me to the faith.
At the end of each visit, however, I had always requested him to
report faithfully everything I had said to him; adding that every day I
felt more and more firm and fixed in my purpose; and that if it
should please God that I should be released from prison, I should,
with the aid of His Holy Spirit, continue my mission with all the more
vigour, from perceiving by His having conferred on me the grace of
being allowed to suffer six months' incarceration for His name's
sake, that it could not be otherwise than acceptable in His sight.
At the same time, I bade him, and the pope and cardinals
likewise, to remember, that the persecution to which I had been
subjected could not be approved or justified even by Roman
Catholics themselves; and that if it had no other effect, it would at
least have the most desirable one of ultimately working the abolition
of the Roman Inquisition, never more to be restored.
Padre Theiner and I were, on this third visit, in the full fervour of
our controversial arguments, when the captain of the castle came to
inform me that two chasseurs de Vincennes were arrived to take me
to the French Council of War, to give evidence in the trial of Signor
Cernuschi, Deputy of the people, under the Republic.
How I, separated as I was, and had been for six months, from the
rest of the world, by a decree emanating from the Inquisition, could
be summoned by a foreign authority to appear before a military
tribunal, was what I could not comprehend; and my theologian was
still more astonished at it than I was. The captain added that he had
Welcome to our website – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.

More than just a book-buying platform, we strive to be a bridge


connecting you with timeless cultural and intellectual values. With an
elegant, user-friendly interface and a smart search system, you can
quickly find the books that best suit your interests. Additionally,
our special promotions and home delivery services help you save time
and fully enjoy the joy of reading.

Join us on a journey of knowledge exploration, passion nurturing, and


personal growth every day!

ebookbell.com

You might also like