Showing posts with label MiniPET. Show all posts
Showing posts with label MiniPET. Show all posts

Sunday, 8 March 2026

PET Serial Interfacing

It turns out it is actually quite easy to interface a Commodore PET or Mini PET to serial, as long as you don't want to go too fast.

There are various ways to do this, and this post by Paul Rickards describes several of them.

Those were all using vintage software, which has a couple of disadvantages, firstly it is difficult to change, but mainly it was designed to interface using crude RS232 level shifters.

The RS232 serial communication protocol was designed in 1960, and as such, was designed to be robust. Communicating over large distances in electrically noisy environments.

The RS232 standard* varies by revision and applications, but by the 1980s was mainly working with signals at +/- 12V. With +12V representing a binary 0 and -12V representing a binary 1. In practice you might find +12V down to +5V representing the zeroes, and anything from 0V down to -12V for the ones.

* it is with pure optimism that I use the words "standard" and "RS232"in the same sentence

This shows the "real" serial port on my PC which is giving 5V and -7V. This is the byte $42, a capital B. It is sent big-endian, with one stop bit (a 0 on the end). You can read that from right to left in the order it was sent as 0100 0010 (42) and then 0 the stop bit. (I realise now that 42 is a binary palindrome, so it not a particularly good example here)

Inside the communications equipment, there will be drivers to convert these RS232 levels to TTL levels. In the 1980s, these were 1488 and 1499 drivers, which required +/- 12V supplies. But the 1990s (when I started fiddling with serial comms) there was a family of chips starting with the MAX232 which did the level conversion and inversion and also generated it's own supplies from a single 5V rail.

In TTL land, the 0s are 0V (or there abouts) and the 1s are 5V (or somewhere over 2V at least).

Here is the same B, and it is now the more logical way around to show 0 0100 0010.

And $40, an @ sign to show the highest bits are indeed at the right of the picture. The transmitter sent 0100 0000 and the final 0. 0100 0000 = $40 = @.

When people were trying to interface to the PET in the 1980s, they went for the simplest solution, and used diode / resistor type level shifters to drop the RS232 input voltages down to safe* levels for the PET userport. The PETs output of 0V and 5V is just about enough for RS232.

A typical interface of the day would be something like this.

The diode protects against the negative side of the incoming signal, and two resistors form a potential divider to drop the signal level. The other resistor protects the output of the PET against the 50:50 chance you have wired up pins 2 and 3 backwards. (It is like inserting USB plugs, you get it the right way around third time)

* This seems to be expecting a maximum of about 9V as anything more than that would give over 5V at the out. I think I would have preferred if the 620Ω was more like 1KΩ to be safe

You will notice there is no inversion going on here, so the software of the day was expecting the input signals to be the RS232 way around, and carried out the inversion in software.

Roll on modern days, and "real" RS232 is rarely used. But it is common to use USB to serial converters, often called FTDI cables (since they made the driver chips). These operate at 5V (or sometimes 3.3V), and work with non-inverted signals.

That means you can connect up one of these FTDI cables to a PET without having to do any inversion in hardware or software. But that does mean the old software cannot be used.

There is however modern software which expects the non-inverted direct connect signals and so it all works together quite nicely.

The adapter I built here is the simple non-inverting, non-level shifting variety, with two resistors for a bit of extra protection.

This pin arrangement is slightly different, but is the same as that commonly used on the VIC20 and Commodore 64. (as it common with many of these things, CA1 is used to generate an interrupt, but it's value cannot be read directly, so the same receive data signal is connected to a pin that can be read. CB2 is the output of the shift register, although this may not be being used as such due to a bug in early revisions of the 6522 VIA it is connected to.

Although you can potentially use adapters designed for the VIC20 and the C64, it is important to remember that no matter what people on the internet tell you, this person on the internet is telling you there is no power on the PET userport connector.

I used the prototyping board in case I needed to add an inverter, something like this, but it wasn't required in the end.

That plugs into the userport and the FTDI cable connects, with ground (usually the black wire) to the left. RTS and CTS are not connected, there is no hardware handshaking.

The software I used was PETTERM, available here:

There are lots of versions. The release includes four, but if you build from source, there are thirteen more.

The main ones have 40 or 80 depending on how many columns your PET screen has, and G for normal/graphics keyboards (i.e. the Mini PET), and B for business keyboards.

I will come to the versions with a memory size later.

For the moment, I am just using petterm40G.prg which suits the MiniPET.

When it starts up, it defaults to 1200 baud, which is fine. 2400 is available, and seemed stable in this release build, but was a bit flaky in the later version built from source.

On the PC end, I setup Tera Term to match. The only setting I had to change was the end of line character. Carriage return just sent the cursor on the PET to the left, CR+LF was required to move it down a line as well.

It was time to try typing stuff.

Success!

Both ways!

I tried various things and it seemed to be working quite well, converting ASCII to PETSCII and handling various control codes for arrow keys, backspace etc.

Even big chunks of text.

It also supports 80 column mode on the Mini PET 40/80, so you can read even more.

This is working fine as a terminal, but is it possible to transfer files?

Yes, that's what the other versions were. Select the memory size of your machine, and load the appropriate version.

You will see it loads but does nothing. You need to type SYS 20480 to enable it. (there are different SYS commands for the different versions).

This brings up a slightly different menu, with two new options. These allow you to load a program into memory over serial. You can also send a file to the PC end. You would load it before you type the SYS command.

These transfers use the XMODEM protocol, so you need a suitable client at the PC end.

This gets the PET ready to receive, you then start up the PC end.

And away it goes.

The transmit pins using CB2 on the PET, which is the same used to drive the speaker, so you get a click when you press a key, or when each block is acknowledged, which is a handy indication things are progressing if you don't have a scope wired up.

Hey this is a posh modern scope, let's decode that serial and see what it says.

Ah no. The hardware and firmware on the scope are perfectly cable of doing it, and probably of higher bandwidth and greater sample depth, but it's all knobbled by licenses. Must remember to google how to hack it one day....

It's not immediately obvious what happens next. The program has been loaded into RAM, but the terminal is still running. You need to press CLR/HOME to go back to the menu, then X to exit. Then enter to get a READY prompt. And then your loaded program is ready for you to type RUN (or save to disk, or whatever you want to do).

And that all seemed to work nicely.

I had planned at one point to add an FTDI connector to the Mini PET, and to add "load over XMODEM" to the file browser, in the same way as on the Minstrel 4D.

Maybe one day I will revisit that.

I did make a PCB version of that.

Which makes things a bit neater.

If anyone is interested in one of those, let me know. Things seem to be running a bit slow on Tindie for some reason. The last few things I added, I had the PCBs made by JLCPCB, shipped here, built and tested, all before the listing was approved.


Adverts

My Tindie store contains all sort of kits, test gear and upgrades for the ZX80, ZX81, Jupiter ACE, and Commodore PET.


Patreon

You can support me via Patreon, and get access to advance previews of blog posts, and progress updates on new projects like the big news on the Mini PET that was announced this week, along with the and Mini VIC and other behind the scenes updates. This also includes access to my Patreon only Discord server for even more regular updates.

Sunday, 1 June 2025

Mini PET 40/80 Internal on Tindie

Last year, I uncovered a forgotten set of prototype Mini PET 40/80 PCBs and built one up. I posted about that at the time and a few months later, someone contacted me about buying a Mini PET, so I sold that.

A few months after that, someone else asked for one, so I built another.

Recently I had another couple of requests, so I thought I should list those on Tindie.

These were the prototype of the 40/80 design (well, actually the second prototype), that went on to be developed into the 40/80D and the Mini PET kits that were sold via TFW8b.

This board has an error on it, two of the pins on the DIP switch were transposed.

Now that I have built a few of these, I have got better at fixing that. I now drill out both of the pads and wire them in, so the full range of options are available.

Due to the timing of the other versions, I never ordered fixed boards, or sold these as a kit. I can't really expect kit builders to do the mod, so I will have this only available as assembled for now.

I did not have a manual written either, but as I have been selling the assembled versions, I have been putting together the missing manual, so now I can properly list it, with all the DIP switches working as intended.

I will see how things go. I only have 4 PCBs left, if there is still interest in those I might order a new set of boards with the error fixed (and I am sure I will also fiddle with some other things, I can't help myself)

This is the version intended for installation in a PET case (although the picture shows an older version)

The white version with the keyboard was intended for standalone use.

I did design a 40/80 version of that (which was the first 40/80 prototype), note there are 5 logic chips on the right hand side, I managed to get that down to 4 on the next version (as seen in the green V1.82 boards I am selling), and the power switch didn't stick (does anyone like that?)

I would need to respin that with the 4 logic chip version and probably no power switch (and again I am sure more changes) - if anyone is interested, let me know.

Since one of the requests was for a replacement board for a PET 2001 case, I have listed the option for the datasette interface board to allow the connection of the internal datasette drive in those cases.

That will be datasette #1, normally the port on the rear, with datasette #2 on the side.

The port is still available, although should not be used for a datasette. It is ideal for providing power to an SD2PET or similar.

You also have the option of mounting the whole board further inside the case, including an SD2PET, so it does not stick out that back of the case.

Ready to restore almost every type of PET from a 2001 to an 8032.

40 and 80 column is supported, as well as normal or business keyboards. (no VIC20/C64 keyboards, no 8xxx-SK, no 64K RAM boards, no SuperPET, no CBM-II, but I think everything else should be OK)

32K of RAM is present, along with a selection of ROMs, BASIC 1, 2, 4 and Mini PET BASIC 4.1 which includes a DOS wedge, improved machine code monitor, self-test and file browser.

This is using all modern chips, other than the last of my stocks of dual port RAM chips, and I have found an alternate microcontroller than can be used without modifying the PCB.

Whilst putting together the listing, I remembered this great video from Sam at Look Mum, No Computer. I had forgotten how good the video was.

The section with Sam installing a Mini PET into a PET case starts just before 3 minutes, but it is definitely worth watching the whole thing:

As Sam says in the captions, you do not need to replace the capacitor in the PET case. I don't think I have found a bad one in a PET case yet. The current consumption of the Mini PET is only around 100mA, compared to the 3A the capacitors were rated for. There is also an extra 100µF capacitor on the Mini PET board.

I did actually order some really nice Nichicon replacements many years ago, so I was ready if I ever need one.

I wonder where they are now....


Adverts

The assembled versions are available from Tindie now:

I am sorry that is a bit pricey, but I have to do each of these as a one off and it's the last of the boards and the RAM chips.

Also available is the recently revived Minstrel 4th (with the updated ROM including Jupiter Ace Forth and ZX81 BASIC), available as a kit or built and tested, from my Tindie store or Z80kits.com


Patreon

You can support me via Patreon, and get access to advance previews of development logs on new projects and behind the scenes updates. New releases like this will be notified to Patreon first, if you want to be sure to get the latest things. This also includes access to my Patreon only Discord server for even more regular updates.

Sunday, 29 December 2024

Coming up in 2025

Just a quick post to let you know about some of the things coming up in 2025.

Mini VIC

The first project likely to be finished is the Mini VIC.

I am currently tweaking the design to improve the video output (you might have noticed the recent deep dive into VIC20 video output circuitry)

The video output is looking better now, with a nice straight edge to the border (it is often very wibbly on a VIC20). There is still an issue with the colour RAM corruption (as demonstrated by the David Bowie tribute Black Star.).

Just needs a few mods.....

The plan is to complete that as a "needs a VIC chip" version in the new year. There are a few VIC chip replacements, which could either end up as a "you need to buy one of those" or be bundled in. Or potentially I might still get one of my own attempts at a VIC replacement working well enough. Either way, this is a solid test bed, as it has been already for the Penultimate +3.

Speaking of which..

Penultimate +3

The Penultimate +3 is available now.

I am currently working with a game developer on a new game that will make full use of the new features.

There will be a proper blog post to follow on that very soon, just waiting for things to settle down in the new year.

Speaking of which....

EU Shipping

Slight problem at the moment due to new GPSR rules that came into place on the 13th December. There seems to be a lot of confusion and conflicting information. It appears I can no longer ship things to the EU as I cannot afford to put in place all the documentation and representation required to be able to sell into the EU marketplace. I am hoping that will get sorted out in the new year.

My Tindie store remains open for shipping to the UK, US and the rest of the world, just not the EU at the moment (sorry, I didn't vote to cut us off from our friends over the channel).

Speaking of cutting yourself off from the rest of the world, we will see how changes in the US play out. It seems likely it is going to get more difficult, certainly more expensive, to get things into the US under the new administration.

What else?

Well, following hot on the heels of the Mini VIC will be the Mini PET II. This is a redesign of the Mini PET to get around two main parts that are now out of production.

But it got a bit more complicated than that.

Just a test bed for the moment. I have a proper PCB made up, but I am trying not to work on too many things at once, and concentrating on the Mini VIC for the moment.

You might notice one of the boards I "borrowed" for the development process was a "Project ORAC" board.

ORAC

This was the beginning of an Oric 1 / Oric Atmos clone. I also have a new board for that with a few tweaks. That will follow after the Mini PET II.

Z80 Projects

After somewhat optimistically buying a lifetime supply of Z80s I have been a little disappointed to have only sold a few of them as part of the Minstrel 2 and 3 kits. I guess everyone who wanted one of them either cannot afford one or already had one.

So onto new Z80 based projects. Several are in the works. Not sure it is a good idea to continue with the ZX Spectrum compatible machine just now, but there are lots of other things that are now back on the table now I have lots of Z80s to use.

There are lots of development log posts on the upcoming Mini VIC and Mini PET II on my Patreon, I will start to post these on here once they are finished, until then, check out my Patreon if you want to know more.

2024 didn't quite go to plan, let's hope 2025 is full of 8-bit goodness.


Advertisements

Minstrel 2 and 3 kits are available from my Tindie store.

Versions are available for ZX81 case:

Or standalone with keyboard:

And also Minstrel 3 with ZXpand microSD card interface:

I have listed the Minstrel 2 and Minstrel 3 PCBs with and without keyboards or overlays on Tindie. Just in case you want to source your own parts and don't like the ease and simplicity of having them all supplied in neat little bags and a foam pad with all the ICs in order.

I am in the process of moving things over there from my SellMyRetro store, so if there is anything that you want, let me know and I'll add it.

I have recently added lots of PET repair and upgrade parts, more to follow.

Bluesky

For those interested in such things, I can now be found on Bluesky.

I am almost at 500 followers, a fraction of what I had on Twitter, but a whole load more interaction and a nicer environment.

Patreon

You can support me via Patreon, and get access to advance previews of development logs on new projects and behind the scenes updates. These are often in more detail than I can fit in here, and some of these posts contain bits from several Patreon posts. This also includes access to my Patreon only Discord server for even more regular updates.