CP/M computer on Arduino Nano 3.0

I added an LRC-checksum for the memory data when writing/reading to the SD-card. While failures were not.

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:

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.

According to the test results, the random access time to the emulated memory card was about 7 milliseconds.

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: (The size of the cache line is 64 bytes) Number of cache lines runtime (seconds) 2 .................................... 345 4 ................................... 155 6 .................................... 80 8 .................................... 60

I ran the Ada language compiler on my Arduino !!!

Compilation of the program TOWERS.ADA for solving the problem of the “Hanoi Tower”:

Running the compiled program TOWERS.COM:

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) The numbers of "inserted" floppies are stored in the Arduino EEPROM and are restored when the emulator is restarted.

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.

Testing for 8 banks of memory:

cpm4nano Mk II (used an adapter to connect a microSD-card)

  • ;)

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

petersieg: 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

Budvar10: + ;)

Thanks!

P.S. Ada compiler for CP/M - https://acdc.foxylab.com/ada.zip

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)

I will boast :slight_smile:
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:

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.

Current project circuit: |500x479 The minimum configuration requires: Arduino Nano 3.0; SD card with adapter; USB-UART converter.

With the addition of the PS/2 interface for connecting the keyboard, my “nanocomputer” has become self-sufficient:

Project on Arduino Project Hub: https://create.arduino.cc/projecthub/FoxyLab/arduino-nano-as-cp-m-compatible-computer-c09d4e