-
Notifications
You must be signed in to change notification settings - Fork 213
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
using mkdocs for building the project website
- Loading branch information
Showing
21 changed files
with
554 additions
and
249 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 not shown.
Oops, something went wrong.