Sunday, 7 July 2024

Using the ZX-IO with the Minstrel Expansion Bus

This is a ZX-IO module from David Stephenson (www.zx81keyboardadventure.com), a 24 bit input / output device for a ZX81 or Minstrel 3. 

Thank you to David for sending the PCBs and 8255 chip so I could try it out.

This uses the same ZX81 edge connector pinout as the Minstrel Expansion Bus, so can be plugged directly into that - http://blog.tynemouthsoftware.co.uk/2024/05/minstrel-expansion-bus.html

(ignore the shrouded connector, that was the only right angled one I had that was long enough).

This is an interesting take on an IO device as it is not actually an IO device. On Z80 systems, you normally have very distinct IO devices. These are accessed using the IO and OUT assembly instructions, and controlled by the /IORQ line (I/O request). RAM and ROM are accessed differently, using pretty much every other instruction and are controlled by the /MREQ line (memory request).

You would need a good reason to diverge from that, and well, there is one. The ZX81 does not have a way of accessing I/O devices directly from BASIC. You need to write short machine code segments. 

This is not that difficult, but can be a block for some users who would prefer to remain in BASIC land. 

See the Minstrel Joystick for an example of reading an input port from BASIC using 6 bytes of assembler - http://blog.tynemouthsoftware.co.uk/2024/05/minstrel-joystick.html

The ZX-IO uses an alternate technique. One which is quite normal on 6502 based systems, but less so on Z80 based systems. It uses memory mapped I/O. 

On something like the Commodore PET, there is an area of the memory map reserved for IO devices, in that case, E800-EFFF. In this range, there is no ROM or RAM, and those addresses are used by the VIA and PIA chips and on later machines, the CRTC.

Address Range
Use
0000-7FFF
(up to) 32K RAM
8000-8FFF
1K or 2K Video RAM
9000-AFFF
2 x 4K Option ROMs
B000-DFFF
BASIC ROMs
E000-E7FF
Editor ROM
E800-EFFF
I/O Range
F000-FFFF
Kernal ROM

The ZX81 memory map is full. Due to simplified address decoding, everything is used by ROM or RAM, or mirrors of those.

Address Range
Use
0000-1FFF
8K ROM
2000-3FFF
8K Non-BASIC RAM or ROM mirror
4000-5FFF
16K BASIC RAM
8000-9FFF
8K Non-BASIC RAM or ROM mirror
A000-BFFF
8K ROM Mirror
C000-DFFF
16K BASIC RAM mirror

The ZX81 has two useful pins on the edge connector, /RAM_CS and /ROM_CS*. These are connected to the chip select pins of the onboard ROM and RAM. They are fed via resistors so that if the pin on the edge connector is pulled to 5V, the ROM will be disabled.

* The ZX81, Minstrel 2 and Minstrel 3 all have /ROM_CS, but this pin is not connected on a real ZX80. You aren't using a real ZX80, are you?

This can be done permanently, say if you are making a 16K RAM pack and you want to disable the onboard 1K RAM which is located in the address range you want to use.

Or, it can be done selectively, as is used on devices such as the divMMC to replace certain areas of ROM code to add new BASIC commands.

This method is used to punch out an area of 4 bytes in the mirror copy of the system ROM. These 4 bytes are then replaced with the four registers in the 8255 IO chip on the ZX-IO.

Address
Use
Access
49148
Port A
Read / Write
49149
Port B
Read / Write
49150
Port C
Read / Write
49151
Control
Write Only

You can read more about this in a series of posts from David himself - https://www.zx81keyboardadventure.com/2023/02/zxio-interface-for-zx81-part-1.html

The point of doing it this way, is you can now easily access this from BASIC using PEEK and POKE.

For example, POKE 49151, 128 will setup the chip with all three 8 bit ports as output. The default is all 24 bits as inputs.

There are various modes of operation, refer to the 8255 datasheet for a full description - https://www.renesas.com/us/en/document/dst/82c55a-datasheet

POKE 49148, 255 will then set all the output bits of port A on.

If you happen to have some LEDs wired up, you can see the the results of those two commands.

Here are a few more examples of driving the LED board. The left hand 8 LEDs are on port A and the right hand is port B. Makes a nice VU meter, but I don't think it will be quite fast enough. Maybe a good candidate for one of those two player games? And you have 8 bits of port C left for controllers if you want.

This was a simple count up, but I complicated it by counting backwards on port B.

Port B didn't look right, so I reversed the video just to check.

We are in BASIC land here, and a floating point BASIC at that. So the mathematical of the operations take a while.

Here I used the ** operator to do two to the power of N, so I could have a moving dot.

As usual, I complicated it on port B. I wanted the dot and all the ones before that, which is 2^n-1, but, it's the next n, so it's actually ( 2^(n+1) ) -1.

And finally, it had to be done.

Blinkenlights.

As with the other examples, there are no delays here, this is running at full pelt in slow mode on a ZX81.


