Close
0%
0%

1802 MemberChip Card

A retro-microcomputer in a micro-package. Learn from the ground up, just like the pioneers. Has monitor editor assembler BASIC FORTH LISP...

Public Chat
Similar projects worth following
The MemberChip Card is a complete microcomputer that fits in a tiny Altoids Smalls(R) tin.

- 1802 microprocessor, 32k RAM, 32k EPROM, and serial I/O.
- Build it yourself, and learn to solder. Entirely built with through-hole parts, big pads, and wide spaces.
- "Heathkit" style educational instruction manual with programming and hardware examples.
- Software includes monitor, visual debugger, mini-editor/assembler, BASIC, FORTH, LISP, VTL2, and Adventureland game.
- Expansion bus for additional I/O.
- Micropower operation; runs on batteries, PV panels, etc.

Once upon a time, microcomputers were simple and easy to understand. So simple in fact that a kid like me, with no computer experience whatsoever, could actually understand them, build them, program them, and put them to work in his very own projects! My first computer was the COSMAC 'ELF', built from an article in the August 1976 issue of Popular Electronics magazine. It used the RCA 1802; an exceptionally easy to use microprocessor. The ELF taught me about computing, and got me started on a career in engineering.

Today's computers are far more powerful than the 1802. But they have also become so complicated that almost no one can build them, or truly understand how they work. They come on pre-assembled boards, and require a powerful PC to download pre-written programs to do anything. The opportunity to learn from the bottom up is missing; it's as if the lower rungs of the ladder have all been cut off, so you have to somehow start at the top.

The MemberChip Card is my attempt to return to the basics. It's the "bicycle" of computers; simple enough so someone with no prior experience can get started, build and program it, and learn about the fascinating world of electronics and computing!

Hardware

  • CPU: RCA CDP1802ACE microprocessor
  • Clock: 4 MHz ceramic resonator
  • Memory: 64k (32k bytes RAM, 32k bytes EPROM)
  • I/O:
    - 4800 baud TTL serial port (for use with USB-serial adapter)
    - 20-pin I/O expansion connector (with data bus, R/W, and I/O port select strobes)
    - one 1-bit output (with red LED, for serial output)
    - four 1-bit flag inputs (one with green LED, for serial input)
    - one interrupt input
  • Connectors:
    - 6-pin power+serial connector (mates with USB-serial adapters)
    - 20-pin expansion connector with power, ground, and I/O signals
  • 100% through-hole construction (no surface-mount)
  • Size: 2-1/8" x 1-3/8" x 5/8" (55 x 35 x 15 mm)
  • Power: 3.6v to 5v DC at 2-3ma (depends on whether the LEDs are lit)
  • Aroma: A hint of curiously strong peppermint

Software

  • Standard ROM:
    - Machine-language monitor to examine/change memory and registers
    - RCA floating point BASIC3
    - Vintage Adventureland game by Scott Adams
  • Advanced Elf-OS ROM by Mike Riley:
    - MINIMON monitor program
    - EDT/ASM mini editor/assembler
    - VISUAL/02 visual debugger
    - Integer Tiny BASIC (a classic from the 1970's)
    - FORTH (an interactive stack-oriented programming language)
    - LISP ( a pioneering programming language still used today)
    - VTL-2 (a Very Tiny Language, even simpler than BASIC)

How did I get it so small? Here's the trick: It uses just one normal 2-sided PC board, but with parts mounted on both sides, to effectively double the space. They are carefully positioned so their pins miss each other, and are accessible for soldering. The PCB and schematics are also old-school; they were produced with last-century OrCAD software running on a 30-year-old PC.

The MemberChip card itself has a small amount of I/O for simple projects. But you can add expansion cards to greatly expand it. Here is an example of an I/O expansion card built by Herb Johnson using the 8255 (or 82C55). It adds three 8-bit expansion ports.

The schematic for it is shown in the gallery above. The red connector plugs into the 1802 MemberChip card expansion port, and the dual right-angle pin header at the bottom brings out power, ground, and the 24 I/O port pins. It was hand-wired on a piece of perfboard. Below is a photo of it plugged onto the 1802 MemberChip card to make a very compact 2-card stack.

BASIC3v11user.pdf

Here is the manual for RCA's floating point BASIC level 3 by Ron Cenker, which is included in the MemberChip card standard ROM.

Adobe Portable Document Format - 189.01 kB - 06/10/2023 at 18:37

Preview
Download

MC20ANSA.BIN

This is the standard MemberChip card system ROM. It contains the 1802 monitor by Chuck Yakym, floating-point BASIC by Ron Cenker, and Adventureland game by Scott Adams and Richard Goedecken. Burn it into a 32K EPROM (27C256 etc.) and install it at U2. (Version 2.0AR, updated 1 Oct 2023 by Chuck Yakym.)

application/octet-stream - 32.00 kB - 03/28/2023 at 20:13

Download

MC21ANSA.bin

This is an expanded MemberChip card system ROM for the rev.B PCB. It contains the 1802 Monitor by Chuck Yakym, floating-point BASIC by Ron Cenker, Adventureland game by Scott Adams, and the Super Star Trek game from David Ahl's BASIC book. Burn it into a 64K EPROM (27C512 etc.) and install it at U2. (Version 2.1AR, updated 19 Feb 2024.)

octet-stream - 64.00 kB - 03/04/2024 at 21:31

Download

ElfOSv172.hex

This is an alternate MemberChip Card system ROM with Mike Riley's Elf-OS mini 1802 operating system. It contains a monitor, visual debugger, editor, assembler, integer BASIC, FORTH, LISP, and VTL2. Burn it into a 32K EPROM (27C256 etc.) and install it at U2. (Version 1.7.2, updated 11 Nov 2023 by Gaston Williams and Al Williams.)

hex - 88.01 kB - 11/03/2023 at 03:17

Download

1802ME.ZIP

This ZIP file contains the Gerbers for the MemberChip PCB layout. These can be submitted to the PCB vendor of your choice to make your own PC boards.

x-zip-compressed - 26.65 kB - 05/11/2023 at 21:26

Download

View all 6 files

  • 5 × C1, C2, C3, C4, C5 0.1uF 50v ceramic MLCC capacitor
  • 1 × Q Red LED high brightness T-1
  • 1 × EF3 Green LED high-brightness T-1
  • 1 × P1 Header 6-pin on 0.1" centers
  • 1 × P2 Header 20-pin on 0.1" centers

View all 15 components

  • 11/2/23 Update

    Lee Hart11/02/2023 at 16:05 0 comments

    David Madole, Gaston Williams, Al Williams and others have been fixing bugs and improving Mike Riley's diskless Elf/OS system. I replaced the earlier version 1.4 file with the latest version 1.7.2, which includes all the latest changes to the various programs. I also updated the 10/8/23 Project Log to document the changes made to the programs in this version 1.7.2 ROM.

    Chuck Yakym made some improvements to the standard MemberChip Card system ROM. I replaced the earlier MC20ANSA.BIN file with the new version, and edited the MemberChip Card manual to reflect the changes.

  • 10/10/23 Update

    Lee Hart10/10/2023 at 18:57 0 comments

    For those that already have a MemberChip Card rev.A, here are the changes to convert it to rev.B, to expand the ROM from 32k to 64k:

    The change is pretty simple; just three pins! Compare it to the rev.A schematic.The EPROM is changed from a 27C256 (32k) to a 27C512 (64k). The 1802 reads the lower 32k of the EPROM normally when A15=0 and /MRD=0 (a normal memory read cycle).

    But if the 1802 writes to the lower 32k, it sets A15=0, /MWR=0 and /MRD=1. /MWR=0 chip-selects the ROM, A15=0 enables it to read, and /MRD=1 sets ROM address bit A15 high; so it reads a byte from the upper 32k.

    We don't want both the 1802 and ROM to put data on the bus at the same time (bus fight)! So we use the 1802's INP instruction to do the write cycle. INP sets /MWR=0, but does not put data on the bus. Instead, the 1802 loads whatever is on the data bus into its D register.

    Thus we have a way to read any byte in the upper 32k of the EPROM. The upper ROM address is specified by the 1802 R(X) register (with bit A15=0). This byte can then be used or saved in RAM normally.

    The 9/20/23 update shows an example program to move blocks of data from 32-64k in the EPROM into RAM.

  • 10/8/23 Update

    Lee Hart10/10/2023 at 05:23 2 comments

    Here are some "Quickstart" instructions for the Menu, BASIC, VTL2, and Visual/02 programs in Mike Riley's alternate program ROM. They're not a full manual yet, but will get you started and give you a "taste" of vintage programs and languages.


    A Quickstart Guide to the Diskless Elf/OS ROM

    by Mike Riley and Lee Hart

    Last update: 2 Nov 2023

    Elf/OS is a disk operating system for 1802 microprocessor systems. Since disk drives on the 1802 are rare, Mike also made a "diskless" version, so users could add their own form of mass storage. The Diskless Elf/OS ROM is stored in a single 32K EPROM, which contains a "sampler" of vintage programming tools and languages, including BASIC, FORTH, LISP, and VTL-2. It also includes a Monitor, Visual debugger, mini Editor/Assembler, and XMODEM load/save programs.

    Diskless Elf/OS can be used in any 1802 system with 32K ROM and 32K RAM. A 5V USB-serial adapter provides power and serial I/O using the 1802's Q output and EF3 input pins. The MemberChip Card has a header to match the Sparkfun FTDI 5v USB-TTL serial cable #9718 www.sparkfun.com/products/9718. Use it with a serial terminal, or a PC running a Terminal program such as TeraTerm http://www.tera-term.en.lo4d.com/windows. Here are the basic steps:

    1. Connect the 1802ME MemberChip Card:

    2. Start TeraTerm:
            If it asks, select Serial (not TCP/IP), and select your COMn: port

    3. Select Setup... Serial port... and select:
            Port = COM5 (or whatever serial port number your computer has)
            Speed = 4800
            Data = 8 bit
            Parity = none
            Stop = 1 bit
            Flow control = none

    4. Select Setup... Terminal... and select:
            Term size = 80 x 24
            New-line: Receive = CR, Transmit = CR
            Terminal ID = VT100
            Coding: Receive = UTF-8, Transmit = UTF-8

    5. Press the <ENTER> key, and the 1802ME will figure out the baud rate
            and display its sign-on menu:

     -------------------------------------
    |    MemberCHIP                       |
    |                                     |
    |    1. Rc/Basic L2                   |
    |    2. Rc/Forth                      |
    |    3. Rc/Lisp                       |
    |    4. EDTASM                        |
    |    5. VTL2                          |
    |    6. Visual/02                     |
    |    7. Minimon                       |
    |    8. Dump Memory                   |
    |    9. Load Memory                   |
    |                                     |
    |       Option ?                      |
    |                            v1.7.2   |
     -------------------------------------
    

    Select one of the options by typing its number (1-9) and the <ENTER> key. The selected program will then start. See the instructions for how to use each program. Each program has its own way to EXIT back to the Menu.

    1. Rc/BASIC L2

    This is a classic 16-bit integer BASIC. Type a command line, and end it with the <ENTER> key. BASIC will execute the command, and display the result. Commands can be typed in upper or lower case, but will be converted to uppercase.

    Rc/BASIC has two types of variables: Numeric and String. There are 26 Numeric variables, named A-Z. Longer names can be used for readability, but the additional letters are ignored (so A is the same variable as APPLE). Numeric variables must be integers in the range -32768 to +32767. Numbers smaller or larger than this will wrap around (so 32767+1 = -32768).

    There are 26 String variables A-Z. Longer names can be used, but the last character must be a $ (so A$ is the same string variable as APPLE$). Strings are placed in quotes, like this: ROSE$="are red". Strings can be any length up to the available memory size.

    There are two modes of operation; Direct and Program. In Direct mode, BASIC executes each line you type immediately. For example:

    A=5                        ...you type these 3 lines
    B=4
    PRINT "A times B is "; A*B
        A times B is 20        ...and BASIC types this line
    

    In Program mode, start each line with a line number. Rather than being executed, the lines are stored in memory, sorted into ascending order. If a line already exists with that number, the new line replaces...

    Read more »

  • 10/6/23 Update

    Lee Hart10/06/2023 at 18:44 0 comments

    There are a number of cross-assemblers for the 1802, but Mike Riley's ASM/02 is the newest, most capable, and runs on Windows and Linux PCs. He used it to write his Elf/OS operating system for the 1802, the source for which is posted on his Github pages (referenced elsewhere in this project). ASM/02 includes directives for producing code for various 1802 hardware platforms, including the MemberChip Card.

    The cosmacelf community https://groups.io/g/cosmacelf/topics has been actively fixing bugs and adding features to ASM/02 and Elf/OS. Tony Hefner suggests downloading it from https://github.com/arhefner/Asm-02 as it's being maintained by the group. Al Williams just posted an excellent instruction manual for it at https://groups.io/g/cosmacelf/files/Al%20Williams/Assembly%20Langauge%20for%20the%20ELF_OS%20and%20ELF_BIOS%20Environment.pdf

    Al's work is basically a programming manual for the 1802 using ASM/02. It explains the charming eccentricities of the 1802 (what, no CALL instruction?), and shows how the assembler gets around them (to add CALL, and many other "normal" instructions).

  • 10/5/23 Update

    Lee Hart10/05/2023 at 19:37 0 comments

    I ordered PCBs from https://www.pcbway.com/ to test out my idea for bank-switching the MemberChip card EPROM to allow more than 32k. It's the first time I've used them. They were super-easy to work with, and even offered to sponsor the boards. :-) The PCBs look great and arrived quickly.

    I was initially worried because their Gerber viewer had problems displaying my PCB. It looked like this:

    The holes and soldermask were obviously in the wrong places! It turned out to be a consequence of my habit of including dimensions, names, dates, and layer identifications outside of the PCB outline in my Gerber files. In my OrCAD PCB layout program, it looks like this:

    Once I removed all the extraneous information outside of the Outline, this problem was resolved. The actual PCBs came out beautifully, like this:

  • 10/1/23 Update

    Lee Hart10/02/2023 at 03:55 0 comments

    Made numerous small changes to the MC20ANSA ROM, and uploaded an updated image to the Hackaday.io page.

    Changes include improved operation at high baud rates, clearer HELP messages, and the addition of a CALL option to the Monitor so you can CALL a user program, make use of the monitor's I/O routines, and RETURN to it when it exits.

    The MCSMP20 monitor in the ROM actually has two separate "run" commands:

    The RUN command

    The monitor's RUN command is like a hardware CLEAR; it sets X=0 and P=0, so R0 becomes the program counter. If you don't provide an address (just R<cr>), then program execution begins at 0000; just like a hardware reset.

    If you *do* provide an address (Raaaa<cr>), the RUN command sets R0 to that address. Thus, that's where your program will begin executing.

    The other registers are set to the values saved in RAM when the monitor started, as shown by the VIEW command. If you like, you can *change* the corresponding value in RAM, and it will be restored by the RUN command.

    For example, R8 is saved in RAM at FFECh and FFEDh. If you use the WRITE command to set these bytes to some value (for example, WFFEC 12 34<cr>), then RUN sets R8=1234h and then starts execution at R0.

    The CALL command

    The other RUN command could more properly be named CALL. Although 1802 register assignments are arbitrary, most 1802 software typically uses them as follows. If you want your programs to work with other people's programs, use these assignments:

          R0 = DMA pointer (and the PC on power-up or clear)
          R1 = Interrupt handler
          R2 = Stack pointer
          R3 = Program counter
          R4 = CALL subroutine
          R5 = RETURN from subroutine
          R6 = used to pass parameters to or from a subroutine

    CALL is an initialization routine to set up all these registers for you. It is in ROM at address 1680h. The R1680<cr> command will:

          - change the program counter from R0 to R3
          - set P=3
          - initialize the stack
          - set X=2 to make it the stack pointer
          - point R4 to SCRT CALL routine
          - point R5 to SCRT RETURN routine
          - push R6 onto the stack
          - use R6 to get the current baud rate constant
          - save the current baud rate constant in RE
          - restore R6 from the stack
          - and jump to 8000h (the start of RAM, where your user program should be)

    Happy hacking!

    Lee Hart

  • 9/20/23 Update

    Lee Hart09/20/2023 at 18:47 1 comment

    I added a link to Josh Bensadon's short Youtube video demo of the MemberChip Card. (Thanks, Josh! I've never made a video in my life, and didn't know how I was going to add one to meet the contest rules.)

    I now have a program to read files from the upper pages of a larger EPROM. This opens the door to using a file system like Mike Riley's Elf/OS. A large EPROM (up to 256k bytes) can be used to simulate a disk drive, making a file system worthwhile.

    The standard ROM is 32k bytes (1 bank), and is simply addressed from 0-32k. But by rewiring the chip-select logic (a single 74HC132), the 1802 can select up to eight 32k banks in a larger ROM.

    Here's the trick: EPROM /CE is selected by *either* /MRD or /MWR, and address bit A15 is connected to EPROM /OE. This means any address from 0-32k selects the EPROM. Obviously, you can't write to an EPROM.

    However, 1802 I/O instructions move bytes from the data bus to/from memory. For example, the INP 1 instruction sets /MWR low, puts the register pointed to by X on the address bus, and writes whatever is on the data bus into that memory location *and* into CPU register D.

    INP 1 thus sets /MWR low (to select the EPROM), sets /MRD high (to address the upper 32-64k bank), and register X provides the other 15 bits of the address to read a byte from that 32-64k bank. The byte read from the EPROM goes into the 1802's D register. It can subsequently be used, or saved anywhere in RAM. Here is a sample program:

          8000 F8 01  ldi 01h  ; point R6 to "source" in high ROM (for example, 0100h)
          8002 B6     phi r6   ; (which will actually read 8100h in the EPROM)
          8003 F8 00  ldi 00h
          8005 A6     plo r6
          8006 E6     sex r6   ; and set X to "source"
          8007 F8 82  ldi 82h  ; point R7 to "destination" in RAM = 8200h
          8009 B7     phi r7
          800A F8 00  ldi 00h
          800C A7     plo r7
          800D F8 10  ldi 10h  ; set R8 as byte counter (move 10h bytes)
          800F A8     plo r8
    loop:
          8010 68     inp 0    ; read byte from high ROM,
          8011 57     str r7   ; and store it in RAM
          8012 16     inc r6   ; increment source
          8013 17     inc r7   ; increment destination
          8014 28     dec r8   ; decrement byte counter
          8015 88     glo r8   ; get counter
          8016 3A     bnz loop ; loop until byte counter = 0
    

    The 1802 has three bits (N0, N1, and N2) to indicate the I/O port address. The INP instructions set these to reflect the instruction (INP 0 to INP 7). These three bits can be connected to the address bits of even larger EPROMs to address up to 256K bytes of banked memory.

  • 8/27/23 Update

    Lee Hart08/30/2023 at 03:25 0 comments

    More updates to the manual at sunrise-ev.com/photos/1802/1802me-manual.pdf.

    I figured out a clever scheme to double the EPROM size (from 32k to 64k) with bank switching. This will allow me to put both the standard and alternate ROMs in at once. Now I'll have to see if there's enough room on the PCB to actually implement it!

    Numerous small bug fixes and enhancements have been made to the Alternate ROM software.  Allow tabs in the editor. Handle the illegal 1802 opcode 68h in the monitor and debugger. Add new words to FORTH, etc.

  • 6/2/23 Update

    Lee Hart06/03/2023 at 00:00 0 comments

    Added some new material to the manual, and updated the parts list.

    I've also started to document the programs in the Alternate ROM package. It has tiny versions of several classical programming languages (BASIC, FORTH, LISP, etc.) so many users will need some "hints" on how they work.

  • 5/15/23 update

    Lee Hart05/15/2023 at 18:38 0 comments

    Corrected a few typos on the schematic, and clarified the text. Updated the PDF manual.

View all 11 project logs

View all instructions

Enjoy this project?

Share

Discussions

Mark B Jones wrote 04/24/2023 at 16:51 point

Loving your concept and idea Lee, kids need better accessible entry into tech, engineering, programming and IT and this looks a real cool way to tap into their curiosity. have followed, would be great if you could follow me too 🙏 hackaday.io/zxfan

  Are you sure? yes | no

Lee Hart wrote 04/25/2023 at 05:54 point

Thanks Mark! I'm hoping that the unusual form factor and "story" in the manual will help get beginners interested. I'd love to hear comments on what people think, and how I could improve on it.

  Are you sure? yes | no

Lee Hart wrote 04/12/2023 at 23:24 point

Yep! All it takes are 8 data switches and a one-shot to DMA bytes into an 1802. A serial loader program is about 16 bytes. Tedious; but that's how it was done before EPROMs.

On the cosmacelf.com list, we recently talked about a diode-ROM. A 1-of-16 decoder, pull-up resistors, and a handful of diodes can provide a "ROM" with that 16-byte serial bootloader.

Or, a vintage UART like the 1602 or 1854 can be wired to the 1802's DMA channel, so every serial byte received goes into memory. That can bootload programs with no ROM, front panel, or other hardware.

  Are you sure? yes | no

crun wrote 04/13/2023 at 01:15 point

Compressing diode roms - now there's a fun time waster. Especially for small roms where the code will never change. Like this.

1) Using shift registers or analog switches instead of decoders, you can choose the polarity to minimise the number of diodes. (i.e. use pull up or pull down R's to minimise the number of diodes. In a cosmac, choosing a particular register might help

2) You can mix pull up and down by bit to minimise the diode count on each bit. Either invert that bit line with a transistor, or use transistors instead of diodes to invert in the rom 

3) You can double diode so that where there are common groups of diodes (e.g 4 diodes select a register) you have that group common, and connect it to the decoder with another diode.

4) Sometimes an address line can correspond to a bit. A bipolar or fet can gate this.

  Are you sure? yes | no

Lee Hart wrote 04/13/2023 at 01:48 point

See http://sunrise-ev.com/1802.htm#nametag for an extreme example of this. It uses the 1802 to display a 32-character scrolling message with *no* RAM or ROM! The program is created by the network of resistors between the address and data buses.

  Are you sure? yes | no

crun wrote 04/13/2023 at 20:27 point

> http://sunrise-ev.com/1802.htm#nametag for an extreme example of this.

I bow down before thee !

  Are you sure? yes | no

crun wrote 04/13/2023 at 01:19 point

Of course a punch card / paper tape reader needs 9 piece of wire or 9 phototransistors if you want to get fancy. That would be the cheapest and simplest way. Also allows longer roms. Easy to laser cut the cards nowadays.

Not to forget marksense cards. The user has to colour in the paper rom with a 2B pencil. I measure ~50k, so easy to sense.

  Are you sure? yes | no

crun wrote 04/12/2023 at 22:23 point

So another possible architecture here is to dma the code into ram and ditch the eprom. Adding a shift register would let the ftdi bootstrap the ram with it's non-uart spi function.

