magenet

Wednesday, October 26, 2016

Apple-1 architecture

It is possible to find information about the Apple-1 architecture on Internet, but there are a few websites that describe it very well:

www.sbprojects.com

www.applefritter.com

So I personally thanks them for their support, very precious for my research. So, let's move to the Apple-1 block diagram. Here we can understand what this computer is made of:

Apple-1 architecture block diagram
Apple-1 blobk diagram by http://www.sbprojects.com

What we have here is:

  • CPU 6502, at the center of the diagram. This is the core of the Apple-1.
  • ROM 256 bytes, at the left most border. In this memory there is the "Monitor" program written by Wozniak. This is a kind of minimal BIOS, needed to enter programs.
  • RAM 4+4Kb, on the left. This is the portion of memory used by the user to store programs.
  • IO PPI 6821, on the right. This is the programmable input output interface that is used to drive the "world outside" the CPU: the video terminal, the keyboard and the expansion slot.
  • Terminal Circuitry, at the top right. This is the electronic circuit that generates the composite video signal and shows the characters on the screen like a terminal.
  • Keyboard, on the right most border. The Apple-1 originally didn't come with a keyboard. The user was supposed to buy it separately. In those ages it was common to find the ASCII keyboards, that for each key stroke they send an ASCII code to the computer through a data bus.
  • Address Decoder, at the bottom left. This is the hardware circuitry that selects the chips of the board according to the address set by the CPU. This routes the data from/to the CPU.
  • Expansion Slot, on the right bottom. This is the expansion bus of the Apple-1, where users could plug custom hardware or specific interfaces like the cassette tape interface (ACI).
I will discuss next all the components and how they are implemented in my emulator.

Thursday, October 20, 2016

Considerations on the Apple-1 system

Originally the Apple-1 computer was planned to have a Motorola 6800 CPU, cheaper than a more popular Intel 8080 (400$ in those ages). So the project has never been developed, and remained on paper. It was modified to have a cheaper and better configurable 6502 ($25), just released in those ages.

So the Apple-1 was designed around this processor, equipped with RAM; a ROM containing the little operating system that Wozniak developed on purpose; a ROM containing the information on the character set for the video section; the hardware video terminal section; and a programmable input output interface chip.

Actually the computer is very simple compared to what we are used nowadays, but Mr. Wozniak was really smart in putting everything together. Especially the video terminal section is really clever because it is an assembly of logic ports and electronic components that are able to generate an NTSC composite video signal without a specific IC like modern video cards.

For my project the design is "easier" because I have to program everything software side, the tricky part is to emulate as best as possible timings and behaviour of the virtual hardware (CPU, I/O, Video signal etc.).

Tuesday, October 18, 2016

By any chance, who knows why software errors are called "Bugs"?

The first electric computers were made mostly of valves. These used to get very hot during operations of the computer so the huge electronic assembly became a very warm and cozy place for? ;)



It is said that when a renowned and seminal computer scientist "Grace Hopper" was working on a project in 1950's, one of her computer machines (a massive part-electrical part-mechanical) broke down because there was an actual bug (insect) in one of the circuits.

Women in tech history: Grace Hopper – Admiral, programmer, and rebel.

The insects caused the valves breaks, so the entire computer didn't work as expected. So engineers had to search the bug. That explains :) There's a good and interesting article about Mrs Hopper who was an incredible and pioneer woman in the computer science history:

Women in tech history: Grace Hopper – Admiral, programmer, and rebel

In 70s computers weren't so friendly

In the seventies computers weren't so friendly like nowadays they are. The software was essential and not as smart as now we expect to be. Programmers had to know everything about the computer: CPU, RAM, ROM, input and output ports, everything. There weren't high level programming languages like Python, Javascript or Delphi or others, but the most of the times they had to write programs in binary format, burn them on a EPROM, plug it on an IC socket on the motherboard and hope that everything was correct.
EPROMs plugged into their sockets on a motherboard.

The debug process was performed on paper instead during run-time. And Actually this approach saved a lot of time, and it should like that even nowadays with high levels programming languages.

A very good example of a hand written Assembly program.

The procedure of erasing and burning an EPROM was long, and sometimes tricky: some old EEPROMs had a tiny circular transparent window; right under that window there was the memory chip, and when you had to erase it, you needed to expose that to an UV light for a specific amount of time.


Old EPROM UV eraser.
We can understand that the development of a computer was affordable and possible mostly for professionals and big companies. Moreover the ICs and electronic components were very expensive, so it was really difficult to "experiment" with the hardware. Nowadays a microcontroller costs around 1$, so if a developer burns it who cares, but in the seventies a microprocessor had a price of hundreds of dollars!

Actually this wasn't really negative because engineers and programmers were pushed to do things once and right! And I personally think that this is the main reason why nowadays the software is alway full of bugs.

Monday, October 10, 2016

The replica projects: Mimeo and Replica 1

The first Apple-1 Replica project that I have found is the Mimeo project. This is a reproduction of a real Apple-1 board, where you have to solder real vintage parts. The result is a real clone of an Apple-1.
Mimeo Apple-1 Replica board
Mimeo 1 assembled board

This is a very cool project, and even you need an electronic background to assemble and test it, at the end you have a real clone almost identical to the original hardware.

The second Apple-1 replica project is the Replica 1, a bit different from the previous project in the use of the components.

Apple-1 Replica1 board
The Replica 1 board

This is very interesting because here we have almost the same main components used in the original board such as the Motorola 6502, logic ports, Memory chips etc. But, for specific tasks like the I/O, handled by the PIA or the video terminal, we have a Parallax Propeller that does everything. I could call this not a real clone but a hybrid clone.

Now, there isn't really the right choice between these projects. I was interested in both of them, but at the end the challenge of building something is to start from scratch. I thought a third way. Since I have some experience in programming microcontrollers, I started to check if I could have created an emulator for a development board like Arduino. This choice leaves most of the work to the software coding, but you have also the chance to easily update the firmware without changing the hardware.

I didn't take in consideration the use of FPGA chips because this technology even if it's more suited for replicating a real hardware, it's very hard to configure, set and program.

So the work started with the first important question: How does a real Apple-1 work?

Saturday, October 8, 2016

What is an Apple-1

At first I thought to find an Apple-1 on eBay and build a wooden case around it, but soon I realized that this was a really stupid idea :) I didn't know that much about the Apple-1, I knew only that it was a super rare computer and more or less the architecture of the hardware.


Apple-1 complete system signed by its designer Mr.Wozniak.

I did a deep research and I was shocked when I read that the price for a working unit, if you are lucky to find one,  is around thousands or hundred thousand of dollars!

Apple-1 Auction article

Apple-1 Auction article

Apple-1 auctions.

I found an article about one auction where this computer was sold for 815,000$! Prices are all the same more or less. So I abandoned the idea of buy one of course, but I still wanted one in my hands. Since it's difficult to find one unit, in working conditions and cheap, I thought that maybe there are kits or replicas somewhere. I know that there are emulation projects for arcade machines, retro consoles and retro computers; so maybe my hopes are not dead.

There are a couple of "Replica" projects that are very popular. These projects replicate the real hardware using real vintage components together with modern ones that substitute old components hard to find.

Other than hardware projects there are several software emulators, one of those is the incredibly popular "MAME".

Mame 0.177: Apple-1 computer driver listed.
I think it's cool to have real hardware running instead of a PC with an emulator, the look and feel of an old keyboard, a CRT monitor and an electronic board in front of you can't be compared to a modern PC that emulates a vintage one.

So my choice was to take a look at the "Replica" projects...

Wednesday, October 5, 2016

Actually this project started when I watched the movie "The Pirates of Silicon Valley" on TV several years ago.

Publicity photo for Pirates of Silicon Valley


I admit that I barely knew the story behind Apple, so this movie gave me the first idea of what there is behind Apple. In particular I was catched by the wooden prototype of the Apple-1 that Wozniak built in the movie. The story tells that he had a contract with HP and he had to submit all his inventions and works to his bosses, so the movie presented a very fun scene about the introduction of the computer that Wozniak designed. I suggest to watch this movie.

'The Pirates of Silicon Valley' Wozniak and his Apple-1 at the HP
Scene from 'The Pirates of Silicon Valley': Wozniak and his Apple-1 at the HP.

For the HP corporation this prototype didn't mean anything, it was the worst looking machine they have ever seen, and they believed that ordinary people didn't need a computer. I believe that for the story, the director of the movie asked to show something that looked incredibly weak, bad, and unprofessional.

Wozniak embarrassed and his Apple-1 at the HP
Scene from 'The Pirates of Silicon Valley': Wozniak embarrassed at the HP.

But what catched me was the spirit that probably moved Wozniak to invent that computer, to experiment with it, to build it and finally to create the case for it. Nowadays we call people like him "Makers" :) Anyway that computer remained in my memory and in my wish list as something I wanted to do "Someday".

A couple of years later I watched another movie about the story of Apple and Steve Jobs. This movie, "JOBS", presented that prototype in a different way.


Instead of underlining the look of it, the movie gave to it the right importance and meaning. It has shown the Apple-1 motherboard working, interacting with Jobs. The scene was really exciting because what Wozniak built shocked Jobs who was able to imagine the future of computers for ordinary people. Something more friendly compared to "business" machine. Basically something really incredible and professional available for ordinary people.

Scene from 'Jobs': Wozniak showing Jobs the prototype of the Apple-1.

At that point the memory of the "Wooden Apple-1" came back to my mind, and you know what? I wanted to feel that spirit. I wanted to build one immediately!


Tuesday, October 4, 2016

I wanted to share my personal project with you by showing you my replica of the Apple-1 computer, built around an ARM Cortex M4 microcontroller.

This project is a fully working emulator that replicates as close as possible the real hardware designed by Steve Wozniak. 
I am a retro computer fan and I discovered the Apple-1 very in late. I was watching the movie "Jobs" and when "Woz" showed his Apple-1 prototype to Jobs, I literally fell in love with it. I wanted one.

I discovered that it's impossible to find and buy one, so since I have written several emulators in the past, I decided to write one based on a ARM Cortex microcontroller. Of course the hardware is not the real one, but the software tries to replicate it as close as possible.

I know it's nothing compared to have a real one in my hands, but I wanted to see how far go with it. In this blog I will show you what I did, so stay tuned and enjoy!