Author Topic: Z80 Surfboard  (Read 827 times)

0 Members and 1 Guest are viewing this topic.

Offline Charlie

  • CPC664
  • ***
  • Posts: 68
  • Country: gb
    • The Qube Server
  • Liked: 34
  • Likes Given: 0
Z80 Surfboard
« on: 13:49, 09 December 19 »
As things are looking up a bit I'm looking to actually make some of the designs I've been splurging on this good forum... there's more to come I'm afraid.
For today here's a teaser for what I'm calling a Z80 Surfboard:

A while back I mentioned I'd been looking in to doing a Z80 accelerator for the PCW, and maybe other Z80 systems. The circuit I'd initially shown was frankly a dubious hack. Further thought has taken me in a couple of directions, this do-dad is by far the simpler version but hopefully of interest to some and a far better rendition than my previous attempt.

Oh, it's a (hopefully) universal plug-in accelerator for Z80 based systems. I'm in the process of going over the schematic and layout again looking for errors. I'll post the Eagle files in a bit then if all seems good I'll be sending an order off to Seeed for some PCBs.

Fingers crossed!
« Last Edit: 13:53, 09 December 19 by Charlie »
Charlie.

Are you pondering what I'm pondering? The Qube Server

Offline Bryce

  • The Hardware Guy.
  • Supporter
  • 6128 Plus
  • *
  • Posts: 11.614
  • Country: wf
  • It's not broken, it just hasn't been fixed yet.
    • index.php?action=treasury
  • Liked: 4155
  • Likes Given: 433
Re: Z80 Surfboard
« Reply #1 on: 14:05, 09 December 19 »
Interesting idea. What method are you using to accelerate the CPU?

Bryce.
« Last Edit: 14:29, 09 December 19 by Bryce »

Offline Gryzor

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 15.698
  • Country: gr
  • CPC-Wiki maintainer
    • CPCWiki
  • Liked: 3245
  • Likes Given: 5904
Re: Z80 Surfboard
« Reply #2 on: 14:11, 09 December 19 »
I realised I don't know the difference between a co-processor and an accelerator...

Can it really be universal?

Offline Bryce

  • The Hardware Guy.
  • Supporter
  • 6128 Plus
  • *
  • Posts: 11.614
  • Country: wf
  • It's not broken, it just hasn't been fixed yet.
    • index.php?action=treasury
  • Liked: 4155
  • Likes Given: 433
Re: Z80 Surfboard
« Reply #3 on: 14:24, 09 December 19 »
A co-processor is used to off-load process-heavy tasks and free up the processor for other things.
An accelerator makes the processor go faster.

I would also question whether it could be made as a universal expansion, as the Z80 is used in completely different ways in many of the better known computers, but it worth looking into.

Bryce.
« Last Edit: 14:29, 09 December 19 by Bryce »

Offline Gryzor

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 15.698
  • Country: gr
  • CPC-Wiki maintainer
    • CPCWiki
  • Liked: 3245
  • Likes Given: 5904
Re: Z80 Surfboard
« Reply #4 on: 14:25, 09 December 19 »
What I suspected (though never thought of it before...) My next question is the same as yours 😄

Offline Bryce

  • The Hardware Guy.
  • Supporter
  • 6128 Plus
  • *
  • Posts: 11.614
  • Country: wf
  • It's not broken, it just hasn't been fixed yet.
    • index.php?action=treasury
  • Liked: 4155
  • Likes Given: 433
Re: Z80 Surfboard
« Reply #5 on: 14:27, 09 December 19 »
I made an accelerator for the 6502 back in the 90's. It worked perfectly on the Atari 800XL, but it wouldn't have worked on any other 6502 computer.

Bryce.
 
« Last Edit: 14:29, 09 December 19 by Bryce »

Offline Charlie

  • CPC664
  • ***
  • Posts: 68
  • Country: gb
    • The Qube Server
  • Liked: 34
  • Likes Given: 0
Re: Z80 Surfboard
« Reply #6 on: 16:05, 10 December 19 »
Hi Chaps, thanks for the interest.  :)


Yes, the words 'universal' and 'accelerator' do need some clarification, especially as that's a bit on an ambitious claim. Let's dial it back a bit:


Universal - This board is indeed intended to fit between a Z80 and it's socket and I have done my best to make it as small as possible. Will it work in any Z80 system? No idea... in theory... maybe.
Will it fit in any Z80 system? I tried to make the board as small as reasonably possible, hence the SMT parts. But there's bound to be machines where there just isn't enough room and as there's no buffering on this board I wouldn't want to hang it off a ribbon cable.


