Z80-MBC2

Feel free to talk about any other retro stuff here including Commodore, Sinclair, Atari, Amstrad, Apple... the list goes on!
User avatar
Strider
Posts: 522
Joined: Thu Sep 03, 2020 4:34 pm
Location: In my time machine, Circa 1985.
Contact:

Z80-MBC2

Post by Strider »


Well, the mainboard arrived, so I know what I'm doing today! ?

Guess it's time to start populating it with the common components, sockets, etc., after I test them of course. I don't have the ICs yet, but no reason I can't get a head start.

z80-mbc2-start.thumb.jpg.e4568ba7e15583ba363e0fe95ef9d9ed.jpg

Image
A classic geek & family man who enjoys all things retro! Computers, hardware, games, electronics, etc. Expert at nothing, professional hobbyist, and old-school blogger!
User avatar
Strider
Posts: 522
Joined: Thu Sep 03, 2020 4:34 pm
Location: In my time machine, Circa 1985.
Contact:

Z80-MBC2

Post by Strider »


Well, I'm as far along as I can get with what I have on hand, everything else has been, or needs to be, found or ordered.

It's a good thing I test everything before using it, my wife got me an assortment box of ceramic capacitors from one of the many re-sellers on Amazon, and I think just about every capacitor in it is faulty. So now I need to order some of those since I don't have the 2 values I need on hand, they were in that kit. I also haven't decided if I want to mount the VGA Terminal Board vertical or horizontal yet, so I held off adding that header until I have the board in hand. 

Overall, a few hours well spent in my opinion. Can't wait to get it completed!

z80-mbc2-started.thumb.jpg.dd3e3467fe0886292f9c63edaac5d0cd.jpg

Image
A classic geek & family man who enjoys all things retro! Computers, hardware, games, electronics, etc. Expert at nothing, professional hobbyist, and old-school blogger!
User avatar
Strider
Posts: 522
Joined: Thu Sep 03, 2020 4:34 pm
Location: In my time machine, Circa 1985.
Contact:

Z80-MBC2

Post by Strider »


eBay, the only current way I can get all the chips needed. It's a real love/hate relationship, love that all the chips I need are available for sale by US sellers, hate the inflated prices and shipping on such tiny items.

Oh well, $55 and some change after taxes, at least I got them. The crazy shipping kills, considering you fit all these chips safely in a First-Class package. $35 for the chips, $20 total or the shipping. ?

Image
A classic geek & family man who enjoys all things retro! Computers, hardware, games, electronics, etc. Expert at nothing, professional hobbyist, and old-school blogger!
User avatar
Strider
Posts: 522
Joined: Thu Sep 03, 2020 4:34 pm
Location: In my time machine, Circa 1985.
Contact:

Z80-MBC2

Post by Strider »


Finally, the last parts arrived this weekend, then I get violently ill thanks to Norovirus (Stomach Flu), feel better today so I put it all together...and...

It completely slipped my mind that I have no way to burn the bootloader on the AtMega32A... ?

So now I have to wait even longer for the USBASP to arrive... It was a very crappy weekend. lol

z80-mbc2-almost.thumb.jpg.db6bff1baa1609c6af79901b8ddd05c5.jpg

Image
A classic geek & family man who enjoys all things retro! Computers, hardware, games, electronics, etc. Expert at nothing, professional hobbyist, and old-school blogger!
BruceMcF
Posts: 1336
Joined: Fri Jul 03, 2020 4:27 am

Z80-MBC2

Post by BruceMcF »


I've been watching retro SBC Z80 computer videos on Youtube, and it occurs to me that what I want is a bit of a mix and match of the Z80-MBC2, the Z80 Playground, and John's Basement's Z80 Retro and Dr. Volt's DIY Home Computer: https://www.youtube.com/watch?v=tocXaInkarE

