100% found this document useful (2 votes)
19 views40 pages

Instant ebooks textbook STM32 IoT Projects for Beginners: A Hands-On Guide to Connecting Sensors, Programming Embedded Systems, Build IoT Devices with STM32 1st Edition Aharen San download all chapters

Connecting

Uploaded by

gandospieren
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
100% found this document useful (2 votes)
19 views40 pages

Instant ebooks textbook STM32 IoT Projects for Beginners: A Hands-On Guide to Connecting Sensors, Programming Embedded Systems, Build IoT Devices with STM32 1st Edition Aharen San download all chapters

Connecting

Uploaded by

gandospieren
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 40

Get ebook downloads in full at ebookmeta.

com

STM32 IoT Projects for Beginners: A Hands-On Guide


to Connecting Sensors, Programming Embedded
Systems, Build IoT Devices with STM32 1st Edition
Aharen San
https://ebookmeta.com/product/stm32-iot-projects-for-
beginners-a-hands-on-guide-to-connecting-sensors-
programming-embedded-systems-build-iot-devices-with-
stm32-1st-edition-aharen-san/

OR CLICK BUTTON

DOWNLOAD NOW

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


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

Hands On Internet of Things with Blynk Build on the Power


of Blynk to Configure Smart Devices and Build Exciting IoT
Projects 1st Edition Pradeeka Seneviratne
https://ebookmeta.com/product/hands-on-internet-of-things-with-blynk-
build-on-the-power-of-blynk-to-configure-smart-devices-and-build-
exciting-iot-projects-1st-edition-pradeeka-seneviratne/
ebookmeta.com

STM32 Bare Metal Embedded C Drivers Mini Cookbook Israel


Gbati

https://ebookmeta.com/product/stm32-bare-metal-embedded-c-drivers-
mini-cookbook-israel-gbati/

ebookmeta.com

AWS IoT With Edge ML and Cybersecurity: A Hands-On


Approach 1st Edition Syed Rehan

https://ebookmeta.com/product/aws-iot-with-edge-ml-and-cybersecurity-
a-hands-on-approach-1st-edition-syed-rehan/

ebookmeta.com

Introducing Software Verification with Dafny Language:


Proving Program Correctness 1st Edition Boro Sitnikovski

https://ebookmeta.com/product/introducing-software-verification-with-
dafny-language-proving-program-correctness-1st-edition-boro-
sitnikovski/
ebookmeta.com
Transformation of the Intimate and the Public in Asian
Modernity The Intimate and the Public in Asian and Global
Perspectives 5 Ochiai Emiko
https://ebookmeta.com/product/transformation-of-the-intimate-and-the-
public-in-asian-modernity-the-intimate-and-the-public-in-asian-and-
global-perspectives-5-ochiai-emiko/
ebookmeta.com

Functional Programming in R 4: Advanced Statistical


Programming for Data Science, Analysis, and Finance -
Second Edition Thomas Mailund
https://ebookmeta.com/product/functional-programming-in-r-4-advanced-
statistical-programming-for-data-science-analysis-and-finance-second-
edition-thomas-mailund/
ebookmeta.com

HBR's 10 Must Reads on Managing People, Vol. 2 (with bonus


article “The Feedback Fallacy” by Marcus Buckingham and
Ashley Goodall) Harvard Business Review
https://ebookmeta.com/product/hbrs-10-must-reads-on-managing-people-
vol-2-with-bonus-article-the-feedback-fallacy-by-marcus-buckingham-
and-ashley-goodall-harvard-business-review/
ebookmeta.com

Scaling Her Dragon 1st Edition Milly Taiden

https://ebookmeta.com/product/scaling-her-dragon-1st-edition-milly-
taiden/

ebookmeta.com

The Big Rig Trucking and the Decline of the American Dream
1st Edition Steve Viscelli

https://ebookmeta.com/product/the-big-rig-trucking-and-the-decline-of-
the-american-dream-1st-edition-steve-viscelli-2/

ebookmeta.com
The Common Touch Popular Literature from the Elizabethans
to the Restoration Volume I 1st Edition Paul A. Scanlon

