Showing posts with label Terminal. Show all posts
Showing posts with label Terminal. Show all posts

Saturday, December 17, 2022

Z80-MBC2 Build Part 3 – Final Assembly


 
Author's Website (Just4Fun): https://j4f.info/z80-mbc2 <--- Check it out! 
 

 Now that the Z80-MBC2 and uTerm are both up and running, it’s time to give it all a nice home. I went through several different ideas on how I wanted the final computer to look, from doing a full custom 3D printed case, to a small “all-in-one” keyboard style case like the Commodore VIC 20/64 “bread bin”, to something “boxier” to better fit 70’s era machines like the Altair, IMSAI, and SWTPC. The custom 3D printed case idea died very early on, I quickly realized I simply don’t have the time or skills to design and print a custom case that size, at least not yet. Perhaps I will revisit this idea in the future once I’ve honed my 3D design and printing skills further. The VIC 20/C64 style bread bin sounded great until I realized I couldn’t realistically find a case to fit my needs, in the size I wanted, at a reasonable price, and I had no desire to incorporate the keyboard into the final build. In the end I settled on a much more realistic and era appropriate “boxy” case that better represented machines of that era and the vision I had in my head. Also, this style of enclosure is much more readily available, inexpensive, and easy to modify. 

 

Buy Case: https://amzn.to/3FD9XgF

I really wanted the final machine to look like a “next step” for these early CP/M machines, with proper front panel buttons and lights. As well the keyboard port on the front panel for ease of use. On the back panel I put the SD card, power, VGA output, and the transparent serial connection so you could still connect to the computer that way if necessary. The last thing I would like to do is extend the GPIO to the back so it could be easily accessed, but that’s something I will tackle later since I haven’t decided exactly how I want to accomplish that. I’ll likely use a simple pin header that can connect to an external break-out board via a ribbon cable.

Here are a few things to note that may influence your own design choices, as it did mine…

  1. Once you have the system setup how you like it, you’ll find yourself swapping the SD card out much less often, perhaps on the rare occasion you want to add something else you may have come across or if there’s an update released by the original Z80-MBC2 author. So having external front or back panel access to it isn’t necessarily a must, especially if your case is easy to open. I put mine on back for that reason, and because it’s a micro-SD and wasn’t sure if I could make the slot look nice enough to be front facing. Full size SD cards are easier to work with and I hate when I have to use my fingernail or a tool to insert and remove the micro cards.

  2. I put the keyboard port in the front instead of the back purely for convenience. My system won’t be setup in the same spot all the time, and will get moved around quite a bit, so it made more sense to put it on the front panel. Also, since that’s where the port is on the uTerm, it just made it easier for the internal layout. I also used a PS/2 to USB adapter for ease of use since a majority of USB keyboards will work fine with this computer.

  3. The transparent serial connection went on the back simply because it won’t get much use, but it’s still nice to have. I also went with USB type B because I prefer it over all the other port types. It’s more robust than its smaller counterparts and type B cables are still cheap and very abundant. I could have just used a pin header but incorporating the serial USB into the design just made things easier for later, especially since I have a few of these lying around and can spare one for this build.


Designing the layout and look of the front and back panels took quite a bit of time to get done and went through several different re-designs as the build progressed and I better realized how much space I actually had to work with. Getting it to look like it belonged in the late 70’s or early 80’s, with a bit of modern flare, wasn’t nearly as easy as I had thought. Once I was happy with the design however, it was just a matter of printing it onto sheets of adhesive vinyl to attach to the panels. The panels themselves had two options, drill and cut out the holes on the included panels or printing my own. In the end I decided to print my own to give me more 3D design practice, and it guaranteed a good fit. 

 



The inside layout was also a bit of a challenge, I wanted it as “clean” as possible, but I also had a very limited amount of space to work with. I had to extend everything to the front panel while trying to maintain the ability to easily disconnect everything if necessary. I thought about designing a custom front panel PCB, but I really didn’t want to wait for it to arrive and I wasn’t sure I could make it cleanly fit. So, I decided to just extend everything directly using pin headers. It makes it easy to replace anything that may go bad and it fits into the limited space. I also think it fits better with the overall aesthetic of the machine since many of these early home computers had a lot of DIY modifications.

Mounting the PCBs was accomplished using a custom 3D printed support structure that I designed to hold everything in place, but still allow for easy servicing should the need arise. The Z80-MBC2 and uTerm are both held in place using screws, and the SD card and RTC are held in place using 3M double sided mounting tape. The base of the support structure is screwed to the case, and the two upper sections are sitting on top of 6 removable 3D printed standoffs. It’s not perfect, but the overall design fits in the limited space, holds everything in place, is easy to disassemble, and it looks the part of a homebrew computer.

 



The final result pretty closely matches what I think a “next step” homebrew CP/M machine like this would look like. If nothing else it appeals to me, and that’s really all that matters. I love how it looks and it has given me the opportunity to explore an era of computing that I missed, even if only a little. The question now becomes, what to do with it? Will I actually use it? The short answer is yes, I’ll definitely use it. 


