Reply to topic  [ 27 posts ]  Go to page Previous  1, 2, 3
W1209 Temperature control Switch (HCTHER0006) 
Author Message

Joined: Sat May 13, 2017 12:43 pm
Posts: 22
Post Re: W1209 Temperature control Switch (HCTHER0006)
There is a development release of STM8EF for the W1209 with full duplex serial communication through the key pins. I find it much easier to use. The keys still work (!)

How-To:
* get a W1209, erase the chip if necessary
* flash the W1209-FD.ihx binary
* connect the serial interface (+key pin near LED display -> TxD, -key -> RxD)
* use terminal program "9600/N/8/1"

The binary is here: https://github.com/TG9541/stm8ef/files/ ... apshot.zip

An issue on github mentions this thread, and @barewires!
https://github.com/TG9541/stm8ef/issues/42


Sun Jul 23, 2017 7:31 am
Profile

Joined: Wed Aug 21, 2013 7:38 am
Posts: 49
Post Re: W1209 Temperature control Switch (HCTHER0006)
Sorry for the duplicated information in this thread, but it is current.

It is typical that the 4 wire SWIM programmer interface is rarely 1:1, always verify the positions of the signals. Equally important is Vdd which is determined by looking at the voltage regulator part number on the top side. The W1209 has an AMS1117-5.0 which is normally powered from 12 volt (15 volt max on datasheet but HC specs rule) external screw terminals.

It is usually safe to program by back-feeding at the rated voltage, but be warned. The STLINK-V2 power should be on the 5 volt pin for this board. Only one power source at a time can be used. The voltage regulator requires a minimum of 6.5 volts plus the 0.7 volt diode drop so external power at the screw terminals should be a minimum of 7.2 volts.

I have traced the 4 pin header from top to bottom, located to the left of the LED.

Pin 4 is the GND at the board edge.
Pin 3 goes to pin 4 , ic STM8S003F TSSOP20 = NRST Reset
Pin 2 goes to pin 18, ic STM8S003F TSSOP20 = PD1/SWIM Interface to Debug or Programming
Pin 1 goes to +5.0 Vdc. Designated as square pad.

Checkout the HCDVBD0034 forum for details on installing the stm8flash burning utility.

On a Pi 3 or Pi Zero W: note the W1209 blaster part designation stm8s003?3 and the question mark and the dash small letter L for list below.
Code:
cd ~/stm8flash
./stm8flash -l | grep stm8s003
... stm8s003?3 ...

\ If you get programming errors then the next two lines must be run once.
 
echo "00 00 ff 00 ff 00 ff 00 ff 00 ff" | xxd -r -p > factory_defaults.bin
sudo ./stm8flash -c stlinkv2 -p stm8s003?3 -s opt -w factory_defaults.bin

sudo ./stm8flash -c stlinkv2 -p stm8s003?3 -s flash -w /home/pi/Downloads/out/W1209-FD/W1209-FD.ihx


In a few seconds the LED should display 4th meaning eForth is running - celebrate now! A convenient ground for the PL2303 UART dongle is by the top edge of the programming header. RxD is either pin at the top of the + button and TxD is the same on the - button. The bottoms of the switches are all common ground. I have it working using picocom at 9600/N81

Thanks Thomas, great work!
https://github.com/TG9541/stm8ef/wiki/B ... e-key-pins

hi
stm8eForth v2.2
ok

NVM
: sq DUP * . ;
: w WORDS ;
RAM
4 sq 16 ok

