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 »



10 hours ago, StephenHorn said:




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?



Not silly at all as I am completely new to this and that hadn't occurred to me. Shall have a look thanks ?

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

Splitting clock signal - 6502

Post by Bader »



3 hours ago, JimmyDansbo said:




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).



I built with NOR and AND as in the Ben Eater videos. Will try this one as well ?

User avatar
JimmyDansbo
Posts: 468
Joined: Sun Apr 26, 2020 8:10 pm
Location: Denmark
Contact:

Splitting clock signal - 6502

Post by JimmyDansbo »


You could also have a look at how the 74ls74 is built. It may very well be a better design.

https://www.ti.com/lit/ds/symlink/sn74ls74a.pdf

The 74ls74 seems to be edge triggered without using the strange NOT-NOT-NOT-AND circuit I have above.

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
BruceMcF
Posts: 1336
Joined: Fri Jul 03, 2020 4:27 am

Splitting clock signal - 6502

Post by BruceMcF »


Simple D-type divide by 2 circuits have problems if the clock edges are not sharp enough. Feeding the clock through an inverter might sharpen its edges.

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

Splitting clock signal - 6502

Post by Bader »



3 hours ago, BruceMcF said:




Simple D-type divide by 2 circuits have problems if the clock edges are not sharp enough. Feeding the clock through an inverter might sharpen its edges.



thanks, will give all of these a try once manage to free up some time ?

 

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

Splitting clock signal - 6502

Post by Bader »


The result of using a 74LS74 (D flip flop) and  a 74HCU04 (hex inverter) is going from this:

IMG_20201110_165032.thumb.jpg.4c7622dac6e41c6d668ccc28697f4858.jpg

 

 

To this:

IMG_20201111_155909.thumb.jpg.d5e652534a5471c71c4a20194a9627a5.jpg

 

And it's probably going to get a bit better once I tied down all unused inputs as well, cheers everyone!

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

Splitting clock signal - 6502

Post by StephenHorn »


Holy smokes, no wonder your latch was having problems. That original signal isn't a square wave clock signal--- it's a bleedin' triangle wave! Was that really the output from a crystal oscillator?

Edit: I may be dumb or simply inexperienced, I thought crystal oscillators produced square-ish signals.

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 »


Here's the circuit ?

 

IMG_20201111_164027.thumb.jpg.3ec2bce400defcd475ec19a74e82dd7a.jpg



This is the tutorial I followed:









I've since found other ones that also uses inverters but I didn't have all the component values for those. I might try some other ones as well

 

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

Splitting clock signal - 6502

Post by Bader »


Interestingly enough, if I put even a 6Mhz, or faster, crystal in instead, it doesn't work very well at all. I was lucky that I found a tutorial using components that matches the speeds I wanted to run I guess. There certainly is lots to learn here ?

Post Reply