# 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:** 1\
**Showing post:** 5

<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`

---

_[View the full topic](https://forum.clockworkpi.com/t/forth-on-the-picocalc/17330)._