https://ebookmeta.com/product/the-common-touch-popular-literature-
from-the-elizabethans-to-the-restoration-volume-i-1st-edition-paul-a-
scanlon/
ebookmeta.com
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
}
Other documents randomly have
different content
actions. If, however, he should neglect to do so, a judgment shall be
rendered by the court in favor of the plaintiff, without prejudice to the
rights of the minors to have the matter reviewed, when they shall
become of lawful age. If the party who made the claim should lose
his case when the minor has reached his majority, he shall be
compelled to restore to the minor, or to his relatives, or to any one
who may have a right to it, whatever property he obtained under the
judgment aforesaid, along with any income it may have produced,
and any profits which may have accrued from its possession; and he
shall be compelled to pay ten solidi in addition, because he has
prosecuted a claim which was not valid in law. Where a guardian
desires to defend any action brought against his ward in court he
shall have full authority to do so; but if the rights of the ward should
be affected, or his property impaired or lost through his neglect, the
guardian shall afterwards be compelled to make restitution.
THE GLORIOUS FLAVIUS RECESVINTUS, KING.
IV. Guardians shall have no Right to Exact from Wards in
their Charge any Instruments in Writing whatever.
As minors are unable to care for themselves or their property, it
has been wisely provided by the laws that they should be subjected
to the authority of guardians, and that their business should be
transacted for them for a stated number of years. For the reason,
however, that certain guardians, by means of either persuasion or
threats, defraud those whose interests it is their duty to carefully
protect, and compel them to enter into agreements that they will not
demand an accounting of their property, or exact bonds or other
written instruments from their wards, by means of which they seek to
prevent inquiry into their actions: therefore, that our solicitude for the
rights of such wards may the better appear in all matters where such
rights are involved, we hereby decree that the following law must be
strictly observed, to wit: that in the case of such wards, even when
they have passed the age of fourteen years, where the guardian or
guardians who had charge of their persons and property shall be
found to have caused the execution of any bond or written
instrument of any description, which enures to the benefit of said
guardians or any person designated by them, then such bond or
instrument shall be void, and of no force whatever in law.
When the time shall come that he who has been under
guardianship shall have the right to assume the management of his
own affairs, the guardian shall give a complete account of the care of
his ward’s property, in the presence of a priest or a judge, and shall
receive from his former ward a full discharge from all obligations; so
that, all restraint being removed, the said ward may come into full
possession of his property, and have the right to dispose of it at his
pleasure. But if it should happen that, while the guardianship is in
force, the ward should be attacked by a dangerous illness, and
should wish to dispose of his property by will, he can do so, provided
he has completed his tenth year, according to the provisions of a
former law.
If the guardian, while living or dying, should give any of the
property belonging to his ward to his own children, or to any persons
whomsoever, and no account of the same was made to the wards,
according to the terms of the inventory which was made at the time
the guardianship was accepted, and proof of this should be legally
established, those who received said property from the guardian
shall make full restitution to the wards. All wards shall have the
benefit of this legal remedy, except where, by the lapse of time, and
having passed the age of fifteen years, their rights shall be
extinguished by law.
TITLE IV.—CONCERNING FOUNDLINGS.

I. Where Anyone Casts Away, or Abandons, a Freeborn Child, he shall


Serve as its Slave.
II. Where a Male or Female Slave shall be proved to have Cast Away a
Child, with, or without the Knowledge of his or her Master.
III. What Compensation for Support anyone shall Receive for the Bringing up
of a Child committed to his Care by its Parents.

I. Where Anyone Casts Away, or Abandons, a Freeborn


Child, he shall Serve as its Slave.
If anyone, induced by compassion, should rescue, and care for a
child, of either sex, who has been abandoned, and such child, after
having been brought up, should be acknowledged by its parents;
where the latter are freeborn persons, they shall either give a slave,
or the price of one, as compensation for the service performed. If
they should neglect to do this, compensation shall be made by order
of the judge of the district; and the parents who have been guilty of
such wickedness shall be condemned to perpetual exile. Where he
who casts away the child has not sufficient property to redeem it, he
shall serve as its slave; and he whom the pity of others has
preserved, shall enjoy complete freedom. It shall be lawful for the
judge both to prosecute and impose sentence for this crime
whenever committed.

II. Where any Male or Female Slave shall be Proved to have


Cast Away a Child, with or without the Knowledge of his or her
Master.
If a slave, of either sex, in order to defraud his or her master,
should expose and abandon their own child, without the knowledge
of said master, and anyone should bring it up, the latter shall be
entitled to receive the third part of its value; but, under such
circumstances, the master must swear or prove that he was ignorant
that his slave had abandoned the child. If, however, it should be
shown that the master was aware of the fact, the child shall become
the slave of him who reared it.
III. What Compensation for Support anyone shall Receive for
the Bringing up of a Child committed to his Care by its Parents.
If anyone should accept from its parents a little child to be reared,
he shall receive as compensation one solidus every year, until the
child has reached the age of ten; but he shall be entitled to no further
compensation after it has completed its tenth year, because after
that time the services of the child should be sufficient to pay for its
support. And if he who seeks to take the child again should be
unwilling to pay this sum, it shall be held in slavery by him who
reared it.
TITLE V. CONCERNING SUCH PROPERTY AS IS VESTED BY THE LAWS OF
NATURE.

I. Concerning the Disinheriting of Children; and What Disposition Parents


should make of their Property.
II. What Part of her Dowry a Woman has a Right to Bequeath.
III. What Property Parents should Bestow upon their Children, at the Time of
their Marriage.
IV. Concerning Children Born of Different Parents; and What Distinctions
Parents may Make in the Disposition of their Estates.
V. Concerning such Property as Children may have Acquired during the
Lives of their Parents.

I. Concerning the Disinheriting of Children; and What


Disposition Parents should make of their Property.
As soon as we have ascertained that any unlawful acts have
been committed, it behooves us to prevent, by legal measures,
similar occurrences in the future. For many persons living reckless
lives, squander their property upon strangers, either on account of
riotous living, or through the unwise counsel of others, and, as a
result of this, leave their inoffensive children or grandchildren weak
and penniless; for those cannot be of any benefit whatever to the
community upon whom the duty of labor has not been enjoined by
the example and virtues of their parents. And, in order that, under
such circumstances, the rights of the community may not be
sacrificed, or children or grandchildren be deprived of the benefits of
that natural affection which should be bestowed upon them, the law,
by which a father or mother, or grandfather or grandmother, have the
right to give their property to a stranger, should they wish to do so, or
a woman to dispose of her dowry in any way that she pleases, is
hereby abrogated; and we decree that the following more equitable
law shall be observed by all, to wit: that neither parents nor
grandparents shall have the absolute right to dispose of all their
property, nor that children nor grandchildren shall, through an unjust
will, be deprived of the inheritance of their parents and grandparents;
therefore, any father or mother, grandfather or grandmother, who
wish to bestow any of their property upon their children or
grandchildren, must observe the following rule, viz: that in the
bestowal of said gifts upon their children or grandchildren they do not
exceed the third part of their property; nor shall it be lawful for them
to transfer any of their property to any stranger, unless they should
not have any legitimate children or grandchildren living.
The following, however, we decree shall be observed, as being in
accordance with the dictates of reason: that if the father or mother,
grandfather or grandmother, should decide to bequeath, by any
instrument in writing, any portion of the third part of their property, as
aforesaid, to their children or grandchildren, in compliance with the
laws governing inheritances, all such proceedings shall be forever
inviolable; and whatever bequest concerning said property may be
made, shall have full and uncontrovertible validity. Nor shall it be
lawful for the child or grandchild who has received any of the said
third part of the estate from their parents, to claim anything more,
unless they should prove to be entitled to it by some former bequest
of their parents or grandparents.
If those having children or grandchildren, should wish to bestow
anything upon the Church, or upon freedmen, or upon anyone else,
they shall have the right to dispose of the fifth part of what remains,
after the said third part has been reserved. The authority of such
persons to dispose of the said fifth part is indubitable; but, in such
cases, either the third part of the property which is to be bequeathed
to the children, or the fifth part which is to be otherwise disposed of,
as aforesaid, must be separated from the remaining property, and a
proper estimate made of the same. But whatever anyone has
received through the generosity of the king, shall, under no
circumstances, be included in the estimate of either the third or the
fifth parts of the estate aforesaid; for, according to another law,
whatever anyone has acquired through the royal bounty shall be
absolutely at his disposal.
It has been already provided that children and grandchildren
cannot be disinherited by their parents for any trifling offence. The
grandfather and grandmother, as well as the father and mother, shall
have the right to chastise and restrain their children and
grandchildren, as long as they remain members of the family. And if
a son or daughter, grandson or granddaughter, should attempt to
inflict any serious injury upon their parents or grandparents; that is to
say, if he or she should give any of them a blow with the fist; or a
kick; or strike them with a stone, or with a scourge, or with a whip; or
should insolently seize any of them by the foot, or by the hair, or
even by the hand; or be guilty of any shameless assault upon them;
or should publicly accuse them of crime; then, any child or
grandchild convicted of such an offence, shall receive fifty lashes
with the scourge, in the presence of the judge, and shall forfeit all
claim to the inheritance of its grandparents or parents, should the
latter so desire. But if, repenting of its conduct, it should implore the
pardon of those whom it has offended; and, through the love of its
parents, it should be again received into favor, and designated as an
heir; it shall not be deprived of its inheritance, or be accounted
infamous, on account of the punishment which it has received.
FLAVIUS CHINTASVINTUS, KING.
II. What Part of her Dowry a Woman has a Right to Bequeath.
For the reason that many women to whom the privilege was
granted of disposing of their dowries as they pleased, have been
found to have bestowed them upon persons with whom they were
living illegally, to the injury of their children or grandchildren;
therefore, we declare it to be both necessary and proper that those
for the rearing of whom the marriage was celebrated, should receive
some benefit from said property. In pursuance whereof we decree
that, if any woman has children or grandchildren, and should wish to
bestow a gift upon the Church, or upon freedmen, or upon any other
person or persons; she shall not have the right to dispose of more
than the fourth part of her dowry in this manner. Three fourths of it
shall be left, without question, to her children or grandchildren,
whether there be one, or many of them. On the other hand, a wife
shall have full power to dispose of her entire dowry, in any way she
pleases, when she leaves no legitimate children or grandchildren.
Nevertheless, it shall not be lawful for any woman who has married
two husbands, or more, to give the dowry she has received from one
husband, to the children or grandchildren of another; but the children
and grandchildren born in a certain line of descent shall, after the
death of their mother, have the entire dowry given by their father or
grandfather.
FLAVIUS CHINTASVINTUS, KING.
III. What Property Parents should Bestow upon their
Children, at the Time of their Marriage.
Wherever wrong is done by parents to the interests of their
children it must be remedied by law. Therefore, because the duplicity
of parents sometimes prompts them to deprive their children of what
they have given them at the time of their marriage, we hereby
declare such acts to be void; and decree that the following law shall
hereafter be observed forever, to wit: that if any property should be
transferred to any person, either by writing, or in the presence of
witnesses, at the time of his or her marriage, excepting such as is
usually given in the way of ornaments or clothes, as a marriage gift,
whether said property consists of slaves, lands, vineyards, buildings,
clothing, or jewels, presented by the parents to the children, either at
the time of the marriage, or after it, the said children shall have full
power to dispose of such property as they wish, with this exception:
that, after the death of their parents, the inheritance shall belong to
the children exclusive of what said parents have previously given to
them according to law, and an equal distribution of said inheritance
shall be made among the heirs; so that a son or daughter shall have
full power to dispose of what they received from their parents at the
time of their marriage, according to the provisions aforesaid.
After the death of the parents, an inventory shall be made, and
the property which was donated at the time of the marriage shall be
appraised, and the other heirs shall receive an equivalent in value to
the amount of said property; and all shall then share equally in the
remainder of the estate of the parents.
FLAVIUS CHINTASVINTUS, KING.
IV. Concerning Children Born of Different Parents; and What
Distinctions Parents may Make in the Disposition of their
Estates.
If a man marries several wives, and has children by all of them,
and any of his sons or daughters should die intestate, his or her
brothers or sisters shall be entitled to the estate, provided the
decedent left neither children nor grandchildren; and said heirs shall
have a right to claim it after proving that they are descended from the
same father and mother. Where there are children by one father and
by different mothers, those only who are descended from the same
father have a right to an equal division of the property belonging to
him. With regard to those who are sprung from one mother and
different fathers, we prescribe the following regulations, to wit: that if
a woman should have children by different husbands, only those
brothers and sisters who are the children of the same father and
mother shall have a right to the inheritance, descending either in the
paternal or maternal line from such as have died intestate, or without
offspring or descendants. As it has been established by a former law
that the grandchildren shall not be deprived of the third part of the
estate of their grandparents, it shall be lawful for the grandsons and
granddaughters who have lost either of their parents, to share
equally with their paternal or maternal uncles in the estates of their
grandfathers and grandmothers; that provision only of said law
remaining valid, by which it was decreed that parents and
grandparents may bestow their property upon their children and
grandchildren, or may give away what they please to a stranger.[22]

