Conversion of KIM-1 to ELF COSMAC – from

In the mid-1970s, if he had his own computer, he built it. If you had a lot of money and abundant structure skills, you could make an Altair 8800 for around $395, more than the $650 to build it. However, the less expensive opportunities were not far behind.

In 1976, Popular Electronics published plans for a computer called COSMAC Elf that you can build for less than $100, let alone if you have a smart trash box. panel or using a coiled cable. We have brought the online archive of the entire Popular Electronics collection, however, please refer to page 33 of this PDF if you want to move directly to the article that started it all. The COSMAC Elf is a wonderful little device built around a 40-pin RCA 1802 processor, and for many, it was the first computer they had. I lost my original 1802 computer in a typhoon and my recent reconstruction in an absolutely different type of typhoon. On the way to those glory days without starting from scratch. I’m moving on to reuse the odd retro-pc game; KIM-1.

I admit, rewiring a genuine KIM-1 to take a 1802 processor would be complicated and unnecessary and that’s not the subject of this article. However, it had a KIM UNO – [Oscar’s] respin from the old PC and an Arduino mini pro. Looking at the keyboard, it happened to me that the Arduino can simulate both a 1802 and a 6502. Heck, those are just two other numbers, is this rarely the case?

The result is pleasant. A “real” Elf had 8 toggle switches, but there were several variants that had keyboards, so it’s not that far away. Most Elf computers had 256 bytes of memory (no update), but the UNO 1802 (as I call it) 1K. There are also a number of other features, adding a ROM and monitor to load and debug systems that require no area in the emulated 1802.

The KIM UNO has 24 switches. There are 16 for hexadecimal digits, of course. The two most sensitive rows mimic the purposes of the original KIM-1. A genuine Elf had a way of entering a byte (usually 8 toggle switches), a load switch, an execution switch, a memory coverage switch, and a button connected to a processor pin. This means that the hardware has more than enough switches.

On the demo side, a general Elf had a one-byte hexadecimal demonstration, although some clones had more. There was also the Q LED that a program can turn on or off. Kim Uno’s hardware has many 7-segment presentations, so it’s conceivable to use those numbers as an Elf clone. However, there are no LEDs, with the exception of the Arduino’s built-in LED, which is usually not visual in operation. However, virtual presentations have decimal problems and are connected to Arduino. So if you don’t mind using them, you also have a lot of LEDs.

The hardware is open source and easy to duplicate. [Oscar] also has kits and they are very reasonable (around $20).

The KIM UNO software is open source, so I started there. First I got rid of all the code from the main register, apart from the parts that controlled the demo and keyboard, and then I built everything necessary for the 1802 emulation. You can locate all the code in my GitHub 1802UNO repository.

The 1802 instruction set is very normal and quite simple. Most commands use the top four bits as the operation code and the decreasing four bits to choose one of the 16 16-bit logins. in 5. There are only a handful of operation codes that do not adhere to this pattern. There is also an 8-bit accumulator called “D” (which should not be with the D login).

A unique feature of the 1802 architecture is the program counter. There isn’t. Well, more precisely, there are up to 16. Any of the records can be the program counter and a call to a subprogram can be as undeniable as converting the program counter. Unfortunately, this is not very reentrant (or smart for recursion). If you want a subprogram call, you want to encode it yourself. RCA provided the “standard call-and-return technique” that had the unfortunate disadvantage of destroying the accumulator.

With so few commands, the emulator turns out to be a few transfer commands and undeniable code. Although it is designed to work with KIM UNO hardware, such as the KIM UNO, it deserves to be able to use it with almost any Arduino through the serial port. It’s not as fun as having the genuine stuff, but it’s easier.

The emulator is quite accurate unless it does not simulate interruptions (since there is no source). However, it does not faithfully reproduce the 1802 charging mode that the DMA used. Instead, the charging mode is just a completely custom designed code. that enters knowledge into memory. It does not simulate the cycle and signs the manipulations that occur in a genuine 1802 that employs DMA in load mode.

In addition to loading a program with the substitute charging mode, you can also move the RAM to the EEPROM or a PC to the serial port.

The serial port is the same old Arduino serial port configured for 9600 baud. By default, serial input will mimic hardware keys. However, you can use the pipeline character (‘|’) to transfer the serial port to terminal mode. Then the code 1802 can read the data from the serial port. It loses the front panel functions and there is no way to go back until you turn the force back on unless you have the code 1802 loose in the port.

