6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Thu Nov 14, 2024 6:44 am

All times are UTC




Post new topic Reply to topic  [ 39 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: Modern UARTs and Uses
PostPosted: Mon Apr 17, 2023 12:13 pm 
Offline

Joined: Sat Oct 09, 2021 11:21 am
Posts: 718
Location: Texas
Hello everyone. I have never used a UART in my computer designs. But Ben Eater has sparked my interest with his new "Serial Interface" videos (here https://www.youtube.com/watch?v=zsERDRM1oy8).

1) It is very well known that the W65C51N has a fairly serious bug in it, and WDC has had no indication of fixing it. Therefore, Kevin (floobydust) uses the SCC2691 and BDD uses the SCC2692. I went on to Mouser and cannot find them, and I figure their search engine is pretty good. Is it no longer in production? What are other modern (still in production) replacements for the W65C51N? I have also seen Garth recommended the MAX3110E (SPI interface) but I don't see that on Mouser anymore either, so I'm guessing it's no longer in production?

2) RS-232 is great, but most modern PCs or Macs don't have that built in. Also, if you are using plain ol' RS-232, you need a MAX232 or some such to meet voltage requirements. How else do you interface the UART? I have played with the FT245RL before, but not seriously enough to know the in's and out's. Is it possible to use an Arduino Nano? Are there other ways to connect your UART to a modern PC easily [ read: USB ]?

3) Why would I use a serial connection to a PC anyways? I know that you can possibly:

a) Send keystrokes to the 6502 and have it send characters back in a terminal like minicom (or telnet?).

b) Send whole binary programs to the 6502 though something like TerraTerm.

Am I correct about this? Is there anything else that it can do for you? How do you use your 6502+UART?

Thanks ahead of time for the learning I will receive.

Chad


Top
 Profile  
Reply with quote  
PostPosted: Mon Apr 17, 2023 2:07 pm 
Offline
User avatar

Joined: Tue Oct 25, 2016 8:56 pm
Posts: 362
1) Assuming you want something that can interface directly with the main parallel bus of your SBC (rather than going through something like SPI), essentially all UARTs currently available are clones or supersets of either the 16C450 (which was the UART used in early IBM PCs) or the SCC269x (the NXP one). They are also pretty much only available in SMT packages. If you want through-hole, and you don't want NOS, you'll need an I2C/SPI based UART, or to use the old-fashioned WDC W65C51N or Zilog Z0847006PSG.
Link: One of many examples of a 16C450-compatible UART available.

2) Actually, many desktop PC motherboards do in fact include an RS-232 serial port on the backplate. Business orientated boards often have 2x serial and a parallel port, even these days. Consumer and "Enthusiast" boards often have an internal serial header which can be accessed using an inexpensive bracket. My own computer falls into the latter camp, and I have just such a bracket in place. But failing that, FTDI make a range of cables and adapters to suit for converting RS-232 or other similar protocols to USB. I'm not sure about an Arduino Nano specifically, but you can definitely use the Arduino Uno as a 232-to-USB adapter: remove the Atmega328p processor chip from the Uno, and connect the TX/RX signals from your UART at TTL level (i.e. not via a MAX232) to the Uno's pins D1 and D0. You now have a somewhat physically fragile but nevertheless fully functional RS-232 to USB adapter - I have done this in the past.

3) In addition to (a) and (b) that you gave, RS-232 can also connect two SBCs together to create networks, or use it as a general peripheral interface bus (there are plenty of industrial widgets which can be controlled, or report data, via 232). For 6502 hobbyist use, it usually comes down to the fact that an RS-232 based interface is one of the easiest and quickest to implement and get you up and running quickly, then you can use that to help you launch off into (and debug) any more complex interfaces you may want. A UART using different logic buffers can also implement RS-422, RS-485, MIDI and DMX-512 protocols, and no doubt others too.

_________________
Want to design a PCB for your project? I strongly recommend KiCad. Its free, its multiplatform, and its easy to learn!
Also, I maintain KiCad libraries of Retro Computing and Arduino components you might find useful.


Top
 Profile  
Reply with quote  
PostPosted: Mon Apr 17, 2023 5:05 pm 
Offline

Joined: Tue Nov 10, 2015 5:46 am
Posts: 230
Location: Kent, UK
Whether you're building something with an LCD display and buttons, or a retro gaming-console with a keyboard and VGA output, a UART can be a great interface for debugging.

My interest is more in the latter, so let's say I'm writing a game with moving graphics and taking input from the keyboard or a joystick... and either (a) things don't look right, or aren't moving right, or (b) everything just stops... freezes... due to a bug. How can I debug that?

Well, one way might be to have an NMI button I can push to enter a monitor. But that's going to need to take over the VGA screen and keyboard so I can interact with it, so either I have to be fancy about it and find somewhere to save al that state, or I'm going to have to accept that some state will be lost.

Another way to go might be to have the debugger use the UART. Now my keyboard I/O state is preserved, as is my video controller state and memory. I can issue commands through the UART to read any state as it existed before I pressed the NMI button.

Even better, with my game running I can use the UART to extract runtime telemetry (taking UART interrupts), and even set breakpoints and debug, single-step, continue, etc.

I think UARTs are great.


Top
 Profile  
Reply with quote  
PostPosted: Mon Apr 17, 2023 6:03 pm 
Offline

Joined: Mon Jan 19, 2004 12:49 pm
Posts: 964
Location: Potsdam, DE
I agree; I can't see me ever designing a processor board without a serial connection - UART->FTDI cable->terminal program->FTDI cable->UART is a tried and true method of talking between a development system and (system agnostically) a terminal.

Curiously, embedded processors like the STM32L07xxx series have at least four (well, depending on pin count) UART ports as well as their one-wire JTAG debugging function; someone thinks they're worth having.

Of course, there are chips from which one might reasonably easily build a JTAG-style interface on a generic digital circuit but frankly life's too short and serial ports are too cheap to bother.

Grant Searle's minimal design uses a no-longer-available (except as NOS or pulls) 68B50 UART which uses a very sneaky trick to automate flow control; he uses the interrupt pin to control CTS so until the processor reads the input port, clearing the interrupt, the sending end waits. The interrupt pin does not go to the processor at all, which instead polls the 68B50's status register. That works with the way the original MS basic was written.

Neil


Top
 Profile  
Reply with quote  
PostPosted: Mon Apr 17, 2023 6:17 pm 
Offline

Joined: Sat Oct 09, 2021 11:21 am
Posts: 718
Location: Texas
Alarm Siren wrote:
Actually, many desktop PC motherboards do in fact include an RS-232 serial port on the backplate.


I don't mind being corrected. What I meant was my home desktops or laptops. Indeed all of the computers here at work do have a serial port. Am I correct in understanding that even if there isn't a DSUB9 on the back of the PC, that it doesn't necessarily mean it's not on the motherboard? Connect to it with a ribbon cable, all is done? That sounds too easy!

sark02 wrote:
Another way to go might be to have the debugger use the UART.


Ah that is a good point. Yes, it can act as a secondary display device in a way, or could send coordinates, codes, or other things that you can't always easily display on the monitor, etc.

barnacle wrote:
I can't see me ever designing a processor board without a serial connection


You are not alone in that school of thought, and that is why I am wanting to discover and learn.

Thanks for the responses so far!

Chad


Top
 Profile  
Reply with quote  
PostPosted: Mon Apr 17, 2023 7:19 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8540
Location: Southern California
sburrow wrote:
1) It is very well known that the W65C51N has a fairly serious bug in it, and WDC has had no indication of fixing it. Therefore, Kevin (floobydust) uses the SCC2691 and BDD uses the SCC2692. I went on to Mouser and cannot find them, and I figure their search engine is pretty good. Is it no longer in production? What are other modern (still in production) replacements for the W65C51N?

For new designs, people are choosing other UARTs, including the 28L92.  Unfortunately that one has recently been discontinued.  This forum topic gives alternatives that are partially compatible.

Quote:
I have also seen Garth recommended the MAX3110E (SPI interface) but I don't see that on Mouser anymore either, so I'm guessing it's no longer in production?

The 3110 is the version with built-in line drivers and receivers.  The one I have mostly been suggesting is the 3100, not the 3110.  The 3100 is just the UART, requiring a separate IC for line drivers and receivers if you want them.  (Not everybody does.)  The 3100 is active and in stock in seven versions at Mouser, including the 14-pin DIP.  See https://www.mouser.com/c/semiconductors ... ystocked=y .