Accelerator - This is in my (not so) humble opinion a fairly cunning design but it certainly isn't a full accelerator. eg: no local fast RAM, etc.
It's basically just a circuit to inject a higher clock speed in to the Z80 to make it execute code a bit faster. The result is never going to be as good as a proper accelerator but this will hopefully add a bit of relatively simple and easy vim to a system. Reasonable questions might be:
But if you're running the Z80 faster won't that throw out timings for everything else? The Z80 has the faster clock the rest of the computer keeps using it's stock clock.
Ok, but the CPU will still need servicing faster. At some point important things like peripherals, video, audio, RAM, ROM, won't be able to keep up or simply not work if they are timing critical. True, and depending on the computer your mileage may vary, but I've hopefully considered that:
By default this board falls back to using the stock clock whenever an /IORQ is asserted.
There are pads on the board for connecting the activation line of any unhappy subsystem. The stock clock will be asserted to slow the Z80 when said systems are activated. As a last resort the board also has a jumper to add a wait state whenever M1 is asserted - that might be of use where RAM or especially ROM is struggling, but it's use is best avoided - there will be a speed penalty.
Finally It's my understanding that Z80's don't like having their clock messed with. This circuit hopefully takes account of that but again your mileage may vary.


I'm certainly open to further questions and indeed suggestions and advice would be most welcome, I know Bryce has probably forgotten more about electronics that I will ever know. Hello by the way.  :)


So here's the files for any that may be interested. I am actually intending to get this one made fairly soon so actually news some time.


As I'm not about much these days it's possibly worth restating my attitude toward the use of my designs. I do this because I enjoy it, it's my hope others may find my stuff interesting and maybe even useful on occasion. I am 100% happy, even flattered, for anyone to use any of my stuff in any way they see fit. I don't expect to be credited but if for instance an enterprising soul should ever make / sell one of my creations a mention would be appreciated.


PS
Below are PNGs of the schematic and board layout, along with a .zip of the Eagle files. I've not done the gerbers as yet as I've no evidence this thing actually works.
« Last Edit: 16:10, 10 December 19 by Charlie »
Charlie.

Are you pondering what I'm pondering? The Qube Server

Offline Bryce

  • The Hardware Guy.
  • Supporter
  • 6128 Plus
  • *
  • Posts: 11.614
  • Country: wf
  • It's not broken, it just hasn't been fixed yet.
    • index.php?action=treasury
  • Liked: 4155
  • Likes Given: 433
Re: Z80 Surfboard
« Reply #7 on: 16:31, 10 December 19 »
That's similar to how my 6502 accelerator worked. It used a faster clock as long as the /IORQ was high, however, this was much easier to do on the 800XL as the clock wasn't being generated by a Gate array, so my expansion had a faster clock on board with a divider to bring it back to the correct speed as soon as the /IORQ went high. Technically possible on a Z80, but I've never looked into what else this might effect. On a CPC you have the added advantage that the RAM refresh isn't being done by the CPU, but this might mean having to restrict the accelerators limits to make it compatible with other systems where the CPU is doing the refresh.

Eh, how are you syncing the original clock with the new clock?


Bryce.
« Last Edit: 16:33, 10 December 19 by Bryce »

Offline gerald

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.482
  • Liked: 1027
  • Likes Given: 257
Re: Z80 Surfboard
« Reply #8 on: 18:01, 10 December 19 »
On a CPC you have the added advantage that the RAM refresh isn't being done by the CPU, but this might mean having to restrict the accelerators limits to make it compatible with other systems where the CPU is doing the refresh.
Except that the RAM refresh on the CPC is done by the Gate Array and only allow one access every 4 4MHz cycles (ie 1MByte/s).
So unless you know that you are accessing an external RAM, you are still bounded by the gate array.

Offline Charlie

  • CPC664
  • ***
  • Posts: 68
  • Country: gb
    • The Qube Server
  • Liked: 34
  • Likes Given: 0
Re: Z80 Surfboard
« Reply #9 on: 20:01, 10 December 19 »
Hi chaps,
Thanks for the interest and indeed further feedback. For what it's worth this is certainly a dirty way to speed up a computer but I have some evidence the theory holds in practice. While looking for ideas to come up with a more elegant solution than my previous, and frankly nasty, attempt I discovered some posts on MSX forums talking about 'accelerators' that used this kind of method. Indeed inspiration for adding a wait-state jumper came from this direction - I know next-to-nothing about MSX's but I understand by design they insert a Wait in to every M1 access because otherwise the RAM used isn't fast enough for reliable access. Maybe part of the reason why these machines have a bit of a reputation for being slower than they should be? Anyway I added the M1 jumper partly because I could, options are nice, and partly because I wondered if RAM (ROM) access might be more critical that I thought.


