Splitting clock signal - 6502

Feel free to talk about any other retro stuff here including Commodore, Sinclair, Atari, Amstrad, Apple... the list goes on!
Bader
Posts: 17
Joined: Sun Sep 27, 2020 7:29 am

Splitting clock signal - 6502

Post by Bader »


Hello

Just got a 6502 A in the mail which I understand runs at 2MHz. I don't have any of those  crystal oscillators, but I do have a 4MHz. Can I split the signal using logic gates? At the top of my head perhaps an XOR gate and a D-latch set/reset latch should do it? But the details are not the point, the question is, is it viable or would it not be exact enough?

 

Thanks

User avatar
StephenHorn
Posts: 565
Joined: Tue Apr 28, 2020 12:00 am
Contact:

Splitting clock signal - 6502

Post by StephenHorn »


I don't have time to find the exact location of his solution, but didn't Ben Eater do some kind of clock division for his homebrew VGA circuit?

Developer for Box16, the other X16 emulator. (Box16 on GitHub)
I also accept pull requests for x16emu, the official X16 emulator. (x16-emulator on GitHub)
Bader
Posts: 17
Joined: Sun Sep 27, 2020 7:29 am

Splitting clock signal - 6502

Post by Bader »


oh I'll have a look, thanks ?

EMwhite
Posts: 220
Joined: Mon Sep 07, 2020 1:02 pm

Splitting clock signal - 6502

Post by EMwhite »


There is also this: 





 

He is no Ben Eater (not quite as organized, rehearsed, etc.) but based on his clock starting point, he appears to have based his design on Ben's original clock.  I've got clock dividers in my modular synthesizer that work in very much the same manner.  The shape of the signal (that the presenter struggles with) ultimately causes issues with the ICs dependent on clock but I think below a given # of single digit Mhz. you are probably ok and will need to try it.

 

Bader
Posts: 17
Joined: Sun Sep 27, 2020 7:29 am

Splitting clock signal - 6502

Post by Bader »


Been playing around in Logisim. To halve the frequency, don't I really just need a D-latch with the invertered Q going to the enable (or is it called input) pin? Like I've done in the picture? I don't really need to split the signal, just remove half the ticks.


latch.png
User avatar
StephenHorn
Posts: 565
Joined: Tue Apr 28, 2020 12:00 am
Contact:

Splitting clock signal - 6502

Post by StephenHorn »


Seems like that would work, sure.

Developer for Box16, the other X16 emulator. (Box16 on GitHub)
I also accept pull requests for x16emu, the official X16 emulator. (x16-emulator on GitHub)
Bader
Posts: 17
Joined: Sun Sep 27, 2020 7:29 am

Splitting clock signal - 6502

Post by Bader »


awesome, thanks all!

Bader
Posts: 17
Joined: Sun Sep 27, 2020 7:29 am

Splitting clock signal - 6502

Post by Bader »


update, if anyone is curious ?



Not getting it to work. I've come as far  as making the outputs do as I want as long as I don't use not Q as input. When I do use not Q then switchover seems random. My guess is I have to de-bounce it but I really have no idea. Will continue experimenting when I'm closer to sobriety ?


User avatar
StephenHorn
Posts: 565
Joined: Tue Apr 28, 2020 12:00 am
Contact:

Splitting clock signal - 6502

Post by StephenHorn »



6 hours ago, Bader said:




update, if anyone is curious ?



Not getting it to work. I've come as far  as making the outputs do as I want as long as I don't use not Q as input. When I do use not Q then switchover seems random. My guess is I have to de-bounce it but I really have no idea. Will continue experimenting when I'm closer to sobriety ?




Not to ask silly questions, but is there a timing graph for the component you're using, and do you know whether your clock input is conforming to the latch's requirements?

Developer for Box16, the other X16 emulator. (Box16 on GitHub)
I also accept pull requests for x16emu, the official X16 emulator. (x16-emulator on GitHub)
User avatar
JimmyDansbo
Posts: 468
Joined: Sun Apr 26, 2020 8:10 pm
Location: Denmark
Contact:

Splitting clock signal - 6502

Post by JimmyDansbo »


In theory, it should work. I have just tested in Logisim as well, both the buil-in d-latch and one made from NAND gates seems to be able to divide the clock signal.

image.png.b9716d12890b2b7e095d1b75bd704e8c.png

As StephenHorn says, ensure that your chip(s) can handle the signal they receive. (dig in to the datasheets).

Visit my Github repo
or my personal site with CX16/C64/6502 related information.
Feel free to contact me regarding any of my projects or even about meeting up somewhere near Denmark
Post Reply