Skip to content

NevynUK/The-Way-of-the-Register

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Way of the Register

The Way of the Register is a series of posts looking at the STM8S series of processors. Each article in the series takes a distinct task (or group of related tasks) and describes how to achieve the task using the STM8S. Where possible, full project and source code for the IAR environment is included.

STM8S

All of these examples use the STM8S103F3 chip. If you are using another chip (say the STM8S Discovery Board) then you will also want to have a look at the post on Converting The Way of The Register Examples in order to work out what you will need to do to convert these examples.

Going from using the STD Peripheral Library on the ST processors can be a little bewildering. This article attempt to guide you through the process of converting you code from using the STD Peripheral library to using registers.

Toggle a single GPIO line to produce an approximate square wave signal.

Configure the system clock to use the internal HSI oscillator running at 16MHz. Generate a square wave signal using a GPIO line and show how the frequency of the square wave can be changed by manipulating the clock divider.

Capturing user input through a switch using the STM8S.

Learn how to setup and use the serial port on the STM8S to generate debug information or control serial devices.

Here we will learn how to use one of the timers on the STM8S to generate a square wave signal.

In this article we look at generating a PWM signal using channel 1 of Timer 2 on the STM8S.

An overview of how interrupts work on the STM8S including setting priorities for the various interrupts and how to tell the compiler that a method is an ISR and which vector it relates to.

This post examines two methods for generating a single pulse of a defined width.

Looking at using the up and down counting modes of the STM8S. We also look at how we can change the overflow interrupt frequency using the Repetition counter.

Using a potentiometer and a simple LED circuit we will learn how to read an analog signal using the ADC on the STM8S.

Enabling single byte communication between a Netduino Plus (acting as SPI master) and a STM8S (acting as a SPI slave).

Enabling transmission of a buffer of data between the Netduino Plus and the STM8S. This posts also shows how to use software slave chip select.

Building on the previous two posts, this post looks at what is necessary to build a Netduino Go module using the STM8S microcontroller.

Using the master mode of the SPI interface on the STM8S to control the brightness of 16 LEDs connected to the TLC5940 16-channel PWM controller IC.

Writing a small amount of data in the EEPROM area of the STM8S in order that the data can survive a device reset or loss of power.

Using the Auto-Wakeup function on the STM8S Discovery board to put the microcontroller to sleep and the wakeup after a predefined time period.

Adding a watchdog to your code in case of software failure.

Using the beep function on the STM8S to generate a signal ranging from 500Hz to 32KHz.

Using the Window Watchdog function to detect software failures on the STM8S.

Create an I2C master device capable of retrieving temperature data from the TMP102 temperature sensor.

Creating a simple I2C slave device using the STM8S micrcontroller.

About

STM8S Code for The Way of the Register Articles

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published