DMA 82C37

415 views
Skip to first unread message

Tadeusz Pycio

unread,
Sep 11, 2023, 8:08:42 AM9/11/23
to retro-comp
The concept of a DMA module built on an 82C37, which can often be found at an attractive price which, despite the rather complex glue logic, is cheaper than a CMOS Z80-DMA with an 8MHz clock. The circuit diagram may contain errors that I have not yet discovered. ;-)
DMA8237.pdf

Interocitor Steve

unread,
Sep 11, 2023, 3:49:25 PM9/11/23
to retro-comp
But there is a lot more to build and test.

Tadeusz Pycio

unread,
Sep 11, 2023, 4:53:31 PM9/11/23
to retro-comp
This is true, but you gain 4 DMA channels instead of one, lose the ability to use interrupts and seek memory. For this reason, it is worthwhile to intersperse a less typical Z80 solution. The idea of using UPD71071 for my Z80+MMU 74HCT612 module is bothering me, I might try this solution.

Douglas Miller

unread,
Sep 11, 2023, 5:32:43 PM9/11/23
to retro-comp
FYI, another DMA controller that was popular before the "PC" was the Am9517 - which was 4 channel and much cheaper than the Z80-DMA. Of course, it is gone from the market now. Being only one channel, it's amazing there were as many systems using Z80-DMA as there were.

Tadeusz Pycio

unread,
Sep 11, 2023, 6:21:38 PM9/11/23
to retro-comp
Which came first Am8517 or i8237? These are exactly the same chips.

Douglas Miller

unread,
Sep 11, 2023, 6:49:27 PM9/11/23
to retro-comp
Interesting, I never even thought to compare them - and hadn't used the Am9517 since 1983 so didn't remember its details. Wikipedia states that the i8237 was "part of the MCS 85" which places it in time with the i8085. I see one old "FINAL" AMD datasheet that's titled "Am9517A / 8237A*" - although that doesn't really tell us much, except for the footnote there which says:

* The 8237A is an AMD-invented device more commonly referred to as the Am9517A

Which implies, to me, that AMD created the device and Intel was either second-source or otherwise licensed/OEMed the device. The date on this datasheet is 1989.

Sergey Kiselev

unread,
Sep 13, 2023, 12:59:23 AM9/13/23
to retro-comp
Intel 8257 came first :)
And then AMD updated it and called it Am8517
Then Intel somehow got the license to manufacture it, and called it 8237
So AMD Am8517 and Intel 8237 is the same device

Regarding using 82C37 DMA with Z80, make sure it can actually work at 8 MHz. Common CMOS variety (with no suffixes) and all NMOS 8237 only work up to 5 MHz

Tadeusz Pycio

unread,
Sep 13, 2023, 3:02:27 AM9/13/23
to retro-comp
O! Now I'm surprised, I assumed the i8257 was a developed version of the i8237, and it's the other way around. Admittedly I have never compared these chips, I was suggesting by the designations. A lot of interesting facts.

Getting the 8MHz version prompted me to start designing this DMA module. I had long wanted to explore the possibilities of such circuits in a Z80 environment but the difficulty of obtaining and price of a dedicated Z80 DMA discouraged me from building one.

PS. As we're on the subject of DMA, the hardest one for me to get hold of was the Z8016 Z8000 Z-DTC chip, for several years I thought it was a chip that only existed on paper, in datasheets. My dream is to have enough free time to design a maximum system on the Z8000. :-)

82C37.jpg

Tadeusz Pycio

unread,
Sep 13, 2023, 4:25:41 AM9/13/23
to retro-comp
In the introduction, I did not mention why I am aiming to build a DMA module. I simply want to see if it is possible to accelerate memory block transfers in hardware without resorting to software tricks like the example below:

The 'rwmove' routine in CP/M2 in every implementation for the Z80 uses the LDIR instruction, which is terribly slow. It can be replaced by the sequence:

rwmove: LDI
                LDI
                LDI
                LDI
               JP   V, rwmove

which is not elegant, but almost 12% faster.

Douglas Miller

unread,
Sep 13, 2023, 8:47:33 AM9/13/23
to retro-comp
This DMA chip (or any DMA controller worth a look) is much faster than anything that can be done in software. Sure, there is setup cost to consider, but the number of cycles per byte is compelling (even with the address latching). Of course, the built-in Z180 DMA is even faster.

Regarding history, I have two photos of Am9517 chips. Neither mention i8237. The first is (c) AMD 1979 w/datecode 8134 and the second is (c) AMD 1981 w/datecode 8204. I find the claim "The 8237A is an AMD-invented device" curious if all AMD did was copy the 8257. AMD does have a reputation for (and history of) taking an Intel chip and redesigning it from scratch to be better, although the word "invented" means something different to me. It does seem that Intel adopted/licensed/bought the Am9517 and called it 8237.  I have not been able to find evidence of 8257 vs. 8237 timelines.

