Hi,
I am currently in the planning stages of a computer
It uses a GAL22V10 on the backplane to do expansion slots address decoding.
I am wondering if it would be possible to have the clock signal (generated by an oscillator on the backplane) go though the 22V10 before reaching the expansion bus and other components to be able to slow the clock down when accessing slow devices such as the ROM. (Yes, I realize VIA timers and such would be affected, but please bear with me)
I understand I might be possible to achieve this by using registered output mode for the specific pin in the 22V10. If so great news! But I am wondering by what factor can the clock be slowed? Is it possible to have a binary counter in the 22V10 maybe?
Thanks
Clock stretching using a GAL22V10
Re: Clock stretching using a GAL22V10
Take a look at this -> https://sbc.rictor.org/wsgen.html
It combines some decoding with a /2 and /4 wait state generator which uses the decoded addresses to apply the proper wait.
It would be a good place to start. How much delay are you looking for?
Daryl
It combines some decoding with a /2 and /4 wait state generator which uses the decoded addresses to apply the proper wait.
It would be a good place to start. How much delay are you looking for?
Daryl
Please visit my website -> https://sbc.rictor.org/
Re: Clock stretching using a GAL22V10
8BIT wrote:
It would be a good place to start. How much delay are you looking for?
Daryl
Daryl
Code: Select all
CLK_OUT = A15 ? CLK_SLOW : CLK_FASTRe: Clock stretching using a GAL22V10
Yes, dividing by 8 would require 1 more output. You can easily multiplex 2 inputs. The big issue with clocks is controlling when they switch, to eliminate very short clock pulses during the transition.
Here's how a basic mux would be written:
Out follows A when control is low and B when control is high.
To ensure the transition is clean, you'd have to qualify the Control signal to change only when both A&B are at the same state. That would require at least one flip-flop. You'd have to study that more to be sure it works with your application.
Daryl
Here's how a basic mux would be written:
Code: Select all
Pin 2 = A
Pin 3 = B
Pin 4 = Control
Pin 23 = Out
Out = (A & !Control) # (B & Control);
To ensure the transition is clean, you'd have to qualify the Control signal to change only when both A&B are at the same state. That would require at least one flip-flop. You'd have to study that more to be sure it works with your application.
Daryl
Please visit my website -> https://sbc.rictor.org/
Re: Clock stretching using a GAL22V10
8BIT wrote:
Yes, dividing by 8 would require 1 more output. You can easily multiplex 2 inputs. The big issue with clocks is controlling when they switch, to eliminate very short clock pulses during the transition.
Here's how a basic mux would be written:
Out follows A when control is low and B when control is high.
To ensure the transition is clean, you'd have to qualify the Control signal to change only when both A&B are at the same state. That would require at least one flip-flop. You'd have to study that more to be sure it works with your application.
Daryl
Here's how a basic mux would be written:
Code: Select all
Pin 2 = A
Pin 3 = B
Pin 4 = Control
Pin 23 = Out
Out = (A & !Control) # (B & Control);
To ensure the transition is clean, you'd have to qualify the Control signal to change only when both A&B are at the same state. That would require at least one flip-flop. You'd have to study that more to be sure it works with your application.
Daryl
Re: Clock stretching using a GAL22V10
Daryl, sorry but I think I need your assistance once more. I have tried dividing the clock by more than two but I fail to do so because I cannot find a way to redirect the output of one flip flop to the clock of the next. I have tried the .CK extension but it seems that the device does not support it. Any advice ?
Thanks
Edit: I Finally managed to do it this way:
Thanks
Edit: I Finally managed to do it this way:
Code: Select all
CLK_DIV_2.d = !CLK_DIV_2;
CLK_DIV_4.d = (CLK_DIV_2 & !CLK_DIV_4) # (!CLK_DIV_2 & CLK_DIV_4);Re: Clock stretching using a GAL22V10
And here is the solution I came up with, which uses 4 output pins to select between either the full speed clock, or one that is 4 times slower:
It's a pity that it uses so many pins, but I'm not sure if it can be optimized...
Code: Select all
// Divide the main clock by two with a flip flop
CLK_DIV_2.d = !CLK_DIV_2;
// Divide the /2 clock by two by using a multiplexer and another flip flop
CLK_DIV_4.d = (CLK_DIV_2 & !CLK_DIV_4) # (!CLK_DIV_2 & CLK_DIV_4);
// Check if the two possible output clocks are at the same level
TEST = CLK_DIV_4&CLK # !CLK_DIV_4&!CLK;
// If yes, the mux flip flop takes the new value, otherwise it retains the old value
MUX.d = (TEST & A15) # (!TEST & MUX);
// CLK_OUT is either CLK or CLK_DIV_4 depending on the output of Mux
CLK_OUT= (MUX & CLK_DIV_4) # (!MUX & CLK);Re: Clock stretching using a GAL22V10
I'll have a go at it, but it won't be until tomorrow.
Daryl
Daryl
Please visit my website -> https://sbc.rictor.org/
Re: Clock stretching using a GAL22V10
Oh thanks, but don't worry about it, I was just saying, not asking.