Beeb FPGA

for bbc micro/electron hardware, peripherals & programming issues (NOT emulators!)
User avatar
1024MAK
Posts: 6795
Joined: Mon Apr 18, 2011 4:46 pm
Location: Looking forward to summer in Somerset, UK...

Re: Beeb FPGA

Postby 1024MAK » Tue Feb 16, 2016 2:30 pm

fordp wrote:Thanks for that Mark but are the physical mice Quadrature or some some other system?

The mice for all the 16/32 bit Atari systems (ST, STF, STM, STFM, Mega ST, Mega STE, Falcon and TT) are all quadrature mice. As are the mice for the Amiga, and for most ZX Spectrum and Amstrad CPC mouse interfaces. And of course most BBC B/Master systems.

Now, I don't know about the details for the Amiga. But the Atari, and most of the rest I listed use software to carry out the decoding. At least one interface for the Amstrad CPC used hardware (74LS series logic) to decode the quadrature mouse signals. It uses up/down counters. The Z80 MPU then reads the counter outputs (one for up/down and one for left/right).

Mark
For a "Complete BBC Games Archive" visit www.bbcmicro.co.uk NOW!
BeebWiki‬ - for answers to many questions...

User avatar
hoglet
Posts: 6626
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol

Re: Beeb FPGA

Postby hoglet » Tue Feb 16, 2016 8:42 pm

Ford, I have a question about your DE1 PS/2 mouse mod:
http://zet.aluzina.org/forums/viewtopic ... 1801#p1801

Was there ever any discussion of whether it's safe to connect a mouse directly like this without any level shifting?

I believe PS/2 outputs should be open collector, but that some devices might contain pull-ups to 5V and I don't think Cyclone II inputs are 5V tolerant. Looking at the DE1 schematic for the PS/2 keyboard port, this includes schottky diodes which would provide some protection:
de1-ps2.PNG

The mouse mod doesn't have these components.

That said, if lots of people in the Minimig community have done this without any problems....

Dave
IMG_0320.JPG

User avatar
1024MAK
Posts: 6795
Joined: Mon Apr 18, 2011 4:46 pm
Location: Looking forward to summer in Somerset, UK...

Re: Beeb FPGA

Postby 1024MAK » Tue Feb 16, 2016 9:11 pm

hoglet wrote:I believe PS/2 outputs should be open collector
I believe that as well, because the PS/2 interface is bi-directional for both keyboards and mice.

Mark
For a "Complete BBC Games Archive" visit www.bbcmicro.co.uk NOW!
BeebWiki‬ - for answers to many questions...

User avatar
1024MAK
Posts: 6795
Joined: Mon Apr 18, 2011 4:46 pm
Location: Looking forward to summer in Somerset, UK...

Re: Beeb FPGA

Postby 1024MAK » Tue Feb 16, 2016 9:19 pm

For a "Complete BBC Games Archive" visit www.bbcmicro.co.uk NOW!
BeebWiki‬ - for answers to many questions...

User avatar
hoglet
Posts: 6626
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol

Re: Beeb FPGA

Postby hoglet » Tue Feb 16, 2016 9:19 pm

1024MAK wrote:
hoglet wrote:I believe PS/2 outputs should be open collector
I believe that as well, because the PS/2 interface is bi-directional for both keyboards and mice.

What's slightly concerning is that when I plug the mouse in, the voltage on the mouse ps/2 clock and data signals (as measured on the DE1) goes up from 3.3v to about 3.5v. This suggests the mouse does have pull ups to +5v.

Dave

User avatar
fordp
Posts: 922
Joined: Sun Feb 12, 2012 9:08 pm
Location: Kent, England

Re: Beeb FPGA

Postby fordp » Tue Feb 16, 2016 10:07 pm

The Mouse should be supplied from 3.3V and should work at that voltage. It will not pull above it's supply so there should be no risk!
FordP (Simon Ellwood)
Time is an illusion. Lunchtime, doubly so!

