Close
0%
0%

Arduino Due CP/M Personal Computer

An affordable CP/M computer that anyone can make! CP/M for all!
*** A RunCPM Project***

Similar projects worth following
A CP/M compatible personal computer that anyone can build for very little money.
Uses an Arduino Due with a MicroSD adaptor with RunCPM by Marcelo Dantas.

Completed project!  CP/M for all!

Run WordStar or Dbase, play Zork or program in C or MBASIC!

A CP/M compatible microcomputer that is low cost and anyone can make!

I had been wanting to make my own CP/M computer for some time, I was very much inspired by other projects I'd seen like the RC2014 and even the Altair clone kits, but I wanted to make something that anyone could make for a low cost.

Marcelo Dantas had produced his brilliant RunCPM, this allows CP/M programs to run on a range of systems including the Arduino Due and uses the native filesystem of the host.   I'd imported some Due clones and SD card adaptors from eBay for a very small cost, probably not more than £17.  I am honoured that Marcelo has joined as a team member for this project, I recommend anyone with an interest in CP/M downloads RunCPM and compile it for their computer: Windows, Linux or Mac (as well as Arduino!)  RunCPM can be compiled with Lua support, this extends the scope and usability of CP/M using a modern programming language.

RunCPM Project

Since completing the build, I have also added a BASIC interpreter called Tiny Basic Plus - I've extended the functionality to support ANSI colour and simple block graphics.  Also, BASIC programs are accessible from CP/M, which can be started with a 'CPM' command.  Exiting the OS returns the user to BASIC.

Original source code for RunCPM and Tiny BASIC Plus.

https://github.com/MockbaTheBorg/RunCPM/

https://github.com/BleuLlama/TinyBasicPlus

  • 1 × Arduino DUE (32bit board with 96K) Approx £10-15 for a clone board
  • 1 × MicroSD SPI adaptor Approx £2
  • 1 × Project case Your choice, I had a project enclosure called a KE26 that I previously bought from eBay. Any plastic box or tub or enclosure of sufficient size will do.
  • 2 × Red LEDs Wired with resistor (for Power and disk activity). They can be bought in packs off eBay.
  • 1 × MicroUSB to USB cable

