| Electronics > Projects, Designs, and Technical Stuff |
| Cloning a Commodore PET-2001 |
| << < (11/33) > >> |
| GK:
The processor board is still a work in progress, but since the video generator board is completed I decided to test it thoroughly by actually programming it. It's handy to know that half the system is functioning properly in its own right before potentially attempting to debug the system as a whole. I plugged a 40-pin PIC16F874 MCU into the breadboard, wired up the video generator address, data and control lines and wrote quick program to clear (fill all character locations with a blank-space character) and then dump the character set* and write and a short message to the screen. Works perfectly. Next up: the processor board............................... * actually only one of two 128-character pages; you only have a choice of one or the other as the PET-2001 isn't able to display both simultaneously. |
| GK:
It is getting on to 3am now, but it's finally alive! Yoo hoo! The OS boots and passes all self checks, cursor is blinking waiting for input. The system is currently built to the minimum required hardware to boot the OS, but all that I still need to do now is add the IO. I stupidly bought only one PIA chip (two needed), which is why there is a vacant socket for PIA#2, which handles the GPIB interface, which aside from the PIA itself, will just required a few 75ALS161 IEEE-488 transceiver chips. However my next scheduled task is to interface a PS2 keyboard to the PIA#1 key-scan inputs/outputs with a small microcontroller (a PIC16F84), and to solder up the small additional amount of circuitry associated with the VIA chip to complete the cassette drive interface. At the moment the PIA#1 key-scan interface is just floating, which is why I get the spurious keyboard entry (a graphics character) upon boot up before the cursor. Just a few more hours work and I'll be able to compose/run/save and load programs. 31743 bytes free! Just imagine the woody that would have given one back in the day! ;D I simplified all of the memory decoding logic to a single 45nS OTP ROM look up-table. After this I'm going to do a Tandy TRS-80 with a current production Z80. Already have the ROM (level 1 and level2) binaries, all necessary technical documentation... |
| GK:
Apparently not a lot of enthusiasm around here for cloning old computers like the PET? I though being a traditional hardware/discrete logic implementation rather than another boring FPGA port that this would garner more interest. I've tested the prototype out to the extent that I can say that the hardware details are finalised and am now starting on the PCB layout, which will just be one large board, which I will have professionally manufactured. It's cheaper in quantity so would anyone else out there be interested in building a PET-2001 clone? I've decided to take a different route with the keyboard interface. My original idea was to put a low-end PIC uC on the board to interface a PS/2 keyboard, but as it turns out such a lowly uC isn't going to cut the mustard. The operations of the PET CPU are interrupt driven by the video generator vertical blanking signal, meaning the keyboard is scanned at the video frame rate (in this case 50 times per second). There are 10 scan lines and the keyboard scan routine is quite slow, taking about 1mS to scan all 10 lines, but the issue is that the matrix is given a single read cycle only several uS after the scan line is updated, even so each scan line is actually active for (a mostly redundant) 100uS or so. This means that the interfacing uC only has several uS to read and decode the BCD for the scan line, look up the correct code in the matrix for the most recently pressed key and apply it the PIA data bus. And that is with a standard 1MHz system clock. In "turbo" mode (which is now finalised at 4MHz) the operation thus described needs to be done within 3uS. Since a PS/2 keyboard is a bit old hat now, I've decided that a USB keyboard interface would be nice to have as well, but plonking this hardware onto the system motherboard would detract from the "retro" feel of the project, IMO. So what I've decided to to is keep the keyboard interface of the motherboard exactly as per the original PET, broken out to the outside world via a 25-pin DB connector, but additionally sporting +5V power. The keyboard interfacing can therefore be done by an external dongle, but you'll also have the option of plugging in a original PET keyboard if you have one (unlikely) or hacking an old PCB-style keyboard to plug directly into the DB25 by cutting all of the PCB tracks to the key buttons and re-wiring as per the PET matrix. Unfortunately I don't have an old-style keyboard spare to hack right now, so in order to post the demonstration video shown here to youtube I rummaged through my parts and came up with a handful of toggle switches and a single push button. I wired the push button to the PIA keyboard scan IO to assert "Return" and the seven switches to assert "L", "O", "A", "D", "R", "U" and "N", which is all I need to load an run (but not much else!) programs from cassette. Here it is loading and running Space Invaders. There is about 2.5 minutes of boredom in the middle of this video while the game loads, but I connected a speaker to the cassette drive data output, so, if you happen to be an old fart, you can turn up the volume and reminisce to some old-school computer sounds ;D EDIT: My copy of Space Invaders appears to be corrupt (found on the net as a.TAP file, converted to a .WAV file and then recorded to tape); there are some glitches in the graphics and not all of the intro screens/animations appear entirely as they should (which I've deduced from watching other youtube videos of the same game). http://youtu.be/b66FU2z5w5w |
| CJay:
Awhh damnit, shame you're so far away, I've got a few lovely keyboards that have proper keyswitches and would be easily adaptable for this, they weigh a ton and would cost a small fortune to post. Very impressive project though, I harbour a bit of a desire to build one (but realistically it'll probably never happen) |
| SeanB:
If keyboard decoding simply use the fact that a keyboard is slow, and use the micro to drive a crosspoint switch ( or at least a simple one using a pair of CMOS analogue switches to emulate one) that will emulate the key being pressed. As you likely will also have a shift and function modifier key as well simply use another analogue switch, and isolating diodes, to do the functions, thus emulating the keyboard using a simpler to interface PS/2 keyboard decoder and a slower micro that only has to set the analogue switch inputs and outputs at a human type rate. |
| Navigation |
| Message Index |
| Next page |
| Previous page |