More photos coming soon!

One of the reasons I wanted the Z80-MBC2 was to learn more on how these old machines worked, and since their so simple, they’re easy to learn on. I enjoy messing around with the old software and games, and it can actually still be useful, but that’s not the real point. Sometimes the best part of a trip is the journey, not the destination. Most people will look at old retro machines like this and think “what’s the point?”, and if you have to ask that question, then I’m not going to be able to explain it to you. That simply means this isn’t your thing, and that’s fine, we’re all different, but if you’ve made it this far through all 3 long winded articles, then you probably already understand.

I had a great deal of fun building this machine, I learned a lot along the way, and ended up with a neat little retro computer that will provide me with countless hours of entertainment. From here I will be doing a follow-up article to cover more of software side of things, changes that may have been made, and share why I think an old-style homebrew computer like this can actually still be fun and useful. For now though, I’m just going to enjoy the fruits of my labor and say thank you for taking the time to read through all of this. I hope you found something helpful here, or if nothing else, it was entertaining. 

Read The Build Follow-Up - What Can It Do?: https://theclassicgeek.blogspot.com/2022/12/z80-mbc2-build-follow-up-what-can-it-do.html

Monday, October 10, 2022

Z80-MBC2 Build Part 2 – The uTerm VT100 Style Terminal



 
Author's Website (Just4Fun): https://j4f.info/z80-mbc2 <--- Check it out!



The next step in building my idea of a “modern retro CP/M & BASIC computer” is building the uTerm. A VT100 style terminal for the Z80-MBC2 that gives it the ability to act more like a stand-alone computer. The uTerm would be the modern equivalent of a classic terminal you would have used back in the 70’s and 80’s to connect to a machine like this, allowing you to hook up a keyboard, monitor, and 9V power supply instead of having to use a serial connection to an existing computer, though that feature is still maintained via a transparent USB serial connection on the board.

The uTerm uses a standard old-school PS/2 style keyboard port, but most standard keyboards should still work with a simple USB to PS/2 adapter.

NOTE: 60% keyboards may not work, I have 2 of them I use for other tasks and neither worked on the uTerm. However, every other “standard” keyboard I have, including 10-keyless, worked fine.

It also uses a D'SUB VGA connector for the video, but here again adapters can be used to connect to displays that may not have that connection available. The best part about the uTerm is the fact you no longer have to use a terminal emulator, like Putty, to use the Z80-MBC2. It outputs a 30x80 column display and even has the ability to set the text color to either white, green, amber, or cyan to complete the retro feel of this machine.



Just like the Z80-MBC2, the build is pretty straight forward, there is bill of materials and schematics included that spell out all the components you need and where they go. All you have to do is track down the components and solder them into place according to those documents. Just like all builds, it’s good practice to test the components you can before using them in your build.

To make things even easier, you can buy the PCB on eBay for around $15 that already has the surface mounted STM32 chip pre-programmed, saving you one extra step if you don’t already have the necessary tools to flash the chip or ae not comfortable with SMD soldering. All the other components are relatively inexpensive and easy to find on Amazon, eBay, and other sites. Just like the Z80-MBC2, I already had most of the parts on hand, making the build even cheaper.

If you can't find the specific heatsink used in the authors build, that's not a problem. Any standard heatsink that fits the LM7805 and covers the entire regulator back, as seen on mine, will work just fine. It does get warm, but dropping 9V to 5V on such a low drain device doesn't produce enough heat to cause any problems using a smaller heatsink. If you have thermal pads or paste you can use, that helps as well.

 

The same advice for building the Z80-MBC2 also applies here, and I have compiled a list of links to all the parts you need on Amazon and eBay to help you along, and most of them are the ones I actually used. 

 

 

eBay Search for 74HCT00 NAND Gate - Note that it must be a 74HCT00N NAND Gate IC, any brand will work. Buy from sellers in the USA (or your local area) when possible to increase your chances of getting "good" parts. It  also makes it a lot quicker and easier to not only get your parts, but do returns if necessary.

eBay Search for uTerm PCB - If the PCB with the pre-programmed STM32 chip is still available, I suggest getting that one. If not, it simply means you have to buy the STM32F030F4P6 surface-mount chip yourself and program it. However, as of writing this article (October 2022), the STM32 chip is nearly impossible to find, so you may have to really look to find one.

Here is a socket kit I have not used, but contains all the necessary sizes: https://amzn.to/3E5tuaz 

I did not include individual links to all the resistors because these are really easy to find and have a pretty wide tolerance, and it’s somewhat difficult to get resistors so far out of spec you can’t use them when a project like this gives you a 5% tolerance variance. Many "cheap" resistors that claim they are within 1%, are actually 2-3%. Either way, for this project and many others, as long as you buy ones that say 1%, you’re generally safe.

Amazon Search 1/4 Watt Resistors: https://amzn.to/3SCccGt

Also, there are a lot of good resistor assortment kits sold on Amazon, and many contain almost all the ones you need for the Z80-MBC2 and uTerm, so you will only need to buy a couple values separately. Just remember 5% (shoot for 1%) and ¼ watt and you’re good.

