@@ -23,7 +23,7 @@ couple of days.
2323
2424Find more in detail information about the supported boards, needed tools and
2525the library APIs on the
26- [ project website ] ( https://tenbaht. github.io/ sduino/ ) .
26+ [ project documentation files ] ( https://github.com/tenbaht/ sduino/blob/master/docs/index.md ) .
2727
2828All you need to get stated is a simple STM8S103F breakout board and a
2929ST-Link V2 compatible flash programmer. Three boards and one flash
@@ -103,7 +103,7 @@ improves significantly from version to version. Be sure to use
103103version that might be included in your distribution. Version 3.5.0 as
104104included with ubuntu 16.04 is definitly too old and compilation will fail
105105due to some compiler errors.
106- [More information on installing SDCC](sdcc.md)
106+ [More information on installing SDCC](blob/master/docs/ sdcc.md)
107107
108108Support for the Cosmic compiler under Windows and integration into the ST
109109visual developer IDE might be possible, but is not done (yet?).
@@ -112,13 +112,13 @@ visual developer IDE might be possible, but is not done (yet?).
112112
113113# # Supported hardware
114114
115- [STM8S103 breakout board](https ://tenbaht.github.io/sduino/ hardware/stm8blue.html ):
115+ [STM8S103 breakout board](blob/master/docs/ hardware/stm8blue.md ) :
116116works
117117
118- [ESP14 Wifi board](https ://tenbaht.github.io/sduino/ hardware/esp14.html ):
118+ [ESP14 Wifi board](blob/master/docs/ hardware/esp14.md ) :
119119untested, but expected to work.
120120
121- [STM8S105 Discovery board](https ://tenbaht.github.io/sduino/ hardware/stm8disco.html ):
121+ [STM8S105 Discovery board](blob/master/docs/ hardware/stm8disco.md ) :
122122not supported yet, but work in progress.
123123
124124
@@ -147,6 +147,8 @@ an option.
147147
148148
149149
150+ # # Current status and to-do list
151+
150152# # Current status and to-do list
151153
152154# ### tested and working
@@ -157,16 +159,23 @@ an option.
157159`analogWrite()`
158160`ShiftOut()`
159161WMath : `map()`
160- HardwareSerial
162+ [ HardwareSerial]
161163Print (without float)
162- SPI : working, no interrupt support
163- LiquidCrystal (for text LCD based on the HD44780 controller)
164- PCD8544 (for Nokia 5110 type displays)
165- [Stepper](Stepper.md) (multi-instance design for more than one stepper at a time)
166- ssd1306 (for monochrome OLED displays based on SSD1306 controller)
164+ [SPI](https ://github.com/tenbaht/sduino/blob/master/docs/SPI.md):
165+ working, no interrupt support
166+ [LiquidCrystal](https ://github.com/tenbaht/sduino/blob/master/docs/api/LiquidCrystal.md):
167+ Text LCD based on the HD44780 controller
168+ [PCD8544](https ://github.com/tenbaht/sduino/blob/master/docs/api/PCD8544.md):
169+ Nokia 5110 type displays
170+ [Mini_SSD1306](https ://github.com/tenbaht/sduino/blob/master/docs/api/Mini_SSD1306.md):
171+ Monochrome OLED displays based on the SSD1306 controller
172+ [Stepper](https ://github.com/tenbaht/sduino/blob/master/docs/api/Stepper.md):
173+ Multi-instance design for more than one stepper at a time
174+ [Servo](https ://github.com/tenbaht/sduino/blob/master/docs/api/Servo.md):
175+ Multi-instance design for more than one servo at a time)
167176
168177# ### implemented and partly working
169- Wire/I2C : no deadlock protection yet
178+ Wire/I2C
170179
171180# ### tested, but not working
172181`alternateFunctions()`
@@ -186,6 +195,7 @@ module WCharacter
186195module WString
187196
188197
198+
189199The compile environment needs to detect which interrupts are actively used
190200and link only the needed ones into the binary. See test/digitalWrite :
191201Compiling with the straight Makefile.classic does not add UART interrupt
@@ -227,7 +237,7 @@ $1.60-$3.00 for an ATmega8.
227237
228238# # Further reading and application notes
229239
230- [sduino project website ](https ://tenbaht. github.io/ sduino/):
240+ [project documentation files ](https ://github.com/tenbaht/ sduino/blob/master/docs/index.md).
231241More in detail information about supported boards, tools and the API.
232242
233243[PM0051](http ://www.st.com/resource/en/programming_manual/cd00191343.pdf):
@@ -261,87 +271,8 @@ hard-coded assumptions about the number of pins with special functions.
261271Ideally, all these numbers would be the same and all programs could be
262272compiled without changes.
263273
264- [Here](https ://tenbaht.github.io/sduino /pin_mapping.md)
274+ [Here](blob/master/docs /pin_mapping.md)
265275I discuss some possible pin mapping strategies and check how close we could
266276get the the ideal mapping. Unfortunatly, it turns out that a perfect mapping
267277is not possible.
268278
269- In the end I chose a simple geometric numbering for the square UFQFPN20
270- package starting with port pin PA1 and counting up from 0. This results in
271- this mapping :
272-
273- sduino pin | STM8S103 CPU port pin
274- ---------- | ---------------------
275- 0-2 | PA1-PA3
276- 3-4 | PB5-PB4 (reverse order)
277- 5-9 | PC3-PC7
278- 10-15 | PD1-PD6
279-
280- serial : 14,15
281- SPI : 2,7,8,9
282- I2C : 3,4
283- Analog : 6,11,12,14,15
284- PWM : 2,5,6,12 plus either only 13 or 7-9 but not 13 (via alternate mapping)
285-
286- + Easy and logical for use on a breadboard
287- + Very clear and logical port pin ordering
288- - Analog pins are still scattered around
289- + TX and RX would be the rarely used analog pin numbers A3/A4 at
290- the end of the analog pin number list
291- + At least the analog pins are in data sheet order
292- - All functions use totally different pin numbers than Arduino
293-
294- I am still not really happy with this mapping. Instead of simplifing things
295- it only adds another layer of abstraction and confusion. To avoid this I
296- added definitions for the regular CPU pin names like `PA1` and `PD2`. In the
297- end, this notation seem a lot easier to me. I am open for suggestions for a
298- better pin number mapping.
299-
300- The chosen pin mapping for the STM8S103 (possible alternate function in
301- paratheses) :
302-
303- |Phys. STM8 pin|Name |Functions |Geometrical mapping|special funcion
304- |--- : |--- |--- | --- |---
305- |1 |PD4 |UART_CLK/T2-1/beep |13 |PWM
306- |2 |PD5 |TX/Ain5 |14 |Analog A3
307- |3 |PD6 |RX/Ain6 |15 |Analog A4
308- |5 |PA1 |(OscIn, kein HS) |0 |
309- |6 |PA2 |(OscIn, kein HS) |1 |
310- |10 |PA3 |SS/T2-3 |2 |PWM
311- |11 |PB5 |SDA LED |3 |
312- |12 |PB4 |SCL |4 |
313- |13 |PC3 |T1-3/[T1-n1] |5 |PWM, (n~)
314- |14 |PC4 |T1-4/Ain2/[T1-n2] |6 |PWM, Analog A0, (n~)
315- |15 |PC5 |SCK/[T2-1] |7 |(~)
316- |16 |PC6 |MOSI/[T1-1] |8 |(~)
317- |17 |PC7 |MISO/[T1-2] |9 |(~)
318- |18 |PD1 |(SWIM) |10 |
319- |19 |PD2 |Ain3/[T2-3] |11 |Analog A1, (~~)
320- |20 |PD3 |Ain4/T2-2 |12 |PWM, Analog A2
321-
322-
323-
324-
325-
326- # ## Performance compared with the original Arduino environment
327-
328- Benchmarking the original Arduino examples from Arduino 1.0.5. The simple
329- Blinky compiles to 57 bytes of code, the total binary including the sduino
330- libraries is 1868 Bytes (0x74c).
331-
332- So far, wiring_analog depends on wiring_digital, even when analogWrite is not
333- used. This could be solved by compiling the sduino functions separately into
334- a library.
335-
336- |Name |Code |Total |Linked files other than main and wiring
337- |--------------------- |------ |----- |-----------------------------
338- |01. Basics/ |
339- |BareMinimum |2 |1238 |-
340- |Blink |57 |1870 |wiring_digital
341- |AnalogReadSerial |205 |3452 |digital, analog, serial, print
342- |DigitalReadSerial |57 |3160 |digital, serial, print
343- |Fade |226 |2189 |digital, analog
344- |ReadAnalogVoltage | | |float not yet implemented
345- |02. Digital/ |
346- |Debounce |192 |2016 |digital
347-
0 commit comments