Page 1 of 2

What does it take to achieve a phi2 frequency of 1MHz?

Posted: Wed Jul 16, 2025 7:31 pm
by olof-a
My second/latest 65C02 computer, constructed on stripboard around February this year, was built to run at 1Mhz. I didn't take bypass capacitors particularly seriously at the time and had even less knowledge about electrical performance than I do now- I thought that it being a soldered design would be enough to reach the 1MHz goal.
So far, it has ran at a maximum of 250KHz, through a 4-bit counter dividing a 1MHz can oscillator. The jump from 250KHz to 500KHz is too much, and I get no activity on either the 65C22 GPIO, or the character LCD (interfaced according to this: http://www.6502.org/mini-projects/optrexlcd/lcd.htm)

I have attached an image of this computer which I write of, and please, excuse the poor lighting; I'm no photographer.
I include the image mainly as a point of reference (are the bus lines too long? Improper power wiring?), although I would also appreciate feedback on how I could possibly get it running at atleast 500KHz.
Note the "bypass" capacitors at the bottom of the board, closer to the VSS pins than to VCC. I revisited the board briefly last week, adding extra ground wires between the RAM, ROM, and 65C02. I also soldered 0.1µF 50V X7R capacitors on the bottom of the board. I kept the lead going to the VCC pin as short as possible, but had only 3 of them with long enough leads. I gave these to the RAM, ROM, and 65C02.
The extra ground wire to the 65C02 had to be cut when I pulled the CPU out of it's socket, and tried my only other 65C02. Both fail to run at 500KHz.

Re: What does it take to achieve a phi2 frequency of 1MHz?

Posted: Wed Jul 16, 2025 8:55 pm
by drogon
I can't tell you what it takes other than to "just do it".

I had a 16Mhz 65C02 running on stripboard at 16Mhz before I went to a PCB.

Some photos and details here:

https://projects.drogon.net/ruby-6502-on-stripboard/

So don't give up - even though I'd suggest that board is a bit wide, 1Mhz ought to be trivially achievable. Check supply voltages, connections and so on.

-Gordon

Re: What does it take to achieve a phi2 frequency of 1MHz?

Posted: Wed Jul 16, 2025 8:57 pm
by drogon
Although I've just checked the schematic you linked to - the LCD is directly connected to the bus - it's possible that the LCD simply isn't fast enough. They're really not designed for high speed, so check the timings of the particular one you have. I've always connected them up through a VIA.

-Gordon

Re: What does it take to achieve a phi2 frequency of 1MHz?

Posted: Wed Jul 16, 2025 11:57 pm
by Yuri
The LCD in my SBC is running comfortably at 8MHz directly off the bus, so I would think 1MHz should be quite doable depending on the model.

That being said, it is hard to know what might be the issue just looking at the one side of your strip board and no schematic or component list.

EDIT: I should note, the LCD module I have is a fairly old one (15, 20 years old?) that I got when I purchased an Arduino learning kit from Fry's Electronics way back in the day.

Re: What does it take to achieve a phi2 frequency of 1MHz?

Posted: Thu Jul 17, 2025 1:08 am
by GARTHWILSON
Yuri, what's the brand of LCD driver IC(s) on your LCD?  The data sheet of the common Hitachi HD44780 doesn't guarantee it'll go much over 250kHz.

Re: What does it take to achieve a phi2 frequency of 1MHz?

Posted: Thu Jul 17, 2025 3:42 am
by Yuri
GARTHWILSON wrote:
Yuri, what's the brand of LCD driver IC(s) on your LCD?  The data sheet of the common Hitachi HD44780 doesn't guarantee it'll go much over 250kHz.
Here it is, data sheet does say it isn't good past 270KHz, but it seems to be happy with how I've been using it. *shrug*

Re: What does it take to achieve a phi2 frequency of 1MHz?

Posted: Thu Jul 17, 2025 3:46 am
by Yuri
Here's a shot of it running my memory diag program.

Re: What does it take to achieve a phi2 frequency of 1MHz?

Posted: Thu Jul 17, 2025 4:45 am
by BigDumbDinosaur
olof-a wrote:
My second/latest 65C02 computer, constructed on stripboard around February this year, was built to run at 1Mhz. I didn't take bypass capacitors particularly seriously at the time and had even less knowledge about electrical performance than I do now- I thought that it being a soldered design would be enough to reach the 1MHz goal.
So far, it has ran at a maximum of 250KHz, through a 4-bit counter dividing a 1MHz can oscillator. The jump from 250KHz to 500KHz is too much, and I get no activity on either the 65C22 GPIO, or the character LCD (interfaced according to this: http://www.6502.org/mini-projects/optrexlcd/lcd.htm)...

Strip boards can definitely be run beyond 1 MHz.  That said, a picture alone isn’t all that helpful in diagnosing your issue.  I will say it appears you could benefit from placing parts closer together to reduce wire run lengths.

You need to post a schematic.

Re: What does it take to achieve a phi2 frequency of 1MHz?

Posted: Thu Jul 17, 2025 6:19 am
by BigEd
(Welcome, olof-a!)

(I go with Gordon's idea that the LCD may well be the limiting factor, as noted also by others. There are many threads, and many tactics, about how to accommodate a slower-speed peripheral on a generally faster system. Best is to check the spec, if you can find it.)

Re: What does it take to achieve a phi2 frequency of 1MHz?

Posted: Thu Jul 17, 2025 8:20 am
by JohanFr
How is the divided clock signal looking coming out from the counter? What kind of counter is it? Is it HC/AC/LS etc? Others have told me the clock signal needs to be very clean for the 65C02 to operate. Perhaps a dumb question but have you tried using the 1 MHz clock directly?

I would probably ignore the LCD (or even detach it) and focus on getting a blinking light running from the IO pins of the 65C22, to reduce the number of possible problem sources.

Re: What does it take to achieve a phi2 frequency of 1MHz?

Posted: Thu Jul 17, 2025 8:59 am
by barnacle
As above, Olof: the most suspicious culprit is the display... but perhaps we could see a circuit diagram?

Regarding the strip board - apart from the obvious - signals not connected, short circuits - at 1MHz, you can basically slap stuff together and it will usually work. Decoupling capacitors are essential, and it helps if the wire lengths are minimised, but that's about it, really.

The suggestion of flashing an LED is a good one; it proves your processor, your memory, your VIA (and your LED!). Just don't try and drive an LED directly from an IC pin; use a series resistor to limit the current to 1-3mA.

Neil

Re: What does it take to achieve a phi2 frequency of 1MHz?

Posted: Thu Jul 17, 2025 11:16 am
by olof-a
Quote:
Although I've just checked the schematic you linked to - the LCD is directly connected to the bus - it's possible that the LCD simply isn't fast enough. They're really not designed for high speed, so check the timings of the particular one you have. I've always connected them up through a VIA.
I started off pretty confident in the LCD- I have a routine for checking the busy-flag of the LCD and waiting if it has not yet been reset. However, I just found a slight error in the address decoding for the LCD. It does output characters just fine but I can't be certain that the status register is being read properly.
I'll give the blinkenlights a go as Neil suggested, my VIA is confirmed to be working. If this still does not work then I will likely give up on this board. It has been a huge pain to work on at this stage.
Quote:
You need to post a schematic.
If only I had one. I mostly made things up as I went along. Though I should note that this is not my first 65C02 computer.
I did draw diagrams for the address decoding, and I can confirm that all address decode logic on the board is true to the plans which I drew, except the LCD decode logic, as noted above. I'll recreate my old diagrams in a paint program and have them posted here somewhat soon.

Re: What does it take to achieve a phi2 frequency of 1MHz?

Posted: Thu Jul 17, 2025 11:23 am
by drogon
olof-a wrote:
Quote:
Although I've just checked the schematic you linked to - the LCD is directly connected to the bus - it's possible that the LCD simply isn't fast enough. They're really not designed for high speed, so check the timings of the particular one you have. I've always connected them up through a VIA.
I started off pretty confident in the LCD- I have a routine for checking the busy-flag of the LCD and waiting if it has not yet been reset. However, I just found a slight error in the address decoding for the LCD. It does output characters just fine but I can't be certain that the status register is being read properly.
I'll give the blinkenlights a go as Neil suggested, my VIA is confirmed to be working. If this still does not work then I will likely give up on this board. It has been a huge pain to work on at this stage.
It may not just a matter of polling - the strobe pulse from the bus is potentially too short - at 1Mhz it will be under 500nS and that may be outside the specification of the LCD driver chipset.

I'd not give up. There is a lot you can do to help check stuff - LEDs on the VIA for example, then using the VIA to do some simple timing interrupts - and also write code for it. Then consider using one port of the VIA to drive the LCD. You only need 8 bits - 4 data, one for the RS and E pins. (leaves one spare) Personally I always tie the R/W pin low and never read from the device - just use a timing loop for each operation.

-Gordon

Re: What does it take to achieve a phi2 frequency of 1MHz?

Posted: Thu Jul 17, 2025 12:11 pm
by Dr Jefyll
Welcome, olof-a! :) I hope you'll lend an ear to Gordon's encouragement, and not give up.

Or perhaps you can explain why the board "has been a huge pain to work on." Are you just losing patience with the debugging, or is there something about this project overall which seems to add friction every step of the way?

As for schematics, yes they're important, but don't feel obliged to recreate them in a paint program before sharing them with us. Honestly, nobody will mind if instead you just post a photo of your hand-drawn diagrams.

That said, it'll obviously be best if, before sharing the hand-drawn diagrams, you review and amend them for clarity! In fact, I wonder if the lack of a clear, complete schematic is *causing* you to feel friction every step of the way!

Speaking for myself, I find that looking at a project's diagram makes it easier to think about what's going on. That's no small advantage! IMO, having a reasonably good diagram is well worth the effort. :!:

-- Jeff

Re: What does it take to achieve a phi2 frequency of 1MHz?

Posted: Thu Jul 17, 2025 2:45 pm
by BigDumbDinosaur
Dr Jefyll wrote:
Speaking for myself, I find that looking at a project's diagram makes it easier to think about what's going on.

Ditto on that.  It’s the old “a picture is worth a thousand words” thing.  Except for wiring up very simple things, e.g., a light bulb, battery and switch, I need some sort of schematic in front of me...a sketch on a napkin, if nothing else.  :D