Some of the buttons have special purposes if you hold them down for more than a second. For example, the AD button writes EEPROM information to RAM. This is to store a standalone demo, for example.

A summary of the keyboard and serial commands can be found on the GitHub site. The serial port can do things it can’t do from the front panel, such as setting a suggestion mode, emptying processor registers, and more.

The hardware requires some modification from the original KIM UNO kit. There’s a lot to solder and once you’ve soldered the displays it would be hard to remove the Arduino from the board.

I can probably create the software using Arduino IDE, but I used Platform IO. This allows me to use the editor of my choice, but it also deserves to be able to run the code in the IDE. There’s enough memory to expand the RAM, but I didn’t. Since one way to back up and load RAM is to use EEPROM, you didn’t need the RAM to be larger than EEPROM. In addition, the RAM “maps” like a genuine Elf (i. e. RAM in the 0x0 location also appears to be 0x4000, 0x8000, etc. ). It would be more complicated if you added a little more than 1K of RAM.

There are some other more sensitive features of 1802config. h. You can choose how the screen and keyboard are refreshed. Higher values are slower to update but faster to run code. It can replace I/O ports related to the keyboard, displays, and serial port. You can also replace the escape character as standard.

Some examples are provided that cause LEDs to flash and manipulate the serial port. If you take a look, there is a lot of 1802 code on the web. However, keep in mind that most 1802s do not have a curtain UART. emulate the serial ports, the Q output, and one of the EF inputs. This is fine for a genuine device, even if it requires a lot of code, but for this virtual device, it is not practical. You’ll want to extract any code that plays serial I/O and update it with unique I/O instructions.

If you have a binary record (or a format that you can convert to binary), I have a converter written in C included on GitHub. You can compile it on almost any platform and use it to convert. He assumes the direction. If this is not correct, you can open the output in a text editor and adjust it.

In addition, there are 3 ROMs included that you can try. By default, there is an undeniable game of ups and downs. There are also two monitors, one for use with the built-in keyboard and the other for use with a serial port. a ROM, edit 1802rom. h and edit the comments so that the desired ROM is not commented and the others are.

Emulators are fun, but as the song says, nothing beats the genuine. If it is not original enough for you, it is imaginable to build a very original elf, even today. The explanation for why the genuine 1802s are still there is that they had several desirable characteristics, namely low force absorption and radiation resistance.

The Arduino simulation doesn’t have any of those features. However, it is a fun and affordable retro computer toy and a wonderful learning tool. The processor is undeniable enough to be programmed directly into the device’s code and the portability is more wonderful than most other old-school computers.

If you need to know more about 1802, several users are committed to it and a very useful Yahoo group. A has a very prolific software author, but most of the code does not support the 1K RAM of 1802 UNO. Perhaps an edition with more reminiscences is in the future.

Deep link to page: http://www. americanradiohistory. com/Archive-Poptronics/70s/1976/Poptronics-1976-08. pdf#page=33

I also have a Kim Uno. Je I think I’ll be checking his ELF firmware one of those days.

I have a super elf COSMAC. In photo frame. Although it is fixed with a force output, so it can be forced. However, I haven’t done this in a long time.

Beware of those electrolytics at the end of the board on the left side. I replaced mine last year after this was the end of the line. A bit messy but absolutely maintainable and I knew it was going to be mandatory sooner or later. .

This! That’s why I read hackaday. I’ll go on to find an arduino and check it out.

I guess 1K is more than the original, but it would be great to have more. I remembered that he did it pdp/Apr11 https://dave. cheney. net/2014/01/24/avr11-how-to-add-256-kilobytes-of-ram-to-an-arduino – would it be imaginable here?

Good to all and thank you for the memories.

I tried it without the Kim hw and had to study some of the ancient elven codes. It works well. The pcb may be recovered.

Good product

I added a small demo of Pixie to the code. Simply plug one of those $2 OLED presentations into the KIM Uno board expansion port (or On the Arduino I2C pins) and you’ll get the iconic Star Trek demo program. Or whatever you need to run, of course. . .

I’m running to make this OLED behave like the TV terminal screen of the old typewriter.

Looks like Oscar! Oscar also sent me this:

Be kind and respectful so that the feedback segment is excellent. (Feedback Policy)

This uses Akismet to reduce spam. Find out how knowledge of your feedback is processed.

Leave a Comment

Your email address will not be published. Required fields are marked *