words
w sq IRET SAVEC RESET RAM NVM LOCKF ULOCKF LOCK ULOCK ADC@ ADC! ?KEYB P7S E7S WORDS .S DUMP ALLOT VARIABLE CREATE DOES> ] IMMEDIATE : ; OVERT ." $" ABORT" AFT REPEAT WHILE AHEAD ELSE THEN IF AGAIN UNTIL BEGIN +LOOP LOOP DO NEXT FOR $," COMPILE [COMPILE] LITERAL CALL, C, , ' [ NAME> \ ( .( ? . U. TYPE U.R .R CR SPACES SPACE NUF? KEY DECIMAL HEX str #> SIGN #S # HOLD <# DIGIT PACK$ ERASE FILL CMOVE @EXECUTE PAD HERE COUNT +! DEPTH PICK 0= ABS NEGATE NOT 1+ 1- 2+ 2- 2* 2/ EXG */ */MOD M* * UM* / MOD /MOD M/MOD UM/MOD WITHIN MIN MAX < U< = DNEGATE 2DUP ROT ?DUP FILE HAND BG TIM BL OUT last '?KEY 'EMIT hld BASE - 0< OR AND XOR + UM+ OVER SWAP DUP 2DROP DROP NIP >R R@ R> I C! C@ ! @ B! 2C@ 2C! 2@ 2! EXIT EXECUTE LEAVE EMIT ?KEY TX! ?RX hi 'BOOT BKEY OUT! COLD ok

cold \erases words except those added during NVM / RAM non-volatile memory (flash) mode.
stm8eForth v2.2
ok

reset \erases all
stm8eForth v2.2
ok

Note the relay coil is 12 volt and will not activate at 5 volt but the LED will light.

\ activate the relay 63 mA @ 12 volt external power in through the screw terminals
1 OUT!

\ deactivate the relay 11 mA @ 12 volt
0 OUT!


Mon Jul 24, 2017 2:21 pm
Profile

Joined: Sat May 13, 2017 12:43 pm
Posts: 22
Post Re: W1209 Temperature control Switch (HCTHER0006)
STM8EF v2.2.13 was released today - the "full duplex serial interface" through the key pins is now "officially" supported! The old "half-duplex" interface through the sensor header is still available.

On hackaday someone asked for a thermostat with serial interface for data logging. This sounds interesting!

Edit: there is now a W1209 thermostat code repository on GitHub, and a Hackaday project.


Sat Aug 05, 2017 5:31 pm
Profile

Joined: Wed Aug 21, 2013 7:38 am
Posts: 49
Post Re: W1209 Temperature control Switch (HCTHER0006)
The 470nF capacitor "C1" (the one next to the sensor connector) now needs to be replaced on the W1209 PCB if it was removed when the sensor input was made dual-purpose as serial communications.
https://github.com/TG9541/stm8ef/wiki/Board-W1209


Sat Sep 16, 2017 5:39 pm
Profile

Joined: Wed Aug 21, 2013 7:38 am
Posts: 49
Post Re: W1209 Temperature control Switch (HCTHER0006)
Check out the parallel forum on the STM8S103F3 Development Board (HCDVBD0034)
viewtopic.php?f=87&t=2180


Sun Oct 01, 2017 11:01 am
Profile

Joined: Wed Aug 21, 2013 7:38 am
Posts: 49
Post Re: W1209 Temperature control Switch (HCTHER0006)
Just updated W1209 to ver 2.2.17 and dumped flash and saw all remnants of previous words in the dictionary. How about padding the remaining 3K flash with 00 for readability?

https://github.com/TG9541/stm8ef/issues/84

I thought about writing another memory to intel hex file converter (how many times I've done that since the mid 70s, but time is running out for me). So I read -r a new blank chip with
./stm8flash -c stlinkv2 -p stm8s003?3 -s flash -r newblankchip.ihx
and had my empty flash template within seconds.


Sun Oct 01, 2017 4:41 pm
Profile

Joined: Sat May 13, 2017 12:43 pm
Posts: 22
Post Re: W1209 Temperature control Switch (HCTHER0006)
News: the first version of the W1209 Data Logging Thermostat firmware is ready:

https://github.com/TG9541/W1209/releases/tag/0.1.0

This took some time (the project was started in August). However, installing the binary is simple, and it works as advertised. The data logger is still very basic, but there is enough free Flash memory for more features.

The Menu is very usable even if there are some minor quirks (e.g. holding the set key leads to a main/select/edit/set cycle ;-) )


Sun Nov 26, 2017 6:11 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 27 posts ]  Go to page Previous  1, 2, 3

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Thank you to phpBB.com & phpBB.ro.
Design created by Florea Cosmin Ionut.
© 2011 All contents of this site are © Hobby Components LTD