6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Thu Nov 21, 2024 1:12 pm

All times are UTC




Post new topic Reply to topic  [ 54 posts ]  Go to page 1, 2, 3, 4  Next
Author Message
PostPosted: Mon May 10, 2021 4:22 am 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
TTL Compatible... NOT! ( modern WDC CPU's )

In this thread I'd like to talk about the practice of using modern WDC CPU's in conjunction with RAM's, ROM's or PLD's etc whose output specifications only guarantee TTL voltage levels. Can the inputs of WDC processors be reliably driven by TTL voltage levels, or is it better to include pullups or level shifters? Are WDC's inputs "TTL compatible"?

We will see they are not. It's true that some RAM's, ROM's and PLD's have a limited degree of WDC compatibility :shock: in the sense that they exceed TTL specs. But WDC's inputs are not TTL compatible. WDC inputs are markedly different from Rockwell's, for example. A comparison of Rockwell and WDC input specs reveals this, and the info is confirmed by my actual testing, reported below. Rockwell CPU's can reliably be driven by TTL voltage levels, but WDC chips are TTL Compatible only in the anecdotal sense. People have reported success using them in a TTL setting -- it's not uncommon. But this is not a robust combination, nor one that's even guaranteed to work.

Datasheets specifications can be hard to interpret, so I've prepared two sets of graphics. The first set is slightly OT because it discusses gates, not CPUs. But that's a good analogy, because most of us already know it's an iffy proposition to have TTL outputs driving CMOS inputs such as those of the 74HC series. (The situation with gates is well known, and my graphics are based on a diagram excerpted from page 4 of the attached document from Texas Instruments.)

This doesn't mean a 74HC device is guaranteed to fail.... but if it works it'll be for reasons that can't be relied upon:

  • The output may come from a chip whose highs are higher than spec and whose lows are lower than spec. And,
  • on the input side, you'll notice that the specs call for highs that are above the actual transition point and lows that are below that transition point. So, the specs call for some extra margin. But cutting corners with that margin won't necessarily result in failure.

What I hope will jump out at you is the fact that a TTL high which merely satisfies spec (ie, doesn't exceed spec) will fail to drive a 74HC input high, because the transition point won't be achieved. It is actually imperative for the TTL chip to exceed the VOH spec. Indeed, you'll even want it to exceed the transition point somewhat; that's so you'll have a little bit of noise immunity (imperative to avoid flaky operation).
Attachment:
File comment: TTL output voltages are a poor match for CMOS inputs such as those of the 74HC series.
TTL output to CMOS gate.png
TTL output to CMOS gate.png [ 27 KiB | Viewed 41888 times ]
Attachment:
File comment: TTL output voltages are a good match for TTL inputs (also inputs of TTL-compatible CMOS such as 74HCT series).
TTL output to TTL gate.png
TTL output to TTL gate.png [ 24.56 KiB | Viewed 41888 times ]
Attachment:
TTL out to gate input.gif
TTL out to gate input.gif [ 27.71 KiB | Viewed 41888 times ]


Here's the other set of graphics, and now it's CPU inputs I'm illustrating. It's much the same story.
Attachment:
File comment: TTL output voltages are a poor match for the inputs of WDC CPU's.
TTL output to WDC CPU.png
TTL output to WDC CPU.png [ 28.02 KiB | Viewed 42291 times ]
Attachment:
File comment: TTL output voltages are a good match for the inputs of TTL compatible CPU's such as Rockwell.
TTL output to Rockwell CPU.png
TTL output to Rockwell CPU.png [ 24.88 KiB | Viewed 42291 times ]
Attachment:
TTL out to CPU input.gif
TTL out to CPU input.gif [ 30.22 KiB | Viewed 42291 times ]


My reference for logic family voltage levels is the TI document attached. Unlike datasheets, it mentions the actual transition voltage -- something which datasheets typically omit, for various reasons. (Manufacturers want to reserve themselves some leeway. And the customer supposedly doesn't need to know the transition point anyway; their job is simply to adhere to the max and min specs.)

For 65xx CPUs I found it necessary to do my own research. I measured the data bus input transition voltage for three 65xx CPUs, as follows. (I haven't tested WDC microcontrollers, but I see no reason to expect them to be different.)

    Rockwell R65C02P4: 1.47V
    WDC 'C02: 2.6V
    WDC '816: 2.57V

From this we see that driving a Rockwell CPU is like driving 74HCT series CMOS. And driving a WDC CPU is like driving 74HC series CMOS... which is to say, for reliable operation you'll need pullups or a level converter IC if the driving IC only guarantees TTL levels.

In a subsequent post I'll share the test circuit I cooked up -- I'm rather proud of its simplicity. :mrgreen: And I have plans to verify the input transitions for other inputs such as IRQ and BE. But with summer coming on I'm not sure how soon I'll get around to doing that... :roll: :P

-- Jeff

Attachment:
PS: mug shots of the suspects:
Attachment:
GEDC0606lores.JPG
GEDC0606lores.JPG [ 87.03 KiB | Viewed 42291 times ]
Attachment:
GEDC0605lores.JPG
GEDC0605lores.JPG [ 113.96 KiB | Viewed 42289 times ]
[b]TTL
Attachment:
GEDC0608lores.JPG
GEDC0608lores.JPG [ 103.26 KiB | Viewed 42289 times ]

_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html


Last edited by Dr Jefyll on Fri Nov 05, 2021 2:20 pm, edited 2 times in total.

Top
 Profile  
Reply with quote  
PostPosted: Mon May 10, 2021 4:47 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8503
Location: Midwestern USA
From where did those illustrations come?

As for whether or not the modern 65C02 has TTL-compatible inputs, that is an unsettled quagmire. Reviewing three different WDC 65C02 data sheets, the oldest having been published in March 2000, shows that the voltage specs were all over the place. Of course, we know that WDC's documentation has always been questionable, so who knows for sure what is being specified.

However, the 65C02 was intended from the outset to be a drop-in replacement for the NMOS 6502 and in fact, worked fine in that capacity in old 6502-powered gear, such as the Commodore PET/CBM machines, Apple ][E units, etc, all of which were built with 74LS logic. That such was the case implies the 65C02's inputs were TTL-compatible back in the day. With modern SRAM and ROM having TTL output levels, I'd find it hard to believe WDC would effectively shut out use of those products by producing an MPU whose inputs will reliably respond only to CMOS levels.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Mon May 10, 2021 4:54 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8503
Location: Midwestern USA
BTW, that 816 in PDIP you have is a relatively rare animal. According to David Gray at WDC, not many Sanyo 0.6µ wafers were used to make 816s.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Mon May 10, 2021 5:51 am 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
BigDumbDinosaur wrote:
Of course, we know that WDC's documentation has always been questionable
Agreed.

Quote:
I'd find it hard to believe [...]
Do you believe that I measured the data bus input transition voltage for three 65xx CPUs? I did.

When I applied 2.4V -- a valid TTL high -- to the WDC chips, they thought it was a zero. To perceive a one, the '816 needed 2.57 volts and the 'C02 needed 2.6.

_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html


Top
 Profile  
Reply with quote  
PostPosted: Mon May 10, 2021 8:24 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10985
Location: England
Thanks for measuring actual parts, Jeff! Beeb816 has just been exploring this territory.


Top
 Profile  
Reply with quote  
PostPosted: Mon May 10, 2021 2:08 pm 
Offline

Joined: Sat Jan 02, 2016 10:22 am
Posts: 197
Is the lack of TTL input compatibility really surprising, given the voltage range that the WDC CPUs run at?


Top
 Profile  
Reply with quote  
PostPosted: Mon May 10, 2021 4:55 pm 
Offline
User avatar

Joined: Sat Sep 29, 2012 10:15 pm
Posts: 904
Still digesting the real-life significance of these disturbing results.

I don't know much about CMOS design, but I cannot imagine that it takes much more than 'a little narrower here, a little closer there' to bias down the switching point of the input buffer transistors...

Looking at the specs of, say, CMOS-compatible AT28C256, the minimum specified output high voltage is 2.4V. Same for the SRAMs i looked at; it seems to be what 5V operation means.

How is it possible to design a CPU that is not technically compatible with any known memories and peripherals, requiring level translation for reliable operation? And manufacture 'billions' of said CPUs? Over many decades? And also, design a 'new improved' CPU?

Gah. There is no smilie to match this particular mix of dismay and annoyance. This hobby was supposed to be a way to reduce stress and get away from bulls**t. As in, after decades there are no surprises like this in our hardware. WDC does not fail to surprise.

_________________
In theory, there is no difference between theory and practice. In practice, there is. ...Jan van de Snepscheut


Last edited by enso on Mon May 10, 2021 5:12 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: Mon May 10, 2021 5:11 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10985
Location: England
My take is that WDC haven't done very well here, on the chip front. (I would say they've never made billions of parts - they've licensed their IP many times, but that's a different thing.)

We do see lots of successful projects here, so in practice things are not so bad, at hobbyist scale. But people do sometimes have unreliable behaviour which is difficult to track down, and this is a possible cause.


Top
 Profile  
Reply with quote  
PostPosted: Mon May 10, 2021 5:46 pm 
Offline
User avatar

Joined: Sat Sep 29, 2012 10:15 pm
Posts: 904
Now that I think about it, Apples and Commodores have buffered busses.

_________________
In theory, there is no difference between theory and practice. In practice, there is. ...Jan van de Snepscheut


Top
 Profile  
Reply with quote  
PostPosted: Mon May 10, 2021 6:21 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8543
Location: Southern California
enso wrote:
Now that I think about it, Apples and Commodores have buffered busses.

and the 816's data bus is nearly always buffered by a 74xxT245, which would avoid the problem.

_________________
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?


Top
 Profile  
Reply with quote  
PostPosted: Mon May 10, 2021 8:21 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
enso wrote:
Still digesting the real-life significance of these disturbing results.
The results may not be to our own liking, but WDC's decision to put the transition point around 50% was balanced and reasonable. There's a whole other world out there, where 5V supplies are not the norm. (Martin A, you hinted at this, too.)

Given the customers they serve, WDC apparently decided TTL Compatibility has more downside than upside.

And for us it's no great hardship. Pullup resistors are tiny and cheap. And, as Garth noted, an '816 will usually have a '245 nearby anyway. Just be sure you specify a "T" variant, such as 'HCT245 or 'AHCT245.

-- Jeff

_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html


Top
 Profile  
Reply with quote  
PostPosted: Mon May 10, 2021 8:24 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
To measure a CPU's input transition point I wanted something simple -- suitable for a solderless breadboard -- and this (below) is the essence of what I came up with.

Attachment:
65xx test jig.png
65xx test jig.png [ 7.46 KiB | Viewed 42172 times ]
- when the potentiometer is at its lowest extreme, the CPU reads nothing but $65 on the bus.
- when the potentiometer is at its highest extreme, the CPU reads nothing but $E5 on the bus.

The $65's get interpreted as an endless series of 2-byte $6565 instructions; this is ADC $65 (using z-pg address mode). The $E5's get interpreted almost identically, but now it's SBC $E5 instead of ADC $65. These are both 3-cycle instructions, so the timing never varies. What does vary is the internal operation and the z-pg address that gets fetched on cycle 3. Address line A7 will go high or low according to whether the CPU thought the value from the potentiometer was a 1 or a 0. :mrgreen:

As I increased the pot upward from 0 or downward from +5, there was no effect at all until I was within a few mV of the transition point. Then A7 would begin wavering erratically, which didn't surprise me as there was probably a few mV of noise superimposed on the signal arriving at D7. The erratic result ceased once the voltage from the pot was sufficiently above or sufficiently below the transition point.
Attachment:
WDC input levels.png
WDC input levels.png [ 11.73 KiB | Viewed 42172 times ]

BTW, most of the voltages in my diagrams are taken from WDC doc or the TI doc I mentioned. Notice I can't verify WDC's or anyone else's VIH Min or VIL Max because these numbers are mere recommendations, the result of judicious and somewhat arbitrary decisions made by the manufacturer. I can't observe or verify VIH or VIL because nothing happens when those points are crossed. All I can observe is the transition points for the samples tested.

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.

-- Jeff

_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html


Last edited by Dr Jefyll on Mon May 10, 2021 8:31 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: Mon May 10, 2021 8:28 pm 
Offline
User avatar

Joined: Sat Sep 29, 2012 10:15 pm
Posts: 904
Dr Jefyll wrote:
...Pullup resistors are tiny and cheap...


I imagine resistors would slow down the transitions. Is there enough slack to accommodate the delay? I have no idea what the capacitance of the bus lines is...

Edit:

My other thought was to operate all non-WDC periphs at 5.3V (or alternatively drop the CPU voltage to 4.6V or whatever)... An extra regulator vs. 24+ resistors...

_________________
In theory, there is no difference between theory and practice. In practice, there is. ...Jan van de Snepscheut


Top
 Profile  
Reply with quote  
PostPosted: Mon May 10, 2021 9:25 pm 
Offline
User avatar

Joined: Wed Feb 14, 2018 2:33 pm
Posts: 1488
Location: Scotland
enso wrote:
Dr Jefyll wrote:
...Pullup resistors are tiny and cheap...


I imagine resistors would slow down the transitions. Is there enough slack to accommodate the delay? I have no idea what the capacitance of the bus lines is...

Edit:

My other thought was to operate all non-WDC periphs at 5.3V (or alternatively drop the CPU voltage to 4.6V or whatever)... An extra regulator vs. 24+ resistors...


FWIW both my Ruby 6502 and '816 boards have 8 x 10K pull-up resistors on the upper 8 address lines and they work just fine at 16Mhz.

There is no buffer on the '816 data bus just a latch on the data bus to provide A16:23 (Implemented in a GAL). The resistors have nothing to do with signal levels but are for another reason to do with communicating between the 02/816 and the ATmega host cpu. D0:7 and A0:7 are connected to both 6502/816 and the ATmega as well as the SRAM.

I don't have the test kit to tell me that my boards shouldn't work as they seem to work just fine. The signal levels is not something I've considered in the past but it's both interesting (and curious) to read about these potential issues.

-Gordon

_________________
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/


Top
 Profile  
Reply with quote  
PostPosted: Mon May 10, 2021 9:27 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8503
Location: Midwestern USA
Dr Jefyll wrote:
BigDumbDinosaur wrote:
Of course, we know that WDC's documentation has always been questionable
Agreed.

Quote:
I'd find it hard to believe [...]
Do you believe that I measured the data bus input transition voltage for three 65xx CPUs? I did.

When I applied 2.4V -- a valid TTL high -- to the WDC chips, they thought it was a zero. To perceive a one, the '816 needed 2.57 volts and the 'C02 needed 2.6.

If that is the case, it suggests the MPUs' inputs are Schmitt-triggered, as the actual CMOS "no man's land" is several volts wide. Without Schmitt triggering, I would not expect to see a transition at VDD ÷ 2 as you are reporting.

Assuming my supposition is correct (I may soon know—I have a query into WDC on this), it would explain why the C02/816 will work despite being driven by a device with TTL-compatible outputs. In theory, such an output could rise to 3.4 volts in a 5 volt system if loading is very light, which might be possible in an all-CMOS system with a tight PCB layout. Even if the output only topped out at 3 volts, that would be more than sufficient for the MPU to perceive its input as being at a logic 1.

EDIT: Fixed a typo.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Last edited by BigDumbDinosaur on Tue Nov 08, 2022 9:45 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 54 posts ]  Go to page 1, 2, 3, 4  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 19 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: