Page 8 of 8

Re: Troed's H4 build

Posted: Sun Aug 23, 2020 3:55 pm
by troed
I've had some progress here. The GAL is up and running the H4 fine with "stock clocks" being emulated, just handing out 32->4MHz via the jumpers. But it turns out my lack of proper micro electronics education is catching up with me - I don't seem to be able to figure out how to handle DTACK.

In stock mode I can just connect the bodge wire - but I know from the doubleST STF that when accelerated I will need to slow down DTACK. So, what I've been trying to do is to connect one end of the bodge wire to a DTACK_IN pin, and then an output as DTACK_OUT (to the CPU). I'm quite sure I had this working without any special treatment, just a straight combinatorial out=in, but either I was wrong or something else isn't working. If I declare the output as .OE at least the H4 starts to boot, but when I measure the input and output the GAL isn't passing anything through, the actual level of the output doesn't change so at some stage I guess the H4 bus errors out and goes high.

Any hints on how to declare the input and output pins and logic?

Code: Select all

DTACK_OUT.oe = DTACK;
is apparently not enough.

Re: Troed's H4 build

Posted: Sun Aug 23, 2020 4:50 pm
by exxos

Code: Select all

CPU_DTACK.D = SYS_DTACK # CPU_AS;
CPU_DTACK.OE = !SYS_DTACK;

Re: Troed's H4 build

Posted: Sun Aug 23, 2020 5:08 pm
by troed
exxos wrote:
Sun Aug 23, 2020 4:50 pm

Code: Select all

CPU_DTACK.D = SYS_DTACK # CPU_AS;
CPU_DTACK.OE = !SYS_DTACK;
Thanks, I have no idea why this turned out to be so problematic. 'stock' below is 1 when running stock clocks:

Code: Select all

*** INPUT ***
PIN 10 = !DTACK;
*** OUTPUT ***
PIN 14 = !DTACK_OUT;

*** equations ***

DTACK_OUT.D = DTACK & stock;
DTACK_OUT.OE = !DTACK & stock;
I tried with both .D (registered) and without (combinatorial) but this still just gave me a constant high on both input and output. In this mode all I'm really trying to do is have the GAL be "transparent" but still in control of the signal.

/Troed

Re: Troed's H4 build

Posted: Sun Aug 23, 2020 5:12 pm
by exxos
There is something odd that you can't drive OE and a signal from the same signal.. IIRC ORing it with CPU_AS gets around that problem.

Normally I just do something like

Code: Select all

CPU_DTACK = 'b'0;
CPU_DTACK.OE = !SYS_DTACK

IIRC

Code: Select all

CPU_DTACK =SYS_DTACK;
CPU_DTACK.OE = !SYS_DTACK
doesn't work.