User avatar
hoglet
Posts: 6626
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol

Re: Beeb FPGA

Postby hoglet » Tue Feb 16, 2016 10:20 pm

fordp wrote:The Mouse should be supplied from 3.3V and should work at that voltage. It will not pull above it's supply so there should be no risk!

On the DE1 the PS/2 connector "power" pin is supplied with 5V. Does the DE1 mode somehow change that?

(Edit: On my board, it seems to be VCC5 seems 4.25V, not 5V)

I've made some measurements of how much current the a mouse will supply to ground. It looks like one of my mice probably uses 4.7K pullups to VCC and the other probably uses 15K pullups. Based on that, I'm not too worried about frying the DE1.

Dave
Last edited by hoglet on Tue Feb 16, 2016 10:26 pm, edited 1 time in total.

User avatar
fordp
Posts: 922
Joined: Sun Feb 12, 2012 9:08 pm
Location: Kent, England

Re: Beeb FPGA

Postby fordp » Tue Feb 16, 2016 10:24 pm

I think 3.3V would work and would be safer.

3.3V may not work on some really old mice however.

All the GPIO's have a 47R resistor is series which will help a little.
FordP (Simon Ellwood)
Time is an illusion. Lunchtime, doubly so!

User avatar
flynnjs
Posts: 757
Joined: Tue Jul 06, 2010 9:33 pm

Re: Beeb FPGA

Postby flynnjs » Wed Feb 17, 2016 7:39 pm

On a Cylone II you can activate the PCI clamping diode which will protect to a certain extent.
However, these are not active until the device is fully configured so they aren't foolproof.

On newer devices, even with external current limiting resistors, you should not connect to a
signal over 3v3.

User avatar
fordp
Posts: 922
Joined: Sun Feb 12, 2012 9:08 pm
Location: Kent, England

Re: Beeb FPGA

Postby fordp » Mon Mar 14, 2016 9:33 pm

Just the heads up that Dave has updated Beeb FPGA with the latest ROMs for ADFS (MMC/SD Card Version of course) and MMFS with a couple of other tweaks I think.
FordP (Simon Ellwood)
Time is an illusion. Lunchtime, doubly so!

User avatar
hoglet
Posts: 6626
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol

Re: Beeb FPGA

Postby hoglet » Tue Jul 12, 2016 1:49 pm

Continued from another thread:
hoglet wrote:Actually, it would be quite easy to connect a real BBC Keyboard to the Beeb FPGA. You just need 15 spare I/Os, which I think both the boards above have.

In fact, if you desoldered the four 74LS TTL chips and replaced them with 74HC equivalents, then you could run the whole thing off 3.3V and not need to faf around with level shifters.

I think I'm going to have to give this a try.....

Edit: Here's the keyboard schematic:
http://mdfs.net/Info/Comp/BBC/Circuits/BBC/bbckbd.gif

The original chips are:
- IC1 74LS163
- IC2 74LS251
- IC3 7445
- IC4 74LS30

I don't think a 74HC45 will be easy to come by :(

Anyone think of an alternative for a 7445 that has the same pinout but will run from 3.3V? It needs open collector outputs.

There is a 74HC145 but that seems hard to get as well.

User avatar
hoglet
Posts: 6626
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol

Re: Beeb FPGA

Postby hoglet » Tue Jul 12, 2016 2:30 pm

To recap, I'd like to connect a proper Beeb keyboard to Beeb Fpga, because I have one to-hand, and they can be cheap (<£20) to acquire.

The issue I am trying to deal with is how to safely interface the 3.3V I/Os on the FPGA board to the 5V 74LS TTL on the Beeb keyboard.

Safely: i.e. without damaging the expensive FPGA board!

Schematic is here:
http://mdfs.net/Info/Comp/BBC/Circuits/BBC/bbckbd.gif

