james1095

Compukit UK101 on P1-500K

16 posts in this topic

This is Grant Searle's UK101 implementation that I've ported over to the P1 500k from his Altera platform. It actually took a fair amount of work as all of the memory primitives had to be changed and there were numerous changes additions and changes I had to make to the VHDL code to make ISE happy. Apparently Altera lets you get away with things that Xilinx doesn't. I set this up for the P1-500k although it should easily fit in the 250k. I used the arcade megawing since I have one and it has a PS/2 port on it. Composite video is produced through the Green (pin 2) on the VGA connector. Note that this is monochrome PAL-50 format so many North American TVs and monitors will not sync to it. I used a cheap B&W portable CRT TV and that displays it fine but I need to modify it to reduce the width. This could also be corrected in the VHDL to adjust the video output to NTSC timing and there is also plenty of room for other improvements in the code. The Spartan3 500k has roughly double the BRAM of Grant's Altera board so the memory can be expanded without adding an external SRAM.

 

Original project page is here: http://searle.hostei.com/grant/uk101FPGA/index.html

 

Now that I've got this working, I think I'll have a go at porting the Multicomp project on the same page. Seems I've finally climbed over enough of the VHDL learning curve that things are getting interesting.

UK101_Papilio500k.zip

uk101_pap500k.bit

Share this post


Link to post
Share on other sites

Hey thanks for posting this James. I'm not familiar with the UK101 but its great to have these old systems available on the Papilio. Once the Papilio DUO is deliverd and DesignLab is stable and not taking up so much of my time I'd like to turn these projects into DesignLab libraries...

 

Jack.

Share this post


Link to post
Share on other sites

It's a British clone of the Ohio Scientific Superboard II. Almost all of these 8 bit systems were a bit before my time, the only ones that were still in common use when I was a kid are the Apple II series. There are a lot of interesting computers that were made prior to the PC/Mac era and most of them are good candidates for FPGA implementation. I haven't tried, but it should be fairly trivial to alter the video timings to the NTSC standard for those of us in the US who might not have something that will lock onto the PAL signal.

 

You're free to do whatever you like with my changes, but you should probably contact Grant Searle prior to incorporating his code into something else. From what I've seen he seems to be pretty reasonable.

Share this post


Link to post
Share on other sites

Sounds good, I think it would be appropriate to talk to Grant before including anything in DesignLab...

 

Regarding converting the video timings from PAL to NTSC, it would actually be great to make a stand alone DesignLab library to do that so we could re-use it in the future if we ever have something that is outputting PAL and we want to convert to NTSC. 

 

Oh, I also just remembered that I made a NTSC to VGA converter for the A2601 project, maybe that would be useful here? Might be easier to convert PAL or NTSC to VGA... Either way this is probably another great candidate for a DesignLab library and is the main reason for DesignLab libraries. There are so many obscure but extremely useful little code snippets like this that are checked into github but nobody would know about them... Turning them into a schematic library in DesignLab makes them easy to find and use.

https://github.com/GadgetFactory/Papilio-Arcade/blob/master/A2601/TIA/src/TIA.vhd

line 596

 

Oh, and there is this project too:

http://papilio.cc/index.php?n=Playground.TVOutputWing

 

I can order up a batch of these TV Wings after I get the DUO delivered if people are interested. It would be great to make a DesignLab library for VGA to PAL/NTSC that can be outputted through this Wing. So people have more flexibility with their projects. People can use a core that generates VGA, PAL, or NTSC and then use the converters to decide what hardware they want to output to.

 

Jack.

Share this post


Link to post
Share on other sites

It could certainly be done. One could probably just alter the video timings in the VHDL to that of VGA and it would likely work. There is also the Multicomp project by the same guy which includes an option for VGA output. Personally my interest is in recreating the vintage machines as faithfully as possible which includes the use of composite video.

 

Speaking of the Multicomp, I've done some work porting that to the Papilio but ran into an obstacle with the video terminal code. It uses modulo division as part of the character position logic supporting different terminal widths and lines and ISE moans about using modulo with a number that's not a multiple of 10 or something like that, been a few weeks so I don't recall the exact details. I can post what I've done if anyone would like to finish it up.

 

In the meantime I've been playing with the UK101 and the Multicomp on one of the $17 Altera boards that Grant Searle used and they work as advertised with minimal fuss. From some comparisons I've done it seems the Cyclone II on those cheap boards is roughly equivalent to the Spartan3 250k used on the lower end Papilio board. Plenty of logic for a lot of vintage computer implementations but a bit lacking in on-chip RAM. I've been working on something like a megawing that will plug onto one of these boards to provide PS/2, composite and RGB video, serial port, I/O header and an external SRAM chip (or EPROM) fitted in a standard 32 pin DIP socket. I'll post the files once I've built one and verified the design is correct for anyone wishing to cross over to the dark side and try Altera. Their equivalent to ISE, Quartus II is actually quite nice, definitely feels more refined and ISE seems clunky after spending some time in Quartus. Unfortunately their free version is a bit more gimped and aspects like refusing to use more than one processor core while compiling annoy me. Quartus is also a lot more forgiving to sloppy VHDL and doesn't require instantiating individual components to hook them into an upper level, this could be viewed as better or worse depending how you look at it. Chinese clones of the Altera USB JTAG cable are also dirt cheap, ~$6 vs $40 for the Xilinx equivalent, which of course you don't need with the Papilio boards. I'm not sure why Xilinx went with such a complex solution for their USB platform cable, the simple USB programmer on the Papilio works just as well except that it's not supported directly by ISE.

