# FORTH on the PicoCalc

**URL:** <https://forum.clockworkpi.com/t/forth-on-the-picocalc/17330>\
**Category:** PicoCalc\
**Created:** [May 7, 2025, 8:26am UTC](https://forum.clockworkpi.com/t/forth-on-the-picocalc/17330 "2025-05-07T08:26:18Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![ethern0t](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/ethern0t/32/12016_2.png) [@ethern0t](https://forum.clockworkpi.com/u/ethern0t)\
**Post date:** [May 7, 2025, 8:26am UTC](https://forum.clockworkpi.com/t/forth-on-the-picocalc/17330/1 "2025-05-07T08:26:18Z")

</div>

I think I saw somebody on a facebook group (Minimal Computing maybe) had ZeptoFORTH running on the PicoCalc, but my attempts to contact the author there failed.

Does anybody know of anything else that will work out of the box?

Thanks

-Dave

---

<div class="post-metadata">

**Author:** ![adcockm](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/adcockm/32/1664_2.png) [@adcockm](https://forum.clockworkpi.com/u/adcockm)\
**Post date:** [May 7, 2025, 8:45am UTC](https://forum.clockworkpi.com/t/forth-on-the-picocalc/17330/2 "2025-05-07T08:45:26Z")

</div>

Someone posted on the forums here that they got Zeptoforth running, but didn’t share any release information, git repo, etc. except a link to a private Facebook group. ☹

Maybe try contacting them and asking if they will share it with other PicoCalc owners?

> [@What do you guys think of the pico calc?](https://forum.clockworkpi.com/t/what-do-you-guys-think-of-the-pico-calc/16030/102):
>
> I have Zeptoforth running on the PicoCalc with LCD drivers I wrote for other boards and portred to PicoCalc. It is very nice! I posted a demo i created in Forth on the [Forth2020 Forth programming language group](https://www.facebook.com/groups/forth2020/) yesterday.

---

<div class="post-metadata">

**Author:** ![ethern0t](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/ethern0t/32/12016_2.png) [@ethern0t](https://forum.clockworkpi.com/u/ethern0t)\
**Post date:** [May 7, 2025, 9:25am UTC](https://forum.clockworkpi.com/t/forth-on-the-picocalc/17330/3 "2025-05-07T09:25:13Z")

</div>

Ah, thanks, that’s the person I saw on facebook, so I clearly had the wrong group. Obviously I’m a member of several different “programming in the previous millenium” groups.

---

<div class="post-metadata">

**Author:** ![ethern0t](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/ethern0t/32/12016_2.png) [@ethern0t](https://forum.clockworkpi.com/u/ethern0t)\
**Post date:** [May 7, 2025, 9:59am UTC](https://forum.clockworkpi.com/t/forth-on-the-picocalc/17330/4 "2025-05-07T09:59:49Z")

</div>

And yeah, I did try contacting them directly, but that was on Facebook so who knows if they ever saw the message.

---

<div class="post-metadata">

**Author:** ![tabemann](https://avatars.discourse-cdn.com/v4/letter/t/df705f/32.png) [@tabemann](https://forum.clockworkpi.com/u/tabemann)\
**Post date:** [May 16, 2025, 4:16am UTC](https://forum.clockworkpi.com/t/forth-on-the-picocalc/17330/5 "2025-05-16T04:16:33Z")

</div>

Hello ─ I just saw this thread, and I am the primary author of zeptoforth. I personally don’t have access to Jerry’s source code, so I cannot show you the code that he demoed.

However, zeptoforth is on GitHub at [GitHub - tabemann/zeptoforth: A not-so-small Forth for Cortex-M](https://github.com/tabemann/zeptoforth) and furthermore has a development branch picocalc-devel at [GitHub - tabemann/zeptoforth at picocalc-devel](https://github.com/tabemann/zeptoforth/tree/picocalc-devel) which includes drivers for the PicoCalc’s keyboard and display and a terminal emulator for the PicoCalc. These compile and at least load without crashing but have not been fully tested (I have not received my PicoCalc yet).

If you are brave and want to try out zeptoforth’s PicoCalc drivers and terminal emulator, first flash your RP2040 or RP2350 board with a UF2 file from the latest zeptoforth release (as the PicoCalc captures the UART0 TX and RX and exposes them via USB-C I recommend using a full rather than full\_usb build, for the RP2040 I recommend the rp2040\_big platform over the rp2040 platform unless you really care about having extra on-board space for blocks or FAT32 filesystems at the expense of flash dictionary space, and for the RP2350 if you are using a Pimoroni Pico Plus 2 or Pimoroni Pico Plus 2 W I recommend the rp2350\_16mib platform over the rp2350 platform so as to take advantage of the full 16 MiB flash size). Then execute the following at the base of the zeptoforth directory tree (taking care to replace `<your tty device>` with your tty device for your serial link):

```auto
utils/codeload3.sh -B 115200 -p <your tty device> serial extra/common/st7365p_spi_8_6x8_font_all.fs
utils/codeload3.sh -B 115200 -p <your tty device> serial extra/rp_common/picocalc_bios.fs
utils/codeload3.sh -B 115200 -p <your tty device> serial extra/rp_common/picocalc_sound.fs
utils/codeload3.sh -B 115200 -p <your tty device> serial extra/rp_common/picocalc_term_common.fs
utils/codeload3.sh -B 115200 -p <your tty device> serial extra/rp_common/picocalc_term.fs

```

Note that `utils/codeload3.sh` is a wrapper around a smallish Python program that requires Python 3 and which will use pip to pull pySerial into a local installation if it is not already installed on your system.

Then, if everything went okay (it should), connect to your tty device with your favorite serial terminal emulator (e.g. picocom, GNU Screen), and execute:

```auto
picocalc-term::term-console

```

If everything goes well, that should transfer control of the console to the PicoCalc’s display and keyboard. Mind you, this has never been tried before to my knowledge, so it may just as well crash your PicoCalc.

Note that at this point the drivers and terminal emulator are only loaded into RAM, and will thus disappear next time you reboot. This is probably what you will want the first time you try this out, as most likely it simply won’t work.

If everything _does_ go well, then if you want to make this permanent, issue at the zeptoforth REPL:

```auto
reboot

```

and then again with your favorite serial terminal emulator issue:

```auto
compile-to-flash

```

and re-issue the commands to upload the code for the drivers and terminal emulator.

Afterwards, issue with your serial terminal emulator:

```auto
reboot

```

or if you want your PicoCalc to boot directly into the terminal emulator:

```auto
initializer picocalc-term::term-console
reboot

```

Then your PicoCalc will be persistently configured to support the keyboard and display under zeptoforth.

However, if you want to re-flash your PicoCalc’s RP2040 or RP2350 board, there is now a more convenient means of doing so rather than sticking an object through the slits in the back to press the BOOTSEL button, which is simply to issue at the REPL:

```auto
bootsel

```

If you only want to return zeptoforth on the PicoCalc to the ‘factory configuration’, you can instead issue:

```auto
restore-state

```

More:

You can now select 5x8-pixel and 7x8-pixel fonts in the place of 6x8-pixel fonts by substituting `extra/common/st7365p_spi_8_5x8_font_all.fs` or `extra/common/st7365p_spi_8_6x8_font_all.fs` for `extra/common/st7365p_spi_8_7x8_font_all.fs`, as a 5x8-pixel font will be useful if you want to stuff 64 columns of text on your screen, or conversely you may want a 7x8-pixel font if you think a 6x8-pixel font is too small.

One thing you might notice from executing `unused` is that the PicoCalc terminal emulator referenced above, which is the graphical terminal emulator (because it supports drawing arbitrary graphics on the display), uses a _lot_ of SRAM. This is because it has a 320x320 byte framebuffer in SRAM. This is especially a concern if you are using an RP2040 rather than an RP2350, as if you want to use a Pico W for zeptoIP or zeptoed there will not be enough RAM available unless you manually severely reduce the amount of SRAM available for zeptoIP or zeptoed.

As a result I have implemented something called the _text-only_ terminal emulator, which does not use a full graphical framebuffer but rather only stores text and its attributes as bytes in SRAM, and thus saves a lot of SRAM. To install this in the instructions above substitute `extra/common/st7365p_spi_text_6x8_font_all.fs` for `extra/common/st7365p_spi_8_6x8_font_all.fs` (or the equivalents with `5x8` or `7x8` if you want to use different-sized fonts) and `extra/rp_common/picocalc_term_text.fs` for `extra/rp_common/picocalc_term.fs`

---

<div class="post-metadata">

**Author:** ![tabemann](https://avatars.discourse-cdn.com/v4/letter/t/df705f/32.png) [@tabemann](https://forum.clockworkpi.com/u/tabemann)\
**Post date:** [May 16, 2025, 4:20am UTC](https://forum.clockworkpi.com/t/forth-on-the-picocalc/17330/6 "2025-05-16T04:20:05Z")

</div>

Oh and please, if you do try this out, I would much appreciate it if you provided feedback on the zeptoforth GitHub, especially if it _doesn’t_ work, so I can work on making it work without having a PicoCalc in my own possession.

---

<div class="post-metadata">

**Author:** ![z900rs](https://avatars.discourse-cdn.com/v4/letter/z/a3d4f5/32.png) [@z900rs](https://forum.clockworkpi.com/u/z900rs)\
**Post date:** [May 16, 2025, 7:17pm UTC](https://forum.clockworkpi.com/t/forth-on-the-picocalc/17330/7 "2025-05-16T19:17:21Z")

</div>

Hey, I’m not the guy who claimed to have zeptoforth working on PicoCalc, but I’ve tinkered with it. SPI is pretty straightforward. I wrote a few words that initialize the LCD and write pixels (slowly). I haven’t messed with I2C yet, but I’m pretty confident all the PicoCalc support could be done in pure forth without any asm.

---

<div class="post-metadata">

**Author:** ![z900rs](https://avatars.discourse-cdn.com/v4/letter/z/a3d4f5/32.png) [@z900rs](https://forum.clockworkpi.com/u/z900rs)\
**Post date:** [May 16, 2025, 7:27pm UTC](https://forum.clockworkpi.com/t/forth-on-the-picocalc/17330/8 "2025-05-16T19:27:46Z")

</div>

Dude! I love zeptoforth! Thank you for making it. I’ve been playing with it on the Pico itself for sometime, and in fact zeptoforth (and the idea of a pocket forth machine) was one of the reasons I bought a PicoCalc.

I will try to make some time this weekend, check this out on the PicoCalc, and report back!

---

<div class="post-metadata">

**Author:** ![tabemann](https://avatars.discourse-cdn.com/v4/letter/t/df705f/32.png) [@tabemann](https://forum.clockworkpi.com/u/tabemann)\
**Post date:** [May 16, 2025, 10:43pm UTC](https://forum.clockworkpi.com/t/forth-on-the-picocalc/17330/9 "2025-05-16T22:43:53Z")

</div>

The main area in which I use asm for my drivers for the PicoCalc is in the graphics support, because while zeptoforth is fast as Forths go, hand-optimized assembly is faster, and provides a definite benefit in areas like blitting bitmaps and pixmaps and converting 8-bit pixmaps to 16-bit data for output.

---

<div class="post-metadata">

**Author:** ![tabemann](https://avatars.discourse-cdn.com/v4/letter/t/df705f/32.png) [@tabemann](https://forum.clockworkpi.com/u/tabemann)\
**Post date:** [May 16, 2025, 10:45pm UTC](https://forum.clockworkpi.com/t/forth-on-the-picocalc/17330/10 "2025-05-16T22:45:00Z")

</div>

You’re welcome! And thank you in advance for trying this out! Let me know if you have any luck with it!

---

<div class="post-metadata">

**Author:** ![z900rs](https://avatars.discourse-cdn.com/v4/letter/z/a3d4f5/32.png) [@z900rs](https://forum.clockworkpi.com/u/z900rs)\
**Post date:** [May 17, 2025, 3:26am UTC](https://forum.clockworkpi.com/t/forth-on-the-picocalc/17330/11 "2025-05-17T03:26:08Z")

</div>

I’m testing everything on Windows 11/zeptocom.js and using 1.13.1 on the Pico.

When I send 1l19488\_spi\_8\_all.fs, picocalc\_keys.fs, and picocalc\_term.fs the Pico 1 runs out of memory and hard-faults at line 1269 of picocalc\_term.

I worked around that by compiling ili9488\_spi\_8\_all to flash. With that out of the way, theres enough memory to work with the other two …

In picocalc\_term I’m getting an out of range branch at line 605 (the “repeat” at the end of handle-input). I haven’t dug into it, but as a quick and dirty test I commented handle-input out, rebooted and resent.

It sent ok after that, but naturally, I get a “method not implemented” error and “block timed out” shortly after, when it tries to initialize the terminal. That said, it does seem to start initializing the lcd. I get a white screen with a couple vertical lines and a black 6x8 square at the top left! Off to a good start!

 ![IMG_0848](https://canada1.discourse-cdn.com/flex029/uploads/clockworkpi/original/2X/3/3dd790a073c0d3c053056905c6a7a89a61d65f96.jpeg)

If I investigate further, I’ll post anything I figure out.

---

<div class="post-metadata">

**Author:** ![tabemann](https://avatars.discourse-cdn.com/v4/letter/t/df705f/32.png) [@tabemann](https://forum.clockworkpi.com/u/tabemann)\
**Post date:** [May 17, 2025, 3:45am UTC](https://forum.clockworkpi.com/t/forth-on-the-picocalc/17330/13 "2025-05-17T03:45:14Z")

</div>

I made some fixes, so please pull again and try again (note that you will not need to re-flash the ILI9488 driver, as that has not changed).

---

<div class="post-metadata">

**Author:** ![tabemann](https://avatars.discourse-cdn.com/v4/letter/t/df705f/32.png) [@tabemann](https://forum.clockworkpi.com/u/tabemann)\
**Post date:** [May 17, 2025, 3:51am UTC](https://forum.clockworkpi.com/t/forth-on-the-picocalc/17330/14 "2025-05-17T03:51:35Z")

</div>

Note that I have been compiling this on a Pimoroni Pico Plus 2, and the RP2350 does not have the significant branch distance problems that plague the RP2040 as, being ARM Cortex-M33 rather than ARM Cortex-M0+, it has longer-distance branch instructions that zeptoforth takes advantage of.

---

<div class="post-metadata">

**Author:** ![tabemann](https://avatars.discourse-cdn.com/v4/letter/t/df705f/32.png) [@tabemann](https://forum.clockworkpi.com/u/tabemann)\
**Post date:** [May 17, 2025, 4:23am UTC](https://forum.clockworkpi.com/t/forth-on-the-picocalc/17330/15 "2025-05-17T04:23:00Z")

</div>

Note that I _just_ made a change to the repo to change the default foreground color to bright green (I personally am a partisan of green-on-black), but if you pulled before this will not fundamentally affect the functioning of the code.

---

<div class="post-metadata">

**Author:** ![ethern0t](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/ethern0t/32/12016_2.png) [@ethern0t](https://forum.clockworkpi.com/u/ethern0t)\
**Post date:** [May 17, 2025, 10:23am UTC](https://forum.clockworkpi.com/t/forth-on-the-picocalc/17330/16 "2025-05-17T10:23:19Z")

</div>

I’m giving this a shot too. I did a git clone then `git checkout picocalc-devel` which I think worked. I built everything — lots of tty spam but it appeared to produce several uf2 files. I flashed the base rp2040 onto my picocalc and plugged in a usb c cable and did the first step of the code load.

I do seem to have python3 (this is on a recent M series MacBook Air) and the output I get is

> TX: begin-module clip  
> error begin-module clip **unable to parse: begin-module**  
> **Error file extra/common/ili9488\_spi\_8\_all.fs line 21: could not upload file**  
> **\>\>\> #include extra/common/clip.fs**

Any idea what I’ve done wrong?

I also tried to upload clip.fs directly and got

> TX: begin-module clip  
> error begin-module clip **unable to parse: begin-module**

so I feel like I’ve done something fundamentally wrong here.

I think it’s installed on the picocalc because when I held down the power button the LED turned amber instead of going off, which I assume is some sort of sleep mode. I held the power button down for 20-30 seconds and that killed power completely (so I didn’t need to mess with pulling the batteries). Then I installed the rp2040\_big uf2.

Next, I tried the upload immediately, and it complained that my TTY device was invalid, which was not unexpected because the power was still off. I turned the power back on, and repeated the upload, and got the same error as above.

So I think the zeptoforth image is getting downloaded and is working, and I think I am able to communicate over the TTY device (wow, built in USB serial is nice, haven’t messed with much of this stuff since there were real serial ports on PC’s).

A bunch of poking around the internet and I got the direct terminal to work. On a Mac, edit/create ~/.screenrc with

> term rxvt-256color

to get rid of an error about $TERM being too long, sorry. Then to actually connect, make sure USB C is connected to the picocalc, turn it on, and run (from a terminal window)

> screen /dev/tty.usbserial-10 115200

You should see an “ok” prompt and you can enter forth commands. You might need to change /dev/tty.usbserial-10 to something else on your machine, do an `ls` in `/dev/` to see what device is created once you’ve turned on and connected your pico.

Thanks,

-Dave

---

<div class="post-metadata">

**Author:** ![ethern0t](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/ethern0t/32/12016_2.png) [@ethern0t](https://forum.clockworkpi.com/u/ethern0t)\
**Post date:** [May 17, 2025, 11:16am UTC](https://forum.clockworkpi.com/t/forth-on-the-picocalc/17330/17 "2025-05-17T11:16:54Z")

</div>

I just realized, I’m trying to flash the uf2 I built myself, and maybe it’s incomplete somehow. My zeptoforth-rp2040\_big.uf2 file is 197,632 bytes long. The released “full” version is substantially larger than that, so I probably built the wrong target somehow. (I just hoped/expected ‘make’ to do what I needed)

Once I pulled the \*.uf2 from an official release, the first download worked. But then I don’t have the picocalc forth files somehow, which means my git-fu is weak and I didn’t really switch to the picocalc-devel branch like I’d hoped.

---

<div class="post-metadata">

**Author:** ![tabemann](https://avatars.discourse-cdn.com/v4/letter/t/df705f/32.png) [@tabemann](https://forum.clockworkpi.com/u/tabemann)\
**Post date:** [May 17, 2025, 1:13pm UTC](https://forum.clockworkpi.com/t/forth-on-the-picocalc/17330/18 "2025-05-17T13:13:46Z")

</div>

Yeah, if you just flashed the output of `make` it is not going to work, as `make` only builds the zeptoforth kernel and nothing else. This is only really meant as a starting point for building more complete zeptoforth systems and lacks much of what one would expect from a useful Forth.

I normally recommend that users not try to build zeptoforth from scratch but rather use the prebuilt binaries under the `bin/` directory in the latest release tarball. This will save you effort and headache getting zeptoforth built.

If you still want to build zeptoforth from scratch, after having flashed your RP2040 or RP2350 with the proper kernel binary, execute at your shell prompt:

```auto
utils/codeload3.sh -B 115200 -p <your tty device> serial src/<your platform>/forth/setup_full.fs

```

(replacing the strings in angle brackets).

Once that is all complete, connect to your PicoCalc with a terminal emulator and execute `reboot`. Then you can follow the directions in a previous post.

Note that if you are targeting the original Pico (or another RP2040 board) as z900rs discovered you will need to compile the ILI9488 driver to flash. This can be accomplished by issuing:

```auto
compile-to-flash

```

prior to uploading it and then afterwards issuing:

```auto
reboot

```

before uploading `extra/rp_common/picocalc_keys.fs` or `extra/rp_common/picocalc_term.fs`.

---

<div class="post-metadata">

**Author:** ![ethern0t](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/ethern0t/32/12016_2.png) [@ethern0t](https://forum.clockworkpi.com/u/ethern0t)\
**Post date:** [May 17, 2025, 1:21pm UTC](https://forum.clockworkpi.com/t/forth-on-the-picocalc/17330/19 "2025-05-17T13:21:42Z")

</div>

I do have multiple pico’s but it’s a 2040 in my picocalc right now, so I’ll definitely do that.

Do you have any idea why even though I’m on the picocalc-devel branch, I can’t see those two picocalc forth files? I’ve searched on a bunch of git-related things but haven’t had any luck.

EDIT - ugh, just noticed I somehow copied an incorrect path the first time and was looking in the wrong subdirectory.

Thanks,

-Dave

---

<div class="post-metadata">

**Author:** ![ethern0t](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/ethern0t/32/12016_2.png) [@ethern0t](https://forum.clockworkpi.com/u/ethern0t)\
**Post date:** [May 17, 2025, 1:31pm UTC](https://forum.clockworkpi.com/t/forth-on-the-picocalc/17330/20 "2025-05-17T13:31:55Z")

</div>

I’m getting closer. Switching between `screen` and `codeload3` keeps tying up the serial port and I can’t figure out how to quit `screen` cleanly without just unplugging the USB cable to kill the connection.

EDIT - Figured out how to exit `screen`, it’s the stunningly intuitive combination of hitting Ctrl+A, then Ctrl+\.

I added `compile-to-flash` at the top of `ili9488_spi_8_all.fs` and `reboot` to the bottom, and then uploaded the two pico-specific files. When I ran

`picocalc-term::term-console`

though it locked up my terminal session and turned my screen white. If I cycle power the screen just comes back white again.

-Dave

---

<div class="post-metadata">

**Author:** ![ethern0t](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/ethern0t/32/12016_2.png) [@ethern0t](https://forum.clockworkpi.com/u/ethern0t)\
**Post date:** [May 17, 2025, 1:36pm UTC](https://forum.clockworkpi.com/t/forth-on-the-picocalc/17330/21 "2025-05-17T13:36:59Z")

</div>

Re-reading this thread, I think I’ve gotten as far as z900rs has.

I tried blind-typing `reboot` on the keyboard and hitting enter but it didn’t seem to do anything.

[Next page](https://forum.clockworkpi.com/t/forth-on-the-picocalc/17330.md?page=2)
