Interfacing with TTL?
Interfacing with TTL?
So I've been playing with the 65C51 for a while and it's been fun, but I'd like to move on to the 16550. The datasheet indicates that it is a TTL part however; and after digging around on the forums I came across some posts that would indicate that interfacing the 6502/65816 to TTL logic isn't as straight forward as I first thought. Apparently the clock pin needs the full CMOS voltage ranges? Looking at the from the datasheets indicates to me there are other pins do as well (e.g. data). (That's a big IF when it comes to me reading some of charts in the datasheets and my lack of knowledge in these areas.)
So I was wondering how people go about interfacing with TTL based logic when using the 65xxx in general.
So I was wondering how people go about interfacing with TTL based logic when using the 65xxx in general.
- akohlbecker
- Posts: 282
- Joined: 24 Jul 2021
- Contact:
Re: Interfacing with TTL?
Note that the 65C51 (in its W65C51N variant) also theoretically uses TTL-level signaling, even though it is a CMOS device.
If your signal goes from 5V CMOS to 5V TTL levels, then the logic levels are compatible.
In the other direction, it is usually fine, but not technically correct. A lot of people wing it and it works. To be safe, you have to use the HCT/ACT/AHCT logic families, which accept TTL level signals on their inputs, and output CMOS levels.
In my 65C816 build, the only thing that has to receive TTL level signals is the data bus buffer, which I made AHCT. That's because ROMs like the AT28C256, and RAMs like the 62256 are both technically outputting TTL levels on the data bus.
If your signal goes from 5V CMOS to 5V TTL levels, then the logic levels are compatible.
In the other direction, it is usually fine, but not technically correct. A lot of people wing it and it works. To be safe, you have to use the HCT/ACT/AHCT logic families, which accept TTL level signals on their inputs, and output CMOS levels.
In my 65C816 build, the only thing that has to receive TTL level signals is the data bus buffer, which I made AHCT. That's because ROMs like the AT28C256, and RAMs like the 62256 are both technically outputting TTL levels on the data bus.
- BigDumbDinosaur
- Posts: 9425
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
Re: Interfacing with TTL?
So far, I have built three iterations of my POC series, using the 65C816. None of them has had anything to translate TTL outputs to CMOS levels. The fastest one runs at 20 MHz. POC V1.3, which is the one currently running on the bench, has been up for nearly 38 days and is rock-solid.
The theoretical maximum VOH of a device with totem-pole outputs is 3.4 volts. A CMOS logic 1 is defined as VCC × 0.7. In a five volt system, that would be 3.5 volts. So it would seem a TTL device would be unable to reach the minimum voltage required by a WDC MPU to recognize an unambiguous logic 1.
However, Bill Mensch has indicated that most of the inputs on the 65C02 and 65C816 cleanly recognize VCC × 0.5 as a logic 1, which will work with a TTL device that is lightly loaded. Jeff has conducted some testing to see if this is the case and has determined that the actual transition point is slightly higher, but well below the VCC × 0.7 point.
Since CMOS inputs draw virtually no current when quiescent, driving a WDC MPU with a TTL device is acceptable on almost all inputs. The clock input is a notable exception—it must swing rail-to-rail, with a maximum rise/fall time of 5ns. Most HCMOS oscillators will readily drive rail-to-rail, but transition time and symmetry may not be ideal. Those items can be addressed by running the oscillator’s output through a 74ACxx flip-flop.
The theoretical maximum VOH of a device with totem-pole outputs is 3.4 volts. A CMOS logic 1 is defined as VCC × 0.7. In a five volt system, that would be 3.5 volts. So it would seem a TTL device would be unable to reach the minimum voltage required by a WDC MPU to recognize an unambiguous logic 1.
However, Bill Mensch has indicated that most of the inputs on the 65C02 and 65C816 cleanly recognize VCC × 0.5 as a logic 1, which will work with a TTL device that is lightly loaded. Jeff has conducted some testing to see if this is the case and has determined that the actual transition point is slightly higher, but well below the VCC × 0.7 point.
Since CMOS inputs draw virtually no current when quiescent, driving a WDC MPU with a TTL device is acceptable on almost all inputs. The clock input is a notable exception—it must swing rail-to-rail, with a maximum rise/fall time of 5ns. Most HCMOS oscillators will readily drive rail-to-rail, but transition time and symmetry may not be ideal. Those items can be addressed by running the oscillator’s output through a 74ACxx flip-flop.
x86? We ain't got no x86. We don't NEED no stinking x86!
Re: Interfacing with TTL?
Cool,
Thank you both for the clarification on that.
I'm taking from this is that I should try the 16550 as is and see how it does.
Thank you both for the clarification on that.
I'm taking from this is that I should try the 16550 as is and see how it does.
Re: Interfacing with TTL?
Yuri wrote:
So I was wondering how people go about interfacing with TTL based logic when using the 65xxx in general.
WDC processors are the only ones still in production, and they are specified to require CMOS voltage levels. But yes, you may as well try the 16550 and see how it does. There's a good chance it'll work as is. Noise immunity will surely be compromised, but you can get away with that if the circumstances are right.
If you do encounter an issue, adding pullup resistors on the data bus will probably tip the scales in your favor. But there's still a degree of compromise involving speed.
-- Jeff
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html
https://laughtonelectronics.com/Arcana/ ... mmary.html
Re: Interfacing with TTL?
Yep,
Looks like it's working! XD
Now to write some more complex programs for it!
Looks like it's working! XD
Now to write some more complex programs for it!
Re: Interfacing with TTL?
A bit late to the party as it looks like you've got it working already.
I'm intending to use the TL16C550D and finally received one a few days ago. And now I've got the datasheet sitting next to me.
Whilst I intend to use it at 3.3V I notice the 16C550 is rated at 5V VCC too.
At 5V:
VIH = 3.5V (from = 0.7 * VCC)
VIL = 1.5V (from = 0.3 * VCC)
VOH = 4.0V
VOL = 0.4V
And those values will work just fine with a 65Cxx running at 5V.
If you do need to do 3.3V to 5V translation and know the direction (input or output) of the databus then a 74LVC4245, 74FCT4245 or similar will get the job done if pull resistors are too slow. You could also try an LSF0108 if you don't want to muck around with direction pins and aren't running at very high frequencies. (Here is me complaining that an LSF0102 is rising to slowly at 25Mhz using a (way to low) 330Ω pull-up).
I'm intending to use the TL16C550D and finally received one a few days ago. And now I've got the datasheet sitting next to me.
Whilst I intend to use it at 3.3V I notice the 16C550 is rated at 5V VCC too.
At 5V:
VIH = 3.5V (from = 0.7 * VCC)
VIL = 1.5V (from = 0.3 * VCC)
VOH = 4.0V
VOL = 0.4V
And those values will work just fine with a 65Cxx running at 5V.
If you do need to do 3.3V to 5V translation and know the direction (input or output) of the databus then a 74LVC4245, 74FCT4245 or similar will get the job done if pull resistors are too slow. You could also try an LSF0108 if you don't want to muck around with direction pins and aren't running at very high frequencies. (Here is me complaining that an LSF0102 is rising to slowly at 25Mhz using a (way to low) 330Ω pull-up).
Re: Interfacing with TTL?
AndrewP wrote:
A bit late to the party as it looks like you've got it working already.
Either way, I'm happy it works. I also have the interrupt routing through my 65C22 at the moment. I THINK I know enough now (famous last words) to get it hooked back into the open drain interrupt directly on the 65C02. (Invert it, throw a diode and pull up resistor on there)
AndrewP wrote:
I'm intending to use the TL16C550D and finally received one a few days ago. And now I've got the datasheet sitting next to me.
Whilst I intend to use it at 3.3V I notice the 16C550 is rated at 5V VCC too.
At 5V:
VIH = 3.5V (from = 0.7 * VCC)
VIL = 1.5V (from = 0.3 * VCC)
VOH = 4.0V
VOL = 0.4V
And those values will work just fine with a 65Cxx running at 5V.
Whilst I intend to use it at 3.3V I notice the 16C550 is rated at 5V VCC too.
At 5V:
VIH = 3.5V (from = 0.7 * VCC)
VIL = 1.5V (from = 0.3 * VCC)
VOH = 4.0V
VOL = 0.4V
And those values will work just fine with a 65Cxx running at 5V.
AndrewP wrote:
If you do need to do 3.3V to 5V translation and know the direction (input or output) of the databus then a 74LVC4245, 74FCT4245 or similar will get the job done if pull resistors are too slow. You could also try an LSF0108 if you don't want to muck around with direction pins and aren't running at very high frequencies. (Here is me complaining that an LSF0102 is rising to slowly at 25Mhz using a (way to low) 330Ω pull-up).
Also, pull up resistors is a good question. I don't know how fast/slow those actually are. What are the general timing for these? Is it based on the value of the resistor? (E.g. 3.3K has X pull time, vs. 100K which has Y time?)
I'd ultimately like to put some on the data and address busses so I can start using the BE pin. Ultimate goal being to implement some sort of DMA controller, but also I have a few unmapped chunks of the memory space that'd like to have return some sort of predetermined value (zero) instead of a floated value, if the software happens to try and read from there. (I'm sure it will do it at some point when I invariably have a bug in my code)
Now that serial is more or less working, my next goal is to work on some USB peripherals for the system. Been look at various ICs for doing USB host controller stuff and most of those appear to be 3.3V, so I'll probably end up using a voltage translation IC for that. Some of the controllers appear to be 3.3V but with 5V tolerant inputs, which is nice. (A lot of them appear to use SPI or I2C which means I wouldn't need to wire a lot of pins for it)
- GARTHWILSON
- Forum Moderator
- Posts: 8773
- Joined: 30 Aug 2002
- Location: Southern California
- Contact:
Re: Interfacing with TTL?
Yuri wrote:
Also, pull up resistors is a good question. I don't know how fast/slow those actually are. What are the general timing for these? Is it based on the value of the resistor? (E.g. 3.3K has X pull time, vs. 100K which has Y time?)
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?
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
- floobydust
- Posts: 1394
- Joined: 05 Mar 2013
Re: Interfacing with TTL?
As the interrupt on the 16C550 is active high, all you need is a simple mosfet and a resistor. Attach a 3.3K resistor from the interrupt out line to ground. You can use a BS170 mosfet for the invert switch. Just as long as you have a pull-up resistor on the 65C02 IRQ line, you can directly drive the IRQ from the mosfet. I also use a jumper on the mosfet gate input, just in case you don't want that device using interrupts or have debug issues. Attached is a schematic clip from my CF-Card adapter, as IDE devices also have their interrupt line active high:
Regards, KM
https://github.com/floobydust
https://github.com/floobydust
Re: Interfacing with TTL?
Yuri wrote:
I have a few 74LVC245s that I got from AdaFruit (I couldn't find them at Digikey or Mouser
)
Mouser's website is ... challenging. It's not hobbyist friendly but it is also BY FAR the best website for electronics. Digikey's is somehow worse and RS Component's is an abomination*. And that's not even counting non-electronic websites that sell ICs like Amazon or Aliexpress.
If you're an engineer and you know your part numbers and have experience with Mouser's interface I'm sure you can find parts really fast. As a hobbyist new to the millions of parts it's a bit more of an adventure.
So how to find a 74LVC245 on Mouser? First off: use the desktop site. If you're on a phone change it to the desktop site. I think the target audience for the mobile site is just web designers because it is really pretty but otherwise unusable.
The best way to find a 74LVC245 is to enter it into the global search that will give you some pretty good hits with a few caveats.
However if you don't know you want exactly a 74LVC245 that's a bit trickier. Maybe you wanted a 74LVC2T45 because you only need 2 lines instead of 8. Or maybe you don't care that it's LVC; an 74LCX245 or 74ABT245 would work instead of a 74LVC245.
You could, if you know a '245 is a bus transceiver, search for "bus transceiver" in Mouser's global search and that will take you right where you want to be.
Then filter by "In Stock"; then filter by family type "74LVC" and "LVC"; then enter "245" into the results search (not the global search) and filter by that. Then sort by price or propagation delay or whatever and filter by that**. That should finally take you to a URL that looks like:
https://www.mouser.co.za/c/semiconductors/logic-ics/bus-transceivers/?q=245&logic%20family=74LVC%7C~LVC&instock=y&sort=pricing
And there you have it. Lots of 74LVC245s. Now all you have to do is scroll through them them until you find a package and manufacturer you like. I tend to Nexperia then Texas Instruments but honestly a 74 series IC is a 74 series IC and as long as the datasheet says it does what you want it will work.
But if you didn't know a 245 would be found under bus transceivers then it's time to start clicking around Mouser's Products. Bus transceivers happen to be under Semiconductors -> Logic ICs -> Bus Transceivers but the only way to find that is to go on an adventure.
And sometimes the final product category isn't obvious. Is a 74LVC543 bi-directional latch found under Latches? Bus Transceivers? Buffers? Registers? Line Interfaces?
Don't Know!
And I'm glad I didn't have to sort and choose categories. But once you've found the exact part number using Mouser's website then do a general Google search for the exact part number (say: 74LVC245AD,118) and see if it is cheaper on Digikey or somewhere local etc... Good luck, Mousering definitely takes practice!
* Although it's gotten better over the last year or two.
**Don't try and do multiple filters in a single step. That can confuse the site and might lose previous things you were filtering on.
Re: Interfacing with TTL?
floobydust wrote:
As the interrupt on the 16C550 is active high, all you need is a simple mosfet and a resistor.
Quote:
Attach a 3.3K resistor from the interrupt out line to ground.
So what's happening here is that with the jumper open, or the jumper closed and the 16C550 INT output low, the voltage on the gate is the same as on the source, GND, and this being less than a 0.8V difference between the two means that the MOSFET does not conduct between the source and the drain (or the drain and anything else). Thus whatever the drain is connected to will be at whatever level it is, which is Vcc because you've got a pull-up (not shown in you schematic) on the 6502's /IRQ line.
When the 16C550 raises its INT output to Vcc that overpowers the pull-up and brings the line to Vcc. This creates a voltage difference between gate and source that's more than the 0.8 V that would make the MOSFET start conducting between source and drain. In fact, it's more than the 3 V that causes the MOSFET to go to minimum resistance between source and drain (no more than 5 Ω at most). That shorts the /IRQ line to ground, which overpowers its pull-up and thus asserts /IRQ on the 6502.
Is this all correct?
Quote:
You can use a BS170 mosfet for the invert switch.
Curt J. Sampson - github.com/0cjs
Re: Interfacing with TTL?
AndrewP wrote:
But once you've found the exact part number using Mouser's website then do a general Google search for the exact part number (say: 74LVC245AD,118) and see if it is cheaper on Digikey or somewhere local etc... Good luck, Mousering definitely takes practice!
Once you've determined the part number you want, you might want to try octopart.com - it maintains an up-to-date database of who has how many of what for electrical components (assuming you're ordering from large distributors). One word of warning for hard to find parts is to stick to the distributors that you know. There are several that are listed that "pretend" to have stock, but all they do is take your order and then turn around and order from the one that really has it - it will often be cheaper if you order directly from the one who actually has them. For small hobbyist quantities, though, who has the lowest minimum order and lowest shipping to your location is probably more important than the piece prices.
Here's an example of 74LVC245AD,118 with the list sorted by available stock:For hobby purchases, you'll only be interested in places with a Minimum Order Quantity (MOQ) of 1. Arrow appears to have the best price for small quantities here, but you'll want to check minimum order requirements and shipping costs. When ording multiple parts, you also get to play the fun "Can I buy them all from the same place to save on shipping?" game.
Re: Interfacing with TTL?
SamCoVT wrote:
you might want to try octopart.com - [...] One word of warning for hard to find parts is to stick to the distributors that you know.
I've been asked to service a high-tech audio amplifier (dual 500W; Class D), and it uses an IRS20957 controller IC which is presently no-stock at Digikey and Mouser. Bitfo has offered to sell me two pieces for about $6 each (reasonable) but they're asking USD$30 for shipping (from Asia).
This too might be acceptable, but a couple of things make me uncomfortable. Their web site talks about shopping carts, multiple shipping options and multiple payment options. But these seem to be either a sham or (plausibly and more charitably) a future aspiration. There's no shopping cart, and I've been trading emails with a sales rep who says payment can only be by Paypal, and who deprecatingly mentions a cheaper and slower shipping option but fails to actually cite any details. Part of me is wondering if I'm at risk of getting taken.
Comments (including alternative suppliers) welcome! Apologies for the OT post...
-- Jeff
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html
https://laughtonelectronics.com/Arcana/ ... mmary.html
Re: Interfacing with TTL?
Dr Jefyll wrote:
For someone who does not frequently deal with suppliers listed on Octopart.com, can you or anyone else vouch for bitfoic.com ?
Is this an SOIC-16 packaged part? I see (on octopart and verified on the vendor's site) IRS20957STRPBF is available in single quantities from Arrow (who has no minimum $ amount for an order):
https://www.arrow.com/en/products/irs20 ... ologies-ag
The PBF on the end of the part number is likely for Lead Free (eg. RoHS), which means there might be an older part number that is no longer available. The TR is also likely to indicate it comes on Tape and Reel, although Arrow will sell cut tape off from one of their reels in this case.