V. Concerning such Property as Children may have Acquired


during the Lives of their Parents.
Any son who, while his father and mother are living, acquires any
property, either through the favor of the king, or through the
generosity of his patron, shall be entitled to absolute control of the
same, and shall have the right to sell, or give it away to any one he
chooses, as has already been provided by our laws; nor can his
father or mother claim any of said property while the son is living.
Where, on the other hand, a son obtains property, not through royal
generosity, but by his own labor, or during some public expedition;
should he be living with his father at the time, the latter shall be
entitled to the third part of said property, and the other two-thirds
shall belong to the son.
BOOK V.
CONCERNING BUSINESS TRANSACTIONS.

TITLE I. ECCLESIASTICAL AFFAIRS.

I. Concerning Donations to the Church.


II. Concerning the Preservation and Restoration of Property Belonging to the
Church.
III. Concerning Sales and Gifts of Church Property.
IV. Concerning Church Property in Charge of Those Devoted to the Service
of the Church.
V. Concerning the Repairs of Churches, and Divers Other Matters.
VI. Concerning the Arbitrary Conduct of Bishops.
VII. Emancipated Slaves of the Church, who are still Bound to Render it
Service, shall not be Permitted to Marry Persons who are Freeborn.

THE GLORIOUS FLAVIUS RECESVINTUS, KING.


I. Concerning Donations to the Church.
If we are compelled to do justice to the merits of those who serve
us, how much greater reason is there that we should care for the
property set apart for the redemption of our souls and the worship of
God, and preserve it intact by the authority of the law. Wherefore, we
decree that all property which has been given, either by kings, or by
any other believers whomsoever, to houses devoted to Divine
worship, shall eternally and irrevocably belong to said churches.[23]

II. Concerning the Preservation and Restoration of Property


Belonging to the Church.
We are of the opinion that it vitally concerns the interests of our
kingdom, to provide by our laws that the temporal rights of the
church shall be protected. Therefore, we hereby decree, that, as
soon as a bishop has been consecrated, he shall straightway
proceed to make an inventory of the property of his church in the
presence of five freeborn witnesses; and to this inventory the said
witnesses shall affix their signatures. After the death of a bishop, and
as soon as his successor has been consecrated, the latter shall
require a second inventory of the church property to be made; and if
it should appear that said property had, in any way, been diminished,
then the heirs of said bishop, or those to whom his estate was
bequeathed by will, shall make up the deficiency. If a bishop should
sell any of the property of the church, his successor shall lay claim to
that property, along with all its rents and profits, and restore it to the
church, after having returned the price paid for it to the purchaser,
and no reproach shall attach to such proceedings. And we hereby
decree that this law shall be observed in every respect by priests
and deacons, as well as by bishops.
ANCIENT LAW.
III. Concerning Sales and Gifts of Church Property.
If a priest or bishop, or any other member of the clergy, should
sell or give away any of the property belonging to the church, without
the consent of the other ecclesiastics, we declare that such a
transaction shall not be valid, unless said sale or donation should
have been made in accordance with the holy canons.

IV. Concerning Church Property in Charge of Those Devoted


to the Service of the Church.
Where heirs of a bishop or of other ecclesiastics, who have
placed their sons in the service of the church, obtain lands or any
other property through the generosity of the clergy, and then return
to the laity, or abandon the service of the church whose lands or
other property they hold, they shall at once forfeit all such
possessions. And this provision must also be observed by all the
clergy holding ecclesiastical property, even though they have held it
for a long time; for the reason that the canons have so decreed. The
widows of priests or of other ecclesiastics, who have devoted their
sons to the service of the church, solely through gratitute to the
latter, shall not be deprived of any property possessed by the
fathers, which was originally derived from the church.[24]
FLAVIUS EGICA, KING.
V. Concerning the Repairs of Churches, and Divers Other
Matters.
The different regulations established in former times by the Holy
Fathers concerning ecclesiastical affairs shall be still observed, so
far as they are consistent with the interests of the church. As
antiquity, which has been the cause of the destruction of many lofty
buildings, has not spared the houses of God; it is eminently proper
that such of the latter as are in danger of destruction should be
repaired. As a result of this necessity it has been made a source of
reproach to our organization, that the greed of certain priests has
caused their parishes to be oppressed by repeated forced
contributions; and that many churches have been impoverished
under pretence of repairs. Consequently it has been decreed and
confirmed by our Council that the third part of the ecclesiastical
revenues, which the ancient canons have set apart for that purpose,
shall be used for the repairs of churches, whenever required. And
when churches are to be repaired, it is better to learn this fact from
the worshippers themselves, and the repairs should then be made
under the personal care and direction of the bishop. For, although
according to the provisions of the ancient canons, every bishop has
the right to reserve for himself the third part of the revenues of his
diocese, if he should desire to do so; so, also, he had no right to
exact from the parish churches, by means of arbitrary proceedings,
the remaining two-thirds of the said revenues; nor was he at liberty
to give away any of such property to anyone by way of
compensation for services performed. We deem it necessary to
decree that a single priest shall never have charge of more than one
church at a time; nor hold any other office; nor by ecclesiastical
authority act as guardian; nor, in any way, have charge of the
property of wards; and any congregation which possesses ten
pieces of property is entitled to a priest, but such as have less than
ten shall be united with other churches. And if any bishop should
disregard this our regulation, and should hereafter venture to
disobey it, he shall expiate his offence by two months’
excommunication.[25]
THE GLORIOUS FLAVIUS WAMBA, KING.
VI. Concerning the Arbitrary Conduct of Bishops.
God, the just Judge, who loves right eternally, does not wish that
justice should be subject to time, but rather that time should be
governed by the principles of equity. God himself is the
personification of justice, and to him should be given whatever is
bestowed by the faithful upon the church through motives of
devotion; for God, as mediator, accepts the vows of every true and
sincere worshipper. And vows should never be renounced which are
known to have proceeded from, and been confirmed by, a sense of
justice; and, therefore, he commits a fraud upon God who unjustly
takes from him his property. He also violates the rules of justice who
corruptly interferes with the vows of others. While, as has been said,
God is justice, what madness is it for anyone to remove from God’s
possession any property under the claim of prescription, alleging that
he has held it for thirty years? For many rash bishops, prompted by
avarice, are in the habit of bestowing upon their cathedral churches,
or upon various individuals, or paying out as wages for labor
performed, the donations that have been given to their dioceses by
the faithful, and, in this way, they not only break the vows of the
donors, but are also guilty of sacrilege, in that they thereby defraud
the Church of God; for it has been long established that to defraud
the church is sacrilege. And when they are urged to make restitution,
they decline to do so, because their predecessors acted in the same
manner; or refuse to make amends, because they claim to have held
the property in question for thirty years. Thus they attempt to
maintain their cupidity and rapacity by right of prescription; and
instead of at once making reparation for their fault, they attempt to
confirm and legalize it by the operation of time. He must be
considered a person of great impiety who asserts such a claim, and
acknowledges that, for thirty years, he has done injury to God, and
refuses to make amends for the injury after that period has elapsed.
Therefore, since these most iniquitous abuses are defended
under a pretence of justice, and as we are not concerned with the
past, but with the future, we shall now proceed to make regulations
applicable to the time of our own reign. For the reason that,
hereafter, all temptation to avarice may be removed, we hereby
decree that it shall not be lawful for a bishop to appropriate any
property belonging to the churches of his diocese; or, if any has
already been appropriated, to allege that he is entitled to the same
on account of his possession for thirty years; but, whenever the facts
have been established, he must make restitution at once. As, in
order that a long period may pass without a claim being made, the
nobility sometimes are guilty of such oppression of ministers of the
church that the latter do not dare to assert their rights against such
eminent persons, concerning property which has been appropriated
by the latter, and lest the voice of the despoiled church remain
forever silent, we decree that hereafter, it shall be lawful, where this
offence has been admitted by the parties or detected by anyone, in
any place, that the claim shall be instituted with all possible speed in
the following manner, to wit: that the heirs of the founders of the
church shall act as prosecutors, if they are present; but, if they
should not be present, and even if they should be, but are unwilling
to act, then the governor of the province, or the governor of the city,
or the deputy of either of them, or anyone else who has legal
cognizance of the matter, shall have the right to act as accuser and
prosecutor.
Where any bishops who, in past times, have committed the
offences hereinbefore mentioned, and have been in adverse
possession of church property for thirty years, and declare that they
hold said property by the right of prescription; such persons we leave
to the justice of God, for we decline to pass judgment upon them.
But whoever, up to the time when this law is promulgated, shall not
have had possession of such property for the space of thirty years,
shall be compelled to restore it intact to the church, but no penalty
shall be required of them. And where any bishop, who from the day
of the adoption of this law, should appropriate anything given by the
faithful to the churches of God, and should use such property for his
own benefit, or for that of his cathedral church, or should bestow any
of it upon any person whomsoever, his act shall not be confirmed by
any lapse of time; and, according to the above-mentioned decree,
whenever he shall have been convicted of the commission of such
acts by anybody, he shall be compelled to restore the property which
he took, along with lawful amends out of his own possessions, to
that church which has been defrauded. If he should not have the
means to make full restitution out of his own property, on account of
his abuse of authority, he shall undergo the penalty of
excommunication prescribed by the canon of the eleventh Council of
Toledo; that is to say, if the property that was appropriated was worth
ten solidi, he shall purge himself of guilt by twenty days of penance.
If the value of the property appropriated should be greater or less,
the proportion of days to be passed in penance shall always be
doubled; and he also shall undergo a similar penalty who retains
possession of any property taken from a diocesan church, which has
been appropriated by his predecessor.
Any judge who neglects to carry out the provisions of this law, or
delays the proceedings without just cause, or does not notify the king
that he may take cognizance of the affair, shall be liable to the same
penalty as the bishop who committed the offence, and shall pay said
penalty out of his own property to the church whose cause he
neglected to decide. This law not only applies to property which has
been bestowed upon minor and diocesan churches, but to that in
which all assemblies included under the general name of churches
are concerned; that is to say, monasteries and convents of men and
women.
We also think it proper to add the following provisions to this law:
that all bishops who ordain priests and rectors in the churches of
their dioceses shall give them instructions concerning the rights of
the churches to which they are ordained; that is to say, if any bishop
should have in his keeping any document defining the rights of any
church in his diocese, he shall show it to the rector of that church, so
that the latter may be familiar with the rights of said church, as well
as with the documents conferring the same, and not be ordained in
ignorance of them, and, what is worse, through the wickedness and
duplicity of the bishop, the will of the benefactor of the church be not
publicly known. It is also decreed that priests and rectors shall not
only have the opportunity to inspect such documents, but shall also
be entitled to copies of the same, confirmed under the hand of the
bishop, to enable them to direct the affairs of the church committed
to their care without any uncertainty, and to enforce the rights to
which it is justly entitled. Given and confirmed in the name of God, at
Toledo, on the tenth day of the Kalends of January, in the fourth year
of our reign.
THE GLORIOUS FLAVIUS WAMBA, KING.
VII. Emancipated Slaves of the Church, who are still Bound
to Render it Service, shall not be Permitted to Marry Persons
who are Freeborn.
Great confusion of lineage results where inequality of rank
causes degradation of offspring; for what is derived from the root is
inevitably found in the fruit of anything. For how indeed can he bear
a title of honor, whose parents are bound by the obligation of
servitude? We refer to this matter because many of the slaves of the
church are set free, but nevertheless do not enjoy absolute liberty;
for the reason that they are still bound to serve the church from
which they deduce their origin; and who, contrary to natural laws,
contract marriages with freeborn women, and seek to have freeborn
children who, in fact, are not so; and thus what ought to enure to the
public good, becomes in fact a burden to it, both in respect to person
and property; as whatever children are born from such an infamous
marriage, following the position inferior in rank, from birth become
the property of the church, along with all their possessions.
Wherefore, that such insolent conduct may be put an end to
hereafter, we decree by this law, that if a slave of any church, while it
is still entitled to his services, should be freed, and accept his liberty
from the priest, he shall not be permitted to marry a freeborn woman.
Those, however, who have been freed in the regular manner, and
are absolutely exempt from all service to the church by the Canon
Law, shall have the right to marry freeborn women, and shall be
entitled to claim all honor and respectability for their offspring.
But if any of those set free, who are still under the dominion of
the church, should venture hereafter to marry any freewoman; as
soon as the judge shall be apprised of the fact, both parties shall be
scourged three times, as has been provided in a former law
concerning freemen and slaves, and the judge shall cause them to
be immediately separated; and where they are unwilling to be
separated, each shall remain in the condition in which he or she was
previously, and any children born of them shall become slaves to the
king.
Whatever property has been bestowed by any free person upon
any freedman, together with such property as a child of either sex
sprung from them can acquire, possess, or waste, shall belong
entirely to the heirs of said free person at his death; and, if such
heirs should be lacking, it shall become the lawful possession of the
king, to be disposed of absolutely at his pleasure. This law shall not
only apply to men, but also to women; that is to say, where either a
freedman or a freedwoman owing services to the church should be
so bold as to marry a freeborn person.
The following exception shall be observed in the execution of this
law, to wit: whoever shall be born of such parents within thirty years
of its promulgation, shall not follow the condition of that parent who is
bound to give service to the church, but shall be free, along with all
the property inherited from his or her parents, both noble and
plebeian. Given and confirmed at Toledo, on the twelfth Kalends of
January and the fourth year of our reign.
TITLE II. CONCERNING DONATIONS IN GENERAL.

I. A Donation Extorted by Violence is Void.


II. Concerning Royal Donations.
III. Concerning Property Given to a Husband or a Wife by the King.
IV. Concerning Property, in Addition to the Dowry, Given to a Wife by her
Husband.
V. Concerning Property Given to a Husband by his Wife; and Where a Wife
has been Convicted of Adultery.
VI. Concerning Property Donated Verbally, or Conveyed by Instruments in
Writing.
VII. Concerning Gifts Bestowed upon One Another by Husband and Wife.

ANCIENT LAW.
I. A Donation Extorted by Violence is Void.
A gift extorted by force and fear has no validity whatever.

II. Concerning Royal Donations.


Donations conferred by royalty upon any person whomsoever,
shall belong absolutely to him to whom they are given; so that he
who is thus honored by the royal munificence shall have the power
to dispose of any property derived from such a source in any way
that he chooses. If he who received such gifts should die intestate,
the donations aforesaid shall belong to the legal heirs in regular
succession, according to law, and the royal favor can in no way be
infringed upon; because it is not fitting that the will of the prince
should be interfered with, where the recipient of royal bounty has not
been guilty of crime.

III. Concerning Property Given to a Husband or a Wife by the


King.
We especially decree that a wife shall be entitled to no part of
any property presented by the king to her husband, unless the latter
should bestow a portion of it upon her by way of dowry. And,
likewise, should the gift be made to a wife, her husband shall have
no right to any of it; nor can he lay claim to it after her death, unless
his wife should give or bequeath it to him.
ANCIENT LAW.
IV. Concerning Property, in Addition to the Dowry, given to a
Wife by her Husband.
If a wife should, at any time, in addition to her dowry, accept from
her husband property acquired by him as a gift, or by profligate
conduct, or the proceeds of claims collected by him, she shall have
the absolute disposal of said property until the day of her death,
according to the terms of the will of her husband, even though there
be children born of that marriage. She shall have the power to
expend or use the income of such property, just as the testator has
designated by will; and, during her lifetime, she shall enjoy
unhampered possession of all such property, the income of which
shall be used for her expenses. But if the testator should not make
any special disposition of said income, his children shall have the
right to said property after his death; and, upon no occasion, shall his
wife be allowed to alienate any part of it, excepting the income.
Where there are no children by said marriage, the wife shall have full
control of all property given her by her husband, according to the
terms of his will. But if she should die intestate, the said property
shall revert to her husband if he is living, and if he should not be
living, it shall belong to his heirs. And we decree that the same rule
shall apply to husbands who, at any time, have received gifts of
property from their wives.
ANCIENT LAW.
V. Concerning Property given to a Husband by his Wife; and
Where a Wife has been Convicted of Adultery.
If a husband should give any property to his wife, and she, after
his death, should remain chaste, or should marry another husband,
she shall have the power of disposing of the property given her by
her first husband according to the terms of his will, if she should
have no children. If she should die intestate and without children, the
property shall revert to her husband if he is living, and if not, it shall
belong to his heirs. But if she should have been convicted of
adultery, or other meretricious conduct, she shall lose any property

You might also like