One idea I had that I'm taken with at the moment is rather than running CP/M in a part of a larger than 64K doing banking to get to the rest you can use a 64K SRAM and a 512K coin-battery-backed SRAM, with the larger SRAM used as a RAM-disk, by accessing the big RAM with I/O reads/writes in one half of the 256 byte I/O address space. Larger SRAMs have two chip selects, one low and one high, so you can tie the /IOREQ line to the pull low /HighRAM_CS1 and A7 to the pull high HighRAM_CS2, and there is no glue logic required for that part.

Even better, there is a Z80 indexed I/O address mode which puts the contents of register C on A0-A7 and the contents of D on A8-A15, giving another 8 bits of a HighRAM address basically "for free", so only four bits in a latch somewhere would support a 512KB SRAM as a RAMdisk.

Then looking at what else I would want:


  • A UART


  • A real time clock


  • A serial flash ROM as a "pseudo-hard-drive"


  • A gamepad port


... and I figured I could get SPI or SSR versions of all of that (the SNES controller is the "or SSR" part, since with it's "pull down /SELECT to latch the button state, then release" system, it doesn't bus neatly with other SPI devices) ... most in Sparkfun breakout boards, though the UART is on backorder.

And now it's coming together. The Z80 bus PIO doesn't attach the /Write line, but infers /Write from the state of /M=0, /IOREQ=0 and /Read=1, so if the /Read line on the PIO is tied high through a pull up resister, it turns into a blind Write port. One PIO port to hold six SPI selects, MOSI and the serial clock. The other port holds the high four bits of the HighRAM address, with four bits free for future expansion (but only as outputs, not as GPIO).

If its running slow enough for wired/or to work, then an octal driver can be used to generate two distinct I/O selects, /IO1 and /IO2, and /IO2 can be put onto a block pin header with D0-D7, A0-A4 and the Z80 control lines, while /IO1 selects the PIO for writes and the SPI serial shift register for reads


  • IN.0 := /IOREQ


  • IN.1 := A7


  • IN.2 := A5


  • /IO2 := OUT.0 + OUT.1 + OUT.2


  • IN.3 := /IOREQ


  • IN.4 := A7


  • IN.5 := A6


  • /IO1 := OUT.3 + OUT.4 + OUT.5


That allows reading $20 to be thought of a reading the SSR, writing $20 through $23 to be writing the PIO data or control registers, while $40-$5F is available for whatever may be on an extension board.

And the problem with the SNES gamepad interfering with the SPI bus can be fixed by dedicating to SPI select lines to the gamepad, one connected to the SNES port as an SNES pull-down or "pulse" select, /SNES_SEL, the other as a normal SPI hold down select, /SNES_MASK:


  • IN.6 := /SNES_MASK


  • IN.7 := SPI_SCLK


  • SNES_CLK := OUT.6 + OUT.7


However, I don't want to monkey around with FlashROM and swapping it in and out. So I was thinking, a DIP 5v, 12 GPIO ATTiny could "inject" a boot up routine into the 64K SRAM. Even the 2KB Flash versions would have plenty of space to store the BIOS internally. Add another tri-state Serial-In, Parallel Out SSR, tie it to A0-A7, make sure A8-A15 has weak pull-down resisters (which feels upside down from back in the day, but unlike TTL, CMOS pulls up just about as hard as it pulls down), connect the Z80 /Reset and /Halt lines and some other lines to the ATTiny, connect the ATTiny serial shift out line to the Serial input of the SSR set up for SPI, pull down /RESET, load the address within the zero page into the address SSR, load the desired byte into the data SSR, output enable the SSR's, pull down the 64KB RAM /CS and /WRITE, release them, release the SSR output enables, rinse and repeat until you have loaded the copy routine starting at $0000 and ending with a HALT opcode, and the chunk of the BIOS into $80-$FF, release the /RESET, wait until /HALT, load the next chunk of the BIOS, release the /RESET, wait until /HALT, repeat until the copy routine sees it has stored stuff up through $FFFF and it's done, so instead of halting it jumps to the cold boot routine in the BIOS and away you go.

