@@ -117,36 +117,16 @@ visual developer IDE might be possible, but is not done (yet?).
117117
118118# # Supported hardware
119119
120- The simple breakout boards are build around a CPU STM8S103F3P6 with 16MHz internal
121- oscillator, 8kB flash, 1kB RAM, and 640 byte EEPROM. The CPU includes a
122- UART, SPI, I2C, PWM, 10 bit ADC, 3 timer, and up to 14 I/O pins - quite similar to the Atmel ATmega8.
120+ [STM8S103 breakout board](https ://tenbaht.github.io/sduino/hardware/stm8blue.html):
121+ works
123122
124- One (red) LED is connected to GPIO PB5 (CPU pin 11). The push button is for
125- reset. The CPU runs on 3.3V, a linear regulator is integrated on the
126- board. The micro USB connector is only for (5V) power supply, the data lines
127- are not connected.
123+ [ESP14 Wifi board](https ://tenbaht.github.io/sduino/hardware/esp14.html):
124+ untested, but expected to work.
128125
129- All CPU pins are easily accessible on (optional) pin headers
130- (pitch 2.54mm, perfect for breadboards) .
126+ [STM8S105 Discovery board](https ://tenbaht.github.io/sduino/hardware/stm8disco.html):
127+ not supported yet, but work in progress .
131128
132129
133- I am using the ST-Link V2 compatible flash tool in the green plastic
134- housing. The one in the metal housing uses a different pinout.
135-
136- Connection to the green flashtool :
137-
138- |Signal name |CPU board |Flash tool |Metal flash tool
139- |------ |----- : |-----: |-----:
140- |3V3 |1 |2 | 7
141- |SWIM |2 |5 | 5
142- |GND |3 |7 | 3
143- |NRST |4 |9 | 1
144-
145- My breakout boards came preprogrammed with a blink program and with active
146- write protection bits. For unlocking before first use :
147-
148- stm8flash -cstlinkv2 -pstm8s103?3 -u
149-
150130
151131# # Compatibility with the Arduino world
152132
@@ -277,64 +257,6 @@ Migration guideline within the STM8L familiy
277257
278258
279259
280- # # Programmer
281-
282- STM8 uses the SWIM protocol, STM32 uses SWD protocol.
283-
284- | STM8-Board | SWIM-Verbinder P3
285- | ---------- | -----------------
286- | 1 | 3V3
287- | 2 | SWIM (PD1)
288- | 3 | GND
289- | 4 | NRST
290-
291-
292- Discovery STM32F0308 as ST-Link/V2 (SWD only, not usable for the STM8) :
293-
294- |Pin out CN3 | SWD
295- |----------- | --------------
296- |1 | ? detect oder so?
297- |2 |JTCK/SWCLK
298- |3 |GND
299- |4 |JTMS/SWDIO
300- |5 |NRST
301- |6 |SWO
302-
303-
304- Pinout of Chinese ST-Link V2-clone with green plasic housing :
305-
306- +-----+
307- T_JRST | 1 2| 3V3
308- 5V | 3 4| T_JTCK/T_SWCLK
309- SWIM 5 6| T_JTMS/T_SWDIO
310- GND | 7 8| T_JTDO
311- SWIM RST| 9 10| T_JTDI
312- +-----+
313-
314- Pinout of Chinese ST-Link V2-clone with metal housing :
315-
316- +-----+
317- RST | 1 2| SWDIO
318- GND | 3 4| GND
319- SWIM 5 6| SWCLK
320- 3V3 | 7 8| 3V3
321- 5V | 9 10| 5V
322- +-----+
323-
324- For Linux : required lines in /etc/udev/rules.d/99-stlink.rules:
325-
326- # ST-Link/V2 programming adapter
327-
328- # ST-Link V1
329- # SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device",
330- ATTR{idVendor}= ="0483", ATTR{idProduct}=="3744", MODE="0666", GROUP="plugdev"
331-
332- # ST-Link/V2, the china adapter with the green plastic housing
333- # SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTR{idVendor}=="0483", ATTR{idProduct}=="3748", MODE="0666"
334- ATTR{idVendor}= ="0483", ATTR{idProduct}=="3748", MODE="0666", GROUP="plugdev"
335-
336-
337-
338260
339261# # Pin number mappings
340262
@@ -345,9 +267,9 @@ Ideally, all these numbers would be the same and all programs could be
345267compiled without changes.
346268
347269[Here](https ://tenbaht.github.io/sduino/pin_mapping.md)
348- I discuss some possible pin mapping and check how close we could get the the
349- ideal mapping. Unfortunatly, it turns out that a perfect mapping is not
350- possible.
270+ I discuss some possible pin mapping strategies and check how close we could
271+ get the the ideal mapping. Unfortunatly, it turns out that a perfect mapping
272+ is not possible.
351273
352274In the end I chose a simple geometric numbering for the square UFQFPN20
353275package starting with port pin PA1 and counting up from 0. This results in
@@ -405,53 +327,6 @@ paratheses):
405327
406328
407329
408- # # Notes for the Arduino port
409-
410- # ## Additional compile-time flags
411-
412- Some internal details can be influenced by setting compile-time defines
413- using the `CFLAGS=-Dflagname` line in the Makefile.
414-
415- Compile-time flag | Purpose
416- ----------------- | --------
417- `SUPPORT_ALTERNATE_MAPPINGS` | Allow the use of `alternateFunctions()`
418- `ENABLE_SWIM` | Do not disable the remote debugging
419- function on the SWIM pin. This means that this pin can not be used for
420- normal I/O functions.
421- `USE_SPL` | Use SPL functions for I/O access instead
422- of direct register accesses. Useful only for debugging and porting to other
423- CPU variants. Do not use for regular development.
424- `` |
425- `` |
426- `` |
427-
428-
429-
430-
431- # ### Use of the timers
432- timer1 : PWM for PC6, PC7 (8,9), could be used for ADC
433- timer2 : PWM for PA3 (2)
434- timer4 : millis()
435-
436- # ### ADC
437- the prescaler is initialised for an ADC clock in the range of 1..2 MHz. The
438- minimum prescaler value is 2, so for a clock speed of less than 2 MHz the
439- required minimum ADC clock frequency can not be reached anymore.
440-
441- # ### Mapping of logical pin numbers to register addresses
442- Die ganze Pin->Portadressen-Arithmetik könnte komlett entrümpelt werden. Statt
443- Tabellen fest im Code enthalten.
444-
445- # ### Inefficient compilation
446- `digitalWrite` wird spektakulär umständlich übersetzt. Hier lohnt sich
447- Handassembler.
448-
449- # ### Accessing the alternate pin functions
450- Added `alternateFunction()` to allow switching of some pins to their alternate
451- functions. This allows for three more PWM pins, but maybe it adds to much
452- complexity for the Arduino API. Not sure if it should stay. Has to be
453- enabled by defining `SUPPORT_ALTERNATE_MAPPINGS`.
454-
455330
456331# ## Performance compared with the original Arduino environment
457332
@@ -475,12 +350,3 @@ a library.
475350|02. Digital/ |
476351|Debounce |192 |2016 |digital
477352
478-
479-
480- # ## Useful CPU features that are not supported by the Arduino API
481-
482- **Input-Capture-Mode :** Available for all four channels, at least for timer1. Would be great for precise time measurements. Maybe build a library?
483-
484- **Encoder interface mode :** Kann von Haus aus mit Quadratur-Encodern umgehen
485- und in Hardware zählen -> perfekt für die Druckerschlitten-Motorsteuerung.
486-
0 commit comments