Bill Shen

unread,
Sep 13, 2023, 9:09:27 AM9/13/23
to retro-comp
I read that DMA chip is limited to 8 Mhz, so how does 8Mhz DMA compares to 20Mhz Z80?  Has anyone tried to overclock DMA?  I know Z80 can be reliably overclocked to 30Mhz (passing memory test and zexall)
  Bill

Tadeusz Pycio

unread,
Sep 13, 2023, 9:47:05 AM9/13/23
to retro-comp
I did a little investigation and indeed Intel did release the ~1974 i8257 chip for the MCS 80, which I think was completely rebuilt by AMD and so the Am8517 was born. Intel probably licensed this chip as the i8237.

8237.jpg

@Bill
There are also 82C37 @ 12MHz versions available and they can probably be overclocked, because if my memory serves me right I have seen an AT motherboard with a 286 @ 16MHz and rather these chips ran at the CPU clock (but I could be wrong here).

Andrew Lynch

unread,
Sep 13, 2023, 9:54:37 AM9/13/23
to retro-comp, Bill Shen
Hi Bill

On duodyne Z80 processor board (currently in initial build and test), there is a Z80 CPU along with two Z80 DMAs.  The DMAs are rated for 8 MHz, but people have overclocked them much faster like 14, 15, 16 MHz.  I was really surprised at how well it supported overclocking and Zilog is being very conservative rating their DMA chips at only 8 MHz.  However, my plan is to not overclock but if people want to do it there is nothing stopping them.

For certain the interrupts, memory-to-memory, and the IO-to-memory DMA-transfers work.  Still working on the memory-to-IO transfers and there are issues with byte mode.  But I am confident we'll get through those and get a high degree of DMA functionality.  

On the nhyodyne design Z80 CPU and Z80 DMA were on separate boards but duodyne merges these so the Z80 CPU and DMAs are closely coupled.  It makes the bus interface logic more complicated.

Thanks, Andrew Lynch


--
You received this message because you are subscribed to the Google Groups "retro-comp" group.
To unsubscribe from this group and stop receiving emails from it, send an email to retro-comp+...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/retro-comp/5e7c508e-da78-47cb-8d81-d8bd9202298dn%40googlegroups.com
.

Alan Cox

unread,
Sep 13, 2023, 10:33:36 AM9/13/23
to retro-comp
> I read that DMA chip is limited to 8 Mhz, so how does 8Mhz DMA compares to 20Mhz Z80? Has anyone tried to overclock DMA? I know Z80 can be reliably overclocked to 30Mhz (passing memory test and zexall)

Depends how fast your memory subsystem is. At peak it can read or
write a byte in 2 cycles so 4 cycles a transfer versus 16 for LDI (or
a bit less with crazy abuses of the stack pointer)

Fuzix uses it for certain things and it is quite noticeable for CF
adapter I/O, and task forking.


Alan

Sergey Kiselev

unread,
Sep 13, 2023, 2:32:12 PM9/13/23
to retro-comp
I didn't have a any luck with overclocking 8237 DMA... At least the NMOS chips. They wouldn't work reliably above 5 MHz.
I am not sure about CMOS 82C37 chips. But I think your mileage would vary depending on the manufacturer (e.g. Toshiba, Harris/Intersil). Harris/Intersil used to make these 12 MHz rated 82C37A-12 chips. I personally never seen one in DIP package (the designation would be CP82C37A-12), only PLCC ones (CS82C37A-12).

Regarding the 286 and the AT compatibles: In the original AT system, the 8237 DMAC was actually underclocked, it ran at 3 MHz (1/2 of the CPU frequency). In the 8 MHz AT (or XT/286) it ran at 4 MHz.  More modern AT compatibles, seem to ran DMA at 4.77 MHz (same as the original PC/XT) or perhaps at some other frequencies, but no faster than 5 MHz. This mostly has to do with the compatibility with older ISA cards, that can go only so fast.

Bill Shen

unread,
Sep 13, 2023, 2:50:15 PM9/13/23
to retro-comp
I’m wondering whether it is better to have a simple SBC that can run fast—2x or 3x—than a complex, slower multi-board design with DMA.  If DMA advantage is 4X but simple, fast SBC is able to run 2x DMA-based system, then intuitively the performance break even point is doing DMA 50% of the time.   Hmmm…it seems to me DMA makes more sense if clock is pegged at 8Mhz due to speed limitations of other IO devices on the system or because of compatibility standards like ISA or RC2014.  
  Bill

