Arduino Forum

Community => Exhibition / Gallery => Topic started by: FoxyLab on Mar 21, 2017, 04:51 pm

Title: CP/M computer on Arduino Nano 3.0
Post by: FoxyLab on Mar 21, 2017, 04:51 pm
Greetings to all lovers of Arduino and old school computing! Nostalgia for the eight-bit computers of my youth led me to this project :-) - CP/M 2.2 computer from ... what would you think? ... Arduino Nano 3.0!

For weeks two or three I made the i8080 processor emulator for Arduino Nano (it passes the test from MICROCOSM) and adapted the CP / M.
The main problem - Arduino has only 2 (!) KB of RAM. But we also have an SD card - I made a 4-line cache (32 bytes) to this card, and the card itself emulated all 64 KB of RAM. Although I applied the most primitive cache management algorithm, the speed of work is not so bad.
At the same time, this card also emulates four floppy disks.

Here's the quick-and-dirty prototype of my work:
(https://acdc.foxylab.com/sites/default/files/cpm_mk1.jpg)

Yes, I did not use the adapter for the card, I inserted it into the connector of the cable from the five-inch drive. :-)

To communicate with a computer, I use a terminal program (in the future I plan a PS/2 keyboard and an LCD screen or connect to a TV).

Here is a screenshot of the memory check:
(https://acdc.foxylab.com/sites/default/files/cpm_memtest.png)

CP/M Download:
(https://acdc.foxylab.com/sites/default/files/cpm_loading.png)

CPU Test:
(https://acdc.foxylab.com/sites/default/files/cpm_mctest.png)

DIR command:
(https://acdc.foxylab.com/sites/default/files/cpm_dir.png)

My first program in BASIC for the past twenty (!)))) years:
(https://acdc.foxylab.com/sites/default/files/cpm_tinybas.png)
(I launched TinyBASIC).

Are you interested in such a project?
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: GrooveFlotilla on Mar 21, 2017, 08:57 pm
{Claps}. Bravo!
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: FoxyLab on Mar 22, 2017, 02:32 am
{Claps}. Bravo!
Thanks a lot!
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: Isaac96 on Mar 22, 2017, 02:48 am
That is great!
Another person (i think it was on here) used a Mega1284, which was probably easier relatively speaking. One thing-there is a VGAout library somewhere. You might be able to output to a vga screen and have a command line!
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: FoxyLab on Mar 22, 2017, 03:41 am
That is great!
Another person (i think it was on here) used a Mega1284, which was probably easier relatively speaking. One thing-there is a VGAout library somewhere. You might be able to output to a vga screen and have a command line!
Many thanks! I plan to add PS/2 keyboard and LCD screen (or TV-out - but this required additional microcontroller as VGA-controller).
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: Isaac96 on Mar 22, 2017, 04:34 am
Awesome. That sounds amazing. Please post when that is complete.
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: FoxyLab on Mar 23, 2017, 03:01 pm
I uploaded on YouTube realtime video of my project in action:
https://youtu.be/LHFmt3qWAuY (https://youtu.be/LHFmt3qWAuY)
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: thomai on Mar 23, 2017, 07:22 pm
Simply awesome!!!

But why didn't you use a SPI RAM extension?
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: petersieg on Mar 23, 2017, 08:33 pm
Where is the source? ;-)
Would like to give it a try..
Very interesting to use a 64kb area on sd card to mimick ram memory.
I assume the 4 floppy images are dd-ed on 4 partitions of the sd card?

Please keep this code as a separate (version 1) project, before you introduce ps/2 kb und display.

thx,

Peter
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: FoxyLab on Mar 23, 2017, 10:04 pm
Simply awesome!!!

But why didn't you use a SPI RAM extension?
Thanks!
In future probably as an option (Ferroelectric RAM).
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: FoxyLab on Mar 23, 2017, 10:15 pm
Where is the source? ;-)
Would like to give it a try..
Very interesting to use a 64kb area on sd card to mimick ram memory.
I assume the 4 floppy images are dd-ed on 4 partitions of the sd card?

Please keep this code as a separate (version 1) project, before you introduce ps/2 kb und display.

thx,

