Close

9/20/23 Update

A project log for 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...

lee-hartLee Hart 09/20/2023 at 18:471 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.

Discussions

Lee Hart wrote 10/18/2023 at 07:05 point

10/18/23: Added example program to read blocks from upper half of a 64k EPROM into RAM.

  Are you sure? yes | no