|
1 | | -## Sduino: Small Devices Arduino |
| 1 | +# Sduino: Small Devices Arduino |
2 | 2 |
|
3 | | -Getting started on the STM8 CPU the easy way by using an Arduino-like |
4 | | -programming API. |
| 3 | +**Getting started on the STM8 the easy way.** |
5 | 4 |
|
6 | | -It fully integrates with the Arduino IDE or it can be used |
7 | | -independently (GUI-less) with very easy Makefiles based on the amazing |
8 | | -[Arduino.mk makefile](https://github.com/sudar/Arduino-Makefile) by |
9 | | -[Sudar](http://sudarmuthu.com>). |
| 5 | +An Arduino-like programming API that can be used from within the Arduino IDE |
| 6 | +or for Makefile-controlled builds. |
10 | 7 |
|
11 | | -This project is based on free tools that are available for Linux, MacOS, and |
12 | | -Windows: SDCC, make, and stm8flash. Since it's based on the SDCC Small |
13 | | -Devices C compiler, I called it "Small Devices -uino" or "Small-duino". |
| 8 | + * [Project website](https://tenbaht.github.io/sduino/) for more |
| 9 | + information on supported hardware and the programming API |
| 10 | + |
| 11 | + * [github issue tracker](https://github.com/tenbaht/sduino/issues) for bug |
| 12 | + reports and other issues tightly related to the repository content |
| 13 | + |
| 14 | + * The [STM8 board](http://stm32duino.com/viewforum.php?f=52) of the |
| 15 | + stm32duino forum: For general discussions and suggestions |
| 16 | + |
| 17 | +Since this project is based on the SDCC Small Devices C compiler, I called |
| 18 | +it "Small Devices -uino" or "Small-duino". It is entirely based on free |
| 19 | +tools that are available for Linux, MacOS, and Windows: SDCC, make, and |
| 20 | +stm8flash. |
14 | 21 |
|
15 | 22 | This project is not supposed to be “better than Arduino”. It’s purpose |
16 | 23 | is to give you a head start into a different CPU architecture if you happen |
17 | 24 | to have a professional need or a private desire for it. |
18 | 25 |
|
19 | | -Please find more detailed information about the supported boards, the needed |
20 | | -tools and the library APIs on the |
21 | | -[project website](https://tenbaht.github.io/sduino/). |
22 | | - |
23 | | -For bug reports and other issues tightly related to the repository content |
24 | | -please use the |
25 | | -[github issue tracker](https://github.com/tenbaht/sduino/issues). |
26 | | - |
27 | | -For general discussions and suggestions on Sduino it might be more |
28 | | -convinient to open a thread on the |
29 | | -[STM8 board](http://stm32duino.com/viewforum.php?f=52) of the stm32duino |
30 | | -forum. It will help to catch my attention to prefix your topic with |
31 | | -"[sduino]". |
32 | 26 |
|
33 | 27 |
|
34 | 28 | ## Installation |
35 | 29 |
|
36 | 30 | Starting with version 0.3.0 automatic IDE integration is supported via the |
37 | 31 | Arduino Boards Manager. This is the recommanded way of installation now. For |
38 | | -a manual non-IDE installation please check the full [installation |
39 | | -instructions](https://tenbaht.github.io/sduino/install/). |
40 | | - |
41 | | -Arduino IDE versions 1.8.5 and 1.6.13 are tested, but any version >=1.6.6 |
42 | | -should work. |
43 | | - |
44 | | -Supported Systems: |
45 | | - |
46 | | -* Linux 64 bit: Tested on Ubuntu 16.04 |
47 | | -* Linux 32 bit: Tested on Ubuntu 16.04 |
48 | | -* Windows: Tested on Windows 7. Sduino might work on XP (not tested), but |
49 | | - the ST-Link/V2 driver is not available anymore for XP. |
50 | | -* MacOS: Not tested, but should be very close to working. Will need a manual |
51 | | - install, but IDE integration should be easy now. Any volunteers? |
52 | | - |
53 | | -Start the Arduino-IDE. In File->Preferences, Settings tab, enter |
54 | | - |
55 | | - https://github.com/tenbaht/sduino/raw/master/package_sduino_stm8_index.json |
56 | | - |
57 | | -as an Additional Boards Manager URL. |
| 32 | +a manual non-IDE installation please check the [manual installation |
| 33 | +instructions](https://tenbaht.github.io/sduino/usage/manual-install/). |
58 | 34 |
|
59 | | -Open Tools->Board:...->Boards Manager. Find Sduino by typing 'sd' into |
60 | | -the search line. Click on the list entry, Click on Install. |
| 35 | +Start the Arduino-IDE. In *File->Preferences*, *Settings* tab, enter |
61 | 36 |
|
62 | | -Now you should find a new entry "STM8S Boards" in the list at |
63 | | -Tools->Board:... Choose *STM8S103F3 Breakout Board* from the list, open the |
64 | | -standard Blink example from File->Examples->01. Basics->Blink and compile it |
65 | | -by hitting 'Verify'. |
| 37 | +> https://github.com/tenbaht/sduino/raw/master/package_sduino_stm8_index.json |
66 | 38 |
|
| 39 | +as an *Additional Boards Manager URL*. |
67 | 40 |
|
| 41 | +* Open *Tools->Board:...->Boards Manager* |
| 42 | +* Find Sduino by typing 'sd' into the search line |
| 43 | +* Click on the list entry |
| 44 | +* Click on *Install*. |
68 | 45 |
|
69 | | -### Uploading to the board |
| 46 | +Now you should find a new entry *STM8S Boards* in the list at |
| 47 | +*Tools->Board:...* |
70 | 48 |
|
71 | | -To upload the compiled sketch to the hardware you need an ST-Link/V2 |
72 | | -compatible flash programmer. They are very cheap, starting at $2.50 on |
73 | | -Aliexpress or eBay. |
| 49 | +* Choose *STM8S103F3 Breakout Board* from the list |
| 50 | +* open the standard Blink example from *File->Examples->01. Basics->Blink* |
| 51 | +* compile it by hitting *Verify* |
74 | 52 |
|
75 | | -#### ST-Link/V2 for Linux |
76 | 53 |
|
77 | | -Required lines in /etc/udev/rules.d/99-stlink.rules: |
| 54 | +## Included libraries |
78 | 55 |
|
79 | | - # ST-Link/V2 programming adapter |
| 56 | +Most parts of the Arduino core system and some Arduino libraries are already |
| 57 | +ported to C-syntax. The resulting API is still very close to the C++ version |
| 58 | +and porting an existing application is not hard. Check out the [migration |
| 59 | +guide](https://tenbaht.github.io/sduino/api/migration/) for details. |
80 | 60 |
|
81 | | - # ST-Link V1, ST-Discovery boards |
82 | | - ATTR{idVendor}=="0483", ATTR{idProduct}=="3744", MODE="0666", GROUP="pl |
83 | 61 |
|
84 | | - # ST-Link/V2, the china adapter with the green plastic housing |
85 | | - ATTR{idVendor}=="0483", ATTR{idProduct}=="3748", MODE="0666", GROUP="pl |
| 62 | +#### Communication |
86 | 63 |
|
| 64 | +* SPI: Real hardware-SPI up to 10MHz. |
| 65 | +* I2C: Port of the I2C master library by Wayne Truchsess |
| 66 | +* HardwareSerial: The standard serial interface. |
87 | 67 |
|
| 68 | +#### Displays |
88 | 69 |
|
89 | | -#### ST-Link/V2 for Windows |
| 70 | +* LiquidCrystal: HD44780 based text LCDs |
| 71 | +* PCD8544: Monochrome graphical LCD based on the PCD8544 controller like the |
| 72 | + Nokia 5110 display. SPI mode only. |
| 73 | +* Mini_SSD1306: SSD1306-based monochrome OLED displays with 128x64 pixels. |
| 74 | + I2C support only. |
90 | 75 |
|
91 | | -Download and install the ST-Link/v2 driver **before you plug in the flash |
92 | | -tool**: [STSW-LINK009 driver download] |
93 | | -(http://www.st.com/en/development-tools/stsw-link009.html) (Registration |
94 | | -required, but very easy) |
| 76 | +#### Motor control |
95 | 77 |
|
96 | | - |
97 | | -#### Serial upload |
98 | | - |
99 | | -Most larger STM8 CPUs (unfortunately not the popular STM8S103) even come |
100 | | -with a builtin bootloader. Support for programming via a simple serial |
101 | | -adapter for these devices is planned, but not implemented yet. |
| 78 | +* Stepper: Stepper motors with 2, 4 or 5 phases. |
| 79 | +* Servo: Up to 12 servos using only 1 timer. |
102 | 80 |
|
103 | 81 |
|
104 | 82 |
|
105 | 83 | ## Compatibility with the Arduino world |
106 | 84 |
|
107 | | -Unfortunatly there is no free C++ compiler for the STM8. This makes it |
108 | | -impossible to do a full 1:1 port of the whole enviroment as is has been done |
109 | | -for the STM32 and the ESP8266. |
| 85 | +Since there is no free C++ for the STM8, it is impossible to do a full 1:1 |
| 86 | +port of the whole enviroment as is has been done for the STM32 and the |
| 87 | +ESP8266. |
110 | 88 |
|
111 | 89 | This is not a drop-in replacement for an AVR, but thanks to some C |
112 | 90 | preprocessor magic the programming API is still very, very similar and it is |
113 | 91 | often enough to just move over the opening bracket of the class |
114 | 92 | instanciation statement and to replace the dot in a method call for an |
115 | | -underscore. |
| 93 | +underscore. Check the [migration |
| 94 | +guide](https://tenbaht.github.io/sduino/api/migration/) for an overview. |
116 | 95 |
|
117 | 96 |
|
118 | 97 |
|
119 | | -## Library support |
| 98 | +## Supported Systems: |
120 | 99 |
|
121 | | -The most important libraries and parts of the Arduino core system are |
122 | | -ported for the STM8 already: analog input and output, digital input and |
123 | | -output, delay(), millis(), Serial, SPI, and I2C. |
124 | | - |
125 | | -There are ported versions of the standard libraries Servo, Stepper, and |
126 | | -LiquidCrystal for motor control and the popular text LCDs based on the |
127 | | -HD44780 controller. |
| 100 | +Arduino IDE versions 1.8.5 and 1.6.13 are tested, but any version >=1.6.6 |
| 101 | +should work. |
128 | 102 |
|
129 | | -For more sophisticated output there are libraries for Nokia-5110-type |
130 | | -graphical LCDs and SSD1306-based graphical OLED displays. |
| 103 | +* Linux 64 bit: Tested on Ubuntu 16.04 |
| 104 | +* Linux 32 bit: Tested on Ubuntu 16.04 |
| 105 | +* Windows: Tested on Windows 7. Sduino might work on XP (not tested), but |
| 106 | + the ST-Link/V2 driver is not available anymore for XP. |
| 107 | +* MacOS: Not tested, but should be very close to working. Will need a manual |
| 108 | + install, but IDE integration should be easy now. Any volunteers? |
0 commit comments