Intro
In April and May 2025 I had great success with BEN2, firstly implementing WOZMON, the Apple I 6502 monitor program written by Steve Wozniak. I then followed Ben's instructions to implement Bill Gates MS-BASIC. setup input buffering / flow control and add commands to control the LCD display.
My aim for 2026 was to write some BASIC programs and also to tidy up the hardware, transferring a few extra connections from an attached breadboard to a circuit board.
As a first step I wanted to transfer the BEN2 development environment from Windows 10 to my Windows 11 PC, Athena. Unfortunately MS have screwed up their WSL environment so that serial ports are no longer shared easily with Windows. In February I went through the pain and suffering of devising a work-around so that I could continue to develop my system.
Hardware Changes
As part of the work to setup MS-BASIC, Ben introduced the idea of copying and pasting programs to the 6502 display. Although small snippets of text can be easily pasted, it was necessary to setup input buffering and flow control so that complete programs can be copied and these features require hardware changes.
Firstly, for input buffering, I need to connect 6502 /IRQ pin to ACIA /IRQ instead of VIA /IRQ which I was previously using for my MON4 monitor. The 6502 /IRQ signal also required a pull-up resistor.
Secondly, for flow control, I needed to connect FTDI serial convertor CTS wire to VIA PA1 pin. I also found it useful to attach an LED to CTS signal so that I had a visual indicator when flow control was in use.
New Board
These changes could not be made on the BEN2 board so for a long while I have had an extra breadboard attached to BEN2 which doesn't look good.
I decided to add a new daughter board CAL to BEN2. This is a small circuit board with interrupt and CTS connections. I also attached the FTDI serial board and incorporated speaker connections.
Although the circuit is straightforward it took a significant amount of time and effort to : decide board contents; finalise circuit board layout; soldering and testing the board. On completion I was able to to physically screw CAL onto BEN and dispense with the breadboard.
<Picture of finished, neater, system required>
Add a simple Emulator
Using WOZMON and MSBASIC I quickly became irritated repeatedly typing commands and programs each time I started/loaded the environment. The ability to copy+paste programs from PC text files is a great improvement but still a nuisance.
BEN2 is attached to Athena through /dev/ttyUSB0. Usually we start the picocom terminal emulator on ttyUSB0; all text entered into picocom is sent to BEN2 and any text output on the serial port by BEN2 is displayed in picocom. It is possible to send text directly from a WSL Ubuntu session to /dev/ttyUSB0 with the command echo e.g. “echo 1000 > /dev/ttyUSB0”
Picocom allows you to write to ttyUSB0 whilst it is running
and already has the device open.
We intend to use python to write commands to ttyUSB0 and
read the output produced.
Although we can write to ttyUSB0 whilst picocom is running we cannot read the
resulting output.
Quite sensibly only one device can read ttyUSB0 at any one time.
Thus we need to set up a simple emulator in python which
allows us to send commands to BEN2 and displays any text sent back. This can partially replace picocom.
Emulator1 simply loops allowing you to enter commands and displaying the output.
It is very effective, not dissimilar to picocom.
Program logic is principally within the python function
keyboard_command.
It displays the yellow command prompt and obtains a line of input.
keyboard_command send the input to BEN2 and prints any response received within
the serial device timeout (0.3s).
Bytestrings are used on the serial port.
The “bytes” method is used to encode a string and the “decode” method is
used on responses to convert output back to a normal string.
LOAD and SAVE programs
BEN2 doesn't have any persistent storage which means we cant save programs. They can be typed in to Windows Notepad and copied, debugged, listed and copied back but this is messy. Now we have a simple emulator I can add LOAD and SAVE commands which will use Windows for program storage.
The SAVE command lists out the current BASIC workspace program, captures the text and writes it to a Windows file.
We also have a DIR command which lists available programs.
Restrictions
The emulator isn't very sophisticated, it uses a timeout to check if there is any 6502 output to display on the screen. This needs to be quite small (say 0.3s) to allow command output to be displayed. However it doesn't work for long listings or long-running programs so I will use python emulator to load and save programs, but continue with picocom when using the environment.
Outro
After a lull BEN2 has been given a respray. The hardware has been consolidated and we have a method for loading and saving BASIC programs. In fact the LOAD mechanism would can also be used to load machine code programs.
Although I haven't done much programming yet, the system is becoming more usable and I can progress other initiatives.