Option 1 is to replace all the Keyboard ICs with 74HC(T) equivalents so the keyboard will work of 3.3V

Option 2 is to continue to run the Keyboard from 5V, and level shift where necessary. I *think* we might be able to get away with level shifting just PA7 and CA2, as all the other signals are outputs from the Beeb. And as the keyboard signals are quite slow, we might be able to just use resistors (e.g. 1K8 + 3K3).

Anyone see any gotchas?

Dave

User avatar
hoglet
Posts: 6626
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol

Re: Beeb FPGA

Postby hoglet » Tue Jul 12, 2016 2:54 pm

1024MAK wrote:Why do you want 74HC chips for? If you run the 74 and 74LS at 4.5V (which most will work okay on), the logic high output voltage if the outputs are fitted with suitable pull down resistors will not go much above 3.3V, so it may be okay to feed into 3.3V logic gates... The only problem may be that if the outputs are loaded too much, the logic high voltage may be too low :lol:

Just an idea mind, I have not tried this yet!

I wasn't clear how low a voltage you could actually run 74LS TTL at, and still have them function.

Just done some quick tests with the Bench PSU, and the keyboard actually seems to work when powered at 2.5V (heaven known what the logic thresholds will be).

I'm going to try running it at 3.3V and connecting it to the FPGA board.

Back soon.....

User avatar
hoglet
Posts: 6626
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol

Re: Beeb FPGA

Postby hoglet » Tue Jul 12, 2016 6:08 pm

hoglet wrote:I'm going to try running it at 3.3V and connecting it to the FPGA board.

Back soon.....

Well, a that took a tad longer than expected, because I forgot to connect one of the keyboard signals (KBD_EN_N) internally in the FPGA, and it took me a long time to spot that.

But I can report that the Beeb keyboard works perfectly when powered at 3.3V from the Altera DE1:
IMG_0496.JPG

The cable assembly needs a bit more work, and I also need to fix the N key, which doesn't seem to want to work.

Dave

User avatar
tricky
Posts: 1918
Joined: Tue Jun 21, 2011 8:25 am
Contact:

Re: Beeb FPGA

Postby tricky » Tue Jul 12, 2016 6:35 pm

Nice =D>
Several of my beebs are beyond my current ability to repair them, but this looks like it would fit nicely inside a beeb case, I think I will still look out for an FPGA with HDMI out though.

Higgy
Posts: 22
Joined: Wed Jan 25, 2017 1:32 pm

Re: Beeb FPGA

Postby Higgy » Wed Jan 25, 2017 5:30 pm

Hello.
Just wondering if anyone has got 'Castle Quest' to load? (My fav game from school!)
I have tried on both a MiST and ZX-Uno FPGA computer and it crashes before the title screen.
The version on the Beeb.MMC doing the Internet rounds is a compilation version.
I have tried about 4 normal releases and I get to the title screen (some graphically errors at the bottom of the title screen logo) but once you enter the game there is no character sprite?

Thanks

User avatar
leenew
Posts: 3402
Joined: Wed Jul 04, 2012 3:27 pm
Location: Doncaster, Yorkshire

Re: Beeb FPGA

Postby leenew » Wed Jan 25, 2017 6:40 pm

Hi Higgy,
You can download it as an SSD file here: http://www.bbcmicro.co.uk/index.php?rt_ ... on&on_S=on
You can play it online, or in an emulator like BeebEm on your PC.
It's a bit more work to get it to a real beeb... what gear do you have?

Lee

Higgy
Posts: 22
Joined: Wed Jan 25, 2017 1:32 pm

Re: Beeb FPGA

Postby Higgy » Wed Jan 25, 2017 8:14 pm

Thanks for the info Lee.

I don't have any Acorn original hardware (most other 8/16-bit computers/consoles though). I bought some FPGA devices because I wanted a device that I could plug in anywhere and use rather than my WinPC which is stuck in a room. Just sods law that my favourite game does not seem to work on FPGA devices!! (or the BBC core I should say).

