# COSMAC Elf

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/COSMAC_Elf
> Markdown URL: https://mediated.wiki/source/COSMAC_Elf.md
> Source: https://en.wikipedia.org/wiki/COSMAC_Elf
> Source revision: 1350931653
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

{{Short description|Early single-board personal computer}}
{{Infobox information appliance
| name = COSMAC Elf
| logo = 
| image = COSMAC ELF CHM.jpg
| caption = COSMAC Elf with Pixie Graphics Display
| aka = 
| developer = 
| manufacturer = [RCA](/source/RCA_Corporation)
| family = 
| type = 
| generation = 
| lifespan = 
| discontinued = 
| media = 
| os = 
| power = 
| system_on_chip = 
| cpu = [RCA 1802](/source/RCA_1802)
| memory = 256 [byte](/source/byte)s of [RAM](/source/RAM); expandable
| storage = 
| memory_card = 
| display = 
| graphics = [RCA CDP1861](/source/RCA_CDP1861)
| sound = Beeper
| input = 
| controllers = 
| camera = 
| touchpad = 
| connectivity = 
| platform = 
| dimensions = 
| weight = 
| compatibility = 
| predecessor = FRED / System 00
| successor = [COSMAC VIP](/source/COSMAC_VIP)
| related = 
| website = 
| release_date = {{Start date and age|1976}}
| price = 
| units_sold = 
| units_shipped = 
| online_services = 
| top_game = 
}}

The '''COSMAC Elf''' is an early single-board [personal computer](/source/personal_computer) based on the [RCA 1802](/source/RCA_1802) microprocessor. It was originally described in a series of construction articles in ''[Popular Electronics](/source/Popular_Electronics)'' magazine in 1976 and 1977. Through the back pages of electronics magazines, both Netronics and Quest Electronics offered low-priced, enhanced kits based on this design. The system operated without [read-only memory](/source/read-only_memory) (ROM) chips—programs were entered directly into [RAM](/source/Random-access_memory) memory using the 1802's integrated [direct memory access](/source/direct_memory_access) (DMA), 8 [toggle switch](/source/toggle_switch)es, and an ''Input'' push button. An updated commercial version called the ''[COSMAC VIP](/source/COSMAC_VIP)'' was later sold in kit form.

==Description==
The original Elf featured two [hexadecimal](/source/hexadecimal) [LED](/source/Light-emitting_diode) displays for byte data value output, and a set of 8 [toggle switch](/source/toggle_switch)es for input (a hexadecimal [keypad](/source/keypad) was an optional extension). The base configuration had 256 [byte](/source/byte)s of [RAM](/source/RAM), but expansion projects could raise that to a power of two-based memory store, with an upper limit of 64K [address space](/source/address_space).

The first Elf design used a [crystal](/source/crystal) with a frequency in the range of 1 to 2&nbsp;MHz with the 1802's built in [oscillator](/source/electronic_oscillator) circuit.

A simple circuit used the DMA feature of the 1802 to permit entry of programs and data into RAM through the toggle switches. Entering a byte via the toggle switches and pressing the "input" button would enter a byte into RAM and display it on the pair of hex LEDs, then advance the DMA counter to the next location. A "memory protect" switch could be used to disable memory alteration. If an error was made in program entry, it could be corrected by turning on memory protect, turning off load mode (thus resetting the [program counter](/source/program_counter) to zero), turning on load mode, and pressing "input" to advance to the address of the incorrect data. After turning off memory protect, the correct value could be entered.

The fourth article of the series presented modifications to use a companion [RCA 1861](/source/RCA_CDP1861) “Pixie” video generator [IC](/source/integrated_circuit) (CDP1861). The Pixie required a 1.76&nbsp;MHz clock, and since that was an uncommon crystal frequency, usually a readily available 3.579545&nbsp;MHz [color burst](/source/color_burst) crystal was instead used in a separate oscillator circuit with a divide-by-two circuit to drive the clock inputs of both the [microprocessor](/source/microprocessor) and Pixie. The resulting 1.7897725&nbsp;MHz clock was close enough for the hardware to work. Monochrome video output (with timing roughly approximating [NTSC](/source/NTSC) standard) could be generated using DMA operations interleaved with carefully arranged 1802 [opcode](/source/opcode)s as instructions in software. The maximum resolution of the 1861 was 64h by 128v rectangular pixels. By changing the placement of instructions in the video display control and [interrupt](/source/interrupt) routines, pixel rows could be repeated to obtain lower resolutions, allowing the video display to be used with 256 bytes of RAM (64×32 [square pixel](/source/square_pixel)s).

