Page 2 of 2

Re: Hello. Is this a 6502?

Posted: Thu Nov 27, 2014 6:02 am
by nyef
Isn't that oscillator circuit supposed to have a couple of capacitors from each side of the crystal to ground? I'm not seeing any...

Re: Hello. Is this a 6502?

Posted: Thu Nov 27, 2014 6:13 am
by barrym95838
GARTHWILSON wrote:
It does sound primarily like a clock problem. The reset circuit, not being debounced, is not adequate, but is probably not what's keeping it from toggling the address lines. The 7805 takes about 1.5V minimum, so if you're starting with 6V from the batteries if they're pretty new, you'll only get 4.5V out of the 7805, which is below spec. for the processor but probably not low enough to keep address lines from toggling.
Many years ago I made a proto-board 65802 project, and the only problem that I had with it was an initial "zombie" condition that I finally traced to improper RESET hysteresis. Playing around with a simple RC combo finally did the trick, and I was off and running!

Here's a post with a picture and brief description.

Mike

Re: Hello. Is this a 6502?

Posted: Thu Nov 27, 2014 6:20 am
by kasrym
nyef wrote:
Isn't that oscillator circuit supposed to have a couple of capacitors from each side of the crystal to ground? I'm not seeing any...
That's what I thought, but every schematic I've seen doesn't have them or specify values.

Re: Hello. Is this a 6502?

Posted: Thu Nov 27, 2014 6:26 am
by kasrym
barrym95838 wrote:
GARTHWILSON wrote:
It does sound primarily like a clock problem. The reset circuit, not being debounced, is not adequate, but is probably not what's keeping it from toggling the address lines. The 7805 takes about 1.5V minimum, so if you're starting with 6V from the batteries if they're pretty new, you'll only get 4.5V out of the 7805, which is below spec. for the processor but probably not low enough to keep address lines from toggling.
Many years ago I made a proto-board 65802 project, and the only problem that I had with it was an initial "zombie" condition that I finally traced to improper RESET hysteresis. Playing around with a simple RC combo finally did the trick, and I was off and running!

Here's a post with a picture and brief description.

Mike
Thanks Mike. One of the fun things about accelerated AA courses are the loss of things. I vaguely remember anything about hysteria.

Re: Hello. Is this a 6502?

Posted: Thu Nov 27, 2014 6:47 am
by barrym95838
kasrym wrote:
Thanks Mike. One of the fun things about accelerated AA courses are the loss of things. I vaguely remember anything about hysteria.
I wasn't exactly hysterical about it, but I remember being up against a deadline, and my blood pressure had reached an unhealthy level because of it! :shock:

Put in "layman's" terms, I found that my /RES was floating to logic high too quickly after power-up to allow the '802 and clock to settle properly, and my solution was to tie /RES to ground through a capacitor, and to +5v through a resistor. I apologize for not remembering the actual working values of those two components, but the idea was to delay the rise of /RES just long enough to do the trick. There are more efficient ways of doing it, I'm sure, but my little kludge got me through to a passing grade, and that was my immediate goal.

Best of luck,

Mike

Re: Hello. Is this a 6502?

Posted: Thu Nov 27, 2014 6:52 am
by GARTHWILSON
I believe the '802 has a Schmitt-trigger reset input though, while the old NMOS 6502 does not, and just putting a capacitor on that line to let it up more slowly can cause problems on the NMOS '02 as the voltage slowly makes its way through no-man's land, possibly with noise on it from the clock and other lines that might start toggling. That's why I advocate a clean reset signal.

Re: Hello. Is this a 6502?

Posted: Thu Nov 27, 2014 6:56 am
by kasrym
barrym95838 wrote:
kasrym wrote:
Thanks Mike. One of the fun things about accelerated AA courses are the loss of things. I vaguely remember anything about hysteria.
I wasn't exactly hysterical about it, but I remember being up against a deadline, and my blood pressure had reached an unhealthy level because of it! :shock:

Put in "layman's" terms, I found that my /RES was floating to logic high too quickly after power-up to allow the '802 and clock to settle properly, and my solution was to tie /RES to ground through a capacitor, and to +5v through a resistor. I apologize for not remembering the actual working values of those two components, but the idea was to delay the rise of /RES just long enough to do the trick. There are more efficient ways of doing it, I'm sure, but my little kludge got me through to a passing grade, and that was my immediate goal.

Best of luck,

Mike
Ah. Yeah, I have /RES tied to ground via a 10uF cap, and to VCC with a 2.7k. I'm going to try to verify the clock before I go forward. I just hope I didn't fry my 6502. What my current worry is. Lol

Re: Hello. Is this a 6502?

Posted: Thu Nov 27, 2014 7:09 am
by BigDumbDinosaur
I didn't see any mention of the MPU's RDY input. It should be pulled up to Vcc with a resistor (3.3K recommended).

Also, Garth noted the problems of generating a proper reset pulse to the NMOS 6502. A good solution is the Maxim DS1813 reset generator, a handy little gadget that will hold reset down for ~150ms after Vcc stabilizes above 4 volts. The DS1813 also responds to a push button on the reset line, so it is both automatic and manual in nature.

Other reset generation methods have included using a 555 timer (the Commodore 64 had one for that purpose) or half of an LM393 comparator rigged up to act as a timer (I used to do that years ago). The DS1813 is the simplest solution that I know.

Lastly, the NMOS 6502 has relatively weak fan-out. It doesn't take too much to load it to where you can no longer get adequate voltage on its outputs when they are supposed to be a logic one. This is one of several reasons why we recommend starting out with the 65C02.

Re: Hello. Is this a 6502?

Posted: Sat Nov 29, 2014 4:39 am
by kasrym
Would adding 2 22pF caps between both pins of the crystal and ground force the clock to oscillate?

Re: Hello. Is this a 6502?

Posted: Sat Nov 29, 2014 4:58 am
by GARTHWILSON
See the 6502 primer's page on clock generation, at http://wilsonminesco.com/6502primer/ClkGen.html . There are a couple of ap. notes linked there also on making oscillators. Using oscillator cans however is less work, more reliable, and takes less board space.

Re: Hello. Is this a 6502?

Posted: Sat Nov 29, 2014 5:10 am
by kasrym
kasrym wrote:
Would adding 2 22pF caps between both pins of the crystal and ground force the clock to oscillate?
I have read both of the pdfs on your primer, and the circuit you have at the top is the one that I am using, I just didn't know if anything is omitted to simplify it. I could do a Colpitts, but I was wanting to try it around the 7404. Just for a learning experience.

Re: Hello. Is this a 6502?

Posted: Sat Nov 29, 2014 5:45 am
by barrym95838
kasrym,

Please take heed of Garth's warning about an inadequate /RST circuit ... the man knows his stuff! Even though it was 27 years ago, I was using a CMOS chip that was apparently much more tolerant of marginal design than your NMOS chip. I would strongly recommend implementing one of Garth's examples, rather than a simple R-C combo.

Mike

Re: Hello. Is this a 6502?

Posted: Sat Nov 29, 2014 5:57 am
by GARTHWILSON
In going from 74LS04 to 7404, I think the resistor from the input (on the left) to ground will need to be about a quarter as much, since the 7404's input current is quadruple that of the 74LS04. There is no reason to use 7400 logic anymore though, unless you have a lot of it and you're in a place or situation that makes it hard to get at least 74LS if not 74HC or other CMOS. The capacitors provide phase shift; but for myself, without being strong in oscillator-related math (which can get rather complex for oscillators if you want them to be dependable across the range of all potential operating conditions), I don't know if maybe the 7404/74LS04's inputs provide a heavy enough load to omit the capacitors. I design mostly analog circuits for a living; but although I've designed various kinds of oscillators that do work, I don't consider myself to be expert enough in that department to fully trust my own crystal oscillator designs for products we will be marketing. For that, I'd rather buy an off-the-shelf one.