Skip to content

Commit

Permalink
fixes #35 pre-loadable dig2tem, update to STM8 eForth 2.2.27.pre3
Browse files Browse the repository at this point in the history
  • Loading branch information
TG9541 committed Feb 21, 2021
1 parent 36af5be commit e5f4ae3
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 23 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ language: c
services:
- docker
before_install:
- docker pull tg9541/docker-sdcc:V3.8.6
- docker pull tg9541/docker-sdcc:V3.9.0
install:
- docker run -v `pwd`:/home tg9541/docker-sdcc:V3.8.6 /bin/sh -c "sdcc --version ;
- docker run -v `pwd`:/home tg9541/docker-sdcc:V3.9.0 /bin/sh -c "sdcc --version ;
sstm8 -version"
script: docker run -v `pwd`:/home tg9541/docker-sdcc:V3.8.6 /bin/sh -c "cd /home &&
script: docker run -v `pwd`:/home tg9541/docker-sdcc:V3.9.0 /bin/sh -c "cd /home &&
make release"
deploy:
provider: releases
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
STM8EF_BOARD=W1209-FD
STM8EF_VER=2.2.25
STM8EF_VER=2.2.27.pre3
STM8EF_BIN=stm8ef-bin.zip
STM8EF_URL=https://github.com/TG9541/stm8ef/releases/download/${STM8EF_VER}/${STM8EF_BIN}

Expand Down
21 changes: 21 additions & 0 deletions dig2tem
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
\ dig2tem - W1209 STM8 eForth digit-to-temperature table
\ primary table for boards w/ R2 = 20k

\ note: adjust to specific sensor here if accuracy is required!
\ note: @inter accepts 2..n value pairs
\ interpolation table ADC digits * 32 -> temperature * 10
CREATE dig2tem 14 , \ number of value pairs
1216 , 1100 , \ 1 1216 -> 11.0 C
1534 , 1000 , \ 2
1982 , 900 , \ 3
2560 , 800 , \ 4
3296 , 700 , \ 5
4320 , 600 , \ 6
5634 , 500 , \ 7
7370 , 400 , \ 8
9632 , 300 , \ 9
12382 , 200 , \ 10
15522 , 100 , \ 11
19012 , 0 , \ 12
20768 , -50 , \ 13
22466 , -100 , \ 14 22466 digits -> -10.0 C
25 changes: 25 additions & 0 deletions dig2tem-5k1
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
\ dig2tem-5k1 - alternative table for boards w/ R2 = 5k1
\ by @BigVulcanDeal - see https://f.ls/YtCBi
\ hint: #include dig2tem-5k1 to NVM using before loading measure.fs

\ note: adjust to specific sensor here if accuracy is required!
\ note: @inter accepts 2..n value pairs
\ interpolation table ADC digits * 32 -> temperature * 10
CREATE dig2tem 14 , \ number of value pairs
4405 , 1100 ,
5372 , 1000 ,
6697 , 900 ,
8156 , 800 ,
10031 , 700 ,
12263 , 600 ,
14760 , 500 ,
17478 , 400 ,
20324 , 300 ,
21701 , 250 ,
23108 , 200 ,
25565 , 100 ,
26509 , 00 ,
28559 , -50 ,
29371 , -100 ,


20 changes: 1 addition & 19 deletions measure.fs
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,7 @@
TARGET

#require @inter

\ note: adjust to specific sensor here if accuracy is required!
\ note: @inter accepts 2..n value pairs
\ interpolation table ADC digits * 32 -> temperature * 10
CREATE dig2tem 14 , \ number of value pairs
1216 , 1100 , \ 1 1216 -> 11.0 C
1534 , 1000 , \ 2
1982 , 900 , \ 3
2560 , 800 , \ 4
3296 , 700 , \ 5
4320 , 600 , \ 6
5634 , 500 , \ 7
7370 , 400 , \ 8
9632 , 300 , \ 9
12382 , 200 , \ 10
15522 , 100 , \ 11
19012 , 0 , \ 12
20768 , -50 , \ 13
22466 , -100 , \ 14 22466 digits -> -10.0 C
#require dig2tem

VARIABLE lpf.adc \ LPF memory for ADC value
VARIABLE lpf.tem \ LPF memory for temperature
Expand Down

0 comments on commit e5f4ae3

Please sign in to comment.