A one-bit output from the microprocessor, the Q line, could be driven by software to produce sounds through an attached speaker, to save programs in RAM to a [cassette recorder](/source/cassette_recorder), and for [serial](/source/serial_communications) [I/O](/source/I%2FO) output. [Branch instruction](/source/Branch_instruction)s in the 1802 [instruction set](/source/instruction_set) could read the state of the EF1 through EF4 single bit value input lines, which were used to read the 'I' keypad (input) momentary pushbutton (typically EF4), programs from the cassette recorder through interface circuitry, serial I/O input, and input from peripherals such as a [light pen](/source/light_pen). There are also seven 8-bit I/O ports available for decoding and interfacing.

== Microcomputers ==
[[Image:Early Personal Computers.jpg|thumb|COSMAC Elf on display at the [Computer History Museum](/source/Computer_History_Museum). (Lower-middle left, below the [Altair 8800](/source/Altair_8800) computer and next to the [TV Typewriter](/source/TV_Typewriter).)]]
The original Elf computers were essentially home-built versions of the [RCA](/source/RCA_Corporation) Microkit, Microtutor I and Microtutor II, which were RCA's demonstration boards for their CDP1801 2-chip predecessor and single-chip CDP1802 microprocessors.

Enhanced kits such as the [Netronics Elf II](/source/ELF_II) and Quest Super Elf added built-in features such as keypads for data entry, serial I/O, cassette interface, and the CDP1861 "Pixie" [video](/source/Video_Display_Controller) chip. RCA later introduced their own similarly expanded version as the [COSMAC VIP](/source/COSMAC_VIP).

In August 2006, ''[Nuts and Volts](/source/Nuts_and_Volts)'' magazine, along with [http://www.sparetimegizmos.com/ Spare Time Gizmos], released a project to build the "Cosmac Elf 2000," based on the original Elf, with some newer and easier to find components and enhanced features, modules, and functionality, including the STG1861 Pixie Graphics Replacement board that is functionally equivalent to the now-rare RCA CDP1861 integrated circuit.

The [http://www.retrotechnology.com/memship/memship.html Membership Card] is a modern, simple COSMAC Elf-like remake for [retrocomputing](/source/retrocomputing) hobbyists that is designed to fit in an [Altoids](/source/Altoids) tin.

Various other hobbyist systems can be found on the Internet, including [hardware emulator](/source/Hardware_emulation)s using FPGA and modern [microcontroller](/source/microcontroller)s.

== Software ==
A series of newsletters and small booklets offered by Netronics and Quest contained 1802 machine language and [CHIP-8](/source/CHIP-8) programs, along with schematics for expanding the Elf and adding peripherals, including a light pen. Other, similar information and hobbyist software projects can be found on the Internet. The only published book about the 1802 is Tom Swan's "Programmer’s Guide to the 1802" (1981), which has been made available as a [PDF](/source/PDF) after being out of print for many years.<ref>{{Cite web|url=http://www.tomswan.com/|title=Programmer’s Guide to the 1802|last=Swan|first=Tom|date=1981|website=Tom Swan Homepage|publisher=Tom Swan|access-date=19 August 2016}}</ref>

Tiny BASIC, a version of [BASIC](/source/BASIC) offered by Tom Pittman, could be used to write small BASIC programs on the Elf that could display through the Pixie low-resolution monochrome graphics display or TV-Typewriter hardware. Pittman also wrote a small booklet about the 1802 titled "A Short Course In Programming", which he has allowed to be published and made available online free of charge.<ref>{{Cite web|url=http://www.cosmacelf.com/publications/books/short-course-in-programming.html|title=A Short Course In Programming|last=Pittman|first=Tom|date=1980|website=COSMAC Elf|publisher=Dave Ruske|access-date=19 August 2016}}</ref><ref>{{Cite web|url=http://www.ittybittycomputers.com/IttyBitty/ShortCor.htm|title=A Short Course In Programming|last=Pittman|first=Tom|date=1980|website=Itty Bitty Computers|publisher=Tom Pittman|access-date=19 August 2016}}</ref>

Mike Riley has written an editor, assembler, [BASIC](/source/BASIC) and [FORTH](/source/FORTH) interpreters, a [BIOS](/source/BIOS), and the Elf/OS [disk operating system](/source/disk_operating_system) that will run on expanded Elf systems, including the COSMAC Elf 2000.

Other languages available are noted at the [RCA 1802](/source/RCA_1802) Wikipedia entry, including [interpreters](/source/Interpreter_(computing)), [compiler](/source/compiler)s and [assemblers](/source/Assembly_language).

Game cartridges for the RCA Studio II contain Chip-8 games, which can run on other 1802 systems. File dumps of these games can be found on the Internet.

== References ==
{{reflist}}

==Further reading==
* {{cite magazine |last=Weisbecker |first=Joseph |date=August 1976 |title=Build the COSMAC 'Elf' (Part 1) |url=https://archive.org/details/197608PopularElectronics_20181123/page/32/mode/2up |magazine=[Popular Electronics](/source/Popular_Electronics) |volume=10 |issue=2 |pages=33–38 |publisher=Ziff Davis |access-date= }}
* {{cite magazine |last=Weisbecker |first=Joseph |date=September 1976 |title=Build the COSMAC 'Elf' (Part 2) |url=https://archive.org/details/197609PopularElectronics/page/34/mode/2up |magazine=[Popular Electronics](/source/Popular_Electronics) |volume=10 |issue=3 |pages=37–40 |publisher=Ziff Davis |access-date= }}
* {{cite magazine |last=Weisbecker |first=Joseph |date=March 1977 |title=Build the COSMAC 'Elf' Microcomputer (Part 3) |url=https://archive.org/details/197703PopularElectronics/page/60/mode/2up |magazine=[Popular Electronics](/source/Popular_Electronics) |volume=11 |issue=3 |pages=63–67 |publisher=Ziff Davis |access-date= }}
* {{cite magazine |last=Weisbecker |first=Joe |date=May 1977 |title=A Practical, Low-cost, Home/School Microprocessor System |url=https://archive.org/details/dr_dobbs_journal_vol_02_201803/page/n233/mode/2up |magazine=[Dr. Dobb's Journal](/source/Dr._Dobb's_Journal) |volume=2 |issue=5 |pages=34–44 |publisher=}}
* {{cite magazine |last=Weisbecker |first=Joseph A. |date=July 1977 |title=Part IV: Build the PIXIE Graphic Display |url=https://archive.org/details/197707PopularElectronics/page/40/mode/2up |magazine=[Popular Electronics](/source/Popular_Electronics) |volume=12 |issue=1 |pages=41–46 |publisher=Ziff Davis}}
* {{cite magazine |last=McCormak |first=Edward |date=October 1977 |title=Promable 1K Operating System for RCA Elfs |url=https://archive.org/details/dr_dobbs_journal_vol_02_201803/page/n405/mode/2up |magazine=[Dr. Dobb's Journal](/source/Dr._Dobb's_Journal) |volume=2 |issue=9 |page=34 |publisher=}}
* {{cite magazine |last=McCormick |first=Edward M. |date=February 1978 |title=How to Upgrade a Basic Elf Microcomputer |url=https://archive.org/details/197802PopularElectronics/page/64/mode/2up |magazine=[Popular Electronics](/source/Popular_Electronics) |volume=13 |issue=2 |pages=65–69 |publisher=Ziff Davis}}
* {{cite magazine |last=Meyer |first=Martin |date=March 1978 |title=Expanding the Elf II |url=https://archive.org/details/197803PopularElectronics/page/60/mode/2up |magazine=[Popular Electronics](/source/Popular_Electronics) |volume=13 |issue=3 |pages=62–65 |publisher=Ziff Davis}}
* {{cite magazine |last=Armstrong |first=Robert |date=August 2006 |title=Elf Turns 30 — Part 1 |url=https://archive.org/details/NutsAndVolts/Nuts%20and%20Volts%202006-08/page/66/mode/2up |magazine=[Nuts and Volts](/source/Nuts_and_Volts) |pages=67–73 |publisher=T & L Publications Inc.}}
* {{cite magazine |last=Armstrong |first=Robert |date=September 2006 |title=Elf Turns 30 — Part 2 |url=https://archive.org/details/NutsAndVolts/Nuts%20and%20Volts%202006-09/page/66/mode/2up |magazine=[Nuts and Volts](/source/Nuts_and_Volts) |pages=67–71 |publisher=T & L Publications Inc.}}

==External links==
* [http://www.sparetimegizmos.com/Hardware/Elf2K.htm Spare Time Gizmo's article on the Cosmac Elf 2000]
* [http://www.emma02.hobby-site.com Emma 02] including Cosmac Elf Emulator
* [http://www.donnelly-house.net/programming/cdp1802/simelf/ SimElf] COSMAC Elf-ish CDP1802 Simulator, an extended web app in JavaScript, SimElf++ / COSMAC Elf<sup>2</sup>
* [https://github.com/wel97459/FPGACosmacELF FPGA Cosmac ELF] An FPGA re-creation of a Cosmac ELF computer on a cycle-accurate 1802 processor, coded in spinalHDL

Category:RCA computers
Category:Early microcomputers
Category:1802-based computers
Category:Computer-related introductions in 1976

---
Adapted from the Wikipedia article [COSMAC Elf](https://en.wikipedia.org/wiki/COSMAC_Elf) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/COSMAC_Elf?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