I have spoken to David (who is in Australia) and has problems shipping to the UK (yeah, sorry to the rest of the world. I didn't vote for it). 

The current situation means on SellMyRetro it is difficult for David to sell TO the UK and for me to sell FROM the UK. I can ship worldwide, but you need to contact me and tell me where and what you want and I can send you an appropriate invoice.

In order to make this available to people in the UK, I will be producing a Minstrel flavoured version. (so this post will probably be delayed whilst I design and order the boards). (Ed - still waiting to order the boards, I have posted this anyway as it may be a while before funds recover sufficiently to be in a position to invest in new products I'm afraid)

When I make kits like this, it is important to me that all the parts are still in production (looking at you Zilog......). The 8255 is surprisingly still in production (well I was surprised anyway as I thought it went out of production 30 years ago).

Almost $20 a shot, and they look like cheap knock offs. Rather disappointing. I might look at alternate suppliers or NOS, but that means I have to test each chip before shipping, rather than just batch testing as I normally can do when I am working with all new parts from reputable suppliers.

This is the one I was using for the test, or, this is how it looked when it arrived.

I accidentally brushed it with IPA when I was cleaning the board, and of course it had been black topped, so the paint rubbed off. Not sure what was underneath, it has been partly sanded, but it looks the same.

Dear China, please stop doing this. Thank you, everyone.


By the way, what do you think of the change to the connectors on the expansion bus?

I had been looking for suitable polarising pins, but this seems a more obvious way to show where the gap is.



Advertisements

The ZXIO V2 Experimenters Kit is available from David's site:

Various other bits for the Minstrel Expansion Bus are described here:

My store also contains the full range of Minstrel and Mini PET kits and accessories, contact me if outside the UK or US. Sorry I have to keep saying that. I am working on an alternative.

All the links can be found here:

Patreon

You can support me via Patreon, and get access to advance previews of posts like this 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 (they also got an extra post covering the development of this board). This also includes access to my Patreon only Discord server for even more regular updates.

Sunday, 30 June 2024

Annoying LCD Monitor Repair

I have been putting this off for a while, but it's finally time to get it sorted.

I run multiple monitors on my main machine, usually 5 or 6, a collection of old mismatched screens that suit me fine.

My favourite quote on the subject comes from the late, great Terry Pratchet - when asked "Why six screens?", his reply was "Because I haven't got enough room for eight."

As these are old monitors, they occasionally fail. And like most old monitors (and other consumer tech these days), they fail because of capacitors in the power supply.

At first they get slow to start, then sometimes they won't come on at all. This one has been going for a while, and it reached the point that it would start up after a few hours, and then be fine and I would just leave it on.

Now it is not starting up at all, so time to go through the hassle of detaching it from the mounting pole and fixing it.

After a bit of a fight getting the case off, lots of plastic clips etc., I got to the back of the panel.

The middle board is the power supply, and it is connected by cables to the pod on the right, the backlight inverter, and the one of the left, the video processor.

These cables are fixed at one end, and have sockets at the other.

Guess which end is soldered in place?

Yes, that's right, the one on the power board, so to get that out, I have to remove both cans and unplug the connectors inside. That involves also undoing the jackposts on the VGA and DVI connectors. Not a great design.

The video processor board at least confirms the date code at around 2003. Not bad, it is still a good monitor with a bright clear picture, so it is worth a bit of frustration to fix.

These connectors are in a bit tight, but it's finally freed.

Now for the backlight inverter.

Damn.

I was pulling the cable hard enough to pull the plug out, not a massive force, but it ripped off the entire connector before it unplugged from the socket.

So that's two things to fix.

Luckily it was all the solder that broken, no damage to any of the tracks. I put it back with far too much solder, to make sure in case I have to disconnect it again.

And back to the original problem.

Same old thing with LCD TVs and lots of other consumer tech of the day such as DVD players etc.

The good old bulging caps with domed tops.

I spotted a couple, all of the CapXon brand (well known for being a bit CrapXon).

There were various other green and brown caps around the board which looked to be OK. Just the black and gold ones.

There were four of those, and two had failed, so I thought it best to replace all of the same brand and age.

The smallest is marked 820uF and reads as, well, it reads as a resistor.

The next 1000uF cap reads as half that, and quite a high resistance.

The two taller 1000uF caps actually read OK, but it is probably best to have replaced them anyway.

I use 105°C rated low ESR capacitors, these have generally proved good replacements.

I didn't have an 820uF 10V, so I went up to 1000uF here.

The 1000uF 16V is a direct replacement.

I didn't have any 1000uF 25V caps, but they were wired in parallel, so I replaced the pair of those with a single 2200uF 25V caps. That's OK, right?

All the parts fitted, and you can see the permanently attached wires that made this job take twice as long as it needed to.

And now all back together and working fine. As expected, I've done dozens of monitors and TVs like this. I only write this one up as it was quite an annoying job that was made a lot harder due to some less that ideal design decisions.

The picture is looking really good in fact. The colours are brighter, the blacks are darker, the contrast is better.

Or in other words, I gave the screen a wipe over with a damp cloth when it was in bits.



Advertisements

I don't sell 20 year old monitors in my store, but I do have the full range of Minstrel and Mini PET kits and accessories.

UK and US only I am afraid, I can ship worldwide, contact me with your location and what you want. Sorry I have to keep saying that. I am working on an alternative.

All the links can be found here:

Patreon

You can support me via Patreon, and get access to advance previews of posts like this 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.

Sunday, 23 June 2024

New Commodore 16 internal 64K RAM upgrade

I have converted many Commodore 16's to Commodore 64s 64K Commodore 16s, and wrote quite a detailed post showing various methods. ( http://blog.tynemouthsoftware.co.uk/2019/02/commodore-16-64k-upgrades.html)

All of these involved removing the two 16Kx4 dynamic RAM chips and replacing them with two 64Kx4 RAM chips. 4416 to 4464. And modifying the multiplexor chips to add the two missing address lines.

The problem is, it's not that easy to get hold of those 4464s. They are used on the Amstrad versions of the Spectrum +2/+3, the C64C and Atari XEGS amongst others.

On other systems with 64Kx1 dynamic RAM chips, 4164s, I have made boards to replace those with a single 64Kx8 static RAM.

The idea with the lower pin count dynamic RAM chips is there are two select pulses, RAS and CAS. One selected the row address (8 bits) and the other the column address (8 bits), making the full 16 bit address.

To use a larger pin count static RAM ICs, the row address is first latched in on the RAS pulse, and then when the CAS pulse comes along, a combination of the previously latched row address and the new column address is used to make the full 16 bit address.

That works nicely on various systems I have made those for, e.g. this for the Spectrum 128K +2, which uses two of those boards.

I wanted to make one for the Commodore 16, but I thought I could try a slightly different approach. 

The multiplexor chips that take A0-A13 and generates the 7x7 row x column addresses are right next to the RAM chips, so I thought I could maybe cut out the middle man and skip the multiplexors (which drops it down to 7x7) and the latch (which brings up back to 14 bits). I would need to pick up A15 and A16 to get the full 16 bits (and it turned out I needed Î¦o and a logic gate to generate an appropriate chip select signal).

I built up a board which taps all the address lines and data lines from the four sockets and wired them direct to the RAM chip.

The board has four IC pin headers on the back which plug into the four sockets on the C16 board.

The four ICs, two 74LS257 multiplexors and two 4416 DRAM chips are carefully desoldered. (and I mean carefully. This is job for someone with the right tools and experience to desolder the chips leaving the board and the chips undamaged)

I should make that caveat larger.

DESOLDERING EXPERIENCE REQUIRED - NOT FOR THE BEGINNER

And whilst I am adding caveats.....

DO NOT BLAME ME IF YOUR COMMODORE 16 DIES WHILST USING THIS

To help with alignment, I supply the module already fitted into four turned pin IC sockets.


All four of those can then be soldered in place. You can then remove the module if you wish to test.

The best way to test this is to install the four chips that have just been removed. If you cut the legs off the chips to desolder them, then this kit is probably not for you.

That should still operate as a 16K Commodore 16.

Time to remove those chips and install the new module again.

The multiplexor chips only have 14 address lines, so as with the other upgrades, A14 and A15 have to be tapped from elsewhere. I added jumpers to allow those to be selected, or disabled to go back 16K, should that be required for compatibility at any point (I am not aware of any games that will fail due to too much RAM).

As described in the previous post, a good place to get those is two vias next to the modulator.

A two pin header can be fitted there for ease of installation.

In addition, the clock line also needs to be tapped. There are various places this can be found, I went for one of the vias next to the PLA. Again a pin header is fitted.

That is the shorter wire marked Φo.

A14 and A15 can be fitted either way around, but this is the correct orientation.

All the cables, connectors and sockets will be supplied with the kit.

OK, that's everything installed, checked and double checked.

Time to switch on.....

Excellent. Let's give Diag264 a run.

Should you ever want to go back to 16K, you can adjust the jumpers to the left.

Although, as I said, I can't see why you would need that.

Time to try out some 64K only programs from the plus/4 catalogue.

CBM command needs more than 16K, so I couldn't run it before on this machine.

And since I used it last time, I will try Icicle Works again.

All seems good, the kits are now available in my store.

Stop Press - new video from Tim's Retro Corner showing installation and testing of the kit.


Advertisements

The kits are now available in my store if you are in the UK or US. If you are elsewhere, contact me as I can ship worldwide.

"DO NOT BLAME ME IF YOUR COMMODORE 16 DIES WHILST USING THIS"

"DESOLDERING EXPERIENCE REQUIRED - NOT FOR THE BEGINNER"

The store also contains the full range of Minstrel and Mini PET kits and accessories, again contact me if outside the UK or US. Sorry I have to keep saying that.

All the links can be found here:

Patreon

You can support me via Patreon, and get access to advance previews of posts like this 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 (they also got an extra post covering the development of this board). This also includes access to my Patreon only Discord server for even more regular updates.