View all 6 components

  • Project Addendum - October 17th, 2018

    Martian4 days ago 0 comments

    I forgot to mention, I also added some EXPERIMENTAL mathematical functions within the integer only limitations of TinyBASIC.

    Sine, Cosine and Tangents are implemented as 16-bit integers and scaled from -32,767 to 32,767.   A similar implementation for Sines can be found here: https://www.dribin.org/dave/trigint/group__trigint__sin16.html

    A square root function was also added.

        case FUNC_SIN:
          return(sin(a/127.0)*32767.0);
            
        case FUNC_COS:
          return(cos(a/127.0)*32767.0);
      
        case FUNC_TAN:
          return(tan(a/127.0)*32767.0);
      
        case FUNC_SQR:
          return(sqrt(a));

  • Project Status - Oct. 7th 2018

    Martian10/07/2018 at 21:43 0 comments

    The project is now officially called the "Arduino Due CP/M Personal Computer" (ADCPC).


    The underlying code (RunCPM and Tiny BASIC Plus) has been updated to the latest upstream versions (3.1 and 0.15 respectively).  Some changes were made while (painfully) copying over my mods from the earlier forked code I had, mostly to the BASIC. 

    This is now Revision 2.0 of the (ADCPC) internal software (BASIC & CP/M).  I haven't been able to compile RunCPM Lua support for Arduino (although it works for PC), perhaps I'm doing something wrong so I will come back to that later.

    One immediate difference is that user programs are now preserved in the portion of RAM that BASIC uses, even when going in and out of CP/M which could be very useful:

  • Project Status - Oct. 6th 2018

    Martian10/06/2018 at 14:42 0 comments

    Just a brief log entry.  The project has been 'reopened'.  The CP/M has been running flawlessly 24/7 for months, I have it connected to a Raspberry Pi server that I can ssh into then connect via minicom.  I also have the Arduino software on the Pi so I can flash updates.

    A few objectives:

    • Update underlying Tiny Basic Plus and RunCPM code to upstream versions.
    • Enable RunCPM Lua interpreter!!!
    • Reorganise SD card contents.
    • Create a tarball of everything for sharing here.

    Longer term:

    I'd like to boot to a Menu, providing links to BASIC, CP/M and perhaps some other terminal programs maybe...  a calculator?  a calendar?  a simple data filer?  an editor?  Anything I can squeeze in and compiles without too much grief on an Arduino.

  • Connecting the MicroSD card adaptor #2

    Martian05/30/2018 at 21:12 0 comments

    Generic MicroSD card adaptor used:

    Wiring diagram:

  • Connecting the MicroSD card adaptor #1

    Martian05/30/2018 at 21:10 0 comments

    I've had some posts about how to get the Arduino Due connected to the MicroSD card adaptor, the DUE uses a different wiring scheme compared to other Arduinos.

    Firstly I've used a widely available generic adaptor from eBay.  I cannot help with any other type that is wired differently.

    There are SIX pins as follows:

    CS
    SCK
    MOSI
    MISO
    VCC
    GND

    These connect directly to the SPI header on the DUE (just above the logo):

    Connect CS from the SD card to PIN 4 on the DUE.  Leave RST(Reset) on the DUE unconnected.

    MISOVCC
    SCKMOSI
    RST
    GND

  • Project status - Apr 14. 2018

    Martian04/14/2018 at 18:44 0 comments

    I've had some requests from people to join this project's 'team'.  If someone wants to do that, they would need to message me and give an idea as to why they want to join and more importantly, what they want to do, add etc.

    Although I will probably make little changes to my CP/M machine, it is marked as a Completed Project, unless I have a compelling reason to turn it back into an ongoing project.

    The instructions on how to make your own low-cost CP/M computer are provided and Marcelo Dantas' RunCPM is linked to on the main project page.

  • Tiny update - Sept. 26th

    Martian09/26/2017 at 19:29 0 comments

    As noted previously, within the Arduino's 96K of RAM, CP/M occupies 64K and BASIC uses a separate 24K.  So when in CP/M, the last BASIC program should still be resident.

    So..

    Now, as well as being able to launch CP/M from BASIC with the 'CPM' command, from CP/M 'exit' will drop back to the calling BASIC interpreter.

    This makes switching a lot easier, eventually I may be able to implement a task switcher, keeping CP/M's RAM contents intact in BASIC and vice versa.

  • Adding Tiny BASIC Plus with Colour and Graphics

    Martian02/19/2017 at 16:37 0 comments

    I took Tiny BASIC Plus and RunCPM and squished them rather inelegantly together! Both projects could compile on other hardware, I've broken that! (oops!)

    I figured out how to expand Tiny BASIC Plus and added a 'CPM' command. This then calls the setup and loop functions of RunCPM, in effect leaving native BASIC and booting Z80 CP/M like the C128.

    It then occurred to me that BASIC was LOADing and SAVEing to the root of the SD card, so I adjusted those routines to prefix filenames with "/B/0/", this makes BASIC files available to CP/M's drive B, user 0. The 'TE' editor is much nicer for writing code.

    Finally, I decided to add some ANSI spice!

    • CLS - Clears the screen
    • COLOR - Changes the text color, 9 resets to default
    • PLOT - Plots and lovely BLOCK graphic at co-ordinates X, Y

    In future, I may make BASIC and CP/M switchable, BASIC programs use 24K RAM and CP/M sits in a separate 64K.


    Spectacular ANSI graphics test:

    From BASIC, type 'CPM' to boot the OS and access the BASIC files on drive B:

    The above BASIC graphics test, now loaded into 'TE' in CP/M:

  • Upgrades Jan 27th, 2016

    Martian01/27/2017 at 12:28 0 comments

    I added a hardware reset button to the back of the unit, handy! One quick press and CP/M will reboot.

    Added a second LED

    Now there is a power-on LED

    ..and a disk activity LED

    When CP/M exits, they blink alternately until the USB plug is pulled or the Reset button is pressed.

View all 9 project logs

  • 1
    Step 1

    Marcello Dantas' RunCPM was flashed onto the Arduino Due. The MicroSD adaptor is connected via SPI. The good thing about RunCPM is that the SD card uses a standard PC filesystem, CP/M drives A to P are implemented as directories. This makes copying software and data over nice and easy. No arcane disk images.

    I tweaked RunCPM to my own tastes, minor things really like the displayed text on startup etc.

  • 2
    Step 2

    I bought a nice project case off eBay. I put some spacers in to mount a 3mm piece of plasticard that I would attach the Arduino and MicroSD adapter.I then drilled the appropriate holes.

  • 3
    Step 3

    Ready for the PCBs

View all 7 instructions

Enjoy this project?

Share

Discussions

villaromba wrote 10/12/2018 at 15:18 point

BTW How did you get TinyBasicPlus to run on Due? I get avr/io.h error - i.e Due not an AVR

  Are you sure? yes | no

Martian wrote 10/12/2018 at 16:20 point

Contact me via the message system and we'll see what we can do.  :)

  Are you sure? yes | no

villaromba wrote 10/12/2018 at 13:17 point

This is a really interesting project running on my Due and I look forward to seeing the integration of the colour graphics side. Will now play with the tiny basic ......

  Are you sure? yes | no

fabian wrote 07/19/2018 at 15:20 point

Meybe zx spectrum version?

  Are you sure? yes | no

joseluis.collado wrote 06/04/2018 at 02:15 point

Hi Martian, very nice project, specially for the added TinyBasic functionality and color support. I'll appreciate if you could share this modified code.

Regards, JL

  Are you sure? yes | no

Peabody1929 wrote 05/29/2018 at 22:09 point

