An Improved MENSCH™ Microcomputer

For discussing the 65xx hardware itself or electronics projects.
barnacle
Posts: 1831
Joined: 19 Jan 2004
Location: Potsdam, DE
Contact:

Re: An Improved MENSCH™ Microcomputer

Post by barnacle »

Another wild five in the morning can't sleep thought: I don't suppose it's possible that your PCB has swapped the chip connections for the TOD and system clocks?

Neil
Martin_H
Posts: 837
Joined: 08 Jan 2014

Re: An Improved MENSCH™ Microcomputer

Post by Martin_H »

barnacle wrote:
Another wild five in the morning can't sleep thought: I don't suppose it's possible that your PCB has swapped the chip connections for the TOD and system clocks?

Neil
I don't think so. I used my DMM to ensure there were no shorted pins. Next, I tested each IC pin connection, its destination on the PCB, verified the function from the data sheet, and my schematic. It all looked correct. Thanks for the suggestion though.

Right now, it oscillates at the same frequency without a crystal on the PCB. My semi-educated guess is that FCLKOB is trying to drive a crystal oscillator, and the resistors and capacitors are acting as an RC resonant circuit. The fact that it's the same frequency as before implies the crystal was dead all along. The same crystal doesn't work on another PCB (that a professional designed) seems further evidence as well. Late yesterday I reinstalled the 32.768khz crystal and that oscillator is working as before. This indicates I am not burning the crystals by soldering or removing them.

I have a few ideas how to proceed. I will order a new crystal and can oscillator of the same frequency. I will build the crystal testing circuit and test the crystal before installation. I may also order enough parts to populate a second PCB with only the power, w65c265, and decoupling capacitor conponents. If there's still an oscillation on FCLKOB then there's definitely an onboard oscillator the IC uses if no external clock is present.

This will have to wait until after Thanksgiving at my sister's. Yesterday and today, I was making thank you gifts on my lathe for my sister and her husband. Attached is a picture of the olive wood pen I turned for her.
Attachments
PXL_20251121_221904597.jpg
Martin_H
Posts: 837
Joined: 08 Jan 2014

Re: An Improved MENSCH™ Microcomputer

Post by Martin_H »

I constructed a test circuit for the crystal and confirmed that it is working. It oscillated at frequency that looks like approximate 3.6 MHz on my analog scope.

This raises the question as to why it does not work on the PCB with w65c265. I'm not sure how to debug that.

I may try driving FCLK pin from the working oscillator to see what happens.
Martin_H
Posts: 837
Joined: 08 Jan 2014

Re: An Improved MENSCH™ Microcomputer

Post by Martin_H »

Good news!

I connected the external clock output to FCLK, put a scope probe on PHI2, and powered on. PHI2 was running at the external clock rate according to my scope. I started TeraTerm at 9600 baud, attached a USB dongle to the FTDI connector, and hit reset. The WDC monitor output was displayed in TeraTerm. Woot woot!

So, the base system works with a kludge external clock. Now to make a permanent fix before moving on. Some options:

1. Buy a can oscillator and use three wires to connect it. This should be easy as pads to ground and FCLK are nearby. Only +5V requires a short lead to the 65c22 socket. The three leads should secure the can oscillator well enough for hobby usage.

2. Debug the crystal oscillator circuit. FCLK as an input works, and FCLKOB can drive an oscillator. I also had a working crystal. So, the problem seems to be the combination of the two resistors and two loading capacitors. Possibly with the geometry and lengths of PCB traces?

I again compared my schematic to the W65c265QBX datasheet, and it matches. So, the problem with option 2 is I don't have a wide selection of SMD resistors and capacitors to experiment with. I also don't know what values to use instead of the values from the WDC datasheet.
Attachments
Clock circuit.png
barnacle
Posts: 1831
Joined: 19 Jan 2004
Location: Potsdam, DE
Contact:

Re: An Improved MENSCH™ Microcomputer

Post by barnacle »

Excellent news. The problem is that as you say there's not a lot to be going on with.

Though I might suggest that the high speed capacitors (27pF, 47pF) are higher than I would expect; perhaps something on the order of 11-15pF? You might increase R3 but it's dependent on the internal gates.

Neil
User avatar
GARTHWILSON
Forum Moderator
Posts: 8773
Joined: 30 Aug 2002
Location: Southern California
Contact:

Re: An Improved MENSCH™ Microcomputer

Post by GARTHWILSON »

You might want to compare the values to what's on p.58 of the W65C265S data sheet at http://6502.org/documents/datasheets/wd ... 3_2010.pdf .  They're quite different.
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?
Martin_H
Posts: 837
Joined: 08 Jan 2014

Re: An Improved MENSCH™ Microcomputer

Post by Martin_H »

GARTHWILSON wrote:
You might want to compare the values to what's on p.58 of the W65C265S data sheet at http://6502.org/documents/datasheets/wd ... 3_2010.pdf .  They're quite different.
Yes, I've seen that. There are two major differences from the w65c265qbx schematic.

* The loading capacitor values are the same, but they're swapped between legs of the crystal. Does this make a difference?

* The resistor values are 100 ohm versus 1.5K ohm, and 800K ohm versus 1M ohm. However, the crystal frequency is different.

I would imagine the 100 ohm resistance would provide much more current to the oscillator.

I may buy components of these values and a few others and give them a try.
Martin_H
Posts: 837
Joined: 08 Jan 2014

Re: An Improved MENSCH™ Microcomputer

Post by Martin_H »

Good news, minor weirdness and annoyances, and next steps.

Good news first.
* My Mouser order arrived yesterday.

* I built a 74HC04 crystal tester on perf board, hooked it up to my scope, and it displayed a square wave at the expected frequency. So, I will keep the tester among my diagnostic tools.

* I replaced the PCB resistors with the values from the data sheet (e.g. 100 ohm and 800K ohm) and installed the crystal. I hooked it up to the scope and the PHI2 wave form looked good. This raises interesting questions about why the 65c265QBX schematic and the W65c265 data sheet don't agree.

* I connected the board to TeraTerm and it displayed the WDC monitor.

Minor weirdness and annoyances:
* When I switch between windows TeraTerm and the board get out of sync and garbage gets displayed. It takes a reset of TeraTerm or the board to set things right.

* There's occasional reset weirdness with a quick press and the board doesn't seem to be working. But pushing and holding the reset button results in a clean reset.

* I purchased a bunch of SMD capacitors at different frequencies and a 3.6864 TTL can oscillator as an insurance policy. Now I don't need them.

Next steps:
* Install the RAM and see if I can address it via the monitor.

* Install the EEPROM and see if the contents are visible.

* Write some programs to see if the system is stable.

* Install the 65c22 and blink some LED's.

* Get a 16 bit Forth kernel on this board.


Overall, this project is already a success. I learned a ton about PCB design, became more comfortable with SMD components and soldering. With the Forum's help I was able to debug and fix a thorny problem. I also got better using my scope.
User avatar
Dr Jefyll
Posts: 3525
Joined: 11 Dec 2009
Location: Ontario, Canada
Contact:

Re: An Improved MENSCH™ Microcomputer

Post by Dr Jefyll »

Martin_H wrote:
I learned a ton about PCB design, became more comfortable with SMD components and soldering. With the Forum's help I was able to debug and fix a thorny problem. I also got better using my scope.
And you triumphed over your oscillatophobia*! :wink: Nice to see your persistence pay off!
Martin_H wrote:
* 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.
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html
barnacle
Posts: 1831
Joined: 19 Jan 2004
Location: Potsdam, DE
Contact:

Re: An Improved MENSCH™ Microcomputer

Post by barnacle »

Congratulations!

Neil
Martin_H
Posts: 837
Joined: 08 Jan 2014

Re: An Improved MENSCH™ Microcomputer

Post by Martin_H »

Current progress.

I reworked the SMD CSB LEDs to be correctly biased. I installed the sockets for the RAM, the 65c22, and put the RAM in its socket. No other chips are installed.

Good news:
* Upon power on the chip select LED's light up indicating that the monitor ROM is probing the external address bus.
* Using CSB3 I was able to examine and deposit values into bank 00 RAM.
* Using CSB5 I was able to examine and deposit values into bank 01 RAM but not bank 00. I thought it would do both but Note 2* in the data sheet is confusing.

Bad News:
* The stability weirdness is noticeably worse. It can take several attempts to get a clean reset and I'm not sure why.

Hypothesis: CSB4 is on indicating it is trying to access an external EEPROM. I'm wondering if the lack of an EEPROM driving the data bus is resulting in junk being read and halting the CPU.

Weird News:
* The operation of the chip select LEDs is mysterious. Sometimes csb3 or csb4 will stay on for a prolonged period. Other times they blink and turn off.
* The board to TeraTerm connection is slightly haunted. When I tab away and tab back it will sometimes display gibberish and require a reset. I suspect the USB to serial convertor and wish I had a real serial port.

* Note 2. When on-chip ROM, CS3B and/or CS4B are enabled, then CS5B decode is reduced by the addresses used by same. CS0B and CS1B address space never appears in CS2B, CS4B or CS5B decoded space.
Martin_H
Posts: 837
Joined: 08 Jan 2014

Re: An Improved MENSCH™ Microcomputer

Post by Martin_H »

I understand some of my instability/weirdness issues and have fixes for some of them.

* Selecting auto for TeraTerm's new line setting fixed some of TeraTerm's weirdness.

* The power led is dimly lit when the USB adapter is connected but no power is applied to the 5v rail. I think there's leakage current from either the data or reset lines via the microprocessor. It seems harmless though.

* The reset instability has nothing to do with the lack of an EEPROM. In fact, it was made worse by adding one.

I reread the W65C265SXB schematic and noticed a 10uf cap across the USB power rails. When I run my board off USB power C10 100uf is not across the power rails. I think this results in stability issues which worsens as more chips are added. When I run the board off battery power stability noticeably improves when using the CPU and a RAM chip. If I revise this PCB, I will move C10 after J11 which should fix this.

However, putting the EEPROM on the board worsens stability issues. It's like pulling teeth to get a clean reset. Adding the 65c22 would likely make things even worse, but I plan to test this.

I'm not sure what to do about this. I have decoupling capacitors across all IC's. I also gave each IC its own power and ground connection. Should I add more decoupling caps?
barnacle
Posts: 1831
Joined: 19 Jan 2004
Location: Potsdam, DE
Contact:

Re: An Improved MENSCH™ Microcomputer

Post by barnacle »

Martin_H wrote:
* The power led is dimly lit when the USB adapter is connected but no power is applied to the 5v rail. I think there's leakage current from either the data or reset lines via the microprocessor. It seems harmless though.
Look into this (and by chance my ancient memory in another thread). It looks suspiciously as if the normally-high-when-idle Tx output from the USB adaptor is powering your circuit through the protection diodes on the Rx input (on the processor, I assume). It's almost certainly not doing a very good job of it, but it can really confuse things like reset circuits.

Plug in the USB, but not the power, and check Vcc... around 4.4v, I suspect. Depending how much load other chips apply, and the abilities of the USB port, it could be lower. (The power is going through a PN junction in the protection diode, to the Vcc of the chip that's receiving it).

You might test by applying power before USB (and the other way around) and seeing which is stable. That might be an issue if you're expecting/requiring serial port operation as part of the boot up sequence, but you may be able to get away with a mechanical reset switch after everything's connected.

Neil
Martin_H
Posts: 837
Joined: 08 Jan 2014

Re: An Improved MENSCH™ Microcomputer

Post by Martin_H »

barnacle wrote:
Plug in the USB, but not the power, and check Vcc... around 4.4v, I suspect. Depending how much load other chips apply, and the abilities of the USB port, it could be lower. (The power is going through a PN junction in the protection diode, to the Vcc of the chip that's receiving it).

You might test by applying power before USB (and the other way around) and seeing which is stable. That might be an issue if you're expecting/requiring serial port operation as part of the boot up sequence, but you may be able to get away with a mechanical reset switch after everything's connected.
Neil, thanks for the suggestions. I did the following set of tests:

Test 1: I plugged in USB without battery power and checked the 5v rail. It had 2.7 volts on it, and it didn't matter if the EEPROM was present or not. I think this confirms power going through the protection diode.

Test 2: I plugged in battery but not USB, hit reset, and then plugged in USB. Most of the time it was not a clean reset. Moreover, hitting reset while USB was plugged in would sometimes yield a clean reset.

Test 3: After getting a clean reset and working system. I let it run for twenty minutes and exercised various monitor functions. It was stable the entire time. So, I hit reset and it failed to come out of reset. Hitting reset multiple times eventually resulted in a clean reset with previous memory contents intact.

Test 4: Since the 65c22 isn't part of chip select reset processing I installed the 65c22. The good news is it didn't make the problem worse.

Test 5: I did in all in test with all chips on the board with only USB connected. The 5v rail had 2.68 volts. I connected battery power and kept hitting reset. Eventually i got a clean reset with all chips installed. When it wasn't a clean reset the various chip select LEDs were on indicating the CPU was using the internal ROM to do something.

Test 6: I used the monitor in EEPROM write protect mode to try and deposit values into the EEPROM and its contents were unchanged. I put the EEPROM write jumper in the write enable and used the monitor to deposit values which I confirmed by reading. This is a big win as it proves the system can update its own EEPROM.

In spite of these frustrations, I feel like things are almost working. After a clean reset the system is perfectly usable.

I'm using the DS1813 eco reset with a 3k pullup on the reset line. So, I'm not sure what the problem is. I will look at the various WDC schematics to see if I'm missing something.

Update: I read through the w65c265sxb and w65c265qxb schematics again. Both use the same reset circuit which I have added as an image. The w65c265sxb has 270-ohm current limiting resistors on the serial port's rxd and dsr lines, while the w65c265qxb has no resistors and is identical to my schematic. Both are powered by the USB port, so they never have the no power scenario my board has. Looking at their reset schematic the 1uf cap controls how long the RESB line is held low. I'm not sure how it compares to the DS1813.
Attachments
reset.png
reset.png (8.43 KiB) Viewed 437 times
Last edited by Martin_H on Mon Dec 29, 2025 9:09 pm, edited 1 time in total.
barnacle
Posts: 1831
Joined: 19 Jan 2004
Location: Potsdam, DE
Contact:

Re: An Improved MENSCH™ Microcomputer

Post by barnacle »

You may have to bodge something to isolate the Rx input... perhaps as simple as a schottky diode and a resistor or two?

That 2.5v floating around is definitely going to mess with your reset circuit, but I would expect it to be fine once it's powered up and reset - is there a difference between powered but no usb and powered _with_ usb (at Vcc)?

Neil

(I tend to power from the USB line, using an FTDI cable with a VCC output. Warning: those cables come in 3.3 and 5v versions, but that refers to the signal levels; the Vcc is 5v from the USB circuitry in both cases).
Post Reply