Share this post


Link to post
Share on other sites

Hi Guys. I've stumbled across your UK101 computer project whilst looking around at FPGA emulations of older 8 bit computers. I love the 8 bits and have a version of Grant Searle's Z80 CP/M project up and running. I noticed you are getting your composite video and PS2 keyboard signals from the Arcade MEgawing. I don't have an Arcade megawing but I do have a Papilio One with Logicstart megawing which has a VGA port but no PS2 port. Would it be possible to convert the code to use the Logicstart VGA and some extra pins for the keyboard without any trouble?

Thanks,

Steve.

Share this post


Link to post
Share on other sites

I did that a long time ago when I barely knew what I was doing. Yes you could easily modify it to use other wings, in fact it's so simple that you don't really need a wing at all. Just two resistors for the composite video and two pins to a PS/2 jack for the keyboard. You can modify the constraints file or just use it as-is and wire the resistors to the same pins I used for the arcade megawing. If you were able to get the Z80 CP/M machine working then the UK101 ought to be a breeze, it's much simpler.

Share this post


Link to post
Share on other sites

Hi James. Thanks for the reply. OK I've downloaded the project file and opened the .ucf file for the pins. I see 2 pins for the video output. Video sync and video connected to the VGA green channel. Can you tell me where these pins are connected and which resistors I need? Thanks again. Steve.

PS. The grant Searle z80 system I assembled is actual hardware with Z80 chip and all logic and so chips as per grants design and not a synthesis. I'm relatively new to vhdl... :)

Share this post


Link to post
Share on other sites

I think it's 1k and 510 Ohm, just go to Grant Searle's site and look at what he used, it's not very critical. When I did this the VGA jack was just a convenient place to extract the signal using a couple of the resistors in the green channel DAC. Grant also used pullup resistors on the PS/2 clock and data lines, I've found the internal pullups on the FPGA pins to be sufficient but YMMV.

Share this post


Link to post
Share on other sites
2 minutes ago, james1095 said:

I think it's 1k and 510 Ohm, just go to Grant Searle's site and look at what he used, it's not very critical. When I did this the VGA jack was just a convenient place to extract the signal using a couple of the resistors in the green channel DAC. Grant also used pullup resistors on the PS/2 clock and data lines, I've found the internal pullups on the FPGA pins to be sufficient but YMMV.

OK so I join the 2 signals together using the resistors from each of the two channels tied together at the end... 

 

Share this post


Link to post
Share on other sites

Yes, all you're doing is mixing the sync with the luminance signal to create composite video. In the case of the UK101 it's something resembling PAL-50 but many NTSC monitors can lock onto it.

Share this post


Link to post
Share on other sites

Excellent I've got the video side of things working!! Thankyou!!! I've got a 12V b/w analogue TV with video in displaying "CEGMON (C)1980 D/C/W/M?" which I assume stand for disk,cold,warm and monitor.

I'm just working out the keyboard now. I have an old USB keyboard that I've cut the usb connector off revealing 4 wires (red,blac,white green). Can I use this type of keyboard or does it have to be a PS2 type?

 

 

Share this post


Link to post
Share on other sites

Sounds like you're just about there. I know very little about the original machine this recreates so I'm afraid I can't be much help in terms of actually using it but there should be plenty of information floating around on the web.

 

You'll need a PS/2 keyboard, though many USB mice are dual mode and support PS/2 via a passive adapter and some keyboards may be the same, I don't know. You won't hurt anything by trying but don't be surprised if it doesn't work. You can get PS/2 jacks cheaply on ebay, I even found some once that come on a handy little breakout board, it's cleaner than chopping the connector off. For cheap keyboards see if there's a computer recycler in your area or check thrift stores, I bought one for $1.99 a few years ago. A keyboard is a handy input device for all kinds of FPGA related stuff, there's some code floating around here to do the interface and decoding which is fairly easy to tack onto other projects and acts just like a whole bunch of buttons that only takes 2 IO pins on the FPGA.

Share this post


Link to post
Share on other sites

Hi James and Happy Xmas and new year.. Its all working! Thanks so much for all your help so far.I managed to get an old ps2 keyboard from work and after working out which wires were which its now all good. I'm now going to dissect your code and work out whats going on in the various files. I'm interested to know how you got the ROM images as hex files into your VHDL ROM files. Also, if I wanted to use a different ROM (I notice there is an a version of CEGMON with an advanced monitor program) how would I go about getting the hex file to examine?

Share this post


Link to post
Share on other sites

It's mostly Grant's code, I only ported it to the Papilio from the Altera platform he used. Since Xilinx ISE lacks the very convenient ability to load hex files directly that Altera Quartus has, I used mikej's Romgen tool, you can get it from the Papilio Arcade source files along with some batch files that you can look at to see how to use it. I have no idea where to find other ROMs for that machine, you might have some luck on a UK based vintage computing forum.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now