SPI is in such common use that I definitely recommend having it onboard.  The benefit in having it would be for other things too, not just the MAX3100.  Each SPI device needs its own chip-select line; but the clock, MISO, and MOSI lines can be bused to all devices.


Quote:
Also, if you are using plain ol' RS-232, you need a MAX232 or some such to meet voltage requirements. How else do you interface the UART? I have played with the FT245RL before, but not seriously enough to know the ins and outs.

The line drivers and receivers are just inverters which also do the voltage translation.  The UART side is usually 3.3V or 5V logic, and the RS-232 side is the higher ± voltages.

Quote:
Is there anything else that it can do for you? How do you use your 6502+UART?

My workbench computer does not have its own text editor and file system, let alone a big monitor and full keyboard, so it needs a host computer that has these.  I use RS-232 to send source code text from the PC to the workbench computer.  The latter then accepts that text, and interprets, compiles, or assembles, on the fly, as appropriate.  Forth allows writing a new code fragment and trying it instantly, with no need to recompile your whole application to integrate it, nor to send the entire assembled image over the link again.  The new fragment becomes part of the language.

The host computer can be anything that can send the text over RS-232; but it should have a worthy text editor for editing and saving source-code files, and be able to send out a marked block of raw text that could be as short as one character or as long as many pages.  The OS doesn't matter, and the host itself does not normally do any compiling or assembling.  It only handles source-code text.  The editor is never suspended or backgrounded during development, nor does the host need to multitask.

I use an old DOS PC running the MultiEdit professional programmer's text editor and 132-column display, and I've had up to 36 files open at once, windowed and tiled various ways.  I've also used my HP-71B hand-held computer as a host.  The host computer is not running a terminal emulator or any TSRs or anything special.  It just thinks it's sending the block of text to a serial line printer.  The workbench computer just thinks the RS-232 link is from an RS-232 keyboard and that you're a lightning-fast typist who never makes a mistake.

It's hard for people to understand just how simple this is when I demonstrate it.  Maybe some day I'll be able to post a video.  It is possible to have the host computer assemble code and then send Intel Hex code for the workbench computer to take in, but that's not the normal way.

_________________
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 Apr 17, 2023 7:27 pm 
Offline

Joined: Sun May 13, 2018 5:49 pm
Posts: 255
sburrow wrote:
Am I correct in understanding that even if there isn't a DSUB9 on the back of the PC, that it doesn't necessarily mean it's not on the motherboard? Connect to it with a ribbon cable, all is done? That sounds too easy!
Modern motherboards are slowly starting to lose them, but yes, many still have the header for a serial port. Look for a port labeled COM or COM1. Note that the voltages on these ports are not directly compatible with TTL/CMOS and so you will need an interface IC (often called a line driver or level shifter, although both of those terms apply to other ICs too) to go in between your ACIA and the PC serial port. The MAX232 and all of its clones are popular chips to use - I often use an ST3232 for this purpose when connecting to real serial ports, but that chip is surface mount only.
Attachment:
File comment: Serial port header on a motherboard
serial_port_header.png
serial_port_header.png [ 294.62 KiB | Viewed 5006 times ]
Ask the e-commerce site of your choice for "motherboard serial port" and you'll see the mating connector, a short ribbon cable, and a DB-9 external connector mounted on a slot plate for the back of a computer (they have half-height versions too if you need the shorter bracket for your computer). Once you know what to look for, you can just open the computer and look on the motherboard to see if you already have a serial port. They are usually near the bottom edge of the motherboard between the expansion slots and the edge of the board.

I run Forth on my single board computer, so using an ACIA allows me to use my computer's display and keyboard, as well as to write software on my PC in my favorite editor and using modern revision control, and then send it quickly over to my SBC to test it out - all without having to reprogram an EEPROM. This falls into categories 3a AND 3b from your head post, although Forth programs are sent to the SBC as text rather than binary. I also enjoy the ability to do debugging over the serial link. I can not only add extra print statements to the program, but Forth allows interactive inspection of variables, dumping memory, changing values, etc. with immediate results. I use a USB->TTL_Serial_Port cable with my board, so I only need a free USB port on my PC.


Top
 Profile  
Reply with quote  
PostPosted: Mon Apr 17, 2023 7:49 pm 
Offline

Joined: Fri Dec 21, 2018 1:05 am
Posts: 1114
Location: Albuquerque NM USA
Chad,
Most people started out with a serial port as the console peeking into the inner working of microprocessors because it is easy and there are plenty of hardware/software examples. It is easy to load files, display memory, change memory and run program via a serial port. However, you’ve started out with video and keyboard and figured out how to debug your programs with emulator and eprom programmer. It is a more difficult path, but now you’ve done it, the serial port seems less useful to you. But even in your setup, serial port is still a good way to upload new programs from your workstation to the target hardware.

Given serial port is just a file transferring mechanism for you, I think you can implement an extremely cheap serial port by software manipulating hardware handshake and bit banging the transmitter and receiver. You can accomplish that with a couple D flipflops and a buffer.
Bill


Top
 Profile  
Reply with quote  
PostPosted: Tue Apr 18, 2023 12:55 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8483
Location: Midwestern USA
sburrow wrote:
Hello everyone. I have never used a UART in my computer designs. But Ben Eater has sparked my interest with his new "Serial Interface" videos (here https://www.youtube.com/watch?v=zsERDRM1oy8).

I definitely would not be using the 68B50 he is using. That is an extremely primitive UART that doesn’t even have a built-in bit rate generator (note that “baud” and “bit” are different things). You have to generate the correct clock rates according to the speed at which you intend to run the serial interface. In that respect, the 6551 is actually a better part.

Also, the 6850’s handling of hardware flow-control sucks. You have to rewrite the control register each time you want to assert or de-assert RTS. This means maintaining a shadow copy or hard-coding settings into your code, neither of which is particularly desirable.

Quote:
1) It is very well known that the W65C51N has a fairly serious bug in it, and WDC has had no indication of fixing it. Therefore, Kevin (floobydust) uses the SCC2691 and BDD uses the SCC2692...

Floobydust and I (and others) use the dual-channel NXP 28L92—both the 2691 and 2692 are obsolete. Right now, Mouser has over 1600 pieces of the PLCC-44 version in stock. In fact, I just received 10 I had ordered so I’d have plenty handy.

Quote:
2) RS-232 is great, but most modern PCs or Macs don't have that built in. Also, if you are using plain ol' RS-232, you need a MAX232 or some such to meet voltage requirements. How else do you interface the UART? I have played with the FT245RL before, but not seriously enough to know the in's and out's. Is it possible to use an Arduino Nano? Are there other ways to connect your UART to a modern PC easily [ read: USB ]?

TIA-232 is readily added to most PCs with a PCI or PCI-E card. Startech.com makes some good ones.

Quote:
3) Why would I use a serial connection to a PC anyways?...

Despite its age, TIA-232 remains one of the most flexible means of getting two systems to talk to each other. I have never had a computer that didn’t have at least one TIA-232 port, either OEM or aftermarket. You can hook up an amazing variety of things with TIA-232. I even have a credit card reader that is TIA-232.

Using a serial connection and the popular PuTTY terminal program, you can have your PC act as a console on your 65xx contraption. I’ve got a serial port in my ancient Window$ XP workstation hooked up to channel D on POC V1.3. It’s real handy for testing interactive programs.

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


Top
 Profile  
Reply with quote  
PostPosted: Tue Apr 18, 2023 1:07 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8483
Location: Midwestern USA
barnacle wrote:
Grant Searle's minimal design uses a no-longer-available (except as NOS or pulls) 68B50 UART which uses a very sneaky trick to automate flow control; he uses the interrupt pin to control CTS so until the processor reads the input port, clearing the interrupt, the sending end waits. The interrupt pin does not go to the processor at all, which instead polls the 68B50's status register. That works with the way the original MS basic was written.

I wouldn't call it a “sneaky trick,” but instead a “naive approach.” His arrangement forces the MPU to constantly read the 6850’s status register and see if something was received. That is terribly inefficient and essentially unworkable in almost all cases in which other things besides TIA-232 processing are going on. It would be like you having to pick up the phone every few minutes to see if someone is calling, instead of having the phone ring when someone does call.

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


Top
 Profile  
Reply with quote  
PostPosted: Tue Apr 18, 2023 5:40 am 
Offline

Joined: Mon Jan 19, 2004 12:49 pm
Posts: 964
Location: Potsdam, DE
A naive approach perhaps, but he was presumably designing something to work with the MS basic.

Don't forget, at some point in any input routine you're going to have to poll *something* to see whether there is any received data requiring your attention. Using a buffer driven by an interrupt is in many ways nicer - in particular because it can largely look after receiving new characters itself without bothering the main program flow, but sooner or later you're going to have to see if the head and tail pointers differ and do something about it.

I can't offhand think of many applications - games perhaps? - when you need an instant interrupt to say a character has arrived... if you're waiting for characters either you're spinning in a loop waiting for the buffer to be not empty, or you're spinning in a loop waiting for the RX register to be not empty. Grant's method moves the buffering off the board and onto the terminal (or more likely, a much more capable computer) but significantly doesn't require you to have a working interrupt routine before you can receive anything.

I can't agree with you that it's terribly inefficient - at least, any more inefficient than other approaches.

Of course, what we'd probably all like is a UART with a large internal buffer to take the strain!

Neil


Top
 Profile  
Reply with quote  
PostPosted: Tue Apr 18, 2023 7:33 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10977
Location: England
For sure I've used a TTL-UART connection to a host machine for a console and for debug - but also for a filesystem, in at least a couple of different ways. Get the right kind of USB adapter and flow control will work properly.

About UART choices, I posted this nearby:
BigEd wrote:
FWIW, in recent discussions about an SBC design we looked into the question of available UARTs, and I have some notes (by @hoglet) from that time, shared with permission:
Quote:
My summary would be:

1. Having a UART that supports automatic-RTS with a programmable threshold is not essential. This is because the mini MOS UART driver needs to be interrupt driven with a buffer, otherwise escape detection won't be possible. And so that driver can manually control RTS (as the current MC6850 Mini-MOS driver does) based on the driver receive buffer threshold. This is better anyway, as that buffer will be larger (256b). So really the main purpose of any buffering on UART itself is just to overcome any interrupt latency. So 4 bytes or more is sufficient, and you could possible get away with less.

2. Looking at the currently available Dual Channel UARTs, they fall into just the following three families:

  • "type 16", for example TL16C2552 (descendents of the 16550)
  • "type 92", for example Exar XR88C92/XR88C192 / NXP SC28L92 / TI 28L28) (descendants of the SCC2692, SC26C92, SC2N681
  • "type 681", for example Exar XR68C681 (descendents of the MC68681)
One key difference is the "type 92" and "type 681" both have a general purpose counter/timer, which the "type 16" lacks.

None are available in DIP, and in fact PLCC-44 is the most hobbyist friendly package still in common use.
The "type 16" seems to be the most popular / widely available, and is consequently a bit cheaper, but you would need a separate device like a 6522 for timer interrupts. Or use an I2C RTC and interface with something like a PCF8584.

We then dug a little deeper, and it turns out the "type 92" and "type 681" have compatible pinouts, and very similar register sets, so could be easily supported by a common driver. The only real difference is the bus interface: the "type 681" can be more easily interfaced to a 68K. But for interfacing to a 6809 there is little difference.

So the conclusion was probably to go with the 92 or 681, in a PLCC44 package, e.g.


For me, one important point is the discovery that some modern UARTs also have timers and GPIO, which means the UART can also serve as a VIA: one peripheral chip instead of two. And we also thought a dual UART (DUART) could be useful if one channel is for user access and the other for debug, or for a serial-connected subsystem such as storage, or display.

Although the project in question is for a 6809 system, everything applies to 6502 equally well.


Top
 Profile  
Reply with quote  
PostPosted: Tue Apr 18, 2023 9:28 am 
Offline
User avatar

Joined: Tue Oct 25, 2016 8:56 pm
Posts: 362
Everything SamCoVT said in his post (quoted below) is correct, but just to add sometimes the motherboard's serial port header will be disabled by default, and you'll need to turn it on in the BIOS settings.

SamCoVT wrote:
sburrow wrote:
Am I correct in understanding that even if there isn't a DSUB9 on the back of the PC, that it doesn't necessarily mean it's not on the motherboard? Connect to it with a ribbon cable, all is done? That sounds too easy!
Modern motherboards are slowly starting to lose them, but yes, many still have the header for a serial port. Look for a port labeled COM or COM1. Note that the voltages on these ports are not directly compatible with TTL/CMOS and so you will need an interface IC (often called a line driver or level shifter, although both of those terms apply to other ICs too) to go in between your ACIA and the PC serial port. The MAX232 and all of its clones are popular chips to use - I often use an ST3232 for this purpose when connecting to real serial ports, but that chip is surface mount only.
Attachment:
serial_port_header.png
Ask the e-commerce site of your choice for "motherboard serial port" and you'll see the mating connector, a short ribbon cable, and a DB-9 external connector mounted on a slot plate for the back of a computer (they have half-height versions too if you need the shorter bracket for your computer). Once you know what to look for, you can just open the computer and look on the motherboard to see if you already have a serial port. They are usually near the bottom edge of the motherboard between the expansion slots and the edge of the board.

I run Forth on my single board computer, so using an ACIA allows me to use my computer's display and keyboard, as well as to write software on my PC in my favorite editor and using modern revision control, and then send it quickly over to my SBC to test it out - all without having to reprogram an EEPROM. This falls into categories 3a AND 3b from your head post, although Forth programs are sent to the SBC as text rather than binary. I also enjoy the ability to do debugging over the serial link. I can not only add extra print statements to the program, but Forth allows interactive inspection of variables, dumping memory, changing values, etc. with immediate results. I use a USB->TTL_Serial_Port cable with my board, so I only need a free USB port on my PC.

_________________
Want to design a PCB for your project? I strongly recommend KiCad. Its free, its multiplatform, and its easy to learn!
Also, I maintain KiCad libraries of Retro Computing and Arduino components you might find useful.


Top
 Profile  
Reply with quote  
PostPosted: Tue Apr 18, 2023 6:01 pm 
Offline

Joined: Mon Jan 19, 2004 12:49 pm
Posts: 964
Location: Potsdam, DE
And one point, of which I'm sure we're all aware but it's still worth pointing out, I think: remember that there is a difference between UART serial output and RS-232. The main thing to be aware of is that the RS-232 signal moves either side of zero volts by at least three volts and often as much as twelve - so from -12v to +12v potentially.

The UART input and output expect to see/provide either zero to 3.3v or zero to 5v depending on Vcc. The signal is also the other way up from RS-232 - it is logic high for a one, while RS-232 is at it's negative level.

As an added bonus, the signal idles at logic high. This means that if you're plugged into a logical UART signal (either direct or through an RS-232 converter) and your device isn't powered, you can find that it actually *is* powered through the substrate diodes because of that logic high... can be surprising.

Neil

EDITED at Dr Jeffyll's suggestion to clarify the voltage levels for UARTs.


Last edited by barnacle on Wed Apr 19, 2023 5:56 am, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: Tue Apr 18, 2023 9:09 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8483
Location: Midwestern USA
barnacle wrote:
A naive approach perhaps, but he was presumably designing something to work with the MS basic.

I didn’t get that impression. I could have been less charitable and referred to his “naive approach” as a “crude hack.” :wink:

Quote:
Don't forget, at some point in any input routine you're going to have to poll *something* to see whether there is any received data requiring your attention.

That’s true, of course, but I think you may be missing the point. If you use foreground processing to get data from a UART, you slow down the local system to the pace at which the UART is operating. Also—and this may not be as obvious, doing what Grant Searle is doing effectively slows down the remote station, since its transmission routine will stall as long as the local station’s 6850’s /IRQ is asserted, since it is de-asserting RTS and preventing the remote station from sending.

The reason interrupt-driven I/O is used is to decouple the pace at which an external interface runs from the pace at which the host system runs. Use of foreground processing to talk to I/O hardware that can be serviced via interrupts drags down everything, since MPU cycles are repeatedly being consumed to check a condition that could report itself without MPU involvement.

Quote:
I can't agree with you that it's terribly inefficient - at least, any more inefficient than other approaches.

You must not have done a lot of low-level programming to think that. :D Treating asynchronous I/O as a foreground process is beyond terribly inefficient, especially when involving an external data interface that runs slowly relative to the host system’s MPU, and especially when involving an external data interface that communicates with another device that emits data at unpredictable times.

Quote:
Of course, what we'd probably all like is a UART with a large internal buffer to take the strain!

You mean a FIFO, not a buffer (they are two different animals). I use the 28L92, which has 16-deep FIFOs for both receivers and transmitters. In most cases, the benefit of the UART having FIFOs is in reduced interrupt activity, as well as a lessened risk of a data overrun on the receiver side.

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


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

All times are UTC


Who is online

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