Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for the W1701 board. #23

TG9541 opened this issue Apr 24, 2017 · 1 comment


Copy link

commented Apr 24, 2017


ICP header:

pin  connected to
1    [VCC] 5.0V 
2    PD1/SWIM
3    NRST
4    GND

Sensor header:

pin  connected to
1    GND
2    PD6/Ain6 - 20k - VCC

STM8S003F3 Signals

The STM8S003F3P6 on W1701 board is connected in the following way:

Pin	STM   Connected to
1	PD4   relay
2	PD5   n.c.
3	PD6   Rx,AIN6 ((5.0V-20k)-AIN6-(NTC10k||C)-GND)
4	NRS   J1.3
5	PA1   LED (low active)
6	PA2    n.c.
8	Vcap  C 
9	VDD   +5.0V
10	PA3   n.c.
11	PB5   n.c.
12	PB4   n.c.
13	PC3   n.c.
14	PC4   DIP6
15	PC5   DIP5
16	PC6   DIP4
17	PC7   DIP3
18	PD    /SWIM  J1.2
19	PD2   DIP2
20	PD3   DIP1

Hardware Description

Based on the above list the following can be said about the W1701:

  • the DIP switches are low-active
  • SWIMCOM will work fine
  • LED and relay can be controlled independently
  • the sensor input circuit is similar to W1209 and most other W1xxx thermostat modules

Other observations:

  • the DIP pads can be used as GPIO breakout
  • the 12V GND and the relay common contact are connected

Never use the relay for switching high voltage!

@TG9541 TG9541 created this issue from a note in Board Support (In Progress) Apr 24, 2017
@TG9541 TG9541 self-assigned this Apr 24, 2017
@TG9541 TG9541 added the enhancement label Apr 24, 2017

This comment has been minimized.

Copy link
Owner Author

commented Apr 26, 2017

The board won't be supported, but the SWIMCOM binary can be used for implementing input and output words.

Here is a starting point:

 file nvm
 variable out
 : out! ( n -- )   \ board outputs: 1 relay, 2 LED
   dup dup out !
   $01 and PD_ODR 4 b!
   $02 and not PA_ODR 1 b! ;
 : dip ( -- n )    \ read DIP switches 1..6 (not in order)
   PC_IDR C@ $F0 and
   PD_IDR C@ $0C and or 4 / ;
 : start ( -- )     \ GPIO settings
   $2  dup PA_DDR c! PA_CR1 c!
   $10 dup PD_DDR c! PD_CR1 c!
   0 out! hi ;
 ' start 'boot !
 ram hand

Here is SWIMCOM binary with the above code compiled-in:

@TG9541 TG9541 closed this Apr 26, 2017
@TG9541 TG9541 added the wontfix label Apr 26, 2017
@TG9541 TG9541 moved this from In Progress to Done in Board Support Apr 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
1 participant
You can’t perform that action at this time.