Another Home-Brew - Z180

General "chat", not necessarily MTX related
Bill B
Posts: 593
Joined: 26 Jan 2014 16:31

Re: Another Home-Brew - Z180

Post by Bill B »

Martin,

Current limit resistors are needed to protect the Propeller from the VOH Max of the other items on the bus.

What I then found, certainly with the MTX, is that with the resistors in place, the Propeller could not meet the VIL Max limit on the bus. The issue may not be so bad on my Z180 system, as I have rather less on the data bus. However when I am running the Z180 at full speed, the impact of the resistors on slew rate may also be an issue.
Martin A
Posts: 799
Joined: 09 Nov 2013 21:03

Re: Another Home-Brew - Z180

Post by Martin A »

IT was just a suggestion for testing, I didn't realise it wss the low that was the issue, I'd asumed it was the high.

One thing I've just spotted looking at the data sheet. VCCA seems to be on pin 2, and VCCB on pin 19.

The schematic shows Pin 1 and pin 20 respectively, do the adaptor boards take casre of that ?
Bill B
Posts: 593
Joined: 26 Jan 2014 16:31

Re: Another Home-Brew - Z180

Post by Bill B »

The high is what would damage the Propeller, which is why some sort of interface is required. Current limit resistors provide protection against the high. The problem with that is that if there are a number of LS devices on the bus, then to pull a bus line low you have to sink some current. That is what limits the fan-out of LS devices. Although the Propeller goes sufficiently low, the voltage drop across the current limit resistors means that the bus is not pulled so low. Certainly on the MTX, the result was not low enough to be recognised as a zero.

On my Z180, I have rather less on the bus, so might be able to get away with just resistors, but I am not sure it is tat much more work to do something better.

The pin-out of the break out board is not the same as the chip. Although not from Adafruit, the break-out is the same as this one https://www.adafruit.com/product/395.

Limited testing has shown that at least one of the break-out boards is completely duff. Always zero on the A outputs, irrespective of what is on B. Two others seem to work B->A, not yet tested A->B except that the Z180 will still not boot with either one on the data bus.
Bill B
Posts: 593
Joined: 26 Jan 2014 16:31

Re: Another Home-Brew - Z180

Post by Bill B »

20201205_125318.jpg
20201205_125318.jpg (795.04 KiB) Viewed 7834 times
My patch board. It plugs into the sockets originally intended for the level shifters, and has:
  • Current limit resistors on all the signals from the Z180 to the Propeller
  • 74HCT245 to buffer the data lines back to the Z180
  • 74LS32 to drive the direction line on the HC245 buffer (I did not have an HC or HCT version)
I really need to get a stock of 74LVC245 chips. Then I would not need the current limit resistors. I did contemplate waiting until I got some of these and then putting them directly into the sockets intended for the level shifters. However, the B-bus is displaced by one pin, so it would have required extensive surgery on the PCB tracks.

Some PCB surgery is necessary anyway :( Spot the difference:
Connector_CPU_Board.png
Connector_CPU_Board.png (5.88 KiB) Viewed 7834 times
Connector_Util_Board.png
Connector_Util_Board.png (6.32 KiB) Viewed 7834 times
This is not the only connector I have messed up :oops:

For the CFX-II (and my original prototype) I have a connector for programming and debugging the Propeller, In reproducing it here, I managed to reverse the power and ground pins, again requiring track surgery.

Perhaps I should stick to software.
User avatar
1024MAK
Posts: 757
Joined: 24 Dec 2012 03:01
Location: Looking forward to summer, in Somerset, UK

Re: Another Home-Brew - Z180

Post by 1024MAK »

It’s just so easy to get connector and device pinouts mirrored, due to alternatively working on the underside and the top (component) side. I’ve certainly dropped a clanger before and I know I will do so again at some point.

The first time I did this, it was for a four pin DC-DC converter module in about 1987! That home produced PCB needed the ground plain cutting!

Mark
:!: Standby alert :!:
“There are four lights!”
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :!:
Looking forward to summer in Somerset later in the year :D

Not as many MTXs as Dave! :lol:
Bill B
Posts: 593
Joined: 26 Jan 2014 16:31

Re: Another Home-Brew - Z180

Post by Bill B »

Working in Kicad it should not be so easy to mirror connections. Everything is designed from a top-side view. So unless the transparency is flipped when etching, everything should be the correct way around.

In this case the connectors are not mirrored.

The diagrams from Kicad are mostly just 180deg rotated with respect to each other. The goof was that /RD and /WR were transposed. The problem occurred when copying the connector layout from the CPU board Kicad design to the one for the Peripherals.

Managed to fix it with a bit of track cutting and some white (didn't have any yellow) wire.

On the patch board I have to OR the /RD and /CS signals to produce the direction signal for the buffer. Since the LS32 chip contains four OR gates, I also OR'ed the /WR and /CS signal, and fed these OR'ed signals to the Propeller instead of the original Z180 signals. I don't know whether it was because of that, or because the Z180 signal timing is slightly different, but my original Propeller code for detecting CPU writes (from CFX-II) did not work. However I could get the Propeller to output diagnostics to the VGA display, and the Z180 to output diagnostics over the serial link to see what is happening on each side and test alternate implementations.

Eventually got a working solution, and the Z180 is now able to display text on the VGA display :)
Martin A
Posts: 799
Joined: 09 Nov 2013 21:03

Re: Another Home-Brew - Z180

Post by Martin A »

IS that workng with the "original" level shifters Or the daughter board ?
Bill B
Posts: 593
Joined: 26 Jan 2014 16:31

Re: Another Home-Brew - Z180

Post by Bill B »

Working with the daughter board. The only issue is that the daughter board overlaps the socket for the RTC. Would probably be OK if it was a normal IC, but the RTC is rather taller, and I am not sure whether there is room.

Still, the next thing to try is the SD card interface.

One thing I discovered looking at Andy's code and VHD for Rememoriser is that the initial communication with the SD card has to be at less than 0.4MHz, before being able to do data transfers at up to 25MHz. Andy's VHD has a programmable divider to provide the SPI clock. There is nowhere near sufficient capacity in the EPM7032S CPLD I am using to implement that. With a bit of reworking of the VHD for my CPLD, I think I can bit-bash the low speed SPI, and then (as originally planed) use a shift register implemented in the CPLD for the high speed transfer.
Martin A
Posts: 799
Joined: 09 Nov 2013 21:03

Re: Another Home-Brew - Z180

Post by Martin A »

Is there sufficient CPLD resources to allow a "manually" opperated clock in addition to the main one?

So that rather than bitbanging the whole SPI interfase, you just have to bitbang the clock for the initial setup period.

I'm thinking a 2 bit I/O port when the shift register clock is (CLK AND Bit1) OR bit0.

With bit1 set and bit0 clear, the shift register is fed CLK
With bit1 clear bit0 becomes the clock.

If it's mechanically stable enough, stacking a couple of extra sockets under the daughter board would deal with any clearance issues.
Bill B
Posts: 593
Joined: 26 Jan 2014 16:31

Re: Another Home-Brew - Z180

Post by Bill B »

Interesting thought. The clock I am applying to the SD card is almost exactly as you describe. It had not occurred to me to use this composite signal to drive the shift register as well.

I will have to try tweaking the VHD and see what Quartus makes of it.
Post Reply