Peter
1. I will uploaded source in my GitHub repository - I believe, by the beginning of next week.
2. I use 4 GB SDHC Card, so i trade free space for simplifying - i write one line cache at the beginning of each sector (64 bytes of 512 bytes)   (cache has 8 lines of 64 bytes)  ->  65536/64 sectors to all RAM.
3. No, i dont use partitions on SD Card - raw read/write only.
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: petersieg on Mar 24, 2017, 09:11 am
Thx. Would be glad if you upload also your sd card image so that one can write it directly with dd on a card.

Peter
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: FoxyLab on Mar 24, 2017, 09:53 am
Thx. Would be glad if you upload also your sd card image so that one can write it directly with dd on a card.

Peter
O.K.
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: pito on Mar 24, 2017, 05:05 pm
I've got stm32duino (stm32F103zet6 board) with 64kB internal and 512kB of external sram (wired via FSMC). The 512kB of sram could be used for the heap. I can allocate the 64kB of CP/M's RAM with malloc() in that 512kB space easily.
So I may try to run your code on it, when available..
FYI:
External sram on stm32duino (http://stm32duino.com/viewtopic.php?f=28&t=1651&p=25394#p22576)


Title: Re: CP/M computer on Arduino Nano 3.0
Post by: FoxyLab on Mar 24, 2017, 05:52 pm
I've got stm32duino (stm32F103zet6 board) with 64kB internal and 512kB of external sram (wired via FSMC). The 512kB of sram could be used for the heap. I can allocate the 64kB of CP/M's RAM with malloc() in that 512kB space easily.
So I may try to run your code on it, when available..
FYI:
External sram on stm32duino (http://stm32duino.com/viewtopic.php?f=28&t=1651&p=25394#p22576)
Thanks!
But my target was Nano. For fun i plan in future connect Nano to 32+32 KBytes Ferroelectric RAM (FRAM) (~1.2$ on eBay) as option.
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: FoxyLab on Mar 25, 2017, 08:55 pm
I uploaded very draft source code of my project to Github:
https://github.com/Dreamy16101976/cpm4nano (https://github.com/Dreamy16101976/cpm4nano)

I did the emulation of ports 0 and 1 in Altair-style and run Altair TinyBASIC without (!) CP/M. He works quick!
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: spcrngr on Mar 28, 2017, 04:59 am
This is very impressive, nice work!
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: FoxyLab on Mar 28, 2017, 09:31 am
This is very impressive, nice work!
Thank you very much!
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: FoxyLab on Mar 31, 2017, 03:32 pm
To simplify the configuration of the CP/M for the current RAM size, I extracted the CCP and BDOS images from MOVCPM.COM and analyzed (using the program, of course) the differences between this template image and the real image of the system with 62 KByte. The result is the project getcpm - https://github.com/Dreamy16101976/getcpm (https://github.com/Dreamy16101976/getcpm)
When you run getcpm.exe, you need to specify the memory size in kilobytes (XX) and the desired serial number of the CP/M system (6 bytes in hexadecimal, YYYYYYYYYYYY), after the configuration is done, the CPMXXK.SYS file is created and its eight-bit checksum is specified:
(https://acdc.foxylab.com/sites/default/files/getcpm_1.png)

The program, using the CPMDIFF.SYS file, corrects the addresses in the CPM00K.SYS file by configuring CCP and BDOS for the specified amount of RAM:
(https://acdc.foxylab.com/sites/default/files/getcpm_2.png)

The program itself is written on Go and compiled by the command go build getcpm.go
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: FoxyLab on Apr 01, 2017, 10:44 am
I found and fixed an error in INR M/DCR M emulation.
Now the TYPE command works correctly!!!
The emulator is almost ready to use widely.
I will write instructions on how to prepare a SD-card for use in the emulator.
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: FoxyLab on Apr 02, 2017, 08:43 am
I added an LRC-checksum for the memory data when writing/reading to the SD-card. While failures were not.
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: FoxyLab on Apr 05, 2017, 12:09 am
I made the input from the console more versatile - through interrupts - to connecting the PS/2 keyboard in the future + added a command R monitor to reset the Arduino.
Also i did 200 runs of the memory test (added a command to the monitor) - failures not detected:
(https://acdc.foxylab.com/sites/default/files/cpm_memtests.png)
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: FoxyLab on Apr 09, 2017, 08:05 pm
Using emulation of address and data buses, as well as internal registers (W, Z, ACT, TMP), made emulation of microoperations as close as possible to the "iron" processor + with #define made the emulation code much more visible. The new code is already laid out on GitHub.
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: FoxyLab on Apr 12, 2017, 01:06 am
According to the test results, the random access time to the emulated memory card was about 7 milliseconds.
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: FoxyLab on Apr 15, 2017, 07:59 pm
Because of the use of caching, the average access time with sequential access to memory is about 80 microseconds.
I used the BASIC test (in the TINYBASIC interpreter) to evaluate the effect of the cache on performance in the real task:
(https://acdc.foxylab.com/sites/default/files/cpm_basic_test.png)
(The size of the cache line is 64 bytes)
Number of cache lines runtime (seconds)
2 .................................... 345
4 ................................... 155
6 .................................... 80
8 .................................... 60
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: FoxyLab on Apr 19, 2017, 09:40 pm
I ran the Ada language compiler on my Arduino !!!

Compilation of the program TOWERS.ADA for solving the problem of the "Hanoi Tower":
(https://acdc.foxylab.com/sites/default/files/towers_ada_comp.png)

Running the compiled program TOWERS.COM:
(https://acdc.foxylab.com/sites/default/files/towers_ada_3.png)
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: FoxyLab on Apr 22, 2017, 05:59 pm
Changed the approach to emulating the floppy disks - allocated on the SD card the area for storing the contents of 100 floppy disks and with the monitor command Z i "insert" a floppy disk into one of the drives A, B, C or D
(for example, the ZB02 command mounts a floppy disk with the number 02 in drive B)
(https://acdc.foxylab.com/sites/default/files/cpm_floppy.png)
The numbers of "inserted" floppies are stored in the Arduino EEPROM and are restored when the emulator is restarted.
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: FoxyLab on Apr 27, 2017, 08:05 pm
I made an emulation of the memory management device (MMU) with switching banks, which allowed access to 512 KByte of memory.
I divided the address space 0x0000 ... 0xFFFF into 16 blocks (with numbers from 0x0 to 0xF) of 4 KByte in size. Each block can be mapped to one of 8 banks (the size of the bank is 64 KByte). The correspondence of banks to blocks is determined by the values ​​(bank numbers from 0 to 7) in a set of 16 registers (only bank 0 is active when the emulator is started).
To specify the bank number for a specific block, two output commands are used in the port:
OUT D0, block number
OUT D1, banknumber
Also, you can use the YXY monitor command to switch the X memory unit to the Y memory bank.
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: FoxyLab on Apr 30, 2017, 07:36 am
Testing for 8 banks of memory:
(https://acdc.foxylab.com/sites/default/files/%D1%81pm_start_banks.png)
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: FoxyLab on May 17, 2017, 08:17 pm
cpm4nano Mk II
(used an adapter to connect a microSD-card)
(https://acdc.foxylab.com/sites/default/files/cpm_mk2.jpg)
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: Budvar10 on May 18, 2017, 07:49 am
+ ;)
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: petersieg on May 18, 2017, 09:57 am
Hmm. Just gave it a try with Arduino 1.0.6 (I know that it is very old).
1. Gives conflict with standard arduino SD library - better to rename your spinoff to something that does not give a conflict with the standard libs.
2. Resulting sketch ist to big for Nano/Mini Pro with atmega328:

Binäre Sketchgröße: 33.386 Bytes (von einem Maximum von 30.720 Bytes)
processing.app.debug.RunnerException: Sketch zu groß;

??

BTW: I assume the ps2 files are just there for future use and not yet used in the project?
Also some wiring information would be making it probably easier.
And where can I locate the ADA compiler for CP/M?

Also it would be a good idea, the let any somewhat stable version there as a release when you start working on a new/anhanced version.. so just have one bucket of code that is a work in progress ist not good.

Peter
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: FoxyLab on May 26, 2017, 08:20 am
Hmm. Just gave it a try with Arduino 1.0.6 (I know that it is very old).
1. Gives conflict with standard arduino SD library - better to rename your spinoff to something that does not give a conflict with the standard libs.
2. Resulting sketch ist to big for Nano/Mini Pro with atmega328:

Binäre Sketchgröße: 33.386 Bytes (von einem Maximum von 30.720 Bytes)
processing.app.debug.RunnerException: Sketch zu groß;

??

BTW: I assume the ps2 files are just there for future use and not yet used in the project?
Also some wiring information would be making it probably easier.
And where can I locate the ADA compiler for CP/M?

Also it would be a good idea, the let any somewhat stable version there as a release when you start working on a new/anhanced version.. so just have one bucket of code that is a work in progress ist not good.

Peter
I compiled the project succesfully on Arduino 1.6.6 (on Arduino 1.8.x - fail with PROGMEM).  Required library files (some are slightly changed!) placed in project folder (Sd2Card.h, SD.h etc).
I upload on GitHub today last project version.
For this code:
"Sketch uses 30,436 bytes (99%) of program storage space. Maximum is 30,720 bytes.
Global variables use 1,465 bytes (71%) of dynamic memory, leaving 583 bytes for local variables. Maximum is 2,048 bytes."

Yes, PS/2 related files - for future use.

I'm working on a wiring drawing.

ADA compiler - i will upload later.

Best regards, Alexey
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: FoxyLab on May 26, 2017, 08:26 am
+ ;)
Thanks!
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: FoxyLab on May 27, 2017, 06:57 am
P.S. Ada compiler for CP/M - https://acdc.foxylab.com/ada.zip (https://acdc.foxylab.com/ada.zip)
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: FoxyLab on Aug 10, 2018, 09:45 pm
Project news:
- connected two FRAM chips (32 KBytes each), and made auto-configuration of chips (they can be up to 8) on banks, so that these two chips filled zero bank RAM
- untied the hardware I2C from interrupts (by rejecting the use of Wire.h)
- untied work with UART from interrupts
- from interruptions I got off for good reason - timer 1 after these tweaks allowed to generate the horizontal line frequency for output on TV; I was able to select a set of assembler commands that would allow one pixel to be output in 7 cycles of the processor (where the characters are taken from the character generator - an array in flash memory, but not the screen buffer in RAM), and this at 56 μs of the active part of the line will give 128 pixels, e. Arduino Nano (one !!!) can both emulate and output to the screen through the composite TV input 24 chars in row with 5 x 8 font, although losing a few in performance (but still not to that the ZX80 of Sir Clive :-))
- rewrote emulation code, saving a few kilobytes of flash
To be continued (and a new version of the code on the GitHub, as well as a edited description (in russian) at https://acdc.foxylab.com/node/76)
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: FoxyLab on Aug 23, 2018, 09:15 pm
I will boast :-)
I taught my "nanocomputer" to display on TV screen without jitter (!) 20 lines of text on 40 columns in each.
The "screenshot" of the TV screen shows the results of the DIR command and the CPU tests:
(http://acdc.foxylab.com/sites/default/files/cpm4nano_tv_1.png)
Currently one (!) Arduino Nano (!) in my "cpm4nano" project:
- emulates the i8080 processor;
- loads the OS CP M and runs its programs;
- exchanges information on the serial port;
- displays the image on the TV screen.
P.S. Font, of course, i will correct, Spectrum compressed font looked better.
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: FoxyLab on Aug 26, 2018, 09:48 pm
Current project circuit:
(https://acdc.foxylab.com/sites/default/files/cpm4nano_mk4_cir.png)
The minimum configuration requires:
Arduino Nano 3.0;
SD card with adapter;
USB-UART converter.
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: FoxyLab on Aug 30, 2018, 08:33 am
With the addition of the PS/2 interface for connecting the keyboard, my "nanocomputer" has become self-sufficient:
(https://acdc.foxylab.com/sites/default/files/ps2_uart_cir.png)
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: FoxyLab on Aug 30, 2018, 09:23 am
Project on Arduino Project Hub:
https://create.arduino.cc/projecthub/FoxyLab/arduino-nano-as-cp-m-compatible-computer-c09d4e (https://create.arduino.cc/projecthub/FoxyLab/arduino-nano-as-cp-m-compatible-computer-c09d4e)
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: CyberCube37 on Sep 02, 2018, 08:57 pm
thank you for this post. I am 16yrs old and im just in love with assembly language and old simple microprocessors and IC. when I get a little bit more experience i will definetly give it a try I dont like newer higher level languages and it would be awesome to learn things on something I already have like an arduino. If you have any suggestions where I could learn more and how to get started I would appreciate your suggestions
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: FoxyLab on Sep 06, 2018, 07:01 pm
thank you for this post. I am 16yrs old and im just in love with assembly language and old simple microprocessors and IC. when I get a little bit more experience i will definetly give it a try I dont like newer higher level languages and it would be awesome to learn things on something I already have like an arduino. If you have any suggestions where I could learn more and how to get started I would appreciate your suggestions
Thanks! I started programming on such a Soviet programmable micro calculator - https://en.wikipedia.org/wiki/Elektronika_MK-61
Then there was ZX Spectrum... This project brings me back to my youth :-)
But enthusiasts do much more incredible things - a processor on TTL logic or even electromagnetic relays ("homebrew relay computers").
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: FoxyLab on Sep 06, 2018, 07:14 pm
Displaying the font on the TV screen after the redesign and adding symbols of the pseudographics and Russian letters in the KOI-8 encoding:
(https://acdc.foxylab.com/sites/default/files/cpm4nano_font.jpg)
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: FoxyLab on Sep 09, 2018, 04:52 pm
"Hardware" underline cursor added:
(https://acdc.foxylab.com/sites/default/files/cpm4nano_cursor.png)
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: FoxyLab on Sep 13, 2018, 11:06 pm
I tested the BASIC compiler on my "nanocomputer":

compilation
(https://acdc.foxylab.com/sites/default/files/cpm4nano_cb80.png)

link
(https://acdc.foxylab.com/sites/default/files/cpm4nano_lk80.png)

run :)
(https://acdc.foxylab.com/sites/default/files/cpm4nano_cbasic_hello.png)
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: FoxyLab on Sep 22, 2018, 03:39 pm
Huzza!
My simulator passed the test DIAGNOSTICS II V1.2 - CPU TEST by SUPERSOFT ASSOCIATES:
(https://acdc.foxylab.com/sites/default/files/cpm4nano_ssdiagcpu_2.png)
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: FoxyLab on Sep 24, 2018, 07:51 pm
Epic game "Star Trek" running in my "nanocomputer":

(https://acdc.foxylab.com/sites/default/files/cpm4nano_startrek_00.png)
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: brandonpcguy on Dec 14, 2018, 08:14 pm
I'm going to try this on:

https://www.adafruit.com/product/2795

I would like to make a compact portable CP/M computer.

Thank you for your work.

It is a really cool project.
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: FoxyLab on Oct 03, 2019, 10:31 pm
The project is unfrozen :-)

Successful tests of connection the PS/2-keyboard via the STM8 adapter made my "nanocomputer" autonomous.
(https://acdc.foxylab.com/fox_ok.png)
So cpm4nano Mk V:
Arduino Nano 3.0 - emulates the i8080, provides work with memory and disks, performs video output and serial communication
RAM - 2 x 32 KB FM24C256-G I2C-chips
FDD - SD-card
input - PS/2-keyboard via STM8S103F3P6 adapter
output - in parallel to the video output (20 lines x 45 columns, font 4 x 8) and serial port (USB-UART converter)
(https://acdc.foxylab.com/sites/default/files/cpm4nano_mk5.jpg)
P.S. I tested the connection to the tube TV (the clarity of the image is worse than on the LCD, but the synchronization is not broken and the font is readable).
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: FoxyLab on Oct 06, 2019, 07:52 pm
(https://acdc.foxylab.com/sites/default/files/cpm4nano_mkV.png)
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: FoxyLab on Oct 10, 2019, 09:09 am
"Handmade" case for "nanocomputer":
(https://acdc.foxylab.com/sites/default/files/cpm4nano_MkV_case.jpg)
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: FoxyLab on Oct 12, 2019, 01:40 pm
Added the ability to enable the "turbo" mode "on the fly" using the jumper - disabling the rendering of pixels in the TV frame, an analog of FAST MODE in ZX81. The BASIC test execution time is reduced in this mode from 120 to 70 seconds.
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: FoxyLab on Oct 15, 2019, 04:33 pm
Adding a read-ahead/write-through instruction cache (single-line, 16 bytes) between the emulation core and I2C-memory accelerated the work of CP/M, for example, the time it took to complete DIR on a floppy disk with system files and tests was reduced by one and a half times.
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: miker00lz on Oct 16, 2019, 09:58 pm
Very nice! I love seeing emulator projects on AVR. But aren't you going to wear out the SD very quickly by using it as RAM?

You should take a look at the Teensy line of boards if you are interested in more memory and speed. They are compatible with the Arduino environment. The T4.0 is especially nice (600 MHz Cortex-M7, 1 MB RAM), and only $20!

I did a similar project recently, but with 8086 on a Mega2560.

EDIT: Nevermind, I see you stopped using SD for RAM. (Or I misunderstood the original post)
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: FoxyLab on Oct 18, 2019, 08:44 pm
Very nice! I love seeing emulator projects on AVR.
Thanks!
(https://acdc.foxylab.com/fox_ok.png)

EDIT: Nevermind, I see you stopped using SD for RAM. (Or I misunderstood the original post)
Yes, in Mk V version FRAM is RAM :-)

You should take a look at the Teensy line of boards if you are interested in more memory and speed. They are compatible with the Arduino environment. The T4.0 is especially nice (600 MHz Cortex-M7, 1 MB RAM), and only $20!
I did a similar project recently, but with 8086 on a Mega2560.
It's my accepted challenge: :)
single Arduino Nano emulates i8080, acts with RAM & SD card, generates videosignal for TV Out, sends/receives data to/from serial (or from PS/2 keyboard with STM8 powered adapter).

My "nanocomputer" in action:
YouTube (https://youtu.be/Yuq1yEH-WZ8)
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: miker00lz on Oct 19, 2019, 06:50 am
It's my accepted challenge: :)
single Arduino Nano emulates i8080, acts with RAM & SD card, generates videosignal for TV Out, sends/receives data to/from serial (or from PS/2 keyboard with STM8 powered adapter).

My "nanocomputer" in action:
YouTube (https://youtu.be/Yuq1yEH-WZ8)
Very impressive! The speed is really good considering that it also has to generate a TV signal.

I know how much fun it is to try to get everything you can out of a simple AVR.  :)
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: FoxyLab on Oct 20, 2019, 12:55 pm
Very impressive! The speed is really good considering that it also has to generate a TV signal.
I know how much fun it is to try to get everything you can out of a simple AVR.  :)
(https://acdc.foxylab.com/fox_ok.png)

Chars of font:
on LCD TV:
(https://acdc.foxylab.com/sites/default/files/cpm4nano_font_45.png)
on CRT TV:
(https://acdc.foxylab.com/sites/default/files/cpm4nano_crt_font.jpg)
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: FoxyLab on Oct 23, 2019, 04:50 am
Othello game

I vs "nanocomputer":
(https://acdc.foxylab.com/sites/default/files/cpm4nano_othello_1.png)
(https://acdc.foxylab.com/sites/default/files/cpm4nano_othello_2.png)
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: FoxyLab on Oct 26, 2019, 04:29 am
StarTrek (running by my "nanocomputer") on CRT TV:
(https://acdc.foxylab.com/sites/default/files/cpm4nano_startrek_crt.png)
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: lastchancename on Oct 26, 2019, 06:02 am
I just looked at the video...
Harks back to the 80s when computing was somewhat simpler !
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: FoxyLab on Oct 27, 2019, 01:59 pm
I just looked at the video...
Harks back to the 80s when computing was somewhat simpler !
Good old times!
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: FoxyLab on Nov 06, 2019, 07:41 am
Memory dump from monitor (CRT TV screenshot):
(https://acdc.foxylab.com/sites/default/files/cpm4nano_dump.jpg)
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: FoxyLab on Nov 08, 2019, 07:44 pm
PS/2-UART converter circuit for connecting a PS/2 keyboard:
(https://acdc.foxylab.com/sites/default/files/cpm4nano_stm8.png)

Additional options -
page mode (scroll lock) - controlled by the Scroll Lock key with LED indication;
russian letters input in KOI-8R encoding - switching the language with the Alt-Shift keys combination with an LED indication;
hardware reboot with Ctrl-Alt-Del keys combination
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: FoxyLab on Nov 13, 2019, 11:14 pm
I overcame the limitation of the physical resolution of the video output of my "nanocomputer" (45 columns) in the style of the Osborne 1 portable microcomputer - using two virtual screens.
The contents of the current virtual screen are stored in video memory (microcontroller RAM), and the contents of another virtual screen are stored in the main memory (I2C chips).
Screens are located horizontally, the resolution of the virtual screen is 40 columns and 19 lines + 1 status line:
(https://acdc.foxylab.com/sites/default/files/cpm4nano_virt_scrs.png)
Thus, virtual screens emulate a physical screen with 80 columns (Osborne emulated a physical screen with 128 columns through overlapping virtual screens with a width of 56 columns).
Switching modes (physical screen / virtual screens) is carried out from the monitor program.
Switching between virtual screens is done by the CTRL-O key combination.
Example:
left virtual screen
(https://acdc.foxylab.com/sites/default/files/cpm4nano_virt_scr_0.png)
right virtual screen
(https://acdc.foxylab.com/sites/default/files/cpm4nano_virt_scr_1.png)
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: FoxyLab on Nov 20, 2019, 07:31 pm
Launched on the "nanocomputer" LISP/80 interpreter version 1.1 from Thomas W. Yonkman:
(https://acdc.foxylab.com/sites/default/files/cpm4nano_lisp80.png)

Here is a note about this interpreter in BYTE magazine:
(https://acdc.foxylab.com/sites/default/files/cpm4nano_lisp80_byte.png)
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: FoxyLab on Nov 24, 2019, 09:29 pm
Altair BASIC 8K:
(https://acdc.foxylab.com/sites/default/files/cpm4nano_basic8k_lst1.png)
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: FoxyLab on Dec 01, 2019, 10:24 pm
Interpreter FOCAL running on my "nanocomputer":
(https://acdc.foxylab.com/sites/default/files/cpm4nano_focal.png)
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: FoxyLab on Dec 06, 2019, 06:52 pm
Microchess program made by Peter R. Jennings in 1977 successfully launched on my "nanocomputer":
(https://acdc.foxylab.com/sites/default/files/cpm4nano_uchess_01.png)
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: FoxyLab on Dec 15, 2019, 10:29 am
I added to the "nanocomputer" the possibility of input-output via an audio file or magnetic tape.
Board for matching voltage levels (classic solution):
(https://acdc.foxylab.com/sites/default/files/cpm4nano_tape_ckt.png)
(https://acdc.foxylab.com/sites/default/files/cpm4nano_tape_brd.jpg)
Formats:
(https://acdc.foxylab.com/sites/default/files/cpm4nano_tape_fmt.png)
Bits in Audacity:
(https://acdc.foxylab.com/sites/default/files/cpm4nano_tape_bits.png)
Functionality was checked for the linear input and output of a "large" computer with a speed deviation of up to 20%.
Example (WAV-file with three blocks):
CAUTION! HIGH VOLUME!
tape.wav (https://acdc.foxylab.com/sites/default/files/tape.wav)
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: FoxyLab on Dec 23, 2019, 02:48 pm
I started a chess duel between my "nanocomputer" running Microchess (playing white) and the "big" computer with the chess engine Sunfish  (written in Python, written by Thomas Dybdahl Ahle) .
After 22 moves the situation is as follows:
(https://blog.foxylab.com/wp-content/uploads/2019/12/cpm4nano_sunfish_22.png)

As it turned out, the Spanish party was played in the opening, then Black used the Berlin Defense, and White used anti-Berlin.
All moves and pictures are recorded  here (https://blog.foxylab.com/shahmatnyj-battl/) (comments - on russian).

The game continues :-)
Title: Re: CP/M computer on Arduino Nano 3.0
Post by: FoxyLab on Jan 03, 2020, 09:32 pm
A companion project has begun - an i8080-based system emulator on Rust - me select from the list of binary files in the program directory the desired one (for example, BASIC, Minol or chess) and run:
(https://blog.foxylab.com/wp-content/uploads/2019/12/fe2o3_uchess.png)

The emulator successfully passed the famous "exerciser" test:
(https://acdc.foxylab.com/sites/default/files/fe2o3_8080_test.png)