6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun May 12, 2024 8:04 am

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Sat Oct 28, 2023 11:50 pm 
Offline
User avatar

Joined: Fri Aug 03, 2018 8:52 am
Posts: 746
Location: Germany
Hi everyone!

Over on the ""Fast" PDIP 6502 design feedback" thread gfoot mentioned the DS1086 Programmble Clock Generator and how they made a little PCB for it.
and since i was in need for some more customizable clock speeds as well i thought i'd tried making one of these boards too.

And this is the result (next to a regular DIP-8 oscillator can):
Attachment:
Clock Compare.jpg
Clock Compare.jpg [ 616.66 KiB | Viewed 5599 times ]


It has the 4 obvious pins on the bottom like any DIP-8 oscillator but also 4 pins on the top for Power and the I2C Interface (they're even labeled!)
the chip itself is hidden under the pull up resistors (which are for the I2C interface and i'm confused why gfoot's design is missing those)
I could've put the chip on the underside like gfoot did and i'm honestly not sure why i didn't... so the github version will have that updated.

besides the PCB itself i also wrote a simple Arduino program to both read out the current clock speed and set a new one.
it works like a CLI where you enter commands for the Arduino to run, though of course the chip is rather simple so there aren't a lot of commands.
"help" - just displays all valid commands and what they do
"get" - reads out the current clock frequency of the chip
"set <freq. in kHz>" - writes a new clock frequency to the chip
"write" - saves the set clock frequency to the EEPROM

The program seems functional enough but it's a bit janky, for example reading the DAC registers always reads back the same value regardless of what was written into them, i don't know why, so just keep in mind that the read-out can be off by ~0-5MHz or so.

like i mentioned above i threw this all on github since it seems rather useful to have: https://github.com/ProxyPlayerHD/DS1086-Adapter


on a side note, the fact that this thing can be programmed while in a system gave me an idea for an automated overclocking setup.
a 65xx System with (ideally) a VIA or some other 8-bit IO port, which would be hooked up to an Arduino or similar MCU.
the MCU would have control over RESET, the DS1086 running the clock, and be connected to the 8-bit IO port.

the idea is that the 65xx would run some tests to make sure it's stable and after each test write some specific value to the 8-bit port before entering a waiting loop.
the MCU would read the value and check if it's correct, if it is then the MCU tells the CPU to continue either via some input port, the SO pin, or the NMI pin on the CPU.
after the whole sequence of bytes has been received and the CPU is known to be stable the MCU pulls the Reset line low, increments the clock speed by some fixed value (like 0.25MHz for example) and then releases the Reset line to redo all the tests.

if any of the received bytes are incorrect or never arrive after some set amount of time, the MCU deems the System unstable, halts all testing, and prints or otherwise saves the result of the high clock speed it was able to run at.

Again it's just an idea, but for some real overclocking maniacs it could save a lot of time swapping or even just buying loads of different oscillators. plus you could even give the MCU control over the voltage and increase it slightly when the system failed to see if it can be pushed further (without frying it of course).


Anyways that's all for now, i still got some other projects to work on, including a 65816 Emulator in C because i couldn't find any documentation on lib65816 so i thought "screw it i'll just write one myself"


Top
 Profile  
Reply with quote  
PostPosted: Sun Oct 29, 2023 1:36 am 
Offline

Joined: Fri Jul 09, 2021 10:12 pm
Posts: 741
Nice job! I'm not sure if I shared my code already, but I'm happy to do so if it would help with the reading-back issue. I doubt it though because I don't think I read anything back except for the prescaler value.

Proxy wrote:
the chip itself is hidden under the pull up resistors (which are for the I2C interface and i'm confused why gfoot's design is missing those)

I think I just forgot about them - luckily it seemed to work fine without, but they should be included, yes.

I think you forgot to add the schematic PDF to the github repository, so will just ask - did you tie SPRD high or low? I got that one the wrong way around in my boards and it was kind of annoying.

Quote:
on a side note, the fact that this thing can be programmed while in a system gave me an idea for an automated overclocking setup.

I was considering just letting the 6502 system control the frequency - however, if you're finding the limit, you still ought to have some external watchdog to reset the system if it's crashed.

It could also be useful for one of these boot-up systems that requires a slower clock speed at boot time, as the system could adjust its own clock after the initial boot is complete.


Top
 Profile  
Reply with quote  
PostPosted: Sun Oct 29, 2023 1:45 am 
Offline

Joined: Fri Dec 21, 2018 1:05 am
Posts: 1076
Location: Albuquerque NM USA
Great job!

I'm one of those overclocking maniacs and most my boards happen to have bit-bang I2C interface so I can just command DS1086 directly via I2C. It is like open surgery on my own brain, what can possibly go wrong?!!
Bill


Top
 Profile  
Reply with quote  
PostPosted: Sun Oct 29, 2023 1:50 am 
Offline
User avatar

Joined: Fri Aug 03, 2018 8:52 am
Posts: 746
Location: Germany
oops yea i did forget the PDF, it's uploaded now

i pretty much just copied the datasheet's "Processor-Controlled Mode" example in terms of connections.
so SPRD, OE, and ~PDN are all tied high.


Top
 Profile  
Reply with quote  
PostPosted: Sun Oct 29, 2023 2:18 am 
Offline

Joined: Fri Jul 09, 2021 10:12 pm
Posts: 741
Proxy wrote:
i pretty much just copied the datasheet's "Processor-Controlled Mode" example in terms of connections.
so SPRD, OE, and ~PDN are all tied high.

Right, that's what I did - I think it may be better for SPRD to be low, as it injects some variation into the clock signal. You can control the variation via one of the prescaler bits, but not disable it - to disable it you need to tie SPRD low instead. Though I haven't tried that, it's just something I intended to change in any new board I made.


Top
 Profile  
Reply with quote  
PostPosted: Sun Oct 29, 2023 6:45 am 
Offline
User avatar

Joined: Wed Feb 14, 2018 2:33 pm
Posts: 1411
Location: Scotland
gfoot wrote:
Nice job! I'm not sure if I shared my code already, but I'm happy to do so if it would help with the reading-back issue. I doubt it though because I don't think I read anything back except for the prescaler value.

Proxy wrote:
the chip itself is hidden under the pull up resistors (which are for the I2C interface and i'm confused why gfoot's design is missing those)

I think I just forgot about them - luckily it seemed to work fine without, but they should be included, yes.


If you have the internal pull-up resistors on the ATmega enabled (which I think the arduino library does by default) then you won't need external pull-ups for very short bus lengths - but the internal pull-ups are only about 10K when you really ought to be using closer to 3K3 for a 5V system.

-Gordon

_________________
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 6 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: