Pin STM Connected to
-------------------------------------
1 NRST
2 PA1 (Y1)
3 PA2 (Y1)
4 VSS digital ground
5 VCAP (C)
6 VDD power supply
7 AE3(VDDIO) AE3 (I/O power supply)
This file contains 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
: Clrdisplay ( -- ) \ clear anything showing | |
32 E7S 32 E7S 32 E7S ; |
This file contains 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 interactive RC-servo demo | |
\ set compilation target for STARTTEMP / ENDTEMP | |
: TARGET NVM ; | |
#require hw/pwm.fs | |
#require OPT! | |
#include STARTTEMP |
This file contains 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 ECHO | |
\ Make local echo in STM8 eForth optional | |
\ Note1: since this code patches TAP, and sets the startup word, | |
\ it should be loaded with #require ECHO | |
\ Note2: the RAM address of variable TAPECHO must be below 0x0100, | |
\ it's recommended to #require ECHO early on in the main file | |
\ Note3: this file sets the 'BOOT vector for initializing TAPECHO - | |
\ any startup code must execute this task! | |
#require TAP |
This file contains 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
RAM | |
#require TOKEN | |
#require >IN | |
#require .ID | |
#require .0 | |
NVM | |
: GET ( string -- ) | |
\ interpretion semantics: get and print variable | |
>IN @ TOKEN CR .ID ." =" | |
>IN ! ' EXECUTE |
This file contains 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
; STM8EF Global Configuration File | |
; Minimal config for STM8S Value Line, defaults with few extras (e.g. NVM) | |
HAS_CPNVM = 1 ; Can compile to Flash, always interpret to RAM | |
BAREBONES = 1 ; Remove or unlink some more: hi HERE .R U.R SPACES @EXECUTE AHEAD CALL, EXIT COMPILE [COMPILE] | |
WORDS_EXTRACORE = 1 ; Extra core words: =0 I | |
WORDS_EXTRAEEPR = 1 ; Extra EEPROM lock/unlock words: LOCK ULOCK ULOCKF LOCKF | |
; RESET RAM NVM LOCK ULOCK WORDS .S DUMP IMMEDIATE ALLOT VARIABLE CONSTANT CREATE ] : ; | |
; OVERT ." AFT REPEAT WHILE ELSE THEN IF AGAIN UNTIL BEGIN NEXT FOR LITERAL C, , ' CR [ |
This file contains 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 <# | |
\ #require $," | |
#require $" | |
\ #require $"| | |
#require # | |
#require #> | |
\ #require 0 | |
\ #require 1 | |
\ #require -1 | |
#require 2DROP |
This file contains 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 PAD | |
: SP@ ( -- a ) \ push current stack pointer | |
[ $9093 , \ LDW Y,X | |
$5A C, \ DECW X | |
$5A C, \ DECW X | |
$FF C, ] \ LDW (X),Y | |
; | |
: dict.free SP@ PAD - . ; |
This file contains 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
\res MCU: STM8S103 | |
\res export PA_ODR | |
\res export PA_DDR | |
\res export PA_CR1 | |
\res export PC_DDR | |
\res export PC_CR1 | |
#require ]B! | |
1 CONSTANT _COL \ PA1 low side KTY10 solar collector |
Do not provide source communication MODBUS code
MODBUS RTU communication instruction:
Modbus RTU instruction
Baud rate: 96008 NONE 1
OlderNewer