Skip to content

Instantly share code, notes, and snippets.

Thomas TG9541

  • Germany
Block or report user

Report or block TG9541

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@TG9541
TG9541 / ntctheta
Created Mar 17, 2019
W1209 style NTC sensor signal to temperature conversion with LPF and un-chatter (GND -- NTC -(Ain)- 20k -- VCC)
View ntctheta
\ 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
@TG9541
TG9541 / SerialAscCoilsTest.java
Created Feb 23, 2019
JAMOD FC01 "Read Coils" with MODBUS ASCII protocol
View SerialAscCoilsTest.java
/**
* 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
@TG9541
TG9541 / USBaspLoader-for-USBasp.hex
Created Jan 12, 2019
An USBaspLoader modified to work on a USBasp dongle. Plug in with JP1 closed to start in USBaspLoader mode. Of course, the USBasp firmware can be loaded onto the USBasp with the USBaspLoader :-)
View USBaspLoader-for-USBasp.hex
:101800004BC07FC064C063C062C061C060C05FC0C5
:101810005EC05DC05CC05BC05AC059C058C057C0F4
:1018200056C055C054C00000EC2DFD2DB7B6B0FC1D
:10183000FDCF27BFE895B7B6B0FCFDCF21E1B7B625
:10184000B6FCF4CF089509021200010100803209AC
:10185000040000000000000012011001FF00000859
:10186000C016DC050201010200010E035500530001
:1018700042006100730070001C037700770077005E
:101880002E00660069007300630068006C002E0083
:10189000640065000403090411241FBECFE5D4E0F1
@TG9541
TG9541 / BUSCTRL
Last active Jan 17, 2019
Very simple but extensible MODBUS server for STM8 eForth
View BUSCTRL
\ 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 ( -- )
@TG9541
TG9541 / MBPROTO
Created Jan 5, 2019
MODBUS protocol implementation
View MBPROTO
#require UARTISR
#require CRC16
#require ]B!
#require WIPE
NVM
: mbslv ( -- c )
;
\ get MODBUS FC
@TG9541
TG9541 / MBCRC
Created Jan 2, 2019
STM8 eForth dependencies of MBTEST
View MBCRC
#require UARTISR
#require CRC16
#require WIPE
NVM
: mbslv ( -- c )
rxbuf C@
;
: mbfc ( -- c )
@TG9541
TG9541 / SerialDOTest.java
Created Jan 2, 2019
CLI test for MODBUS RTU FC05 "Write Single Coils" with JAMOD
View SerialDOTest.java
/**
* 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
@TG9541
TG9541 / SerialCoilsTest.java
Created Jan 2, 2019
CLI test for MODBUS RTU FC01 "Read Coils" with JAMOD
View SerialCoilsTest.java
/**
* 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
@TG9541
TG9541 / RS485DE
Created Jan 2, 2019
TM8 eForth MODBUS - stubs for bus media access
View RS485DE
\ STM8 eForth MODBUS stubs for bus media access
\res MCU: STM8S103
\res export PB_ODR PB_DDR
#require ]B!
NVM
\ Set RS485 Driver to "RX"
: RS485rx ( -- )
@TG9541
TG9541 / MBTEST
Last active Jan 2, 2019
Minimal MODBUS test program
View MBTEST
#require MBCRC
#require 'IDLE
VARIABLE coils
: process ( -- )
rxp @ 2- ( a1 ) DUP rxbuf ( a1 a1 a0 ) MBCRC
( a1 crc-le ) SWAP @ =
CR CR
( crc-ok ) IF
You can’t perform that action at this time.