Jump to content
  • entries
    9
  • comments
    8
  • views
    742

Sound chip, video circuitry, and more address decoding: 6502 computer part 2


bluejay

405 views

I had a theoretically working computer by the end of the last entry. It could input and output binary data to and from RAM, ROM, a 65C22, and some LEDs. I was heavily considering a form of video output and keyboard input, and settled on using the Motorola MC6847 for the former, and was undecided about the latter. I decided to think of a list of things I wanted to add onto the computer (from most to least important), and here it is:

 

PS/2 Keyboard

Another 65C22

Some sort of sound chip

Dedicated Video RAM

RS232 serial I/O capability

Assembly language and BASIC programming

External Character ROM

 

I set out to achieve these goals and so far completed three of them.

 

For the sound chip I decided on the Yamaha YM3812. It's kind of out of place on a computer so crude, but it's cheap and easy to find. I originally wanted to connect everything (data and control bits) to the 65C22, but decided against it. I need it for more important things. Now it is independent and has its own separate address space just above the second 65C22. IRQ pin is connected to IRQ on the 65C02, The Write pin to the RW pin on the 65C02, and Read pin to the RW pin on the 65C02 through and inverter. Clock is shared with the video circuitry since both need a 3.58MHz clock. It takes up a whopping one bit of address space, and since it shares the 4 most significant bits with the 65C22s, address decoding is piggybacked on top of the 65C22s'.

 

Speaking of which, I added second one just above the first one. Each use a nybble of address space.

 

I sacrificed two expansion slots to add 8k of dedicated video RAM. I needed the 65C02 to only write to it when the MC6847 wants it to. I used an 8 bit D flip-flop with the Clock pin connected to the R/W pin on the 65C02 through an inverter and the Output Enable (active low) pin connected to the Horizontal Sync and Field Sync (both are active low) through an AND gate. The data inputs are connected to the data bus, and the outputs are connected to the 6264. I'll use two more 8 bit D flip-flops for the address pins. I also tied Write Enable (active low) high through a pullup resistor, and Read Enable (active low) to ground through a pulldown resistor. Write Enable is also connected to HS and FS of the MC6847 through an AND gate, and Read Enable receives the same signal except through an inverter. I also connected the MS pin (not sure what the MS stands for) on the MC6847 to HS and FS through an AND gate and an inverter. This pin, when low, sets the address pins on the MC6847 into high impedance state, so the video RAM can be controlled by the 65C02. So yeah, this is pretty complicated, but it's the best I could come up with. Let me know if there's a better way to do things.

 

All the 8 control bits on the MC6847 is connected to one of the 65C22s. Now graphics capability is already better than on a CoCo.

 

I should note that a lot of the audio circuitry is copied off the Commodore SFX Sound Expander and a minimal amount of the video circuitry is stolen from a TRS-80 CoCo. Mostly the amplification circuitry as I have no clue how those work.

 

365422299_20210221_1714351.thumb.jpg.6ceea667a56c94fc35a5c11f20d160ee.jpg

 

This is the current schematics of the computer. It's been erased and redrawn in a lot of places and it's very messy. I plan on re-doing everything on a computer in the future. However, unless I'm mistaken, this combined with some code should mean a fully working computer. If it doesn't, it shouldn't be terribly complicated to figure something out. I would be the most suspicious of the D flip-flops between the processor and video RAM, since it's the most complex bit of circuitry on the computer and I came up with it.

 

528155954_20210221_1714591.thumb.jpg.69ae9fdf1f339bb79d051b0ad1d124ac.jpg

 

This is the current memory map and address decode logic for each of the ICs. I tried to make everything as simple as possible, although perhaps the I/O portion might need some more work. I do plan on adding a parallel to UART IC (and of course a MAX232 on top of it) into the I/O portion, so we'll see how that goes.

 

Tomorrow, I will add a DB9 joystick port and that RS232 interface. The UART used in the RS232 interface may also be used for input and output to cassette. If I have time afterwards I'll begin programming the BIOS and a simple test program. A bit depressing that I won't be able to test and use this computer until much later... I want to log onto BBS with it, and program some games for it too!

 

Update: I scanned through the CoCo schematics and it seems that it uses a similar system. However, I use a 74LS374 since I need it to handle all the decoding, and the CoCo uses a 74LS273 (almost the same as the 74LS374 except it has a Clear pin instead of an Output Enable pin) and relies on the MC6883 multiplexer in many ways. I want to use one of those in my computer someday, but they seem really expensive these days. At least this means that my idea of using a D flip-flop for buffering data input to video RAM has been done before.

 

Update #2: Okay, I found someone who figured out how to interface IDE devices with an 8 bit computer using a latch and a multiplexer; now that I know it's possible I have to implement it. I'll probably use the lone expansion slot for this. I'll make an interface for a 40 pin HDD and 34 pin floppy drive. I don't know how IDE devices work yet, but I'll figure it out.

2 Comments


Recommended Comments

Best of luck!  The one thing I suggest is to spend as much time as possible planning before spending $$ and also determine your critical path for spending.  Nothing worse than a CFO asking about an expensive never-to-be-finished project.  Also start small with something you can easily verify success, then start adding complexity.

 

You may want to invest in something like an Arduino or RPi Pico which you can use to validate external HW.

 

Heck, pick up a CoCo off eBay to understand how it works.  (Also check out https://colorcomputerarchive.com/repo/Documents/Manuals/Hardware/Color Computer Technical Reference Manual (Tandy).pdf - lots of good info.)

 

You're also going to need some way to program your micro, i.e. a ROM burner.  You might also want to check into PALs for address decoding.

 

  • Like 1
Link to comment

Thanks. I own a CoCo 2 and an original copy of that manual, but I'll still check out that PDF as my original copy is borderline disgusting. A bookworm crawled out of it the last time I opened it. I also have an Arduino Mega and a TL866II+ EPROM programmer. I'm ready to build the computer with real parts apart from... owning the actual parts to make the computer. At this point I've stepped away from designing hardware and started the software part of things. Not that I won't work more on the hardware in the future; I most definitely will. I still need to add that serial port and floppy/hard drive controller card!

Link to comment
Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...