A device with direct memory access?

For experts to discuss very technical stuff and newbies to ask why the Spectrum they bought off ebay doesn't work.
Post Reply
Alcoholics Anonymous
Microbot
Posts: 194
Joined: Mon Oct 08, 2018 3:36 am

Re: A device with direct memory access?

Post by Alcoholics Anonymous »

The z80 dma's bus transaction lengths are programmable at 2, 3 or 4 cycles. 3 is "standard timing" which corresponds to typical z80 memory read/write cycles (but not instruction fetch cycles). However using 2 cycle timing is perfectly fine if the external memory and/or io device is fast enough. In 2 cycle timing, the address is stable for something less than 2 cycles and the rd/wr signal is asserted for about 1.5 cycles. Spectrum memory can handle this no problem.

So what does 2-cycle timing mean? One byte can be read and one byte written in 4 cycles, which is four times faster than an LDI instruction or an INI instruction.

The problem with refresh is another thing as mentioned but depending on how the computer's memory is wired up, the act of generating sequential addresses by the dma could also act as refresh. But I don't know if this works in the spectrum. I do know that it's common for datagear and mb02 programs using their dma chips to transfer a display file at least uninterrupted which amounts to 6k and those programs seem to work stably on a spectrum. I don't know if they are depending on likely decay time of the drams being > 2ms (they say 2ms but I know there's a reputation for it being much larger in practice). The mb03 is another interface that is getting a dma and it will have the refresh issue too. The zx next is all sram so its dma can blast away without problems.

Anyway, matthew smith would not have been using a dma for transferring his programs. It's just too complicated - the other end (the trs80 that did the transferring) would not be synchronized with the z80 bus to supply bytes when the dma demanded it. For one thing, the trs80 is too slow.

It would have a been a much simpler io port interface that the spectrum's z80 read with a regular 16T INI instruction. Keep in mind the trs80 was half as fast and you probably need some margin for synchronizing so maybe a transfer every 48T or so. That amounts to sending 32k in 32768*48/70000 = 22.5 frames or about 4-5 seconds.
Firefox

Re: A device with direct memory access?

Post by Firefox »

I was having a geek out over the "what did Matthew Smith make?" problem on Sunday.
After poring over the Tandy Model III and Spectrum schematics for a while I came to the conclusion that it could probably be done with a couple of daisy-chained counter ICs and some octal tri-state buffers (trying to use components that Matthew could've got from the Maplin catalogue). It wouldn't even really need much in the way of glue logic.
Annoyingly the Model III's printer port doesn't implement any of the nice flag signals in the printer-wards direction like linefeed, so there's no simple way to be able to kick off the transfer directly from the Model III. A sort of "arm" button would be needed to get ready for the transfer, and you'd probably want to reset the Spectrum before that so it's not running out of upper RAM and so you can type "RAND USR 32768" or whatever after the transfer's complete.

*sigh* Now I'm going to have to build one to see if it would work...

Of course, this is just a complete guess. Maybe he had access to an EPROM programmer and just stuck an EPROM and a Z80-PIO on his Veroboard?
User avatar
1024MAK
Bugaboo
Posts: 3123
Joined: Wed Nov 15, 2017 2:52 pm
Location: Sunny Somerset in the U.K. in Europe

Re: A device with direct memory access?

Post by 1024MAK »

For transfers in one direction only, from another computer with a parallel printer port to a ZX Spectrum with a Sinclair Interface 2 joystick interface, or any of the Kempston (or compatible) joystick interfaces where the common pin on the joystick port is the ZX Spectrum 0V (GND) you only need a custom cable. Other joystick interfaces may also be suitable. The criteria being that the common pin on the joystick port is the ZX Spectrum 0V (GND). That includes the +2 grey, but not the +2A, the +2B, the +3 or the +3B machines.

On the Spectrum you will need a short bootstrap loader, and on the other computer you will need a custom program to send the data as 4 bit nibbles.

Mark
:!: Standby alert :!:
“There are four lights!”
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :dance
Looking forward to summer later in the year.
Post Reply