The ISP connector has the pins needed for the SD Card interface except Card Select.

  Are you sure? yes | no

jharre wrote 04/22/2018 at 17:48 point

This is cool! I've got the parts, but can't figure out how you wired the SD card board. Can you share which pins on the Due go to which pins on the SD adapter board?

  Are you sure? yes | no

Martian wrote 05/15/2018 at 22:20 point

I'm SO sorry I failed to see this post, did you get it working or do you still need help?

  Are you sure? yes | no

jharre wrote 05/29/2018 at 16:09 point

Yes, I did eventually get this to work with a Sparkfun SD adapter board. (With the Due, you have to bend out pins D11, D12, D13 before plugging in the adapter and use pin 8 for CS.) But, it would be nice to see how you wired the SD card board to the Due with the jumper wires.

  Are you sure? yes | no

Martian wrote 05/30/2018 at 21:15 point

I've added a couple of project logs to show how I connected mine up.

  Are you sure? yes | no

jharre wrote 05/30/2018 at 23:27 point

Ah! That looks good - easy to follow how you did the connections now. Thanks!

  Are you sure? yes | no

Arawn Davies wrote 01/18/2018 at 19:57 point

Hi, great project! I've just put RunCP/M on an Arduino Due after waiting months for my Micro SD card adapter to arrive. Do you plan on making this open-source at any point? If it was hosted on GitHub or something like the main RunCP/M project is, more people can contribute to it if you wanted. I respect your decision not to, just in the event that you don't :)

  Are you sure? yes | no

Martian wrote 01/26/2018 at 10:10 point

I could do.  The project was originally to run vanilla RunCPM following Marcello's work.  I've just extended it with a custom TinyBASIC for my own use, it's really a messy hack.  I'm focussing everything on my custom CPU project right now, but I do come back to this every now and then.


I'm not sure I want to get into a forked RunCPM project as such, because I don't understand all of the code and I have too much respect for Marcello's work.  I would have to make time to tidy everything up, but essentially I'd probably share stuff and explain how to modify vanilla RunCPM, it's essentially renaming loop and setup to cpmloop and cpmsetup so they can be manually called by an customised TinyBASIC keyword.


And all of this is affected by whether I make further hardware changes, I am -considering- making the machine standalone by adding a "$5 graphics card", ie. Pi Zero:

https://hackaday.io/project/9567-5-graphics-card-for-homebrew-z80

It also opens up possibilities for remote wireless connection and maybe connecting to the outside world.

  Are you sure? yes | no

Arawn Davies wrote 05/17/2018 at 23:30 point

Thanks for the tip, I'll give it a go and dabble more into it. I'm also considering moving onto a real Z80-based microcomputer that cna run at least MBASIC - bought the RC2014 Starter Kit without realising that it only came with the PCBs, a few headers and the MBASIC ROM, so I might be able to do something with what I've got already.

  Are you sure? yes | no

guido.lehwalder wrote 09/26/2017 at 10:17 point

Hi, whats the name of the blue terminal-font in the banner pictures (its not the glass-tty-vt200). It looks like a OCR A font, but OCR A hasnt the point inside the number zero.
I did built myself a RunCPM, but I didnt see files for your project (only the vt220-ttf).
Are there any - anywhere? :)

  Are you sure? yes | no

Martian wrote 09/26/2017 at 14:40 point

The font I was using is here:

https://github.com/rbanffy/3270font

It's based on the IBM 3270 terminal font.

RunCPM comes from the wonderful work by Marcello Dantas:

https://hackaday.io/hacker/42223-marcelo-dantas

The BASIC thing is still very much a work-in-progress and I'm not planning on sharing files until the project is -complete-.   It's a messy kludge of TinyBASIC Plus (heavily customised) and a slightly altered version of Marcello's RunCPM.  I'm still changing a lot of stuff - frequently, I may even change the BASIC interpreter if I can find a better one that is easily modifiable.  I am also looking into adding more software features and hardware.

  Are you sure? yes | no

FloppySoftware wrote 06/29/2017 at 20:19 point

Very nice project!

I'm glad to see that my humble TE text editor for CP/M is useful for somebody!

  Are you sure? yes | no

Martian wrote 09/14/2017 at 14:23 point

My apologies for not replying before.  My sincerest thanks to you for TE, it's a very useful program and it's great to see new software on the venerable CP/M OS.

  Are you sure? yes | no

Marcelo Dantas wrote 01/25/2017 at 00:18 point

This is simply AWESOME!!! Looks like the real thing, I just had a trip down memory lane right now.

Honored that RunCPM is behind such a beautiful machine.

  Are you sure? yes | no

Martian wrote 01/25/2017 at 06:54 point

Thanks, and thanks to you for RunCPM.  The machine is a joy to use, I'm gonna get many years out of it.  I've been doing some distraction-free writing on it.  I've also to look into the Lua aspect of it, but that sounds really interesting.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates