Skip to content

Commit

Permalink
using mkdocs for building the project website
Browse files Browse the repository at this point in the history
  • Loading branch information
tenbaht committed Apr 24, 2017
1 parent ab011f1 commit 741f027
Show file tree
Hide file tree
Showing 21 changed files with 554 additions and 249 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,7 @@ build-*
# ignore files generated by patch:
*.orig
*.rej
# ignore mkdocs build directory
site/
# ignore my scratch directory
notes/
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
## [Unreleased]
### Added
### Changed
- using mkdocs for building the project website
### Fixed

## [0.2.0 - 2017-03-01]
Expand Down
19 changes: 8 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ This project is not supposed to be “better than Arduino”. It’s purpose
is to give you a head start into a different CPU architecture if you happen
to have a professional need or a private desire for it.

Please find more detailed information about the supported boards, the needed tools
and the library APIs on the
[project documentation files](https://github.com/tenbaht/sduino/blob/master/docs/index.md).
Please find more detailed information about the supported boards, the needed
tools and the library APIs on the
[project website](https://tenbaht.github.io/sduino/).


## Table of Contents

* [Project Website](blob/master/docs/index.md)
* [Project Website](https://tenbaht.github.io/sduino/)
* [Usage example](#usage)
* [Supported hardware](#supported-hardware)
* [Why use a STM8 instead of an ATmega?](#why-use-a-stm8-instead-of-an-atmega)
Expand Down Expand Up @@ -90,8 +90,8 @@ Done! Your first STM8 based project is up and running!
## Supported hardware

Anything with an STM8S103 or STM8S003 should work. For example, the
70-cent-[STM8S103 breakout boards](blob/master/docs/hardware/stm8blue.md),
[ESP14 Wifi boards](blob/master/docs/hardware/esp14.md),
70-cent-[STM8S103 breakout boards](https://tenbaht.github.io/sduino/hardware/stm8blue.md),
[ESP14 Wifi boards](https://tenbaht.github.io/sduino/hardware/esp14.md),
or even the [W1209 thermostat boards](https://www.aliexpress.com/wholesale?SearchText=w1209)
that are abundant on aliexpress and Amazon. All you need to get started is a
simple ST-Link/V2 compatible flash programmer, available for less then $3
Expand All @@ -109,12 +109,12 @@ five 10 bit ADC inputs, 3 timers, and up to 14 I/O pins - quite similar to
an Atmel ATmega8 as it was used on the first Arduino boards.

Support for the more powerful
[STM8S105 Discovery board](blob/master/docs/hardware/stm8disco.md)
[STM8S105 Discovery board](https://tenbaht.github.io/sduino/hardware/stm8sdiscovery.md)
is very fresh, but should work now. At least Blink.c works already. These
amazing $9 boards offer even more resources, come with a build-in flash
programmer and are very similar to an Arduino Uno with an ATmega328 CPU.

Find more information here: [Supported Boards](blob/master/docs/hardware.md)
Find more information here: [Supported Boards](https://tenbaht.github.io/sduino/hardware.md)



Expand Down Expand Up @@ -193,6 +193,3 @@ processing C++ source files. I am not sure if it would be even possible to
configure a build process based only on C files without modifing the IDE
sources. This makes a full IDE integration very unlikely.




5 changes: 0 additions & 5 deletions _config.yml

This file was deleted.

7 changes: 0 additions & 7 deletions docs/_config.yml

This file was deleted.

45 changes: 45 additions & 0 deletions docs/about.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# About

The idea is to smoothen the path towards your first successful STM8-based
project.

The Arduino project was very successful in offering a simplified API hiding
most of the complexity of embedded system programming while still allowing
for advanced programming technics.

The SPL (standard peripheral library) [offered by
ST](http://www.st.com/en/embedded-software/stsw-stm8069.html) is very
powerful and provides an relativly easy migration path towards the STM32 CPU
series in case a project outgrows the capabilities of the 8-bit STM8 series.
But using that library is not very intuitive and still requires a fairly
detailed knowledge of the CPU internals. [compiling the SPL with
SDCC](spl.md)



## Project origin

For a customer I needed to port an existing project from an ATmega to a
better suited (read: cheaper) platform. As the project was based on some
Arduino libraries, porting parts of the Arduino environment was the logical
first step. After doing that porting the firmware was finished in a couple
of days. Porting some of the more commonly used Arduino libraries was a fun
project done in my spare time later.


## About me

I am a freelance programmer for embedded systems and electronics developer
based in Heidelberg, Germany. I work with embedded systems for more than
25 years now.


### Experiences

**current CPU architectures**: AVR (ATmega, ATxmega), PIC, STM8, STM32, MCS51

**classic CPU architectures**: 6502, 68HC11, 6809, Z80, MCS48

**electronics development**: optical sensors, laser driver, sensor
electronics, measurement equipment, industrial control, SMPS, displays
(LCD, TFT)
12 changes: 12 additions & 0 deletions docs/api/HardwareSerial.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# HardwareSerial

Uses the UART. API similar to Arduino. Single instance only.
Pre-instanciated.

This page is only a stub.


## API
## Example
## Implementation details
## Possible impovements
12 changes: 12 additions & 0 deletions docs/api/I2C.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# I2C

The
[I2C master library](http://www.dsscircuits.com/articles/arduino-i2c-master-library)
by Wayne Truchsess offers some significant advantages over the Wire/TWI
library included in the standard arduino environment: It fixes some possible
deadlock situations, it allows for communication using a repeated start
condition as required by some devices, the code is much more compact and the
structure is easier to understand.

The current state of the port does not include the deadlock protection,
though.
3 changes: 0 additions & 3 deletions docs/api/LiquidCrystal.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,3 @@ assume 4-bit mode.

As init() is not called very frequently the possible advantage would be small
compared to the downside of breaking the Arduino compatibility.


[Back to the main page](../index.html)
5 changes: 0 additions & 5 deletions docs/api/Mini_SSD1306.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,3 @@ Other libraries:
Faster I2C transfer is supported by the [I2C.html](I2C library), but to use
it you have to modify the source code for the Mini_SSD1306 library. Make
this configurable in the instantiation function.




[Back to the main page](../index.html)
9 changes: 6 additions & 3 deletions docs/api/PCD8544.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ or compatibles. These displays quite cheap and are commonly found on older monoc
phones, such as the [Nokia 3310](http://en.wikipedia.org/wiki/Nokia_3310) or
[5110](http://en.wikipedia.org/wiki/Nokia_5110).

This library is a very much simpified version of the Adafruit library.

* Optimized for a minimal memory footprint.
* Only SPI mode supported.
* Uses soft-SPI, does not need the SPI pins.

This is a modified version of the
[PCD8544 library](https://github.com/carlosefr/pcd8544) written by
[Carlos Rodrigues](https://github.com/carlosefr). It is ported from C++ to C
Expand Down Expand Up @@ -148,6 +154,3 @@ of this function.
To make it easy to create custom symbols, there's a
graphical glyph editor [available online](http://carlosefr.github.io/pcd8544/).
[Back to the main page](../index.html)
11 changes: 11 additions & 0 deletions docs/api/SPI.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# SPI

Real hardware-SPI up to 10MHz. No interrupt support yet.

This page is only a stub.


## API
## Example
## Implementation details
## Possible impovements
3 changes: 0 additions & 3 deletions docs/api/Servo.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,3 @@ at the same time, attaching one servo group to each CC-channel. This way it
would be possible to serve up to 48 servos using the four CC-channels of
timer TIM1. Monitoring the repetion period might become a little complex, as
it must be ensured that all servos on all channels have finshed before.


[Back to the main page](../index.html)
4 changes: 0 additions & 4 deletions docs/api/Stepper.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,3 @@ This is not a to-do-list, just brainstorming and a collection of random
thoughts.
Nothing yet.
[Back to the main page](../index.html)
File renamed without changes
87 changes: 87 additions & 0 deletions docs/hardware/flashtool.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# Flash tool

You need a special flash tools in order to program the CPU. As far as I know
there is no third-party product or software that implements the needed
communication protocol. So you can't just use a regular Arduino board as a
flash tool as you could for the ATmega. But this is not a problem, as these
tools are are easily available and unbeliveably cheap (well under $3 on
aliexpress, search for st-link).

There are two versions of the ST-Link V2 compatible flash tool available:
One in a USB-Drive-like metal housing (often pink or blue) and one made by
Baite in a green plastic housing. Both work well, but they use a different
pinout.

![Picture of both flash tools](ST-LinkV2_pinout_01.jpg)

Both flash tools support the SWIM protocol for STM8 CPUs and the SWD
protocol for the STM32 CPUs. The programmer from Baite additionally supports
JTAG and is slightly superior to the more common one in the metal housing.
More information on the hardware and the pinouts:
https://wiki.cuvoodoo.info/doku.php?id=jtag


## Pinout

Pinout of Chinese ST-Link V2-clone made by Baite with green plasic housing
(supports SWIM, SWD and JTAG):

+-----+
T_JRST | 1 2| 3V3
5V | 3 4| T_JTCK/T_SWCLK
SWIM 5 6| T_JTMS/T_SWDIO
GND | 7 8| T_JTDO
SWIM RST| 9 10| T_JTDI
+-----+

Pinout of Chinese ST-Link V2-clone with metal housing (supports SWIM and
SWD):

+-----+
RST | 1 2| SWDIO
GND | 3 4| GND
SWIM 5 6| SWCLK
3V3 | 7 8| 3V3
5V | 9 10| 5V
+-----+


## Installation for Linux

For Linux: required lines in /etc/udev/rules.d/99-stlink.rules:

# ST-Link/V2 programming adapter

# ST-Link V1, ST-Discovery boards
ATTR{idVendor}=="0483", ATTR{idProduct}=="3744", MODE="0666", GROUP="plugdev"

# ST-Link/V2, the china adapter with the green plastic housing
ATTR{idVendor}=="0483", ATTR{idProduct}=="3748", MODE="0666", GROUP="plugdev"


## Connection to the CPU board

The pinout of the SWIM connector P3 on my STM8S103 breakout board fits the
pinout of the flash tool in the metal housing perfectly:

| Signal | SWIM connector P3 | Baite ST-Link | Metal ST-Link
| ------ | :---------------: | :-----------: | :-----------:
| 3V3 | 1 | 2 | 7
| SWIM | 2 | 5 | 5
| GND | 3 | 7 | 3
| NRST | 4 | 9 | 1


The Discovery boards made by ST all feature a ST-Link interface as well, but
only the Discovery STM8S105 supports the SWIM protocol. The Discovery
STM32F0308 implements SWD only and is not usable for the STM8.

|Pin out CN3 | SWD
|----------- | --------------
|1 | ? detect oder so?
|2 |JTCK/SWCLK
|3 |GND
|4 |JTMS/SWDIO
|5 |NRST
|6 |SWO

File renamed without changes
Binary file added docs/hardware/st-link_v2_baite.pdf
Binary file not shown.

0 comments on commit 741f027

Please sign in to comment.