Beeb emulation on Raspberry Pi does not seem to have progressed much. Although there is the Risc OS route via Pi. I did try it a few years back but could not get any games to run via the Archimedes emulator (reading again recently I think i need to decompress the files on the RPi/Risc OS not using WinPC.

User avatar
hoglet
Posts: 6626
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol

Re: Beeb FPGA

Postby hoglet » Wed Jan 25, 2017 9:45 pm

Hi Higgy,

Welcome to Stardot!
Higgy wrote:I don't have any Acorn original hardware (most other 8/16-bit computers/consoles though). I bought some FPGA devices because I wanted a device that I could plug in anywhere and use rather than my WinPC which is stuck in a room. Just sods law that my favourite game does not seem to work on FPGA devices!! (or the BBC core I should say).

I'm happy to look into what the issue is here.

Can you upload as an attachement the exact tape/disk image for Castle Quest that you are using please?

Dave

Higgy
Posts: 22
Joined: Wed Jan 25, 2017 1:32 pm

Re: Beeb FPGA

Postby Higgy » Thu Jan 26, 2017 1:45 pm

Thanks for offering to look at the file.

CastleQuest.zip
ZIP of SSD file
(16.65 KiB) Downloaded 12 times
- this is a single disk version.

Apart from only the background being shown once in the main game, there is a strange error which might help diagnose the issue(?) On the title screen the 'Quest' written in magenta has some flickering at the bottom. At first I thought it was some intentional 'flame' effect, but when running the game via BeebEm I see it is not the case and it is an error.

The Castle Quest on the 'usual' BEEB.MMB doing the Internet rounds is on a compilation disc and is located on disk 166. This version does not even get to title screen or 'Do you want Instructions' screen. It crashes to command line with some 'error at Line 40' text.

Thanks again.

User avatar
hoglet
Posts: 6626
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol

Re: Beeb FPGA

Postby hoglet » Thu Jan 26, 2017 4:43 pm

Higgy wrote:Thanks for offering to look at the file.

You're welcome - I'm always keen to look at test cases that fail...

It turns out Castle Quest relies on the power up settings of the 6522 timer latches for correct operation, and the 6522 VHDL model in BeebFPGA had these set incorrectly.

As a quick work around, if you type ?&FE69=&FF then you should be able to run your Castle Quest .ssd

The hardware fix is quite small:
https://github.com/hoglet67/BeebFpga/co ... d8c6741bfd

Here is an updated DE1 build that includes that fix:
latest.zip
(304.62 KiB) Downloaded 17 times

I assume this is the FPGA board you are using?

Higgy wrote:The Castle Quest on the 'usual' BEEB.MMB doing the Internet rounds is on a compilation disc and is located on disk 166. This version does not even get to title screen or 'Do you want Instructions' screen. It crashes to command line with some 'error at Line 40' text.

I also looked at the reason the Castle Quest on the 'usual' BEEB.MMB fails with an "at line 40". It actually also does this on a real Model B, and I expect that's because it's incompatible with the later versions of DFS that MMFS is based on. We've seen that with a couple of games that use memory that they really shouldn't.

Anyway, your version seems to work fine now, on a real Model B and on Beeb FPGA.

Dave

Higgy
Posts: 22
Joined: Wed Jan 25, 2017 1:32 pm

Re: Beeb FPGA

Postby Higgy » Thu Jan 26, 2017 8:28 pm

Many thanks Dave.

I am using a ZX-Uno (Xilinx Spartan XC6SLX9-2TQG144C) (http://zxuno.speccy.org/maquina_e.shtml ) and a MiST (Altera Cyclone EP3C25 FPGA ).

I am very new to FPGA's and don't know much about building binaries from source but I can pass on the information to the respective people.

I am glad looking at Castle Quest has helped improved the accuracy of the FPGA implementation.
With the ever more failure of legacy hardware components FPGA's are the future (just need replica keyboards or USB/ PS/2 adaptors for original hardware!)

Cheers

User avatar
hoglet
Posts: 6626
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol

Re: Beeb FPGA

Postby hoglet » Thu Jan 26, 2017 8:30 pm

Higgy wrote:Many thanks Dave.

You are welcome.

Let me know if the ?&FE69=&FF patch works with your boards (it should.....)

You only need to do this once after power up.

Dave

Higgy
Posts: 22
Joined: Wed Jan 25, 2017 1:32 pm

Re: Beeb FPGA

Postby Higgy » Thu Jan 26, 2017 10:12 pm

It works on both ZX-Uno and MiST 8)

I will try and get them to push your changes into their cores.

Many Thanks :D

Higgy
Posts: 22
Joined: Wed Jan 25, 2017 1:32 pm

Re: Beeb FPGA

Postby Higgy » Thu Feb 16, 2017 8:55 am

The Core on the ZX-Uno got updated with the fix :D also joystick support was added 8)

