Page 11 of 15

Re: An Improved MENSCH™ Microcomputer

Posted: Tue Nov 11, 2025 6:45 pm
by Martin_H
Dr Jefyll wrote:
The value of the loading caps is very small, on the order of 10pF, is that right? I'm not sure a DMM can reliably read a value that small (partly because of the capacitance of your hands gripping the probes, which would tend to increase the value "seen" by the DMM). Or perhaps that's not a legitimate concern. But -- just a suggestion -- if you choose instead to simply buy and install new caps then you can be certain things are right.

Speaking of ascertaining the correct parts, are your crystals the right type, I mean wrt series-resonant vs. parallel-resonant?
I measured the exact values of the resistors, but you are correct my DMM couldn't measure the exact value of the loading capacitors. They're 47 pf and 27 pf and my measurements were within an order of magnitude, so I know I didn't accidentally install decoupling capacitors. I have extras of the loading capacitors, and I can reinstall them as a last resort.

The schematic is parallel resonant, and I used the Vishay XT9S20ANA3M6864 crystal. I checked the data sheet and 20 after the 9S means its standard loading capacitance. If it had SE it would be series. So, I have the correct type of crystal.
plasmo wrote:
A little known feature of TeraTerm is you can specify arbitrary baud number by typing whatever value instead of picking the default values in the drop down menu. The actual value is limited by granularity of prescaler, but at lower baud you have pretty good granularity. So take the best scope measurements you can and try a ranges of guesses at 5% increments.
Bill
Thanks.

Some ideas I plan to try:

I have a 1 MHz TTL oscillator which I can compare the clock waveform against. It should be 3.6 to 1.

Find my w65c265qbx and look at its serial output to see what it should look like.

Swap the Tx and Rx lines to see if I misread the datasheet and routed the traces wrong.

Fiddle with TeraTerm's baud rate if I can figure out what the exact value might be.

Re: An Improved MENSCH™ Microcomputer

Posted: Tue Nov 11, 2025 8:31 pm
by Martin_H
I compared the output of my 1 MHz TTL oscillator to the clock output and it's running much slower than 1 MHz. I am not sure why it's wrong, but that's the biggest problem. Would loading capacitor values too high slow the clock frequency?

I verified connectivity between R3, R4, C2, and C4 with the crystal leads, ground, and the IC pins.

The crystal case markings M03686 which I would assume is the frequency with a leading zero and no decimal point.

The other problem may or may not be a problem. I am using TXD3, and RXD3 for my FTDI header and verified this with my DMM. This matches the W65c265sxb and W65c265qbx schematics. But I tested continuity on my w65c265qbx and it looks like it is using TXD0, and RXD0. Can the monitor choose which UART to use? Also, the mismatch between w65c265qbx schematic and my board is worrying since I used the schematic to guide my design.

Re: An Improved MENSCH™ Microcomputer

Posted: Thu Nov 20, 2025 6:04 pm
by Martin_H
I have time to work on this again. I validated my pin connections to the oscillator components against the data sheet and they look good. So, this isn't a PCB wiring error.

I did some measurements at the IC pins and confirmed the following:

FCLKOB (pin 33) has a square wave with a relatively large voltage amplitude. I assume a five-volt swing since that's Vcc and that this pin is an output driven by the IC.
FCLK (pin 34) has a saw tooth wave with a much smaller amplitude. I assume this is the oscillator output feeding back into the IC, and the smaller amplitude is due to the various resistors in the oscillator circuit. This is then used to drive the actual system clock.

The CLKOB and CLK are similar, except the waveform on the CLK looks more like a sine wave.

Does all of this sound reasonable?

Re: An Improved MENSCH™ Microcomputer

Posted: Thu Nov 20, 2025 8:07 pm
by barnacle
Incorrect loading capacitors on a crystal will change its frequency by parts per million for pF errors. Too much and it just won't run. I've never seen a capacitor operate at a quarter or less of its design frequency (though I suppose that with overtone crystals operating at some harmonic of their base frequency it might happen...)

Neil

Re: An Improved MENSCH™ Microcomputer

Posted: Thu Nov 20, 2025 9:35 pm
by Martin_H
Thanks. It's definitely doing something because I put a scope probe on the XBUS header pins to read the address and data lines. They're switching between high a low signal levels indicating its fetching data from its internal RAM and ROM. The voltage signal levels match the FCLKOB.

I found the manual for my Tektronix 2213 online and I am going to learn how to calibrate it.

Re: An Improved MENSCH™ Microcomputer

Posted: Sat Nov 22, 2025 4:58 pm
by Martin_H
I think I know what's going on and if I am right, I am POed at Mouser.

Short story.

I believe Mouser shipped me a 0.0360 Mhz crystal, even though I ordered a Vishay 3.6864MHz crystal. I am certain I ordered the correct value as I have checked the invoice several times. Also, the markings on top of the crystal are M03686 which aligns with my evidence below.

Long story.

After being unable to connect to the w65c265 over its serial port, I validated every possible connection and part value against the schematic and found nothing shorted or incorrect.

I aligned and calibrated my scope using the instructions and a brand-new signal generator. I then measured the w65c265's FCLKOB (pin 33) oscillator frequency (using the signal generator as a reference). The matching value on the signal generator was 0.0360 Mhz. The M03686 markings on top of the crystal suddenly make a lot more sense now.

To double check my methodology I measured the w65c265's CLKOB oscillator and got 32.6 Khz which was nearly the expected value.

So good news/bad news.

The good news is that I was able to get the oscillator circuit working. I was also able to debug problems with it using my boat anchor Tektroinx scope.

The bad news is that I wasted hours on what is likely Mouser's mistake.

Re: An Improved MENSCH™ Microcomputer

Posted: Sat Nov 22, 2025 9:13 pm
by John West
Martin_H wrote:
I believe Mouser shipped me a 0.0360 Mhz crystal
That sounds very unlikely to me. Vishay make crystals at exactly 32.768KHz, and they make them at a range of frequencies from 3.579545MHz upwards. They do not, as far as I can tell, offer a 36KHz crystal. That's the sort of frequency you'd have to get custom made, and you would pay for it.

3.6864MHz is a standard value. Farnell have a photo of one (XT9M20ANA3M6864, which is surface mount but otherwise the same) https://uk.farnell.com/vishay/xt9m20ana ... dp/4667153 with the marking M0368GC5 / 520-030-R. It seems far more likely that you have what you ordered, and your problem is elsewhere.

Re: An Improved MENSCH™ Microcomputer

Posted: Sat Nov 22, 2025 9:23 pm
by Martin_H
John West wrote:
That sounds very unlikely to me...
3.6864MHz is a standard value. Farnell have a photo of one (XT9M20ANA3M6864, which is surface mount but otherwise the same) https://uk.farnell.com/vishay/xt9m20ana ... dp/4667153 with the marking M0368GC5 / 520-030-R. It seems far more likely that you have what you ordered, and your problem is elsewhere.
Okay, thanks for the reply. I am disappointed because I thought I understood it. If this is the case, I have no idea why it would be oscillating at such a weird frequency.

I used dual trace mode to display both oscillator outputs at the same time. They're not in phase and one is at a slightly lower frequency. So, I am not accidentally measuring the same wave form, nor are they shorted together somehow.

In the data sheet they showed the loading capacitors for both oscillators connected together via a ground plane. Mine are connected with a PCB trace to the outer ground ring. Could this couple them together somehow?

The only thing I can think of doing next is slightly destructive. I could remove the 32.768 KHz clock crystal and see what happens to the FCLKOB frequency. I'm not keen on doing this because solder residue will likely make it difficult to install a new crystal.

Re: An Improved MENSCH™ Microcomputer

Posted: Sun Nov 23, 2025 8:37 am
by barnacle
Martin, your scope should have controls to select 'alt' or 'chop'. To confirm synchronous signals, you need the 'chop' option; in 'alt' each input is triggered and scanned alternately, so they can move sideways.

One of the delights of analogue scopes; digital scopes sample inputs synchronously so chop happens automatically. On the other hand, you _won't_ be seeing alias effects which can occur on digital scopes when the sample rate and the signal rate interfere with each other.

Neil

Re: An Improved MENSCH™ Microcomputer

Posted: Sun Nov 23, 2025 2:36 pm
by Martin_H
Neil, thanks for the suggestion. I switched from alt to chop and the two wave forms are offset from each other, but not quite in quadrature. Counting the peak size on the graticule for both wave forms yielded the same number of divisions.

That opens the possibility that the 32.768 khz crystal was somehow controlling both oscillators. So, I desoldered the 32.768 khz crystal and repeated the measurement. The FCLKOB oscillator is at 34.7 khz* while there's a constant voltage of the CLKOB pin.

This is weird but indicates that FCLKOB is oscillating at a frequency that it can't with the crystal installed. Some microcontrollers contain an onboard oscillator they use when there's no external crystal, but I can't find anything in the data sheet about that for the w65c265.

Unfortunately, I now have solder clogging the 32.768 khz crystal holes that I need to deal with. I'm hoping flux and solder wick fixes it. Update: de soldering wick and flux fixed it.

* I used the signal generator as a reference for this frequency.

Re: An Improved MENSCH™ Microcomputer

Posted: Sun Nov 23, 2025 11:01 pm
by Martin_H
Tonight, I'm redo the loading capacitors on the board to see if that fixes things. To make sure I used the right values I re-read the w65c265qbx schematic, the w65265sxb schematic, and the datasheet to look at the oscillator components. My schematic and PCB layout agrees with the w65c265qbx and w65265sxb schematics. So far so good.

The data sheet schematic is slightly different. It uses a 4 Mhz oscillator with lower resistor values, and the 27 pf and 47 pf capacitors are swapped between the oscillator pins. I'm assuming the different resistance values are related to the high frequency.

Question: Does swapping the 27 pf and 47 pf loading capacitors make a difference? Are oscillators symmetric? Is this a capacitor in parallel adding their values situation?

As an aside. The reason I've been sweating the oscillators is I did some RF projects a decade ago building several direct conversion receivers for various ham bands. Making the VFO's for them was not easy and was the hardest part of the project. So, oscillators and I have a history.

Update: I replaced the loading capacitors, and it didn't change the frequency.

Re: An Improved MENSCH™ Microcomputer

Posted: Mon Nov 24, 2025 6:58 pm
by Martin_H
Interesting data points.

I removed the 3.6864 Mhz crystal and measured the FCLKOB output. It is still oscillating at the same frequency. So, the w65c265 must have an onboard oscillator that is supposed to drive the crystal oscillator and that was what I was measuring on FCLKOB all along.

I soldered the crystal into my Apatco NCS-EB50 single board computer and put a scope probe on PHI2. When I selected the can oscillator, I saw activity on PHI2, and when I switched to the crystal via the jumper there was no activity. The Apacto board was developed jointly with WDC for use with the 65c02 and 65c816 and can switch between a can oscillator or crystal based upon a jumper. It follows a WDC reference design and was used in education at one point.

The bottom line is I still think it might be the crystal.

What I may do is buy a 3.6864 can oscillator and use it to drive the W65c265 via the FCLK pin. I may also buy another crystal.

Re: An Improved MENSCH™ Microcomputer

Posted: Mon Nov 24, 2025 8:45 pm
by barnacle
I have found this circuit extremely reliable for crystal oscillators: if you have a spare bit of breadboard around, it's quick to knock up to test a crystal.
Screenshot from 2025-11-24 21-43-52.png
Neil

(apologies to BDD for the colour; screen clip from Kicad)

Re: An Improved MENSCH™ Microcomputer

Posted: Mon Nov 24, 2025 10:54 pm
by Martin_H
Thanks Neil. That looks straightforward, so I will put that together on a breadboard soon. It may help with my oscillatophobia* and testing crystals in general.

The two-invertor design driving the crystal looks similar to the Apatco schematic and I attached that segment of it.

* The fear of oscillators, or oscillatophobia, is associated with oscillator failure. Learn what causes a fear of oscillators, the symptoms, and treatments that can help.

Re: An Improved MENSCH™ Microcomputer

Posted: Tue Nov 25, 2025 12:48 am
by gfoot
That last one is similar to that in the BBC Micro:
bbcimicrooscillator.png
I've always used this circuit though - similar to barnacle's but with one resistor missing:
Screenshot 2025-11-25 004107.png
I don't know whether this would work better or worse, but thought I'd share in case you want to try it too.