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

Building your first 6502-based project? We'll help you get started here.
User avatar
olof-a
Posts: 10
Joined: 21 Jan 2025

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

Post 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.
Attachments
IMG_5724.JPG
User avatar
drogon
Posts: 1671
Joined: 14 Feb 2018
Location: Scotland
Contact:

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

Post 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
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/
User avatar
drogon
Posts: 1671
Joined: 14 Feb 2018
Location: Scotland
Contact:

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

Post 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
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/
User avatar
Yuri
Posts: 371
Joined: 28 Feb 2023
Location: Texas

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

Post 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.
User avatar
GARTHWILSON
Forum Moderator
Posts: 8773
Joined: 30 Aug 2002
Location: Southern California
Contact:

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

Post 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.
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
User avatar
Yuri
Posts: 371
Joined: 28 Feb 2023
Location: Texas

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

Post 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*
Attachments
eone-1602a1.pdf
(367.66 KiB) Downloaded 29 times
User avatar
Yuri
Posts: 371
Joined: 28 Feb 2023
Location: Texas

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

Post by Yuri »

Here's a shot of it running my memory diag program.
Attachments
photo_2025-07-16_22-45-32.jpg
User avatar
BigDumbDinosaur
Posts: 9425
Joined: 28 May 2009
Location: Midwestern USA (JB Pritzker’s dystopia)
Contact:

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

Post 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.
x86?  We ain't got no x86.  We don't NEED no stinking x86!
User avatar
BigEd
Posts: 11463
Joined: 11 Dec 2008
Location: England
Contact:

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

Post 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.)
JohanFr
Posts: 88
Joined: 16 Nov 2011
Contact:

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

Post 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.
barnacle
Posts: 1831
Joined: 19 Jan 2004
Location: Potsdam, DE
Contact:

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

Post 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
User avatar
olof-a
Posts: 10
Joined: 21 Jan 2025

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

Post 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.
User avatar
drogon
Posts: 1671
Joined: 14 Feb 2018
Location: Scotland
Contact:

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

Post 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
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/
User avatar
Dr Jefyll
Posts: 3525
Joined: 11 Dec 2009
Location: Ontario, Canada
Contact:

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

Post 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
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html
User avatar
BigDumbDinosaur
Posts: 9425
Joined: 28 May 2009
Location: Midwestern USA (JB Pritzker’s dystopia)
Contact:

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

Post 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
x86?  We ain't got no x86.  We don't NEED no stinking x86!
Post Reply