Skip to content

Commit bd43343

Browse files
committed
fix spelling and formatting on the website
1 parent 08e2733 commit bd43343

15 files changed

Lines changed: 157 additions & 94 deletions

File tree

docs/about.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# About
1+
# About Sduino
22

33
The idea is to smoothen the path towards your first successful STM8-based
44
project.
@@ -16,7 +16,7 @@ detailed knowledge of the CPU internals. [compiling the SPL with
1616
SDCC](developer/spl.md)
1717

1818

19-
## Tools used
19+
### Tools used
2020

2121
This project is based on free tools that are available for Linux, MacOS, and
2222
Windows.
@@ -34,7 +34,7 @@ The build process is controlled by a makefile based on the amazing
3434

3535

3636

37-
## Project origin
37+
### Project origin
3838

3939
For a customer I needed to port an existing project from an ATmega to a
4040
better suited (read: cheaper) platform. As the project was based on some
@@ -44,14 +44,14 @@ of days. Porting some of the more commonly used Arduino libraries was a fun
4444
project done in my spare time later.
4545

4646

47-
## About me
47+
### About me
4848

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

5353

54-
### Experiences
54+
#### Experiences
5555

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

docs/api/Mini_SSD1306.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ void loop()
7676

7777
## Hardware requirements
7878

79-
These tiny displays communicate usually via I2C, but SPI version do exist.
79+
These tiny displays communicate usually via I2C, but SPI versions do exist.
8080
My display uses the I2C address 0x3C, but there are similar displays out
8181
there configured to use the address 0x3D.
8282

@@ -89,6 +89,7 @@ of the screen:
8989
![My 0.96" OLED display](oled-ssd1306.jpg)
9090

9191
Technical data:
92+
9293
* Driver chip SSD1306
9394
* Display resolution: 128x64
9495
* Power: 3.3V, approx. 20mA (5V possible)
@@ -109,13 +110,15 @@ Pin |Function|STM8S103 pin |sduino pin
109110
## Further reading
110111

111112
Technical information:
112-
* Adafruit tutorial: https://learn.adafruit.com/monochrome-oled-breakouts
113-
* SSD1306 datasheet: https://www.adafruit.com/datasheets/SSD1306.pdf
113+
114+
* [Adafruit tutorial](https://learn.adafruit.com/monochrome-oled-breakouts)
115+
* [SSD1306 datasheet](https://www.adafruit.com/datasheets/SSD1306.pdf)
114116

115117
Other libraries:
116-
* Adafruit library: https://github.com/adafruit/Adafruit_SSD1306
117-
* Old Arduino library u8glib: https://github.com/olikraus/u8glib
118-
* newer library u8g2: https://github.com/olikraus/u8g2
118+
119+
* [Adafruit library](https://github.com/adafruit/Adafruit_SSD1306)
120+
* [Old Arduino library u8glib](https://github.com/olikraus/u8glib)
121+
* [newer library u8g2](https://github.com/olikraus/u8g2)
119122

120123

121124
## Possible improvements

docs/api/Print.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Print
2+
3+
Formatting functions for use with other output libraries. Involves serious
4+
preprocessor magic. See the [migration guidelines](../api/migration.md) and
5+
the [xmacro description](../developer/macro.md)
6+
7+
This page is only a stub.
8+
9+
10+
## API
11+
## Example
12+
## Implementation details
13+
## Possible impovements

docs/api.md renamed to docs/api/migration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ structure. Typically, this is done in the `setup()`-function and this pointer
124124
is stored in a global variable to be used as a device descriptor.
125125
126126
127-
So far the [Stepper library](api/Stepper.md) is the only example:
127+
So far the [Stepper library](Stepper.md) is the only example:
128128
129129
```c
130130
#include <Stepper.h>

docs/developer/links.md

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,9 @@ metal programming of the STM8S CPUs. By far the best introduction I
88
found so far. It would have helped me a lot if it would have around at the
99
time when I started this project.
1010

11-
[project documentation files](https://github.com/tenbaht/sduino/blob/master/docs/index.md)
12-
More in detail information about supported boards, tools and the API.
13-
14-
[Quick introduction to the Arduino.mk makefile]
15-
(http://hackaday.com/2015/10/01/arduino-development-theres-a-makefile-for-that/)
11+
[Quick introduction to the Arduino.mk
12+
makefile](http://hackaday.com/2015/10/01/arduino-development-theres-a-makefile-for-that/)
13+
on hackaday.com
1614

1715
[PM0051](http://www.st.com/resource/en/programming_manual/cd00191343.pdf):
1816
STM8AF Flash programming manual
@@ -21,19 +19,22 @@ STM8 SWIM protocol and debug manual
2119
[AN2658](http://www.st.com/resource/en/application_note/cd00176594.pdf):
2220
Using the analog-to-digital converter of the STM8S microcontroller
2321

24-
Many examples and presentations about the STM8S:
25-
https://github.com/VincentYChen/STM8teach
26-
It contains the SPL examples from ST, the most useful resource on the STM8:
27-
https://github.com/VincentYChen/STM8teach/tree/master/code/Project/STM8S_StdPeriph_Examples
22+
Many [examples and presentations about the
23+
STM8S](https://github.com/VincentYChen/STM8teach)
24+
25+
It contains the [SPL examples from
26+
ST](https://github.com/VincentYChen/STM8teach/tree/master/code/Project/STM8S_StdPeriph_Examples),
27+
one of the most useful resources on the STM8.
2828

29-
Hardware and pinouts of several ST-Link compatible flash tools:
30-
https://wiki.cuvoodoo.info/doku.php?id=jtag
29+
[Hardware and pinouts of several ST-Link compatible flash
30+
tools](https://wiki.cuvoodoo.info/doku.php?id=jtag)
3131

32-
Using the ADC:
33-
http://blog.mark-stevens.co.uk/2012/09/single-scan-adc-on-the-stm8s/
32+
[Using the
33+
ADC](http://blog.mark-stevens.co.uk/2012/09/single-scan-adc-on-the-stm8s/)
34+
by Mark Stevens
3435

35-
Example for RS-232 handling with SPL:
36-
https://sourceforge.net/p/oggstreamer/oggs-stm8-firmware-001/ci/master/tree/rx_ringbuffer.c
36+
[Example for RS-232 handling with
37+
SPL](https://sourceforge.net/p/oggstreamer/oggs-stm8-firmware-001/ci/master/tree/rx_ringbuffer.c)
3738

3839
[AN3139](http://www.st.com/resource/en/application_note/cd00262293.pdf):
3940
Migration guideline within the STM8L familiy

docs/developer/sdcc.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,37 +5,46 @@ http://www.cnx-software.com/2015/04/13/how-to-program-stm8s-1-board-in-linux/
55

66
STM8-Support only started with Version 3.4 in Ubuntu 14.10. For Ubuntu 14.4:
77

8+
```bash
89
add-apt-repository ppa:laczik/ppa
910
apt-get update
1011
apt-get install sdcc
12+
```
1113

1214
But even this version is fairly old and contains some known bugs. Better
1315
download a current snapshot build from http://sdcc.sourceforge.net/ and
1416
unpack it to `/opt/sdcc`. This requires a current version of libstdc++6:
1517

18+
```bash
1619
add-apt-repository ppa:ubuntu-toolchain-r/test
1720
apt-get update
1821
apt-get install libstdc++6
22+
```
1923

2024
If you prefer to compile stm8flash yourself instead of using the Linux
2125
binaries in the `tools` directory:
2226

27+
```bash
2328
git clone https://github.com/vdudouyt/stm8flash.git
2429
cd stm8flash
2530
make
2631
sudo make install
32+
```
2733

2834
Download some example code:
2935

36+
```bash
3037
git clone https://github.com/vdudouyt/sdcc-examples-stm8.git
3138
cd sdcc-examples-stm8
39+
```
3240

3341
The examples are meant for the STM8L, not the STM8S. This requires some
3442
changes to account for the different pinout and register addresses (see below).
3543
Finally upload the binary to the CPU:
3644

45+
```bash
3746
stm8flash -c stlinkv2 -p stm8s103?3 -w blinky.ihx
38-
47+
```
3948

4049

4150
### Mixing assembler code with C code
@@ -101,7 +110,7 @@ Make sure to use a recent snapshot build if you are planing to use simulator!
101110

102111
#### Missing peephole optimisations
103112

104-
See discussion of issue 14: https://github.com/tenbaht/sduino/issues/14
113+
See discussion of [issue #14](https://github.com/tenbaht/sduino/issues/14)
105114

106115

107116

docs/developer/spl.md

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,25 @@
1-
## ST Standard Library
1+
## ST Standard Peripherie Library
22

3-
Can be [downloaded from the ST website]
4-
(http://www.st.com/en/embedded-software/stsw-stm8069.html)
5-
(free registration required). Don't miss the Examples folder within the
6-
downloaded zip file. This is the most useful reference on using this library
7-
and programming the STM8 in general.
3+
The Library an be [downloaded from the ST
4+
website](http://www.st.com/en/embedded-software/stsw-stm8069.html) (free
5+
registration required). A slightly older version is part of the [STM8S_Teach
6+
presentation](https://github.com/VincentYChen/STM8teach/tree/master/code/Project/STM8S_StdPeriph_Examples),
7+
8+
Don't miss the Examples folder within the downloaded
9+
zip file. This and [Lujji's
10+
blog](https://lujji.github.io/blog/bare-metal-programming-stm8/) is the most
11+
useful reference on using this library and programming the STM8 in general.
812

913
For use with SDCC the library needs to be patched:
1014

11-
git clone https://github.com/g-gabber/STM8S_StdPeriph_Driver.git
12-
git clone https://github.com/gicking/SPL_2.2.0_SDCC_patch.git
13-
cp ../STM8S_SPL_2.2.0/Libraries/STM8S_StdPeriph_Driver/inc/stm8s.h .
14-
patch -p1 < ../SPL_2.2.0_SDCC_patch/STM8_SPL_v2.2.0_SDCC.patch
15-
cp -av ../STM8S_StdPeriph_Lib/Project/STM8S_StdPeriph_Template/stm8s_conf.h .
16-
cp -av ../STM8S_StdPeriph_Lib/Project/STM8S_StdPeriph_Template/stm8s_it.h .
15+
```bash
16+
git clone https://github.com/g-gabber/STM8S_StdPeriph_Driver.git
17+
git clone https://github.com/gicking/SPL_2.2.0_SDCC_patch.git
18+
cp ../STM8S_SPL_2.2.0/Libraries/STM8S_StdPeriph_Driver/inc/stm8s.h .
19+
patch -p1 < ../SPL_2.2.0_SDCC_patch/STM8_SPL_v2.2.0_SDCC.patch
20+
cp -av ../STM8S_StdPeriph_Lib/Project/STM8S_StdPeriph_Template/stm8s_conf.h .
21+
cp -av ../STM8S_StdPeriph_Lib/Project/STM8S_StdPeriph_Template/stm8s_it.h .
22+
```
1723

1824
SDCC uses .rel as the file extension for its object files.
1925

@@ -82,16 +88,17 @@ The SPL folder in this archive contains a script `doit` to separate the
8288
functions before compilation.
8389
FIXME: description needed
8490

85-
Erklärung wie zumindest die Interrupt-Vektoren in die eigene Datei kommen
86-
können:
91+
A suggestion how to move at least the IRQ vectors away from the libray into
92+
the own source files:
8793
http://richs-words.blogspot.de/2010/09/stm8s-interrupt-handling.html
8894

8995

9096

9197
### Interrupts
9298

93-
Namen definiert in stm8s_itc.h
94-
Interrupt-Routine definieren:
99+
Interrupt names are defined in stm8s_itc.h
100+
101+
Declaration of an interrupt function for SDCC:
95102

96103
```c
97104
/* UART1 TX */
@@ -100,15 +107,15 @@ void UART1_TX_IRQHandler(void) __interrupt(ITC_IRQ_UART1_TX)
100107
}
101108
```
102109

103-
Jetzt muss noch das passende IRQ-Enable-Flag gesetzt werden und Interrupt
104-
generell freigegeben werden, also hier:
110+
Set the matching IRQ enable flag and globally allow interrupts:
105111

106112
```c
107113
UART1_ITConfig(UART1_IT_TXE, ENABLE);
108114
enableInterrupts();
109115
```
110116
111-
Unklar ist, was die ITC-Prioritäten bewirken. Es geht jedenfalls auch ohne:
117+
Not sure about the meaning of the ITC priorities. It works even without
118+
them:
112119
113120
```c
114121
ITC_DeInit();

docs/hardware/esp14.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Feature | STM8S003 | STM8S103
2020
------------ | ------------- | ------------
2121
EEPROM size | 128 Bytes | 640 Bytes
2222

23-
I am not sure why the '003 is sold for half the price, or, to but it the
23+
I am not sure why the '003 is sold for half the price, or, to put it the
2424
other way around, why anybody should choose the '103 at all. Did I miss an
2525
important difference?
2626

@@ -35,9 +35,9 @@ usual ESP AT-Firmware and is connected to the RX/TX pins of the STM8S.
3535
It feels like having a classic ATmega8-Arduino with a build-in ESP-01
3636
module. Using the [WiFiEsp library](https://github.com/bportaluri/WiFiEsp)
3737
we could have a programming experience very similar to using an Arduino with
38-
a Wifi-shield.
38+
a Wifi-shield or an Arduino Yun.
3939

40-
Problem is the limited flash space of the '003. Even the very basic
40+
The main problem is the limited flash space of the '003. Even the very basic
4141
WebServer example that comes with the WiFiEsp library needs more then 14kB
4242
flash and more than 1kB RAM when compiled for an Arduino Uno. Even if the
4343
library could be carefully optimized to fit into the 8kB flash of an '003 -

docs/hardware/stm8blue.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ perfect for breadboards).
2727
My breakout boards came preprogrammed with a blink program and with active
2828
write protection bits. For unlocking before first use:
2929

30-
stm8flash -cstlinkv2 -pstm8s103?3 -u
30+
```bash
31+
stm8flash -cstlinkv2 -pstm8s103?3 -u
32+
```
3133

3234

3335

docs/hardware/stm8sdiscovery.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# STM8S Discovery
22

3-
A widespread evaluation board made by ST. All CPU pin are easily accessible
3+
A widespread evaluation board made by ST. All CPU pins are easily accessible
44
on 2x6 pin headers. It costs only $9 and includes a ST-Link/v1 flash
55
programmer on board.
66

7-
It should work now, but the support is very fresh and not thoroughly tested.
8-
At least Blink.c is known to work already.
7+
It should work now, but the support is not thoroughly tested. At least
8+
Blink.c is known to work already.
99

1010
STM8S105C6T6 microcontroller, 32 KB Flash, 2 KB RAM, 1 KB EEPROM
1111

@@ -39,20 +39,27 @@ hole board useless. You need to make modprobe to ignore it by adding this
3939
line to /etc/modprobe.conf or by adding a file
4040
/etc/modprobe.d/stdiscovery.conf with this line:
4141

42+
```bash
4243
options usb-storage quirks=0483:3744:i
44+
```
4345

4446
Unplug the Discovery board and unload the usb mass storage driver with
4547

48+
```bash
4649
modprobe -r uas usb_storage
50+
```
4751

4852
If you can't unload the usb_storage drive because it is in use with other
4953
devices you can temporary trigger the same effect by this line:
5054

55+
```bash
5156
echo "0483:3744:i" >/sys/module/usb_storage/parameters/quirks
57+
```
5258

5359
The second step is to add a new udev rule in order to access the USB port.
5460
Save this as root in in `/etc/udev/rules.d/99-stlink.rules`:
5561

62+
```bash
5663
# ST-Link/V2 programming adapter
5764

5865
# ST-Link V1, if using a STM8S discovery board
@@ -61,10 +68,12 @@ Save this as root in in `/etc/udev/rules.d/99-stlink.rules`:
6168

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

6573
Finally, it is time to (re-) connect the board. Now dmesg should show that
6674
the mass storage device of the Discovery board is ignored:
6775

76+
```bash
6877
[ 815.228928] usbcore: deregistering interface driver uas
6978
[ 815.229201] usbcore: deregistering interface driver usb-storage
7079
[ 823.001086] usb 1-3: new full-speed USB device number 7 using xhci_hcd
@@ -77,10 +86,13 @@ the mass storage device of the Discovery board is ignored:
7786
[ 823.748299] usb-storage 1-3:1.0: device ignored
7887
[ 823.748453] usbcore: registered new interface driver usb-storage
7988
[ 823.771094] usbcore: registered new interface driver uas
89+
```
8090

8191
Let's read the preinstalled firmware of the STM8S105:
8292

93+
```bash
8394
stm8flash -cstlink "-pstm8s105?6" -r flash.img
95+
```
8496

8597

8698
## Further reading

0 commit comments

Comments
 (0)