In the bill of materials, they list 4k7 and 2k2 resistor values, this is just another way of writing 4.7K  ohms and 2.2K ohms.

For the LEDs, be sure to use the colors indicated, or other colors with the same forward voltage value. This is talked about on the project page as well.



If you bought the PCB with the pre-programmed STM32 chip already installed, then there really isn’t much more required once you have it all assembled, other than using the jumpers to select your color choice.

If you bought a bare board and the STM32 separately, then you’re going to have to solder the chip to the board, fully assemble the uTerm, and then flash the chip before you can use it. A programmer is needed to do this, but thankfully they’re cheap and easy to find on Amazon. The full instructions on how to do it are covered on the project’s homepage, linked above and below.

Programmer: https://amzn.to/3SOjk2o

How to Program the STM32: https://hackaday.io/project/165325-uterm/details 

(Scroll down to "HOW TO FLASH THE STM32 WITH THE ST-LINK V2" at the link above.)

 


Using the uTerm is easy. To power both the Z80-MBC2 and uTerm, all you need is a 9V power supply, a PS/2 keyboard or USB to PS/2 adapter and just about any USB keyboard, and a standard D'SUB VGA cable (and an adapter if you don’t have a monitor that accepts the VGA input). If you’re connecting the uTerm to the Z80-MBC2 directly, you don’t need the supplemental power cord running between the uTerm and Z80-MBC2, but if you’re going to run it detached the supplemental power connection is highly recommended. Mine has been slightly altered to better fit into my final case design. If you're using the supplemental power between the uTerm and Z80-MBC2, ensure you have the polarity correct before powering it up! Also, the 9V power supply must be center pin positive!

You don't need a beefy power supply, in fact, it will even run off a 9V battery for a while if necessary. As you can see from the photos, I'm powering mine using a simple DIY power supply I put together to test small 12V or less projects, that also allows me to measure usage information.

Here are some power and temp numbers running under load. Using ASCIART.BAS and LOG10K.BAS as benchmarks. Readings taken from my PSU and IR thermometer. Temps taken after 30 minutes of operation at idle and then under load at around 70F (21C) ambient.

Standard Keyboard (No Backlight): 0.090 to 0.100A / 0.81 to 0.105W max draw - Around 100F (38C) on the LM7805, hovering around 98F.

Standard LED Backlit Keyboard: 0.255 to 0.265A / 2.25 to 2.40W max draw - Around 110 to 115F on the LM7805, hovering around 111F (44C).

Note that the power draw and temps are affected by your choice of keyboard, however the numbers are so small it really doesn't matter much as long as your 9V source can provide the power needed. The temps using the smaller heatsink are also well within the safe operational range of the LM7805 voltage regulator. Remember, these voltage regulators work by dissipating the excess voltage as heat, and you generally don't want to operate electronics anywhere near their max operational temperature. The LM7805 can handle a lot of heat, but the max temp often used for safety is about 110C (230F), and we never go over 46C (115F). So this system stays nice and "cool" by LM7805 standards.

Once you have it all hooked up, just power it up and enjoy! I'm not going to cover troubleshooting in any detail for the same reason as on the Z80-MBC2, not enough time. However, if it's not working, make sure all the connections are hooked up correctly and securely, check to ensure you have the correct input selected on your monitor, and press the “Reset” button on the uTerm to see if that helps. You can also check the jumper settings for the color selector. If all else fails, hook the Z80-MBC2 back up to your PC using the USB serial adapter to ensure it's working. Note that there are test points on the uTerm PCB if you know how and need to use them, labeled as TP1, TP2 etc.

There's also a modified firmware version available that adds a few more options you can try if nothing else is working, or you can re-flash the original firmware if you have the programming tool to do so. 

Modified Firmware: https://gitlab.com/luckynate4/nuterm

My uTerm fired right up and has been working just fine. Since building the Z80-MBC2, I has since settled in on using CP/M 3 and have grown quite attached to the classic green text. The Asus monitors I use have legacy VGA inputs and have the ability to run that input at 4:3, so it's about as “authentic” as you can get using modern hardware.





Now that I have the uTerm all setup and running, the final step is to cram it all into a case that does the build justice, completing the “modern-retro” look I want for this cool little Z80 computer.

I did print the brackets the author included, the flat (horizontal) mount version, just to see how they worked, and they print just fine on my Ender 3, as you can see. The print time is about 5 1/2 minutes per bracket.

 

I will be using a pre-existing enclosure and modifying it to fit my needs for the final build. I had considered 3D printing a full custom case, but to be blunt, that’s a little outside my 3D design capability at the moment considering the overall size, however I have found a couple cases I can easily modify and 3D print only the parts I need to complete the build.

Thanks for reading and I’ll see you in the 3rd and final part, where it all comes together!

Read Part 3 - The Final Assembly: https://theclassicgeek.blogspot.com/2022/12/z80-mbc2-build-part-3-final-assembly.html