6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Fri Nov 22, 2024 2:38 am

All times are UTC




Post new topic Reply to topic  [ 9 posts ] 
Author Message
PostPosted: Fri Jan 01, 2021 9:31 pm 
Offline
User avatar

Joined: Sun Dec 27, 2020 11:12 pm
Posts: 94
Location: France
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

_________________
Jonathan Foucher

Take a look at the Planck 6502 computer.


Top
 Profile  
Reply with quote  
PostPosted: Sat Jan 02, 2021 12:10 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 9:02 pm
Posts: 1748
Location: Sacramento, CA
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

_________________
Please visit my website -> https://sbc.rictor.org/


Top
 Profile  
Reply with quote  
PostPosted: Sun Jan 03, 2021 4:08 pm 
Offline
User avatar

Joined: Sun Dec 27, 2020 11:12 pm
Posts: 94
Location: France
8BIT wrote:
It would be a good place to start. How much delay are you looking for?
Daryl

Yes, great place to start. Ideally the clock would be divided by 8. From I gather by looking at your code and the ATF22V10 datasheet though, there is only one flip flip per pin. So dividing by 8 would use three pins, is that right ? Alternatively is there a way to multiplex two clocks to one output pin depending on (to simplify) whether another pin is high or low ? This would require adding another oscillator but would only use another additional pin of the 22V10. But I'm not sure about multiplexing in WinCupl. Can you do this for example ?

Code:
CLK_OUT = A15 ? CLK_SLOW : CLK_FAST


The CUPL manual I found is not really clear, and the error messages in WINCUPL were not very helpful...

_________________
Jonathan Foucher

Take a look at the Planck 6502 computer.


Top
 Profile  
Reply with quote  
PostPosted: Sun Jan 03, 2021 4:32 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 9:02 pm
Posts: 1748
Location: Sacramento, CA
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:

Code:
Pin 2 = A
Pin 3 = B
Pin 4 = Control
Pin 23 = Out

Out = (A & !Control) # (B & Control);

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

_________________
Please visit my website -> https://sbc.rictor.org/


Top
 Profile  
Reply with quote  
PostPosted: Sun Jan 03, 2021 4:57 pm 
Offline
User avatar

Joined: Sun Dec 27, 2020 11:12 pm
Posts: 94
Location: France
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:

Code:
Pin 2 = A
Pin 3 = B
Pin 4 = Control
Pin 23 = Out

Out = (A & !Control) # (B & Control);

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


Great, thanks Daryl I have all the info I need now. It seems both solution would use the same number of pins in my application, but the dividing by 8 with flip flops would seem to provide more flexibility with less external circuitry, so I'll probably go that route.

_________________
Jonathan Foucher

Take a look at the Planck 6502 computer.


Top
 Profile  
Reply with quote  
PostPosted: Sun Jan 03, 2021 6:53 pm 
Offline
User avatar

Joined: Sun Dec 27, 2020 11:12 pm
Posts: 94
Location: France
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:

Code:
CLK_DIV_2.d = !CLK_DIV_2;
CLK_DIV_4.d = (CLK_DIV_2 & !CLK_DIV_4) # (!CLK_DIV_2 & CLK_DIV_4);

_________________
Jonathan Foucher

Take a look at the Planck 6502 computer.


Top
 Profile  
Reply with quote  
PostPosted: Sun Jan 03, 2021 8:49 pm 
Offline
User avatar

Joined: Sun Dec 27, 2020 11:12 pm
Posts: 94
Location: France
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:

Code:
// 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);


It's a pity that it uses so many pins, but I'm not sure if it can be optimized...

_________________
Jonathan Foucher

Take a look at the Planck 6502 computer.


Top
 Profile  
Reply with quote  
PostPosted: Sun Jan 03, 2021 9:07 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 9:02 pm
Posts: 1748
Location: Sacramento, CA
I'll have a go at it, but it won't be until tomorrow.

Daryl

_________________
Please visit my website -> https://sbc.rictor.org/


Top
 Profile  
Reply with quote  
PostPosted: Sun Jan 03, 2021 9:30 pm 
Offline
User avatar

Joined: Sun Dec 27, 2020 11:12 pm
Posts: 94
Location: France
Oh thanks, but don't worry about it, I was just saying, not asking.

_________________
Jonathan Foucher

Take a look at the Planck 6502 computer.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: