The first 1-wire low level sketch was nice - but since Brad J. Rodriguez has implemented high level code, e.g. the 0F0h "ROM Search" algorithm, for CamelForth it's maybe a better idea to re-use it!
The "onewire" source archive contains the CamelForth source file "onewire.f", MSP430 assembler code and some documentation. The assembler code implements the primitives OWRESET
(reset the bus) and OWSLOT
(write and read a bit).
Unlike the MSP430 files the low-level code doesn't need to be compiled into the kernel, and the configuration doesn't need to be fixed.
Here are the primitives in STM8 eForth (the words gpio.d
and gpio.i
carry the GPIO configuration into the code):
\ STM8 eForth "1-Wire" communication primitives