2017年8月26日星期六

STM8 eforth 实验

在 W1209 温控板上(板上的 MCU 是 STM8S003F3P6)测试了 eForth,可以工作,还需做更多实验。


计算机收到的一些字符显示不正常,原因不明,难道是因为没有用外部晶振导致的 timing 问题?例如,从串口发送 1 out! 到 stm8 后,返回的字符是 b outB ok, 而下面发送的 0 out! 返回又正常。


上图是把串口和 USB to TTL 板连接起来做通讯。STM8 上的 UART 被 NTC 占用了。于是用连接按键的 IO 模拟了一个 UART. 软件里有个目录是 W1209-FD, FD 的意思是 Full-Duplex,就是模拟全双工通讯。

接线:

+--------------+-------------------+----------+
| TTY com port | W1209-FD          | comments |
+--------------+-------------------+----------+
| GND          | GND               |          |
+--------------+-------------------+----------+
| TXD          | key "+"(PC4, RXD) | 2nd key  |
+--------------+-------------------+----------+
| RXD          | key "-"(PC5, TXD) | 3rd key  |
+--------------+-------------------+----------+


上面是测试 Leo Brodie 的书 Starting Forth 第一章中的例子。

链接
  1. eForth for STM8S Value Line and Access Line devices

3 条评论:

Gert 说...

Thanks for the blog entry!

The internal oscillator accuracy is usually not the problem.

Please try this:
```
NVM
: t4rel! ( $c8..$d8 -- ) $5348 c!;
RAM
```
I just tried it with an STM8S003F3: it worked from $C6 to $D4 (-9 / +5) which means it's about +2 off center.

Please feel free to contact me (just write an "issue" :-) ).

Gert 说...

Just to let you know: STM8EF v2.2.13 had a problem with compiling to Flash memory which was fixed in revision v2.2.16.

atommann 说...

Hi Gert,
Thank you for the updates! I'll try more. The STM8EF is really a cool project! Just love it.