The ATTiny just sits there until the reset button is pushed again, then it loads the BIOS again.

Sketching it out, I think it uses about 9 of the 12 available GPIO, so you could also have a "warm boot" button, which simply pulls /RESET down and releases without any first stage bootloading, to execute the jump to the BIOS warm boot that sits at $0000 under CP/M.

EMwhite
Posts: 220
Joined: Mon Sep 07, 2020 1:02 pm

Z80-MBC2

Post by EMwhite »


On the edge of this topic, what software is the 'killer app' for CP/M?  I am fully aware of the history and legacy platforms that ran it and in fact, bought the CP/M card for my Apple II but never bothered to procure software after getting it to boot successfully.  

Is the thrill to just build the board, get it working and get a command prompt and some light development or are there classic titles (even if classic title = a particular word processor or text based Infocom game or terminal?).  Thank you!

kelli217
Posts: 522
Joined: Sun Jul 05, 2020 11:27 pm

Z80-MBC2

Post by kelli217 »



On 9/15/2022 at 8:50 AM, EMwhite said:




On the edge of this topic, what software is the 'killer app' for CP/M?  I am fully aware of the history and legacy platforms that ran it and in fact, bought the CP/M card for my Apple II but never bothered to procure software after getting it to boot successfully.  



Is the thrill to just build the board, get it working and get a command prompt and some light development or are there classic titles (even if classic title = a particular word processor or text based Infocom game or terminal?).  Thank you!



Well, most of the Infocom games were released for CP/M, until they started including graphics, so take your pick. But the killer business apps were probably WordStar, Multiplan, and dBase II.

There's also Turbo Pascal, several versions of BASIC, and a couple of C compilers.

BruceMcF
Posts: 1336
Joined: Fri Jul 03, 2020 4:27 am

Z80-MBC2

Post by BruceMcF »



On 9/15/2022 at 9:50 AM, EMwhite said:




On the edge of this topic, what software is the 'killer app' for CP/M?  I am fully aware of the history and legacy platforms that ran it and in fact, bought the CP/M card for my Apple II but never bothered to procure software after getting it to boot successfully.  



Is the thrill to just build the board, get it working and get a command prompt and some light development or are there classic titles (even if classic title = a particular word processor or text based Infocom game or terminal?).  Thank you!



For tinkering and dabbling with languages hosted on an 8bit system, CP/M is great.

Look at the programming languages page at Retro Archive ... skipping assemblers and linkers:


  • Turbo Modula 2


  • Microsoft Fortrain


  • Microsoft Cobol


  • BDS C


  • BASCOM


  • Microsoft Basic


  • Turbo Pascal


  • APL/Z


  • Software Toolworks C80


  • "MI C" C compiler


  • Nevada Fortran


  • Software Warehouse Lisp/80


  • Mix C


  • Turbo Database Toolbox for Turbo Pascal


  • Aztec C


  • Algol compiler


  • DRI CBASIC80 Basic Compiler


  • Microsoft "OBasic"


  • Nevada Cobol


  • Nevada Fortran


  • Tiny C


  • JRT Pascal


  • Nevada Basic


  • Pascal/Z


  • Janus ADA


  • Z-80 MUMPS


And of course CamelForth has a CP/M implementation.

 

kelli217
Posts: 522
Joined: Sun Jul 05, 2020 11:27 pm

Z80-MBC2

Post by kelli217 »


There's QBasic for CP/M?!?

BruceMcF
Posts: 1336
Joined: Fri Jul 03, 2020 4:27 am

Z80-MBC2

Post by BruceMcF »



On 9/16/2022 at 12:23 PM, kelli217 said:




There's QBasic for CP/M?!?



Oh no, when I look using my desktop monitor in the office, I misread the file name OBASIC.COM as QBASIC.COM. Oops. I am going to blame my cataracts, because I don't want to say anything bad about my loyal and trusty laptop.

The legend says that that is MBasic v4.51.

Post Reply