7

According to the Western Design Center (WDC) W65C02S datasheet, table 6-2 on p.24, Vih on all inputs is VDD x 0.7 = 3.5 V when running the CPU at 5 V VDD. This is somwhat above the level at which it would be TTL compatible (Vih = 2.0 V as far as I'm aware, with minimum high output level on TTL chips being 2.7 V), and some people have thus built adapter boards to do level matching.¹ This one uses an SN74HCT245 bus transceiver to bring the the levels on the VIC-20 system board data bus lines up to CMOS levels for the W65C02S inputs (though interestingly, he doesn't do the same for the input control and clock signals).

I have heard from others, however, that the W65C02S works fine in a TTL system and that someone may have contacted WDC at some point and gotten clarification from them that their data sheet was not fully correct on this point. (I have also seen a lot of hobby boards that seem to allow mixing of the W65C02S and TTL parts.)

Can anybody point me to some evidence that the W65C02S can run farily reliably with TTL input levels, especially any evidence from WDC themselves? Perhaps under certain design limitations for the rest of the system in which it's running, such as the load placed on the data bus by the rest of the system?


¹ These boards usually make a few other tweaks to deal with some pins on the W65C02S that are slightly different from the original NMOS 6502, but those are not relevant to whether the board and CPU are using TTL or CMOS levels.

7
  • 2
    I can't think of any logic device has a Vih of 4.75 volts when running from a 5 volt supply. Voh maybe, but a Vih of 4.75 would be almost unusable.
    – supercat
    Commented Jun 16, 2022 at 13:25
  • @supercat Indeed, looking through my logic level notes I see that input "min HIGH" for 5V CMOS is 3.5 V (I presumably took this from various sources in the "References" section below that.) So it's looking more and more like the WDC datasheet is not correct on that score, though perhaps it is correct in the "VDDx0.7" spec it also provides. (3.5 V is still above the 2.7 V output "min HIGH" for TTL, though, and I have personally seen TTL systems that were running nearly that low for a high signal.)
    – cjs
    Commented Jun 16, 2022 at 13:39
  • 2
    This question seems to be based on a misreading of that table, taking the first data row and confusing it with the second. Commented Jun 16, 2022 at 13:44
  • @ThomasJager You're right! I've edited the question to use the correct VDD x 0.7 value, though that doesn't change the substance of the question because that is still higher than TTL levels.
    – cjs
    Commented Jun 16, 2022 at 13:50
  • 1
    The TTL VoutH minimum is when sourcing a significant amount of current. Since the CMOS inputs take virtually no current (a few uA) there is in practice never a problem. Commented Jun 16, 2022 at 15:28

5 Answers 5

7

There's a good discussion about this at the 6502.org forum, where somebody was also in contact with WDC and got a reply from Bill Mensch.

Opinions seem to differ a bit but I think this quote from BigDumbDinosaur in that thread is not far from consensus:

So I think the takeaway is we probably have nothing about which to be concerned in interfacing the WDC MPU's to devices that produce TTL outputs, provided the design isn't excessively loading the outputs. If you are at all concerned about it, stick a 74AHCT/VHCT/ACT245 transceiver in there to act as a level converter. Just be aware of the prop delay and its possible effects on your timing.

4
  • Could you perhaps summarise the communications with WDC and the evidence that led them to that takeaway?
    – cjs
    Commented Jun 16, 2022 at 13:52
  • 2
    @cjs: The evidence that would have led them to that takeaway would likely be the fact that historically many devices used the processor in systems that also used TTL logic. If a CMOS device has buffered inputs, the input stage may pass a low-to-high transition within 5ns from when the input reaches 3.5 volts, or 25ns from when it reaches 3.3, or 120ns from when it reaches 3.0, whichever happens first (actual numbers would likely be different, but the concept would still apply). In a typical 6502 system, many inputs will switch well ahead of when they would need to, so speed isn't critical.
    – supercat
    Commented Jun 16, 2022 at 15:07
  • 3
    @supercat That sounds like it's worth expanding into an answer.
    – cjs
    Commented Jun 16, 2022 at 17:55
  • 1
    I read the linked forum discussion. It confirms the datasheet correct - the input voltage threshold does not fall within TTL voltage specs based on testing, so the WDC W65C02S is not TTL compatible.
    – Justme
    Commented Jun 20, 2022 at 23:03
6

Is the W65C02S TTL-compatible?

TLDR: Yes as compatible as various implementations can be.

After all, compatibility means that devices can work within given specs, not that they are the same in all aspects. TTL operates with a nominal value of 0V for low and 5V for high. Everything above or below either value is up to device and implementation.

Any setup that diverges far from these is in itself a fringe case to be checked on a case by case base. A TTL based circuit that delivers a high voltage of for example 3V to any of it's circuits is already at fault, no matter if it's still working or not.


At that point it might be helpful to keep in mind that WDC is not a chip manufacturer. The never owned a fab or shares thereof. They are an IP house, selling designs for others to implement them in silicon, either as single chips, or more common as parts of custom SoC designs.

Over 30+ years the devices sold as WDC65C02 have been manufactured by several different fabs in quite different processes. Each time the design gets adapted to the process used. In turn each implementation features different behaviour over all parameters, including Vih/Vil.

Despite all these changes in manufacturing the data sheet has stayed virtually unchanged. Thus it's safe to assume that these values aren't the real capabilities provided by WDC65C02 sold right now, but over all guarantees independent of implementation.

These are data sheets of an IP house. They do not give the same authoritative answer as data sheets made by manufacturers.


According to the Western Design Center (WDC) W65C02S datasheet, table 6-2 on p.24, Vih on all inputs is 4.75 V when running the CPU at 5 V VDD.

You might want to look again:

enter image description here

Given, the whole data sheet is a bit confusing to say at least, but 4.75 is simply the calculated min of a 5V with 5% tolerance. Essentially a useless information, especially as the CPU can operate at any voltage between 1 and 5 Volt.

Vih is defined in the line below as VDD*0.7 or VDD-0.4V, whichever is lower. In case of a VDD at 5V this will be 3.5V. This is common for CMOS devices operating over a large range of VDD.

[At that time the question became a moving target]

This is somwhat above the level at which it would be TTL compatible (Vih = 2.0 V as far as I'm aware, with minimum high output level on TTL chips being 2.7 V)

That artificial strict definition would make some classic TTL chips non-TTL-compatible. For this it's quite important to keep in mind that compatibility isn't a 1:1 issue, but a continuum. As soon as parameters go into

2.7V is a definition that has creeped in during the 1990s when 3.3V logic became a thing. It's neither true in general or for all TTL-compatible designs in particular. When operating at the fringe of any range is a must, one has to select chip type and series (and manufacturer) quite careful.

A design that relies on detecting as 2.7V as high input is barely a TTL design, as true TTL deliver considerable more than that. If voltage drops that low, there's either usually a design problem. Low input voltages are usually only encountered when combining 5V sinks with less than 5V sources - like interfacing with 3.3V output - thus not TTL at all.

Long story short: Compatibility is not a single number but a multi dimensional issue - that's why Datasheets usually spend way more than a single line on this. WDC's less than great sheets are a reason why there are so many misguided rumours running around the net.

I have heard from others, however, that the W65C02S works fine in a TTL system a

Jup. Have one running in an original Apple II (no plus) - the most definitive TTL pile of them all, works like a charm. Not to mention many other designs made right from the start with TTL and 65C02.

10
  • 1
    0.7 x 5.0 V = 3.5 V. That is well above the min high output of 2.7 V for TTL.
    – cjs
    Commented Jun 16, 2022 at 13:44
  • 1
    And by "run reliably," I meant something better than, "I saw it work once on my particular system."
    – cjs
    Commented Jun 16, 2022 at 13:51
  • 1
    @cjs I see, so, tell me, where is it defined that TTL is 2.7V? Would be interesting, as a classic Totem-Pole has a hard time below 3.5V. Real TTL can be anywhere between 2.0 and 3V Vih. TTL is a quite fuzzy definition. Compatible does not mean the same as. Last, yes, it's one anecdotal reference - out of several dozend I did, including some that have been sold in large numbers. Bottom line: learn the basics (including how to read along a marked line in a datasheet) before trying to debunk people who're doing this since 40+ years.
    – Raffzahn
    Commented Jun 16, 2022 at 14:10
  • 1
    @Raffzahn Learn to use Wikipedia and Google. Here are some sources that define TTL minimum Vih as 2.0 V: en.wikipedia.org/wiki/Logic_level#Logic_voltage_levels allaboutcircuits.com/textbook/digital/chpt-3/… interfacebus.com/voltage_threshold.html . If you have a different option about why a higher Vih should work well on many systems, please feel free say what your level is and support it with references. As for your one anecdotal reference actually being "several dozen," etc., well, you didn't say that in the answer.
    – cjs
    Commented Jun 16, 2022 at 17:51
  • 1
    Regarding your "but you made a mistake too" argument, it doesn't matter. Concentrate on improving your answer, not using "someone else made a mistake too" as a reason to justify you making a poor answer.
    – cjs
    Commented Jun 16, 2022 at 17:52
1

Technically, if this is about the CPU itself being TTL compatible, no it is not compatible, because according to datasheet, it uses standard CMOS level inputs, which are not compatible with TTL level output voltages, and has much weaker output drive ability than a TTL output does.

This means that with a supply voltage VDD of 5.0 volts, CMOS input must be below 0.3×VDD or 1.5V for guaranteed logic low level, and above 0.7×VDD or 3.5V for guaranteed logic high level.

A standard TTL input levels of 74 series logic chips must be below 0.8V for logic low and above 2.0V for logic high level.

Thus to an electronic engineer that is enough to say that it is not compatible with TTL levels, because a valid TTL input level may not be a valid CMOS input level.

A standard TTL output of 74 series logic chips can have logic high output level as low as 2.4V at rated load. Typical logic high output level is also only 3.4V at rated load. Both less than rated input of 3.5V for CMOS levels. So a loaded TTL output is not near 5V level because of how the TTL output stage BJT drives the output.

The rated load means that a 74 series TTL output is capable of driving only ten 74 series TTL inputs. That is because TTL inputs need some current to operate.

Later on in time, after the 74 series chips, the TTL chips were improved, and these guarantee that logic high output is at least 2.7V at rated load of 74S series output driving 10 74S inputs, and 74LS further improves this by being able to drive 20 74LS inputs as inputs take less current.

OK, so chips are not directly compatible, but it does not mean it can or can't work in a system.

The CPU is rated to drive 1.6 mA current while pulling the pin low to 0.4 volts, so finally that is a TTL compatible spec, and also rated to drive 700uA current while pulling the pin high to 4.6V. So the CPU just has a weaker output able to drive four LS-TTL inputs. Also the input voltage specification for high enough CMOS input voltage can easily be achieved with simply a resistor to 5V, which would by itself be an extra load when pulling the output low.

So if the system has pull-up resistors and only a light load on the bus, it is technically possible for the CPU to operate in the system even if the system was not originally designed to take a CMOS type CPU. So it highly depends on the system where you put it, and depending on a lot of factors, it may just work OK, or it may work poorly, ot it may not work at all, depending on toleances in system supply voltage and component manufacturing tolerances.

8
  • Nice explanation of the factors involved in potential compatibility, though I should note that part of my question was about the spec sheet of the W65C02S perhaps not being entirely accurate. Also, don't you mean not "drive" but "sink" current while pulling the pin low?
    – cjs
    Commented Jun 17, 2022 at 3:13
  • 1
    The WDC W65C02 datasheet was last updated in April 2022; nearly 30 years later from the introduction, which is very rare for a component datasheet. Surely they should have noticed any inaccuracies and fixed the datasheet by now. But that datasheet is only for the WDC manufactured chip. If any other manufacturer has made their own version of the chip with TTL level IO stages, I would not know. Yes, driving low means sinking current.
    – Justme
    Commented Jun 17, 2022 at 5:29
  • 1
    Keep in mind, there's always a discrepancy between what a chip does, and what a datasheet guarantees to work. WDC's main business is not selling chips, but selling IP.
    – Raffzahn
    Commented Jun 20, 2022 at 9:01
  • The datasheet reflects the design specs it is guaranteed to work. Outside datasheet specs it may work but operation is not guaranteed so if it does not work then it won't. And simple search indicates confirmation that the WDC W65C02S is CMOS but not TTL compatible : forum.6502.org/viewtopic.php?f=4&t=6594
    – Justme
    Commented Jun 20, 2022 at 9:57
  • @Justme: One of the web links on page 5 of the data sheet was updated in between October 2018 and April 2022. If WDC had noticed after shipping parts for a year that all parts for which it measured the precise switching threshold would consistently treat 2.0 volts as a logic high when VDD is 5.25V or below and ambient is 50C or below, but most parts which had been shipped prior to that time were only tested by confirming operation with 2.3 volt signals, changing the data sheet to reduce Vih would require creating a new part number, since the exisitng parts would not have been tested...
    – supercat
    Commented Jul 1, 2022 at 19:08
1

The short answer is that in the general case, no, the W65C02S is not TTL-compatible. However, you can probably make it work reliably in a TTL system if you know what you're doing, you're careful (especially in the management of your margins), and you have control over everything attached to it.

A further implication is that you may be able to drop a W65C02S into an existing system not of your own design and have it work if you're able and willing to do the same analysis as above and can assure that the system meets all the necessary requirements, including when the user changes the electrical characteristics of the system (such as by plugging in a cartridge or expansion board). But in general it's going to be a lot less work just to get hold of an R65C02 or something similar that is TTL-compatible.

In the following I explain a little bit about where the compatibility problem lies and how you can approach the analysis mentioned above.

The Details

The W65C02S and R65C02 have a transition point on their inputs; below this they sense the input value as "0"; above it they sense the input value as "1." (There may actually be a range in which the input value will be random, but if there is, it's small enough that it's not distinguishable from the effect of the typical noise one sees on even a quiet input line.)

According to the designer, Bill Mensch, as quoted in this post from BigDumbDinosaur:

The inputs for the W65C816S is [sic] set for 50% of VDD. That said, if VDD is 5.0V then the 1-0 and 0-1 transition happens at approximately 2.5V. At VDD 3.3V the 1-0 and 0-1 will occur around 1.65V.

This is probably a little bit low, especially since Vcc in many systems is often a little above 5 V. In this post, Dr Jefyll measured the transition point for the W65C02S and found it to be 2.6 V. He also measured the transition point for a Rockwell R65C02 at 1.47 V (this figure is given in a later post). He mentions that this is evidence for the WDC data sheet being reliable:

I find it encouraging that, for both Rockwell and WDC, the observed transition point sits midway between the published recommendations VIH and VOL. Were it otherwise I would suspect an error somewhere. Instead, I believe the experiment and the published figures support one another. I now have increased confidence in the WDC doc, at least in the limited context of VIL and VIH for the data bus.

Do note that this is a test of one specimen, and doesn't take into account some other things related to TTL compatibility; in a later post he goes on to say:

Note: my limited testing of 65xx CPU's can't be used to predict the transition voltage for all extant specimens. Also, the subject of TTL Compatibility involves current as well as voltage, and outputs as well as inputs. But I have focused only on the voltages accepted by CPU inputs because that's by far the most controversial and problematic aspect.

The difference between the lowest accepted value on an input and VOH min on an output connected to it is the noise immunity. There are actually two measurements for this. For example, on the R65C02, when using it with a device that has a TTL-standard VOH min = 2.4 V we have:

  1. The specified VIH min = 2.0 V (the standard for TTL), giving 0.4 V of noise immunity; and
  2. The measured transition point of 1.47 V, giving about 0.9 V of noise immunity.

Which one of these you want to use in the calculations for your particular system is an engineering decision. If you're doing this in a one-off system where you've measured the actual devices you're using, you may consider it reasonably safe to use your measured transition point value (perhaps with a little bit of a safety margin to account for drift in the device itself over time). If you're building a million of these, it obviously makes a lot more sense to use the manufacturer's specification.

Now we see from the above that the W65C02S has a problem here: using TTL-standard VOH min = 2.4 V it actually has negative noise immunity: -0.2 V. So at this point if we want to use it in a "TTL" system our only option is to start looking at how we might ensure that the actual VOH min is well above 2.6 V.

As it turns out; the output voltage of a TTL chip varies a lot depending on load; with no load it can be as high as 3.6 V, and, at least for TI series 74LS chips, remain above 2.6 V even when sourcing 20 mA of current. plasmo found some graphs of "typical characteristics" in an old TI databook; the page he posted included this graph:

VOH vs. IOH

So we can see that if we can keep the load on the TTL outputs low enough, we probably can use the W65C02S in a TTL system. This may be actually less difficult than it might seem, at least in a small system: according to TI's TTL Data Book the typical maximum high-level input current is 20 μA for 74LS parts and 40 μA for plain 74 series parts. CMOS devices (TTL-compatible or not) pull a tiny fraction of what TTL devices do.

So what we see here is that, though you can't plop a W65C02S into any random system and expect it to Just Work, with appropriate calculations you probably can design a TTL or partly-TTL system in which a W65C02S will work as a substitute for an earlier 6502 part, and existing designs may satisfy the criteria needed for a W65C02S to work (as was apparently the case for the clock and control lines in the W65C02S in a VIC-20 video mentioned in the question).

This apparently happens reasonably often, as mentioned in another quote here from Bill Mensch:

I think that the reason most if not all systems that use the W65C02S, W65C21S, W65C22S and W65C816S work in legacy systems is because I designed my chips to be rather forgiving in many ways. The minimum “1” level of a TTL interface is most likely around 3-3.5V which would be enough for the “S” chips to recognize a “1”. The “0” level is no problem.

The Longer Summary

BigDumbDinosaur's conclusion in that post,

So I think the takeaway is we probably have nothing about which to be concerned in interfacing the WDC MPU's to devices that produce TTL outputs, provided the design isn't excessively loading the outputs. If you are at all concerned about it, stick a 74AHCT/VHCT/ACT245 transceiver in there to act as a level converter. Just be aware of the prop delay and its possible effects on your timing.

may, however, come across as a little more optimistic than it should. "[P]rovided the design isn't excessively loading the outputs" doesn't appear to be something that you can know at a glance. I think that Dr. Jefyll's summary, which I reproduce here in full, gives a much better sense of the caveats:

The term "TTL compatible" appears occasionally on this forum, and readers (especially newbies) may gather that it has a single, unambiguous meaning. But there are two tiers of "TTL compatibility," and they differ markedly.

...We have what I would call genuine TTL compatibility, which any engineer would prefer due to its maximal noise immunity. The second tier is what I'd call "hope it works" TTL compatibility -- and very often it does work (as I was careful to mention in the lead post, and others have echoed that).

But let's not confuse the two tiers: Maximal TTL Compatibility Handicapped TTL "Compatibility"

There are also two tiers when we say a certain combination "will work." We need to remember that the TTL-to-WDC combination is far more prone to stop working in noisy circumstances. Those include proximity to external noise, of course, but other important factors include supply noise, crosstalk and inoptimal construction techniques.

The lower of the two attached diagrams shows that the TTL-to-WDC combination actually has negative noise immunity when conveying a 2.4V logic high. Luckily, the shortfall is small when comparing 2.4V with the input transition point, VT. Especially without DC loading, the VOH of most TTL-output devices is likely to exceed the TTL spec of 2.4V... at least sufficiently to bring it slightly above the transition point, and this explains why success is often reported.

But operating near the transition point involves tradeoffs. Poorer noise immunity is the obvious factor, but operating near VT may also increase data setup times, thus degrading the maximum operating speed. :!:

WDC publishes the VIH spec for a reason, and really you want the incoming logic-high level to be at or above VIH. Although VT is only slightly above 2.4V, the shortfall from 2.4V to VIH is not trivial. I suspect there aren't many TTL-output devices which overperform to this extent. This means noise immunity is likely to be compromised, and perhaps maximum clock frequency as well.

I don't feel this unhappy situation deserves to be called TTL compatibility! It is a second-tier solution, not to be confused with the optimal compatibility an engineer would prefer....

-1

The Rockwell R65C02, from one of the early licensees/manufacturers of WDC's CMOS design, has a Vih(min) of 2.0-2.4 V (datasheet, p.15). It was used as a drop-in replacement for the NMOS chip in the Apple IIe Enhanced, and also in the IIe Platinum. The IIe Enhancement kit (parts list) only contained the 65C02 and some ROMs: no logic conversion required or supplied.

WDC list the W65C02S as an exact, drop-in replacement for many (possibly all) R65C02 processors. Because WDC is fabless, the same chip has had many sources. WDC state this explicitly: "WDC has licensed our 65xx technology to a number of companies over our long history including MOS Tech, Rockwell, GTE, CMD and many others ..."

While exact sales numbers for the IIe Enhanced are hard to estimate, it would have been in the order of 500K - 1 million units. This is rather more than seeing it work once on one's particular system.

There's also WDC's own "AN-002: Replacement Notes for Obsolete Versions of 6502 8-bit Microprocessors" which documents how the W65C02S can be used in NMOS systems. At most, a couple of pins should be bypassed (Vpb and MLB), another (BE) tied to Vdd, and an optional 3K3 resistor added to RDY to make the newer chip "mostly pin compatible" (WDC's words) with older ones.

7
  • 1
    But that's a different chip so this really does not answer the question about WDC W65C02S. The Rockwel may implement the same logic operation than a WDC but Rockwell is physically realized with a CMOS process that makes the voltage levels TTL compatible.
    – Justme
    Commented Jun 20, 2022 at 5:33
  • 1
    It's the same chip, since WDC is fabless. See clarified answer
    – scruss
    Commented Jun 21, 2022 at 12:07
  • 1
    Why it would be the same chip? They sell licenses and IP. You can manufacture that IP with any technology you want. It will result into chip made with some technology so it can interally be very different, even if it externally looks identical in function. But they are different. That's why the Rockwell R65C02 has completely different specs. For example clock can be stopped only by holding it high, and electrical specs are TTL compatible. WDC part clock can be stopped either high or low. If you say it is the same chip, the chip data says otherwise.
    – Justme
    Commented Jun 21, 2022 at 12:55
  • 1
    "WDC list the W65C02S as an exact, drop-in replacement for many (possibly all) R65C02 processors." Do you have a source for this? The R65C02 datasheet lists Vih as 2.0 V, markedly different from WDC's 3.5 V. That does not sound like a "drop-in replacement" to me.
    – cjs
    Commented Jun 30, 2022 at 23:39
  • 1
    I'm not sure what the relevance of the IIe enhancement kit is. That did not use a W65C02S, it used an R65C02, which has very different electrical specifications. I am asking specifically about the former chip, not about 65C02 processors in general.
    – cjs
    Commented Jun 30, 2022 at 23:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .