Pin STM Connected to
1 PD4 dig 1
2 PD5 seg A
3 PD6 seg F
4 NRST R - VSS
5 PA1 seg DP
6 PA2 seg D
7 VSS GND
8 Vcap Cap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\ Minimal MODBUS server with a single FC handler | |
\ | |
\ Features: | |
\ * implements FC15 "Write Multiple Coils" | |
\ * prints debug infos to the console | |
\ | |
\ Example output for 96008N1, Node=1, FC=15 Addr=22, N=10, Data=111... | |
\ | |
\ coils 10 0 fill ok | |
\ ok |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; starting from B! ( t a u -- ) | |
; t a u | |
; 1 $100 7 | |
; bit# Addr Bool | |
; 00 01 01 00 FF FF | |
; == --- ===== ===== | |
; 72 1F 01 00 81 FF | |
; X 1,X 2,X 4,X |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# | |
# codeload3.py - a mostly e4thcom compatible Forth loader | |
# | |
# The MIT License | |
# | |
# Copyright (c) 2020 TG9541 | |
# | |
# Permission is hereby granted, free of charge, | |
# to any person obtaining a copy of this software and |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\ W1209 temperature measurement with filter and noise suppression | |
\ © 2017 TG9541, refer to https://github.com/TG9541/W1209/blob/master/LICENSE | |
\ Note: W1209 thermostats may require adjustment, | |
\ especially when used outside the range of -5C to +20C | |
\ Refer to https://github.com/TG9541/W1209/wiki/W1209-Sensor | |
RAM | |
900 CONSTANT USENSMAX \ max temperature |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Copyright 2002-2010 jamod development team | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:101800004BC07FC064C063C062C061C060C05FC0C5 | |
:101810005EC05DC05CC05BC05AC059C058C057C0F4 | |
:1018200056C055C054C00000EC2DFD2DB7B6B0FC1D | |
:10183000FDCF27BFE895B7B6B0FCFDCF21E1B7B625 | |
:10184000B6FCF4CF089509021200010100803209AC | |
:10185000040000000000000012011001FF00000859 | |
:10186000C016DC050201010200010E035500530001 | |
:1018700042006100730070001C037700770077005E | |
:101880002E00660069007300630068006C002E0083 | |
:10189000640065000403090411241FBECFE5D4E0F1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\ STM8 eForth C0135 bus control for RS485 - MODBUS | |
\res MCU: STM8S103 | |
\res export PB_ODR PB_DDR | |
#require ]B! | |
NVM | |
\ Set RS485 Driver to "RX" | |
: BUSrx ( -- ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#require UARTISR | |
#require CRC16 | |
#require ]B! | |
#require WIPE | |
NVM | |
: mbslv ( -- c ) | |
; | |
\ get MODBUS FC |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#require UARTISR | |
#require CRC16 | |
#require WIPE | |
NVM | |
: mbslv ( -- c ) | |
rxbuf C@ | |
; | |
: mbfc ( -- c ) |