The github repo has a branch with a cutout for MMU board, but even there I had to mill the last two pins and solder short wires directly to pin headers. I should have put GAL on the opposite end of the MMU PCB. But back then I had no idea that one day there would be a Z80 daughterboard too :).
The tower of terror MMU stack fits fine in my 128D at least with the 1571 removed. I pulled the MMU out of the slim though, I think it's causing problems with the autoboot stuff. I'll have to look at your repo again, thanks for putting your hard work out there for us to use!
Due to timing requirements the standard z80 chip in the c128 is rated for 4MHz, and it gets clock pulses at that frequency but the clock will “sleep” from time to time to fit the bus structure of the 8502. Thus the effective clock is only 2 MHz normally, even if the chip is rated for 4 MHz.
you could try modyfying the memory expansion board with 2 pieces of hdd cable and 2 rows of L headers and just move the board sideways the headers would had to be fixed to the medule by hot glue or epoxy though so it wouldn't fly around
As an earlier RTI video suggests, the hit Z80 + CP/M take on switching I/O between Z80 and 8502 code might be more significant than any of the commonly-aired wisdom regarding the C128 Z80's disconnected-NMI or the clock/2 wait-state issue. I agree with this suspicion as there may not be any other CP/M port that relies so heavily on 6502-code. CAVEAT: Though I don't recall how Z80 and 8502 switch under CP/M Plus, and don't have a good idea on how qtermsl internals work, I am going to assume that qtermsl was compiled with CP/M environment as the target. In other words, no direct IN/OUT Z80 instructions within qtermsl are banging the $dexx swiftlink page directly. If this is the case, qtermsl is held hostage to plenty of CPU switching courtesy of CP/M itself. A simple example of 8502 -> z80 -> 8502 .. follows further below: (Please note that even if Z80 were banging I/O directly, the IN/OUT z80 instructions wired to $dxxx I/O block are typiocally a step-slower than direct LOAD/STORE to memory mapped I/O addresses. That's right, there is no MM I/O on the C128 for Z80 - except for the MMU mirrors at $ffxx !) Feel free to count the cycles wasted in the subsequent process. (I hope I didn't mess anything up!) MG -- THE DANCE OF 8502 to Z80, and back to 8502 ... ... a rough, quick and simple example ... (code is untested) ; origin .. anywhere you please withion reason ; $ffee is default z80 re-start address where the C128 z80-boot-rom (?) lands the z80's program counter, after full control is passed to the 8502. lda #$3e ; MMU guides explain this move sta $ff00 ldx #$03 ; copy for z80 bytes ; pre-load z80 opcodes/data LOOP: lda $z80.preload,x dex ; stash opcodes/bytes to default Z80 restart address sta $ffee,x bpl LOOP: sei ; sei/cli may or may not be necesary, i don't recall. lda #$b0 ; tri-state 8502, re-activate z80 sta $d505 nop ; 8502 Reactivation point (AFTER thje nop above) cli rts ; Z80 Recativation bytes, copied to $ffee, by 8502 code. z80.preload - bytes 21 (low-byte) (high-byte) e9 - these bytes correspond to: ld hl, #$z80.code.start ld pc,hl z80.code.start ld a, #$3e ; MMU guides explain this move ld ($ff00),a ~place desired Z80 work-code here~ Next z80 segment: Z80 tri-states, 8502 re-activates di ; di/ei may or may not be necesary, i don't recall. ld bc,#$d505 ld a,#$b1 out bc,a nop ; if you switch back to z80 later on, ; it reactivates here AFTER the nop. ; therefore, we immediately force it back to $ffee formal z80 restart point ei ld hl,#$ffee ld pc, hl
Pretty cool. I have to dig into what all the other mods you have are but getting the Z80 up to 4 MHz is definitely something I'd like to do with my C128. But it's also a wedge so we'll see if I can get it to fit.
OMG this video was so exciting! 8 MHz Z80 on the C128?? AMAZING! Hey did you ever figure out what the Z80 you used in this video was rated for? Also: your virtual drive: Does it use the burst mode that the C1571 and C1581 uses?
I never pulled the heatsink off, but I do believe the z80 came from Ebay and was a more modern one. Unfortunately the only 2 80's vintage z80's I have are both directly soldered to boards so I can't easily pull and test. I bet they'd work though. The z80 in the c128 was severely underclocked compared to other systems of the era. And yeah, 8mhz sounds cool, but it still only runs about half the time so its effective speed is just under 4mhz.
@@retrotechinsanity Yeah they did that so that it could play nice with the system board. The first computer I used, actually, was a Toshiba T-250 with an intel 8085 running CP/M 2.2, dual 8" floppy disks (about 1 MB each!) and 64k RAM (58k TPA). It was definitely faster than the 128, but that was my dad's computer. I would love to upgrade my 128D with a higher speed Z80 chip, but I lack the skills needed with a soldering iron to do the mod you created (of course the Z80 is soldered to the 128D's mainboard). I'm very interested in seeing where you take this! Thanks for the great video.
The brown one is ancient and I don't recommend. The new one is the X-Pander 3. TH-cam usually craps on links in comments, so give it a google and you'll find it easily.
Form the wiki sheet the C128 has an Z80A or Z80B are 4MHz CPUs but they run at only 2MHz on the C128. Will you get an 8MHz Z80? If it will work at 8MHz that will 4X faster than the 2MHz it runs at now.
8MHz operation should in theory be possible in the C128's 2MHz mode... The VIC-II doesn't double the clock speed of the Z80 like it doubles the clock speed of the 8502 in 2MHz mode, however, there is no reason why this is not possible. Therefore it should be possible to get 8MHz operation, but the challenge will be to replicate the cycle stretching that the VIC-II does during memory refresh and I/O access.
@@lucahitman The z80 clock is running at 8mhz but due to the c128 architecture (sharing time with the 8502) it only runs about half the time. Overall just under 4mhz effective speed.
Those drives were so sloooow. I remember playing zork on a friend's c64 . He typed in a command, 5 minutes of drive whirring around to finally spit out "you have died"
I own the accelerators SuperCPU 128 and Flash 8. Both great cards, but too expensive and they never spread. The same is with all this modern FPGA-based stuff. So I didn't want to make the same mistakes. The board is designed for self-soldering, nearly all IC's are Through-Hole. So only the PCB has to be produced. The part costs are about 50-60 Euro. The compatibility is about 99%. It works best in C128 mode, but also in C64 mode. It also may improve using the VDC.
Unfortunately I found nobody who thinks like me. Creating inexpensive hardware with lots of potential. That was the base of the success of the C64. But today the people want useless FPGA-based stuff which will never spread widely because it's too expensive. Effectively it is the same mistake the creators of Flash8 and SuperCPU made. But this time with an FPGA instead of a CPLD.
So instead of really slow to slow? :) I'm pretty sure I said this before some place. When I saw the c128 could run cpm. I was like heck yea. Thinking of Kaypro. Then I found out how slow it was.
If you use this mod in combination with the optimized versions of CP/M that have been release over the years, the C128 should become a fine CP/M machine. At 2MHz the C128 was underpowered, but at 4MHz, it compute power it pretty competitive to other CP/M machines.
nice to see someone upgrading one of my fav Commodore machines
Love your channel. Not enough 128 content.
Thanks mate, couldn't agree more. The 128 needs more love!
The github repo has a branch with a cutout for MMU board, but even there I had to mill the last two pins and solder short wires directly to pin headers.
I should have put GAL on the opposite end of the MMU PCB. But back then I had no idea that one day there would be a Z80 daughterboard too :).
The tower of terror MMU stack fits fine in my 128D at least with the 1571 removed. I pulled the MMU out of the slim though, I think it's causing problems with the autoboot stuff. I'll have to look at your repo again, thanks for putting your hard work out there for us to use!
Due to timing requirements the standard z80 chip in the c128 is rated for 4MHz, and it gets clock pulses at that frequency but the clock will “sleep” from time to time to fit the bus structure of the 8502. Thus the effective clock is only 2 MHz normally, even if the chip is rated for 4 MHz.
Nice work.
Now lets KiCad up a union board for PCBWay so there isn't a tower of terror!
Fun video! I've been banging my head against the wall on my 128 not working. Going to add this to my list once I defeat it!
Keep on fighting! Feel free to hit me up for help, lots of other helpful people on discord too.
you could try modyfying the memory expansion board with 2 pieces of hdd cable and 2 rows of L headers and just move the board sideways
the headers would had to be fixed to the medule by hot glue or epoxy though so it wouldn't fly around
I wound up removing it for now, was causing some problems unrelated to the z80. Will revisit the MMU in the future.
Nice job. Great to see the mod working.
As an earlier RTI video suggests, the hit Z80 + CP/M take on switching I/O between Z80 and 8502 code might be more significant than any of the commonly-aired wisdom regarding the C128 Z80's disconnected-NMI or the clock/2 wait-state issue. I agree with this suspicion as there may not be any other CP/M port that relies so heavily on 6502-code.
CAVEAT: Though I don't recall how Z80 and 8502 switch under CP/M Plus, and don't have a good idea on how qtermsl internals work, I am going to assume that qtermsl was compiled with CP/M environment as the target. In other words, no direct IN/OUT Z80 instructions within qtermsl are banging the $dexx swiftlink page directly. If this is the case, qtermsl is held hostage to plenty of CPU switching courtesy of CP/M itself. A simple example of 8502 -> z80 -> 8502 .. follows further below: (Please note that even if Z80 were banging I/O directly, the IN/OUT z80 instructions wired to $dxxx I/O block are typiocally a step-slower than direct LOAD/STORE to memory mapped I/O addresses. That's right, there is no MM I/O on the C128 for Z80 - except for the MMU mirrors at $ffxx !)
Feel free to count the cycles wasted in the subsequent process.
(I hope I didn't mess anything up!)
MG
--
THE DANCE OF 8502 to Z80, and back to 8502 ...
... a rough, quick and simple example ... (code is untested)
; origin .. anywhere you please withion reason
; $ffee is default z80 re-start address where the C128 z80-boot-rom (?) lands the z80's program counter, after full control is passed to the 8502.
lda #$3e ; MMU guides explain this move
sta $ff00
ldx #$03 ; copy for z80 bytes
; pre-load z80 opcodes/data
LOOP:
lda $z80.preload,x
dex
; stash opcodes/bytes to default Z80 restart address
sta $ffee,x
bpl LOOP:
sei ; sei/cli may or may not be necesary, i don't recall.
lda #$b0 ; tri-state 8502, re-activate z80
sta $d505
nop
; 8502 Reactivation point (AFTER thje nop above)
cli
rts
; Z80 Recativation bytes, copied to $ffee, by 8502 code.
z80.preload
- bytes 21 (low-byte) (high-byte) e9
- these bytes correspond to:
ld hl, #$z80.code.start
ld pc,hl
z80.code.start
ld a, #$3e ; MMU guides explain this move
ld ($ff00),a
~place desired Z80 work-code here~
Next z80 segment: Z80 tri-states, 8502 re-activates
di ; di/ei may or may not be necesary, i don't recall.
ld bc,#$d505
ld a,#$b1
out bc,a
nop
; if you switch back to z80 later on,
; it reactivates here AFTER the nop.
; therefore, we immediately force it back to $ffee formal z80 restart point
ei
ld hl,#$ffee
ld pc, hl
I really gotta find myself a C128, just such a great machine and a looker too, in it's A500 profile case!
Yeah these things are fun to play around with. Just wish the VIC-IIe 40 column output was cleaner.
you need C128D case for that Mod
Yep I've got a D as well. Had to pull the 1571 out of it for the MMU tower to fit.
Pretty cool. I have to dig into what all the other mods you have are but getting the Z80 up to 4 MHz is definitely something I'd like to do with my C128. But it's also a wedge so we'll see if I can get it to fit.
I think it might fit in the wedge without the MMU mod. I've got some more 74ls74's on order so I can make up a few more and see.
@@retrotechinsanity Thanks. I appreciate that.
Where can i find the project on pcb Way site? Best Regards
In this video i noted that you have the logo and changed the color of basic in you c128 how you accomplished taht?
OMG this video was so exciting! 8 MHz Z80 on the C128?? AMAZING! Hey did you ever figure out what the Z80 you used in this video was rated for? Also: your virtual drive: Does it use the burst mode that the C1571 and C1581 uses?
I never pulled the heatsink off, but I do believe the z80 came from Ebay and was a more modern one. Unfortunately the only 2 80's vintage z80's I have are both directly soldered to boards so I can't easily pull and test. I bet they'd work though. The z80 in the c128 was severely underclocked compared to other systems of the era. And yeah, 8mhz sounds cool, but it still only runs about half the time so its effective speed is just under 4mhz.
@@retrotechinsanity Yeah they did that so that it could play nice with the system board. The first computer I used, actually, was a Toshiba T-250 with an intel 8085 running CP/M 2.2, dual 8" floppy disks (about 1 MB each!) and 64k RAM (58k TPA). It was definitely faster than the 128, but that was my dad's computer. I would love to upgrade my 128D with a higher speed Z80 chip, but I lack the skills needed with a soldering iron to do the mod you created (of course the Z80 is soldered to the 128D's mainboard). I'm very interested in seeing where you take this! Thanks for the great video.
What port expander is this? I also have a U1541 II+ and a Link232 cartridge I'd like to use together on my C128. Love the 128 videos!!
The brown one is ancient and I don't recommend. The new one is the X-Pander 3. TH-cam usually craps on links in comments, so give it a google and you'll find it easily.
Form the wiki sheet the C128 has an Z80A or Z80B are 4MHz CPUs but they run at only 2MHz on the C128. Will you get an 8MHz Z80? If it will work at 8MHz that will 4X faster than the 2MHz it runs at now.
8MHz operation should in theory be possible in the C128's 2MHz mode... The VIC-II doesn't double the clock speed of the Z80 like it doubles the clock speed of the 8502 in 2MHz mode, however, there is no reason why this is not possible. Therefore it should be possible to get 8MHz operation, but the challenge will be to replicate the cycle stretching that the VIC-II does during memory refresh and I/O access.
so in the end, at which frequency is c128 running now? thanks
@@lucahitman The z80 clock is running at 8mhz but due to the c128 architecture (sharing time with the 8502) it only runs about half the time. Overall just under 4mhz effective speed.
Those drives were so sloooow. I remember playing zork on a friend's c64 . He typed in a command, 5 minutes of drive whirring around to finally spit out "you have died"
Should have been a 1541 then, because a 1571 in 2MHz burst mode is quite fast.
I am so confused.
Me too! :D If you want me to take a deeper dive into a particular topic I'll do my best to help.
I'm surprised that no one has created a Pi Zero adapter board that fits in the Z80 or 6502 socket that runs VICE at light speed.
Use a faster c128 cpmbios (cpmfast) or use a u2+enhanced bios (boots from reu)
Yeah I'm looking into those now.
Can you design PCB's?
Not really, I've played around in KiCad a bit though. I think if I had a few days to really concentrate on it I could pull something off though.
I have a special project for the C128. It's not too difficult, all schematics are already existing.
I own the accelerators SuperCPU 128 and Flash 8. Both great cards, but too expensive and they never spread. The same is with all this modern FPGA-based stuff. So I didn't want to make the same mistakes. The board is designed for self-soldering, nearly all IC's are Through-Hole. So only the PCB has to be produced. The part costs are about 50-60 Euro. The compatibility is about 99%. It works best in C128 mode, but also in C64 mode. It also may improve using the VDC.
Unfortunately I found nobody who thinks like me. Creating inexpensive hardware with lots of potential. That was the base of the success of the C64. But today the people want useless FPGA-based stuff which will never spread widely because it's too expensive.
Effectively it is the same mistake the creators of Flash8 and SuperCPU made. But this time with an FPGA instead of a CPLD.
So instead of really slow to slow? :) I'm pretty sure I said this before some place. When I saw the c128 could run cpm. I was like heck yea. Thinking of Kaypro. Then I found out how slow it was.
If you use this mod in combination with the optimized versions of CP/M that have been release over the years, the C128 should become a fine CP/M machine. At 2MHz the C128 was underpowered, but at 4MHz, it compute power it pretty competitive to other CP/M machines.