Tadeusz Pycio

unread,
Sep 13, 2023, 3:02:45 PM9/13/23
to retro-comp
Yes, that magical 4.77MHz, I subconsciously felt I had overlooked something in my deliberations. Sergey you are absolutely right.

Bill, don't expect that much of an acceleration thanks to the use of DMA, if again I haven't missed something the gain from its use is only when we transfer min. 128kB, because the expenses for its programming must be added to this transfer speed (something similar to the example with the quadruple use of LDI instead of LDIR). In CP/M, only the disk subsystem will gain, and that's it.

Tadeusz Pycio

unread,
Sep 13, 2023, 3:07:54 PM9/13/23
to retro-comp
Erratum: 128B not 128kB

Andrew Lynch

unread,
Sep 13, 2023, 3:20:33 PM9/13/23
to retro-comp, Bill Shen
Hi Bill

Yes, I think you've got it right.  You can get CMOS Z80 CPUs to go 20MHz as rated and overclock much higher.  However, the strategy is really only applicable if you have an SBC with a high level of integration.  

Once you put a 20MHz or greater CPU on a system bus, even one that's fully buffered with fast 74Fxxx or 74ALSxxx parts, going full speed is going to be challenging.  DMA can have a big impact on a slower, 8 MHz system but less so a blazing 20+ MHz system.  Parallel busses really start to get difficult when you push past about 10 MHz.

I suspect an overclocked 30MHz Z80 CPU is probably faster on net than an 8 MHz Z80 CPU with matching DMA.  It depends on the application, of course. I think the real advantage of the slower CPU with DMA is expandability on a system bus like ECB, S-100, ISA, etc.

Not saying there are not advantages to raw CPU speed, but each approach has its own strengths and weaknesses.  It depends on what you are trying to do.

Thanks, Andrew Lynch

  

--
You received this message because you are subscribed to the Google Groups "retro-comp" group.
To unsubscribe from this group and stop receiving emails from it, send an email to retro-comp+...@googlegroups.com.
To view this discussion on the web visit

Bill Shen

unread,
Sep 13, 2023, 5:51:37 PM9/13/23
to retro-comp
In my own experience with Z80, 22MHz Z80 is a very stable CPU frequency and I have designed half a dozen Z80 SBC since 2018 either as 50mmX100mm SBC plugging into RC2014 backplane or as 100mmX100mm motherboard with RC2014 expansion slots.  A couple of those designs also run RomWBW.   Beyond 22MHz is Z80ALL at 25.175MHz with a KIORC expansion board that Ladislau Szilagyi has developed real time operating system and many amazing CP/M software as documented in RC2014-Z80 google pages and his GitHub page, https://github.com/Laci1953/Software-for-Z80ALL-retro-computer
Z80ALL is a very stable standalone platform with its own VGA and PS2 keyboard plus SIO/PIO/CTC/DS1302RTC functions provided by the KIORC expansion board.  Beyond 25.175MHz is specially developed ZRCC rev1.3 nominally operating at 29.5MHz but overclocked to 33MHz with selected Z80 parts.  I do admit such highly overclocked Z80 won't work with additional expansion I/O boards.

I know this sounds like bragging, but I want to point out empirically that Z80 can be overclocked past 20MHz yet support many I/O boards on RC2014 backplane without additional 74xx245 address/data buffers.
  Bill

Andrew Lynch

unread,
Sep 13, 2023, 7:15:40 PM9/13/23
to retro-comp, Bill Shen
Hi Bill,

I think the key for high speed Z80 on the bus is small size and compact design with as much local to the CPU as possible.  I think there was a really good reason the AT-ISA spec capped out at 8.33 MHz and S-100 rarely goes above 10 MHz.  I have found going past 10 MHz for a large parallel bus opens it up to big time capacitive effects which can affect timing and boards become sensitive to where they are relative to the processor.

RC2014/RCBUS is kind of special because while it has a bus structure, it doesn't use buffers/transceivers so the parts are effectively local to the CPU.  Is that an expansion bus or is it a modular SBC?  I guess it depends on how you look at it.  There are definitely some advantages like cost, size, simplified bus logic, and reduced part count.

Regardless of what you prefer, I think it is all good and glad to see the retrocomputer community thriving in whatever form that takes.

Have a great day!  Thanks!  Andrew Lynch



Tadeusz Pycio

unread,
Jan 19, 2025, 7:18:20 AMJan 19
to retro-comp
The project is finally done after so long, it's time for testing. It will be interesting to see if it works. :)

82C37.jpg
Reply all
Reply to author
Forward
0 new messages