Search found 23 matches

by Alfredo
Sat Jul 08, 2017 8:07 pm
Forum: ST Microelectronics
Topic: STM8S103F3 Development Board (HCDVBD0034)
Replies: 22
Views: 11813

Re: STM8S103F3 Development Board (HCDVBD0034)

Now it's just a small step to playing a tune in the background: * a words to represent musical notes * maybe some kind of ADSR simulation using the PWM duty cycle * some kind of action table * a background task that interprets the action table Actions can also be percussion elements, e.g. an annoy b...
by Alfredo
Sat Jul 08, 2017 10:02 am
Forum: ST Microelectronics
Topic: STM8S103F3 Development Board (HCDVBD0034)
Replies: 22
Views: 11813

Re: STM8S103F3 Development Board (HCDVBD0034)

Frequency generation with the Buzzer output is very limited. Playing a tune wouldn't sound 'nice'. There is an example for Timer1 and PWM usage on HackaDay here . The SFR addresses can be found here . It wouldn't be difficult to control a servo with it. I turned the example into a frequency generato...
by Alfredo
Wed Jul 05, 2017 5:38 am
Forum: ST Microelectronics
Topic: STM8S103F3 Development Board (HCDVBD0034)
Replies: 22
Views: 11813

Re: STM8S103F3 Development Board (HCDVBD0034)

Nice!

Silencing should work by resetting the BEEPEN bit:

Code: Select all

: BEEPEN BEEP_CSR 5 B! ;
30 beep  \ 2kHz
0 BEEPEN \ off
1 BEEPEN \ on
: silence 0 BEEPEN ; 
silence  \ should be better now
I don't have a beeper connected to my board, so no test.
by Alfredo
Tue Jun 27, 2017 2:50 pm
Forum: Sensors
Topic: W1209 Temperature control Switch (HCTHER0006)
Replies: 27
Views: 61585

Re: W1209 Temperature control Switch (HCTHER0006)

Hi Barewires, I think you'll like this: https://wiki.forth-ev.de/doku.php/en:projects:e4thcom

4ethcom is a terminal for embedded eForth system with many features (e.g. a half-duplex mode). It also runs on the Pi!
by Alfredo
Mon Jun 26, 2017 8:25 pm
Forum: ST Microelectronics
Topic: STM8S105K4 Development board (HCDVBD0018)
Replies: 6
Views: 14766

Re: STM8S105K4 Development board (HCDVBD0018)

Nice :-) A "TTL" serial interface adapter needs to be connected to PD5, PD6, and GND, and nothing should ever be connected to "VCAP" :-) I just looked it up: the LED is connected to PE5 - it's supported by the OUT! word. This means that the following "blinky" Forth code should work: \ Blinky using t...
by Alfredo
Fri Jun 16, 2017 8:51 pm
Forum: Sensors
Topic: W1209 Temperature control Switch (HCTHER0006)
Replies: 27
Views: 61585

Re: W1209 Temperature control Switch (HCTHER0006)

Barewires,

-oout works for me (-o out works, too, but strangely -m stm8 doesn't work). This sounds like a (benign) bug in SDCC.

What's your version of SDCC ( sdcc --version)?
by Alfredo
Mon Jun 05, 2017 9:41 pm
Forum: Sensors
Topic: W1209 Temperature control Switch (HCTHER0006)
Replies: 27
Views: 61585

Re: W1209 Temperature control Switch (HCTHER0006)

I think that the trick with the W1209 half-duplex serial is that "TTL style serial" is negative logic, and it even works with open collector outputs and a pull-up: * The diode effectively converts the serial interface's push-pull output into "open collector" (or open drain). * The terminal program r...
by Alfredo
Sun Jun 04, 2017 9:19 pm
Forum: Sensors
Topic: W1209 Temperature control Switch (HCTHER0006)
Replies: 27
Views: 61585

Re: W1209 Temperature control Switch (HCTHER0006)

Hi barewires, did you see the instructions in the W1209 wiki ? The serial interface uses some kind of single wire connection: . .----o CH340 TxD (5V) . | | . --- | . / \ 1N4148 20k . --- | . | PD6----*----->>-----*----o CH340 RxD | . J1.1 NTC header X <- C1 removed, or replaced with max. 22nF | . | ...
by Alfredo
Thu Jun 01, 2017 5:39 pm
Forum: Sensors
Topic: W1209 Temperature control Switch (HCTHER0006)
Replies: 27
Views: 61585

Re: W1209 Temperature control Switch (HCTHER0006)

There is a Forth introduction on the W1209 Forth web site: https://github.com/TG9541/stm8ef/wiki/STM8S-eForth-Programming It looks rather complete, but the word DUMP you showed was not mentioned. There is also a nice little word for inspecting the data stack: .S 1 2 3 4 5<enter> ok swap<enter> ok .S...
by Alfredo
Sun May 28, 2017 4:40 pm
Forum: Sensors
Topic: W1209 Temperature control Switch (HCTHER0006)
Replies: 27
Views: 61585

Re: W1209 Temperature control Switch (HCTHER0006)

Barewires, did you try using Picocom on the RaspPi as described in the docs? The page links to a Forth code transfer tool written in Python. https://github.com/TG9541/stm8ef/wiki/STM8S-eForth-Programming#transferring-forth-code After flashing Forth the W1209 is "naked" but there is some example code...