Wednesday, November 13, 2013

This hasn't been my day...

Things haven't gone well today at all. No progress has been made on the computer, despite devoting quite a chunk of time to working on it. Here's what's going on:

For starters, the 28C64 doesn't seem to be working at all. It's brand new, with a recent date code, but still refuses to be programmed. As I mentioned, my little eeprom programmer worked great on a 8kb sram chip with the same pinout, but refuses to write. Dr. Jefyll of the 6502.org forum pointed out that write is disabled if any of the enable inputs are tied (that's my understanding, anyway), but all are controlled by the 74LS00 on my circuit, and seem to be correct based on the rams' working fine. Assuming at this point the chip is dead..

Not willing to wait another long while to get new chips, I decided to make a simple nvram circuit. It's based on a 32k sram chip disabled to 8kb, with a 3v coin cell on the back, tied to the VCC pin through a diode, which is then tied to the programmer power with another diode. A 10k resistor also holds /CE high, to put it in standby mode. The datasheet specifies a current draw of 250 microwatts at standby, and data retention down to 2v. I assembled everything, programmed some $AA and $FF, read them back, then restarted the computer. All data gone. I also noticed the battery is running down much quicker than my 5,000+ hour estimate too (not while plugged in, the programmer takes over the power just fine, raising it to about 4.5v). Bother. I don't at all understand why this isn't working, all the voltages are within spec, and the chip works fine plugged in. Still looking in to it. Any thoughts?

Must trudge on..

Tuesday, November 12, 2013

Quick Update

I'm currently in the midst of college applications, but have still managed to get some work done on my computer. Some long awaited parts came today, including the 2mhz crystal, R65C02, R65C22, 6821 andAT28C64. This rounds out the parts list for the first computer for now, so now a first run is just a matter of hooking up some data busses and burning the ROM.

I've also disassembled an LCD interface I was trying to build for the replica 1, and repurposed it into the EEPROM programmer. It is based on this design, a very simple one chip hack. On first power up, I put in a ram chip to test it, wrote $AA to a memory location and it read back! It's always great having a design work on the first try. I then tried writing $FF, and it read back as $BF. Darn.. A quick calculation showed the D6 line wasn't working, and I found the problem in a bad connection to the IDE header. Everything is now working great. I'm going to burn in the little program on the First Great 6502 Project page to make sure my I/O chip is working. After that I'm going to try to modify the Woz monitor to run with the 6551, and things will really be rolling.

I'll upload some more pictures tomorrow. I also have some interesting ideas for handling a matrix keyboard easily in hardware without tying up too many resources. A description of that should come tomorrow or the next day as well.

If everything goes well, I could have a running computer in the next few days.



Thanks for reading!



EDIT: Looks like someone over on the Briel Computers forum beat me to converting the Woz Mon to serial. I’ll reassemble this instead.

Saturday, November 9, 2013

Update and Pictures of Computer 1

Today I finally got around to taking a couple pictures of my first 6502 computer, which is in breadboard testing.

The board I chose is 2x 64 rows, not very big. I regret using it now, I have one twice as big. There are more chips than I expected to use, or are even necessary, but everything was built with what I could find. The biggest example is the over complexity of the clock section, described below. Whatever additional I/O chips are needed (probably at least the max232) will have to go on another board.

Another regret is using the thick green wire you can see carrying the address lines. I figured out later that thin cat5 wires are perfect for breadboarding, but I'm not about to undo what I've done.

At any rate, here's the pictures: (sorry they're small, it's either that or off the page)



There are currently nine chips. Starting with the top left: 74LS74, 74LS42, 65C22, 74LS00, 6551.
Bottom right: 74LS04, MOS6502, Sony 5864, AT28C64.
Some of the chips are placeholders (6522 and 27C256), until the real ones arrive.

Starting on the left of the board is the clock circuitry. Using a simple three inverter, resistor, capacitor and crystal network, the 74ls74 generates a clean 3.8 Mhz square wave. That was the lowest frequency crystal I had laying around, it's an NTSC color carrier. That signal is fed into the 74ls74 via the black wire on the left edge, which divides it twice and feeds it into Phi0 of the MPU. The real frequency is somewhere around 850khz. I'll replace the crystal with a 2mhz one when it comes, giving me the 2mhz, 1mhz and .5mhz options I'm shooting for.

On the top of the inverter IC is the reset circuitry. A resistor and capacitor between it and the processor hold down the reset line, through two inverters, for about 300ms on start up (I know that isn't necessary/optimal, but it works). The orange and white connector goes to a switch for manual reset. It is also wired through the RC circuit to debounce.

The final inverter is fed with the R/W signal from the MPU, enabling the /OE for RAM and ROM.

Next is the NMOS 6502. Nothing interesting, I bought it NOS, made in 1984. It consumes about 100ma, and gets fairly warm, but I think that's normal. Various control signals are tied to allow free run. Address lines are thick green and thin orange wires, data lines are thin blue (not tied to the MPU yet.) All the messy hook up wire on the data lines is emulating an $EA op code, feeding the 6502 with endless NOP instructions. This just quickly cycles through the address space, allowing you to check functionality of a few of the chips without burning a ROM test program.

8KB SRAM and (soon to be) 8KB ROM on the bottom right. These are addressed at $0000.1FFF and $E000.FFFF, respectively. An LED is connected to each chip's enable pin, and if everything is working properly, they should flash slightly out of sync. The RAM will be soon upgraded to a 32KB chip, which is physically half the size.

On the top left of the board, there's the flip-flop and 74LS42. The latter is a 4 of 10 decoder, with the A3 pin tied low to function like the more common '138, which I of course wasn't able to find until later. The first and eighth blocks are used for RAM and ROM.

Next is an early Synertek 6522 from 1981. I think this chip is blown, as most of its outputs are stuck in a strange pattern, and resetting does nothing. It's just a placeholder until the new one comes. It is powered, but doesn't use any current.

Going down the line, there's a 74LS00, which takes the inverted R/W line and Phi2, and does some magical logic to drive the RAM chip's /WE pin. The three other gates are unused, for future decoding use.

Last is the 6551 ACIA. Not sure about using this chip, it seems to have a bad reputation of bugginess. I'm not going to spend $10+ on a CMOS one, it might have to do. I have quite a few other com chips of the same vintage, I might try to use one of them.

At the very top right is a simple voltage regulator circuit. My bench power supply is very old and makes a loud 'bong' when powered on, so this is essentially a surge protector. 7.5v DC comes in over the cat5 wires, is regulated, then spread on the busses.

The entire computer is working great in free run! It pulls about 120ma and has run fine for hours. Every chip involved so far seems to be doing its job, as the LEDs' flashing shows.

All there is to do now is wait. Wiring up the last couple data busses is an easy task once everything is in place. As soon as the chips come (hopefully in the next couple days), I can burn a little test program in and blink lights 'for real' on an I/O port.

The possibilities from there are endless! :D


Another photo from the top:



Any suggestions/thoughts/etc are greatly appreciated.

I'll try to draw up schematics soon. More for my own reference, as it's probably simple enough from the description. It's a very basic SBC, but it's mine, and I'm quite proud of it ;)

Thanks for reading

Thursday, November 7, 2013

Design Goals

I already have one 6502 based computer, the Replica I, but there isn't any fun in leaving it at that. I have plans in the works for two more single board computers (SBC), with the end goal of hopefully having the three communicate with each other for some useful function. Here are the proposed specs for each:

Replica I TE - Briel Computers
- 32KB Ram
- 8 KB ROM with BASIC, monitor and an assembler
- Slow video terminal i/o
- 1mhz


First computer - constructing breadboard iteration now, maybe PCB eventually.
- Name - suggestions?
- 8KB SRam on the breadboard, 32KB in a permanent version
- 8KB EEPROM with a monitor and BASIC
- Small ASCII LCD and fast serial RS232
- Selectable clock rate, 2mhz, 1mhz, 500khz
- MOS 6502 CPU
- R6522 I/O chip
- R6551 serial (if I can find one cheap, otherwise I may use one of a couple old UARTS I have)
- Several 74 series chips for address decoding, clock generation and division, and phi2 handling.


Second computer - enclosed in an old radio case, in the spirit of early micros
- Name - Pulsar Micro. Because of the blinkenlights :)
- W65C02S mpu for DMA compatibility
- Intel P2102 RAM chips. 8 add up to 1KB. Circa 1973
- No ROM
- 250khz or 500khz clock to allow the RAM to keep up. A simple card could speed it up for fast RAM.
- 24 switches and lights on a front panel to program data in one byte at a time in the spirit of     the Altair computers. Expansion cards can add ROM or I/O
- Built in linear power supply

This computer is basically a recreation of exactly the parts and specs an early hobbyist might get out of a home computer. This is exclusively for fun.



The replica I will be used for ROM burning and software development until I get computer 1 running.

One of my design philosophies with these older computers is avoiding programable glue, micro controllers, or other modern components that weren't available at the time. The exceptions are high density RAM chips and the newer WDC processors. Doing so detracts from the purity of the early micros, in my humble opinion.

Hello World!

Hello World, testing 1 2 3. This is the blinking LED, all systems go.



In other words, I'm on line (again).



Hi everyone, my name's Will, I'm a high school student with an obsession for old technology, especially computers. I am perhaps 35 years behind the times in terms of being able to understand the processes that enable the extremely high tech devices that life revolves around today, and expect pretty much everyone else is the same way. It bothers me that you can't program a computer anymore. A computer has to do it for you. You can't design a computer anymore either, only supercomputers can lay out the intricacies of even the cheapest consumer workstation. It's been that way for years, and isn't about to change. That's what draws me to the simpler times in computing and innovation, when a techie worth his salt could buy some chips and build a reasonably state of the art computer at home.
But I digress.
This blog is going to chronicle my adventures in building and programming homebrew 6502 computers, and all the processes involved in doing so. It has two purposes to that end, first to have a build log for preservation and future reference, and to give other 6502 enthusiasts an account of a young person's experience with the venerable and antiquated microprocessor. I can only imagine there aren't many like me.

A short backstory.

My interest in the 6502 started with the Macintosh. I grew up playing with, fixing and interfacing old Macs that my dad (a tech support guy at the time) brought home. They used the 68k chips, which are (very) distant relatives of the 6502, but following the history of Apple back as far as I could, I ended up curious about the Apple I and II computers. I never actually bought one because of a lack of funds (an overarching theme in my story), but a couple strokes of unbelievable luck landed me with a couple free Apple IIe computers, loaded with cards, and a bare bones IIGS for $5. I was 12 or 13 at the time, and began to learn the BASIC language and a little about how the old computers worked. I grew my collection and dabbled in electronics some throughout that time, with microcontrollers and other simple circuits. I discovered the 6502.org website (pretty much the greatest site ever made) and got really interested in the low level electronics themselves. I bought a MOS 6502 cpu on eBay for $8, just to have one, and read everything I could. I bought books, crawled the web, wrote programs and filled notebooks with designs. Ultimately, however, my lack of funds and understanding kept the circuits in the binding, and nothing much happened. Three years ago my (amazing) family got me a Replica I computer for Christmas, which is a clone of the Apple I, and my interest was intensified. Around then I read the great website lateblt.tripod.com, where a small 6502 computer and excellent quick start guide were found. I hooked up a few wires and cobbled together a clock circuit to get it running, hard wired $EA to the data bus, and she took off running. It worked perfectly, and was one of the more amazing moments of my life. I had built a computer! Granted it couldn't do anything, but the 6502 was loading and executing NOP instructions at an amazing rate. I learned a bit of assembly on the replica I, but my longing to build my own real computer took a back seat to school and illness at the time (and of course the lack of money), and the project got shelved.

Just this year I pulled out the chips and breadboards again, and decided to start again from the beginning. From purchases, gifts and disassemblies of old computers I collected quite a stash of chips, almost everything I needed. A couple more bought on eBay, what the heck, now or never, finished off the list and I got to work.

In the next few posts I'll explain where I am now with this project, what the design goals are, and hopefully some interesting schematics or code snippets that might be useful.

I hope you enjoy reading the blog, please leave a comment!