a simple multitask forth on ch32v003
make
[ ] PD1(SWIO) <------------> SWIO [ ]
[ CH32V003 ] VSS <------------> GND [ WCH LINK ]
[ ] VDD <------------> 3V3 [ ]
PD6 <-----------------------------> UART TX & RX
use this software download it into mcu:
https://www.wch.cn/downloads/WCH-LinkUtility_ZIP.html
PD6 provide half-duplex one wire uart
_____ _____ _____ _____ _____ | __| | __ |_ _| | | | __| | | -| | | | | |__| |_____|__|__| |_| |__|__| ITC FORTH on CH32V003 (rv32ec) CHIP UID: FE2AABCD6656BC5FFFFFFFFF 0x1 0x2 + . 00000003
baudrate is 921600
word header is optimized for ch32v003, please read source code
: star 0x2A emit ;
: stars dup if begin star 1- dup 0= until then drop ;
0x41 constant ascii-A
words
sysrst
You can save your environment into rom
romunlock rambakerase rompgon rambaksave rompgoff romlock
You can load your saved environment from rom
only recover data in ram, some data such as mmio register, riscv csr, can’t restore
rambakload
dogon
You can trig a watchdog reset:
: badloop begin false until ;
badloop
default systick use for a millis counter
systickon
dump ms count low 32bit:
mscountl ?
dump ms count high 32bit:
mscounth ?
ch32v003 only have 2KiB SRAM, don’t define a lot of task,
please define multi action in one task.
create a dummy task:
: dummytask begin yield false until task;
create a task display star per 1 sec
systickon
: star 0x2A emit ;
: startask begin yield 0x3E8 delayms star false until task;
- add doc for define a new word in asm file
- add i2c host driver
mit