I have updated the 'Internet .MMB' with a version of Castle Quest that works and adjusted the MMB Menu to suit.
It was quite difficult to understand how to modify the Menu, I just ended up hacking the D.GAMESDB.TXT and creating a new MENU.SSD :lol:

Higgy
Posts: 22
Joined: Wed Jan 25, 2017 1:32 pm

Re: Beeb FPGA

Postby Higgy » Fri Feb 24, 2017 8:21 am

ZX-Uno Core has now been updated and Castle Quest works :D

I am trying to get 'Bad Apple' to run, which is being worked on over in the 8-Bit - Software Others - forum. - http://stardot.org.uk/forums/viewtopic.php?f=2&t=12574

The MiST uses 'Super MMC' and it is fine. The ZX-Uno uses 'Smart SPI' and I need to disable the DFS ROM in order for 'Bad Apple' to work. Do you know which ROM it is located on? I am using the following instructions:

Also, if you're running Super MMC and Acorn DFS in the same computer, they may interfere with each other during the background load routine used in the Bad Apple code. To avoid this, you'll need to disable the file system not in use (to disable, use ?&DFx=&FF, where x=ROM number to disable, 0-&F in hex, then press Ctrl-Break).


I am also hoping the the keyboard command for Ctrl-Break on ZX-Uno does the same as on a real BBC Micro

Thanks

Image

User avatar
hoglet
Posts: 6626
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol

Re: Beeb FPGA

Postby hoglet » Fri Feb 24, 2017 8:35 am

Do you have a link to the ZX Uno sources for the Beeb core?

Dave

User avatar
BigEd
Posts: 1499
Joined: Sun Jan 24, 2010 10:24 am
Location: West
Contact:

Re: Beeb FPGA

Postby BigEd » Fri Feb 24, 2017 9:22 am

(There's a link to a repo here)

Higgy
Posts: 22
Joined: Wed Jan 25, 2017 1:32 pm

Re: Beeb FPGA

Postby Higgy » Fri Feb 24, 2017 10:14 am


User avatar
hoglet
Posts: 6626
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol

Re: Beeb FPGA

Postby hoglet » Fri Feb 24, 2017 10:27 am

Higgy wrote:The MiST uses 'Super MMC' and it is fine. The ZX-Uno uses 'Smart SPI' and I need to disable the DFS ROM in order for 'Bad Apple' to work. Do you know which ROM it is located on? I am using the following instructions:

Looking at the script that builds the ROM image:
http://www.atc.us.es/svn/zxuno/cores/BB ... m_image.sh

There is just SmartSPI (slot 14 I guess) and Basic II (slot 15 I guess), no DFS.

What does *HELP show?

I'll try Bad Apple out on my BeebFPGA this morning, but that uses MMFS not SmartSPI.

Dave


Return to “hardware”

Who is online

Users browsing this forum: No registered users and 6 guests