6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat Apr 27, 2024 8:28 pm

All times are UTC




Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Interfacing with TTL?
PostPosted: Sat Jun 03, 2023 7:30 pm 
Offline
User avatar

Joined: Tue Feb 28, 2023 11:39 pm
Posts: 133
Location: Texas
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.


Top
 Profile  
Reply with quote  
PostPosted: Sat Jun 03, 2023 7:59 pm 
Offline
User avatar

Joined: Sat Jul 24, 2021 1:37 pm
Posts: 282
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.

_________________
BB816 Computer YouTube series


Top
 Profile  
Reply with quote  
PostPosted: Sun Jun 04, 2023 12:00 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8144
Location: Midwestern USA
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.

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


Top
 Profile  
Reply with quote  
PostPosted: Sun Jun 04, 2023 6:46 am 
Offline
User avatar

Joined: Tue Feb 28, 2023 11:39 pm
Posts: 133
Location: Texas
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.


Top
 Profile  
Reply with quote  
PostPosted: Sun Jun 04, 2023 12:22 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3346
Location: Ontario, Canada
Yuri wrote:
So I was wondering how people go about interfacing with TTL based logic when using the 65xxx in general.

65xxx in general? All NMOS 6502s and many 65C02s are specified to accept TTL voltage levels on their inputs. These chips can still be purchased although they're no longer in production. IMO, a Rockwell or CMD 65C02 is an excellent choice, assuming you can obtain a genuine part rather than one that's been re-marked.

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


Top
 Profile  
Reply with quote  
PostPosted: Mon Jun 05, 2023 5:49 am 
Offline
User avatar

Joined: Tue Feb 28, 2023 11:39 pm
Posts: 133
Location: Texas
Yep,

Looks like it's working! XD

Now to write some more complex programs for it!


Top
 Profile  
Reply with quote  
PostPosted: Wed Jun 07, 2023 7:33 am 
Offline
User avatar

Joined: Mon Aug 30, 2021 11:52 am
Posts: 251
Location: South Africa
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).


Top
 Profile  
Reply with quote  
PostPosted: Wed Jun 07, 2023 7:11 pm 
Offline
User avatar

Joined: Tue Feb 28, 2023 11:39 pm
Posts: 133
Location: Texas
AndrewP wrote:
A bit late to the party as it looks like you've got it working already.


Yea, I rewired the bread board and got it all working, going to tie it to a MAX232 and a 9-pin DSub for a "proper" serial port when I get a PCB made; but the serial USB cable I have does TTL levels, so the MAX232 wasn't required to check it.

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.


Good to know for sure, those AC/DC charts is a bit of a mystery to me. I think I kinda sorta understand them, but I have doubts in my mind that I'm ever reading them correctly. Notably because when I read them it seems like every IC shouldn't be able to work with every other IC, and that's clearly not correct.

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).


I have a few 74LVC245s that I got from AdaFruit (I couldn't find them at Digikey or Mouser :cry: ), but haven't needed to use them JUST yet. The datasheet indicates they're pretty slow though, fine I would assume for GPIO pins off an Arduino, but not good for the 6/12MHz I am/want to run my 65C02 at.

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)


Top
 Profile  
Reply with quote  
PostPosted: Thu Jun 08, 2023 1:47 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8428
Location: Southern California
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?)

See my post at viewtopic.php?p=100145#p100145 .  However, for helping a TTL output satisfy a CMOS input, it'd be difficult to determine the timing without just building it up and measuring, because the resistor pull-up will be most involved as the voltage reaches levels where the TTL output starts to run out of gas, something which won't be an exact point but rather a range.

_________________
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: Thu Jun 08, 2023 2:28 am 
Offline
User avatar

Joined: Tue Mar 05, 2013 4:31 am
Posts: 1373
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:

Attachment:
Screen Shot 2023-06-07 at 22.25.21.png
Screen Shot 2023-06-07 at 22.25.21.png [ 29.63 KiB | Viewed 13939 times ]

_________________
Regards, KM
https://github.com/floobydust


Top
 Profile  
Reply with quote  
PostPosted: Thu Jun 08, 2023 7:09 am 
Offline
User avatar

Joined: Mon Aug 30, 2021 11:52 am
Posts: 251
Location: South Africa
Yuri wrote:
I have a few 74LVC245s that I got from AdaFruit (I couldn't find them at Digikey or Mouser :cry: )
Unhinged rant time!

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.


Top
 Profile  
Reply with quote  
PostPosted: Thu Jun 08, 2023 7:37 am 
Offline
User avatar

Joined: Sat Dec 01, 2018 1:53 pm
Posts: 727
Location: Tokyo, Japan
floobydust wrote:
As the interrupt on the 16C550 is active high, all you need is a simple mosfet and a resistor.

Ah, thanks for this! Studying it (along with searching up some additional materials) finally let me understand how MOSFETs work and their uses, I think. Let's see if I've got this right.

Quote:
Attach a 3.3K resistor from the interrupt out line to ground.

This looks to me as if it's serving as a pull-down for when the jumper is open, to ensure that the gate is at the same level (GND) as the source, right? So really, we want to make sure that the resistor is not just on the interrupt output, where it would be out of the circuit if the jumper is open, but on the MOSFET gate, right? And we wouldn't need the pull-down if we didn't have that jumper, because the 16C550 is always providing GND or VCC on its INT output, correct?

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.

And a 2N7000 should work just as well, since the only difference between that and a BS170 is that the former has only 200 mA current-carrying capacity between source and drain, as opposed to the 500 mA the BS170 can handle, right? (The pull-up on /IRQ is presumably something reasonable, such as no less than 1K, and so there should be no more than about 5 mA going through the MOSFET when it pulls that line low.)

_________________
Curt J. Sampson - github.com/0cjs


Top
 Profile  
Reply with quote  
PostPosted: Thu Jun 08, 2023 1:00 pm 
Offline

Joined: Sun May 13, 2018 5:49 pm
Posts: 247
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!
Welcome to my world. I do this for work every day. I actually prefer Digikey's site (they were the first to do this kind of web site - Mouser has only caught up with them about 3 years ago), so I usually go there first because I am used to its quirks.

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:
Attachment:
File comment: Octopart.com example search for 74LVC245AD,118
octopart.png
octopart.png [ 107.3 KiB | Viewed 13880 times ]
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.


Top
 Profile  
Reply with quote  
PostPosted: Thu Jun 08, 2023 4:01 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3346
Location: Ontario, Canada
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.
Thank you for your suggestions. For someone who does not frequently deal with suppliers listed on Octopart.com, can you or anyone else vouch for bitfoic.com ?

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


Top
 Profile  
Reply with quote  
PostPosted: Thu Jun 08, 2023 5:46 pm 
Offline

Joined: Sun May 13, 2018 5:49 pm
Posts: 247
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 ?
Your description sounds rather fishy and I personally wouldn't bite. I try to stick to the authorized distributors. I generally buy from: Digikey or Mouser, and if they don't have it then Arrow, Avnet, Newark, or Future. Some of those have minimum orders, and distributors like Future are very unlikely to be selling anything except for reels, but sometimes they will have a minimum order quantity of 1.

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/irs20957strpbf/infineon-technologies-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.


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 15 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: