-
Example Code Wiki Page Updated
12/01/2018 at 10:28 • 0 commentsThe Example Code page in the STM8 eForth Wiki contained some seriously "under-hyped" projects, libraries and demos.
Some of the demos really deserve to be more "accessible" (search engines algorithms don't rank the beauty of code ;-) ). Here is one from the attic:
STM8 eForth W1209 based HC-SR04 Ultrasonic Distance Display
This code uses a W1209 and a HC-SR04
(or a compatible device for $0.75) to create an ultrasonic distance display. By controlling the relay, building an approximation detector, fill level controller, or some other embedded control device is easy.
Also see the discussion in Issue #136:
I received a HC-SR04 and connected it to a W1209 through PC3/TIM1_CH3 (the set key input). With the STM8S Timer1 puls-width measurement feature it works surprisingly well (up to about 3m). The W1219 doesn't have an input that's equally well suited, but I'm sure that something can be hacked with PD4/TIM2_CH1 (although the background task might have to use TIM1 then).
-
Now is a good time to start STM8 eForth with a STM8S103 Relay Board
11/01/2018 at 09:53 • 0 commentsNew: check out the new STM8 eForth MODBUS project on GitHub - the code is compatible with this board :-)
Some vendors on AliExpress give "11.11 Sale" rebates on STM8S103 Relay Boards: the lowest price I've found is at $7.11.
Even if you add the $1.85 for a ST-Link V2 clone, and the $0.60 for a RS232-USB adapter you'll stay below $10 for something that's not only good for experimenting with interactive embedded Forth, but that's also OK for real world control applications!
The C0135 image in the STM8 eForth Binary Release works from out of the box, and the STM8 eForth Wiki on Github has a page dedicated to the C0135 module.
-
Designing a Solar Control Board for STM8 eForth
10/29/2018 at 13:05 • 0 commentsSince our home's solar heating system needs a new controller I started designing a PCB with KiCad. I only need one SolBoard PCB for the solar heating - the others will be control or demo boards. To that end I decided to add Arduino-like connectors for mass-production "shields". I plan to make using any STM8S controller in a LQFP32 package with 0.8mm pitch possible (from STM8S003K3T6C up to STM8S208KBT6C).
There are a number of design decisions to take, e.g. how to ensure that the power supply that will survive at least two decades.
There are now some things to decide:
- Which power supply module to use?
- How to design surge and overload protection?
- How to do milling for insulation?
- Which type of ESP8266 and nRF24L01 module to use (e.g. external or PCB antenna)
I would be happy to receive advice from the community!
-
STM8S003F3P6 chips are getting cheaper again
10/18/2018 at 06:15 • 3 commentsEdit: I just noticed that today the STM8S207RBT6 breakout board shown below is on sale - I just ordered one for $2.92. STM8S103F3P6 breakout boards are at $0.76 (both including international shipping fees).
About a year ago the price for STM8S003F3P6 chips (8K Flash, 1K RAM, nominal 128 bytes EEPROM) rose from $0.20 to up to $0.80, exceeding the price of the identical but higher rated device STM8S103F3P6 (8K Flash, 1K RAM, 640 bytes EEPROM). That was the time when manufacturers started to use Nuvoton N76E003AT20 chips (an almost pin compatible MCS51 style device) instead of the no longer cheap STM8S chip in many low cost boards. Ordering $1.50 boards, like the W1209, led in most cases to a disappointment.I regularly checked the price of common STM8 devices to get an indication of future developments: it turned out that some devices sometimes got very cheap, like the STM8S903K3T6C dropping to below $0.30 until Chinese manufacturers found out that it can be used as a replacement for the STM8S103K3T6C.
Now, the "hobbyist purchase price" for STM8S003F3P6 devices drops again below $0.40. It will take a lot to turn it into the default choice for a low cost electronics, but let's see what happens - maybe ST will push "fatter" 8-bitters into the low price bracket.
In the meantime experimenting with STM8S207RB devices got cheaper:
on usual Chinese market sites a low cost (about $3.50) "STM8S207RBT6 Development Board" has appeared:
up to 32K Flash can be used for Forth programs, and up to 96K Flash can be used for storing data. 6K RAM should be sufficient even for most applications. The STM8S207RB binary from the Github Releases page should work without modification.
-
STM8 eForth Solar Heating Controller on HaD
09/26/2018 at 18:02 • 0 commentsMy old PIC16F84 based solar heating controller started acting up, and I started a little project on HaD to build a replacement based on STM8 eForth.
To make things more interesting (and useful) I added nRF24L01 data transmission.
-
STM8L051F3 improvements and other updates
09/16/2018 at 06:36 • 0 commentsSome updates about the project:
- @Eelco provided ADC support for STM8L devices, and he also fixed an issue with the RTC code
- there are activities to bring the e4thcom method to Windows (Windows 10 WSL would be a nice way to sidestep restrictions on file names)
- some of the docs on GitHub have been updated for social criteria (avoid frightening first time visitors with Forth jargon etc.)
Even though the dominance of low-end STM8S devices for low-cost electronics in China has come to a surprisingly sudden end the STM8 eForth community is doing well. The current focus is on custom PCBs, and on boards where replacing a Nuvoton MCS51 controller with a STM8S003F3P6 is worth the effort.
I'm right now hacking a quick replacement for a PIC16F84 based solar heating control that I made about 15 years ago (thanks to STM8 eForth making new is much more attractive than repairing a prototype board with a rats nest of wires ;-) ).
-
STM8S903K3 and STM8S001J3
06/24/2018 at 07:53 • 0 commentsThe STM8S903K3T6C is an upgraded "application specific" STM8S low-density device with 7 ADC channels, an internal bandgap reference, re-mappable UART pins, and the cascaded timer features of the medium/high-density devices. All other features are identical to the STM8S103K3T6C (pin-out, memory 8K Flash, 640 byte EEPROM).
For the same unfathomable reason that now made the "Value Line" STM8S003F3P6 more expensive than the higher rated "Access Line" STM8S103F3P6 the upgraded low density chip is available for as little as $0.32/piece (I bought my supply at an even lower price), and low-cost break-out boards are suddenly appearing on AliExpress, TaoBao and the like.I updated the notes on the STM8S001J3 in the Wiki because, when comparing the datasheet, I noticed that this chip quite obviously is an STM8S903 and not an STM8S003: some of the additional features are listed, even if the docs were mostly copied from the STM8S003. I have no idea what this should be good for since a subset of STM8S903 features has been documented, and replacing the chip with generic low-density won't work. Using the bandgap reference works (at 3.3V supply 7 ADC! ADC@ . results in approx. 400), the specified 16bit timer Timer2 is indeed a Timer5 and the 8bit timer Timer4 is a Timer6 (the additional configuration bits are present). For hobby projects it should be safe to use both feature groups. For product use I would talk with the ST sales team first.
-
STM8 eForth 2.2.22 released
05/28/2018 at 17:57 • 1 commentAfter 10 weeks, and 4 pre-releases, there is again a new STM8 eForth release. Most of the new features have already been presented here. New and noteworthy is the following:
- XY-PWM (HW-0515): support for a cheap dual PWM board (thanks to @Ivan Alf ),
- STM8L Discovery support (also thanks to Ivan), more driver code for the STM8L (e.g. RTC and SPI) (once more, thanks to Ivan).
- The STM8S initialization word for SPI, SPIon, was changed to match the STM8L implementation, and example code for SPI, e.g. the Nokia 3310 display demo code, has been updated.
Have a look at the release notes!
-
Making PCBs again: STM8L051F3P6 with nRF24L01+
05/12/2018 at 22:53 • 2 commentsEdit: I made a new HaD project for this :-)
My first PCB after 25 years, and the first PCB I ordered ever.
OK, just a breakout board, but at least I made it with KiCad 5.0.0.rc2, and I ordered it from @oshpark. I must say that PCB tools have come a long way since the humble version of EAGLE which I used in the early 90s. The KiCad tutorials I found are excellent (especially those by Contextual Electronics), but it was the Cern tutorials that convinced me that the hours learning would be well spent.
I found the KiCad workflow natural, and the fact that symbols can be combined with footprints was a nice surprise. My first steps were with the stable KiCad4, but since KiCad5 is where the users are switched after a couple of hours.
This schematic is battery powered STM8L051F3P6 with nRF24L01+ (or rather SI24R1) .
Ordering PCBs was also much easier than I thought, and navigating the different cheapo PCB offers, including checking Gerber files was rather easy. However, for 3pcs small purple PCBs, OSHPark is as good as it gets (in case someone is interested, the PCBs are here).
Edit: the KiCad files are here on GitHub.
-
Announcing XY-LPWM Board Support in STM8 eForth
05/11/2018 at 10:01 • 5 commentsEDIT: I received both the XY-LPWM and XY-PWM board yesterday. As expected, the Nuvoton chip on the XY-LPWM had to be replaced by a STM8S003F3P6, and a 1uF 0603 capacitor had to be added, but that was quickly done. The XY-PWM for $1.65 came with the required controller, and both worked right after flashing - nice work @Ivan Alf!
=======================================================
@Ivan Alf contributed board support for the Chinese board XY-LPWM in his GitHub fork plumbum/stm8ef:
I never understood what people use "PWM boards" for, but this one, and the slightly cheaper 2CH PWM Generator board both provide a serial interface. Which is really nice for interactive Programming with Forth!
The board provides a 2x4 digit LCD display with a HT1621 LCD controller:
Like many STM8S003F3P6 based boards these days, there is a big risk that the board you rceive has a "pin compatible" Nuvoton N76E003AT20 µC, a controller with an 8051 like core. Better be prepared to do some soldering when you order this board!
Hint: sometimes STM8S103F3P6 chips are cheaper than the lower rated STM8S003F3P6.