It would be further possible to use a simple r-c-d circuit to let normal uart signals push 1/0 into the shift register (you only put one bit / char into the SR). e.g char 0xFE=1 , 0x8F=0 , 0x00=DMA strobe byte. (so 9 chars per byte)

A specially crafted bootloader file would be required (but no special hardware or pc software), but this is very much like bringing up a pdp11, where you had pre-bootloader to load the bootloader paper tape. All that would be required is the bootloader file, and any serial terminal to dump it out at the required baud rate.

  Are you sure? yes | no

crun wrote 04/12/2023 at 22:23 point

My 1802 used cmos rams. What was nice about 1802, was it had the DMA pin, and so you could write switches direct into ram, i.e. toggle* the code in without having to have an eprom programmer. (The other issue being that roms were total power hogs - the true cmos rams and fully static 1802 drew less than 1uA ).

*[I made a hex keypad to do it pretty quick, as setting toggles was beyond tedious. I had no serial terminal, and thus no monitor, so programs were keyed in as hex, from the beginning every time. Made a strong incentive to try and get it to work first time]

  Are you sure? yes | no

Lee Hart wrote 03/30/2023 at 02:10 point

Glad you like it. I'm still working on it, so will be adding to the hackaday.io page as I go. What do you think of the manual? I'm trying to get novices interested.

  Are you sure? yes | no

Dan Julio wrote 03/30/2023 at 00:25 point

Always had a sweet spot for the quirky 1802.   Nice job Lee.

  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