|
|
|
|
|
by elcritch
2523 days ago
|
|
Intriguing article. Just updated some Forth code for interfacing with an ADC on a sensor I’m building. Dealing with SPI/I2C and sensors/adc’s in Forth really is fantastic. The results in much more succinct hardware code IMHO than C or even higher level languages. Really Chuck Moore seems spot on when dealing with specific hardware. One example is a simple Forth word (macro) to convert 3 bytes into one 32 bit number integrates well into code for dealing with an adc chip. However I wouldn’t want to write while applications in Forth as dealing with stack swaps becomes annoying. Still writing your own Forth is pretty fun too. I did mine by basing C compiler XMacros which made porting to an Itsy M4 trivial (about 3-4 of work) [1]. Still there’s a few Forth’s for Arduino’s, Itsy’s, ESP’s [2] which are really fun as they enable repl style interactive programming with hardware while still being blindingly fast! 1: https://github.com/elcritch/forthwith
2: https://github.com/zeroflag/punyforth |
|