chochain / nanoFORTH

Forth for Arduino Nano - Interactive, Multi-tasking, EEPROM turnkey.
MIT License
27 stars 4 forks source link

Will this run on a Teensy? #1

Open znmeb opened 2 years ago

znmeb commented 2 years ago

I have a couple of Teensy 4.1 microcontroller units. They are supported by the Arduino IDE. Specs:

Teensy 4.1 Specs

Will nanoForth run on it? It shows up as an available library in the IDE, but I haven't tried to run it yet.

chochain commented 2 years ago

Hi Ed,

Thank you for taking interest in NanoForth. The spec for Teensy looks great but I haven't have a chance to try on it.

NanoForth is coded in standard C with Arduino.h include. If porting could break, it is most likely IO pin related. I can think of the following 3 areas and they should be straight forward to adapt.

  1. pin IO i.e. pinMode, digitalRead/Write, analogRead/Write (in nanoforth_vm.cpp line 255), for example ESP32 has a slightly different syntax
  2. EEPROM read/write (in nanoforth_asm.cpp line 263), and
  3. Flash memory read i.e. pgm_byte_read (in nanoforth_core.cpp line 80 and 157)

It would be exciting to hear that NanoForth is adapted to any other playground.

Have fun!

znmeb commented 2 years ago

I'm coming back to this over the weekend. Since I posted this I've acquired more micro-controllers - a couple of BBC micro:bit v2s and a couple of Arduino Nano RP2040 Connects. I'm probably going to try the RP2040s first; they've got WiFi / Bluetooth and a humongous amount of flash (16 MBytes!). The Arduino IDE lets the user partition the flash into code space and a filesystem, which would make the Forth BLOCK words immensely useful.

chochain commented 2 years ago

Ed, Wow! With RP2040, you can even call it picoForth. 8-) Please play with it and make any modification you see fit. - Lee

chochain commented 1 year ago

Ed, I was pleasantly surprised to see you presenting on SVFIG. Nicely done and congratulations! I'm closely associated with this group especially with a past member Dr. Ting. Small world! BTW, I was a Perl programmer as well and still do Ruby. 8-)

znmeb commented 1 year ago

Ed, I was pleasantly surprised to see you presenting on SVFIG. Nicely done and congratulations! I'm closely associated with this group especially with a past member Dr. Ting. Small world! BTW, I was a Perl programmer as well and still do Ruby. 8-)

You should do a presentation on TensorForth. I'm guessing there are quite a few Forthers with NVIDIA GPUs.

chochain commented 1 year ago

Ed, I hear you sir. However, there are so many things that needed to be done before I considered it stabilized. There should be a working GAN support, at least. The concern is that it might flip my development into supporting mode. I think, maybe a few months later. Do appreciate your recognition and suggestion, though.