Choice of UART for 8 bit computer project - Page 1
Forum section: electronics / projects

author: ChristofferB
author_rank: Frequent Contributor
timestamp: November 15, 2015, 01:31:19 am
content: Hello again, all!I'm in the midst of a z80 based computer project, which is currently Little more than the CPU module, Memory, some LED's and some switches. See Attachment.Now is the time to design a serial interface for it, around one of the old UARTs. I'd prefer not to buy any, but since I have no experience with any of them, I'd love some recommendations on which one I should use.Speed is not in any waya design criteria, as I'm planning on running all serial in the 1200bd to 9600bd.What is, however, is ease of use. I'm not terribly experienced in assembly-fu, so something that requires less coding would be optimal, unless there is one of them which has a lot of example code to copy/learn from.Here's what I have in stock:- i8250 UART- i8251 UART- i8274 UART-ish- SCN 2681 DUART- HM83450 UART- 6850 ACIAWhich one would you go with? Is there any special concerns I don't know with any of these?Thanks in advance!--Christoffer

author: DrGeoff
author_rank: Frequent Contributor
timestamp: November 15, 2015, 01:42:22 am
content: Since you don't have any COM8017's, which were dead eady to hook up for anything, I'd go for the DUART, mainly because I used them extensively in the late 80's with 68K developments.

author: westfw
author_rank: Super Contributor
timestamp: November 15, 2015, 10:56:34 am
content: The 8250 is what got used in the IBM PC, and has become a sort of industry standard. Modern PC UARTs are essentially 8250s with deep fifos and additional features, 8250-like uarts show up in modern microcontrollers (NXP LPC ARM chips, for instance) and as free FPGA IP, and so on. I think this would be my first choice. Maybe one of the more modern equivalents, like a 16552 Dual UART.The 8251 is simpler, and was pretty commonly used with intel 8-bit chips, back in the day. If you're looking at OLD z80 code, you can probably find 8251 code.The 2681 is a fine device, used in many early cisco Terminal Servers. 4-byte receive fifo. Separate receive/transmit speeds (which was once important.)Good selection of external signals for generating interrupts/etc. Not too common, though.6850 ACIA was used mostly with 6800-like buses; I think it might have "issues" connecting to a z80.One thing to watch out for is whether you'll need an external Baud Rate Generator. The 8251 needs external clocks, for instance.

author: Psi
author_rank: Super Contributor
timestamp: November 15, 2015, 11:00:26 am
content: would i be shunned for recommending a AVR coded to be a simple UART interface

author: obiwanjacobi
author_rank: Super Contributor
timestamp: November 15, 2015, 12:40:37 pm
content: I remember having a Z80 SIO (and PIO and CTC)... ahh, the good old days. Lovely project(sorry no real advice here for you just wanted to give a thumbs up)

author: bitslice
author_rank: Frequent Contributor
timestamp: November 15, 2015, 01:48:23 pm
content: For ease of coding and of interfacing I'd just go and buy a Zilog SIO/2 for 40 DKK,finding software for such an interface must surely be easier?Please update us on your project, I'm always interested in Z80 stuff

author: Ian.M
author_rank: Super Contributor
timestamp: November 15, 2015, 02:34:43 pm
content: I'm going to be heretic and sayhttp://www.ftdichip.com/Products/FT245R.htm, However, at some stage you may need a real UART as well.

author: IanJ
author_rank: Unknown
timestamp: November 15, 2015, 05:36:25 pm
content: Hi all,Ahhh, back in the day we used 6402 UART's on the Z80.http://www.intersil.com/content/dam/Intersil/documents/hd-6/hd-6402.pdfIan.

author: georges80
author_rank: Frequent Contributor
timestamp: November 15, 2015, 05:43:51 pm
content: For such a project, which is essentially some learning and having fun, I'd suggest the 2681. It is simple to configure and works just fine. The zilog sio is very powerful (especially the synchronous modes) but as such can be a bit more overwhelming to figure out.Back in the day I remember working in a small company in the backwaters of Perth where we designed our own business computer that was z80 based. The lead engineer (I had just graduated from uni) that designed it used an sio to provide the uart link to a CRT terminal and the 2nd channel was used to handle the data stream to/from the 8" floppies. The sio in synchronous mode could do the CRC stuff and all interfaced via the Z80 DMA to handle the data sectors.Have fun with your project. The 8080A and Z80 are the first microprocessors that I ever worked with and got me fully addicted to the career path of being an EE. Ah, the good old EARLY days of Byte magazine, S100, CP/M and even that 4k Basic from that little software company microsoft. Cassette NRZ to store/recall (sometimes) programs and so on...cheers,george.

author: woodchips
author_rank: Frequent Contributor
timestamp: November 15, 2015, 06:45:14 pm
content: It is a long time ago but be wary of the Intel 8250. From memory it has no receive buffering at all, so you have just one bit, not byte, time to read the character before overrun. The 8250 is very rare, quickly replaced by the 8251 which did have a one character receive buffer.I used the 6850 lots of times, but with a 6800 bus, probably not worth the effort with a Z80.

author: ChristofferB
author_rank: Frequent Contributor
timestamp: November 15, 2015, 10:14:54 pm
content: Wow, thanks for the interest! A lot of you are suggesting the 2681, and it does seem to be the one with the most features (even has some general purpose outputs that could be used for other things, it seems), but I am gravitating towards the 8251, since ijust(why didn't I start there?) found a chapter specifically about that chip, interface and programming in my 8086/8088 system design book. I also can't find any application examples for the 2681.But I've made a Europe Card Bus /DIN4.1612 to breadboard adapter, so it should be fairly fast to try them both and whip some simple code up.

author: TerraHertz
author_rank: Super Contributor
timestamp: November 16, 2015, 06:15:33 am
content: Or, the ST16C550. Similar to Nat Semi 16550. UART with 16 byte FIFOs.http://pdf1.alldatasheet.com/datasheet-pdf/view/82557/EXAR/ST16C550CP40.htmlReason I suggest it, is that I have several hundred of them (40 pin DIP) new in tubes, and you can have a tube or two if you pay postage. From Australia.

author: coppice
author_rank: Super Contributor
timestamp: November 16, 2015, 06:23:46 am
content: Definitely don't use an 8251. Its seriously buggy. If you like the 8251, make sure you actually use an 8251A.

author: ChristofferB
author_rank: Frequent Contributor
timestamp: November 16, 2015, 10:54:44 pm
content: Okay I had my head on completely backwards today. I managed to hook up my UART with reverse voltage, inverted reset (making it reset at all times when the processor is not), and get pinouts wrong. Some days are slower than others. Anyway, I got a 8251C hooked up and it actually sent data! Although only gibberish, and only when you placed a finger near it for some coupling trickery. So I'll probably go with my 2681 (even though this was probably more my fault than the 8251s). I read (specifically about the 8251), that from the processor's point of view, it's just another parallel input/output port, and act as such. Is this a general thing with UARTS?--Christoffer

author: georges80
author_rank: Frequent Contributor
timestamp: November 17, 2015, 12:15:08 am
content: Uart (old school parts) on the processor side will look like a parallel data port (8 bit data bus). It'll have a Chip Select and typically an address bit or two to choose between the data or control registers. Read and write strobes for direction.You of course DO HAVE TO POLL (or use interrupts) to decide when you can output another byte into the data register fifo (so as to not overflow it). Ditto to see if new data is waiting to be read in from the receive fifo. The fifo might only be one deep on some Uarts...Time to read the Uart datasheetcheers,george.