@Bryce:
Assuming I'm not about to discover I'm spouting rubbish, or my schematic has errors I've not spotted, the plan goes something like this:

'153 (4-to-1 multiplexer)
'175 (positive-edge triggered 4 bit register)
The '153 maintains a current state, and handles the status LED(s). Its clock input is triggered on the low-to-high transition, making sure that changes occur only right after the clock signal (pin 7) has turned high to meet Z80 CPU requirements. Its output (pin 2) is fed into the multiplexer.
One half is used internally to switch between clock signals, required to prevent the circuit from halting itself. At the next low-to-high transition, a second output (pin 15), following the first one, controls the actual switching of the clock output. If these two lines are the same the multiplexer acts as a buffer for the desired output. If the two control signals are different, circuit switching over, the other multiplexer inputs (tied to VCC) lengthen the high-period of the clock output.
« Last Edit: 20:04, 10 December 19 by Charlie »
Charlie.

Are you pondering what I'm pondering? The Qube Server

Offline Bryce

  • The Hardware Guy.
  • Supporter
  • 6128 Plus
  • *
  • Posts: 11.614
  • Country: wf
  • It's not broken, it just hasn't been fixed yet.
    • index.php?action=treasury
  • Liked: 4155
  • Likes Given: 433
Re: Z80 Surfboard
« Reply #10 on: 09:31, 11 December 19 »
Sounds like a nice solution. Interested to see if it works as planned.

Bryce.

Offline Charlie

  • CPC664
  • ***
  • Posts: 68
  • Country: gb
    • The Qube Server
  • Liked: 34
  • Likes Given: 0
Re: Z80 Surfboard
« Reply #11 on: 18:22, 11 December 19 »
Fingers Crossed!  :)
Charlie.

Are you pondering what I'm pondering? The Qube Server

Offline 1024MAK

  • Supporter
  • 464 Plus
  • *
  • Posts: 343
  • Country: gb
  • Touching the hot end of an iron will hurt!
  • Liked: 146
  • Likes Given: 197
Re: Z80 Surfboard
« Reply #12 on: 09:50, 12 December 19 »
Sounds like a nice solution. Interested to see if it works as planned.

Bryce.

Ditto  :D

Mark
Looking forward to summer in Somerset :-)

Offline Charlie

  • CPC664
  • ***
  • Posts: 68
  • Country: gb
    • The Qube Server
  • Liked: 34
  • Likes Given: 0
Re: Z80 Surfboard
« Reply #13 on: 18:53, 14 December 19 »
Once again thanks for the interest.  :)

I've just sent an order for the PCB's off to Seeed so fingers crossed.

Why Seeed?
There's plenty of good PCB fabrication houses out there but I've never had any issues with Seeed. Their work is always excellent quality, dirt cheap, they have lots of options, and they'll even do the construction for you... for a fee:
eg: 10 x 66x26mm boards = $3.92, for a total of £12.13 with shipping vial Royal Mail.

Highly recommended.

Attached below is the .zip file for the gerbers - should anyone want to order their own the process is generally:
Upload the .zip file to the FAB house of your choice, enter the dimensions if this isn't automatic, say how many you want, pay, wait for your delivery.
As a general rule, at least with Seeed, there are many options indeed but the defaults are fine.

Might I suggest that if anyone is interested in their own:
-Wait for me to report back that it actually works
-Ask me if I have any spare boards you can have, there are likely to be some
-Order your own if I haven't got spares or you want something other than a Green PCB with the standard options

PS
Yes, I know this board has SMT components. It was necessary to make everything fit. I very rarely use SMT or programmable components because it often puts people off making their own but:
-SMT components aren't hard to solder, even with basic equipment
-I've deliberately gone for the larger sizes to make it easier
-I (almost) never do production runs
-I'm happy to render advice
 
« Last Edit: 18:54, 14 December 19 by Charlie »
Charlie.

Are you pondering what I'm pondering? The Qube Server

Offline GUNHED

  • 6128 Plus
  • ******
  • Posts: 1.868
  • Country: de
  • Reincarnation of TFM
    • FutureOS - The quickest OS for the CPC and Plus
  • Liked: 845
  • Likes Given: 2100
Re: Z80 Surfboard
« Reply #14 on: 15:04, 15 December 19 »
Let us please know which results you get with real hardware.  :)
http://futureos.de --> Get the revolutionary FutureOS (Recent update: 2019.08.07)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2019.08.14)