RetroBrew Computers Forum
Discussion forum for the RetroBrew Computers community.

Home » RBC Forums » General Discussion » ECB-USB-FIFO: Fast USB interface for ECB machines
ECB-USB-FIFO: Fast USB interface for ECB machines [message #1907] Sat, 04 March 2017 13:36 Go to next message
will is currently offline  will
Messages: 144
Registered: October 2015
Senior Member
Hi everyone

I am pleased to announce a new ECB expansion board that I have been working on for the last few weeks. It provides a nice fast interface to a PC over USB. I am measuring sustained receive and transmit rates of 690KB/sec (5.65Mbit/sec) using this board with my Mark-IV SBC (Z180 at 2x18.432MHz, 2 I/O wait states).

The board is based around the FTDI FT232H chip, configured in asynchronous 8-bit wide FIFO mode. To avoid having to solder 0.5mm pitch connections I have chosen to use the Adafruit FT232H Breakout Board (product 2264) which costs about $15 and is in stock at Mouser (part 485-2264), Digikey (part 1528-1449-ND), and no doubt various other distributors.

The connection is presented to the PC as a USB serial device, so it can be treated just like a normal serial port. The baud rate and other serial settings configured on the Virtual COM Port are ignored, it just provides an 8-bit clean path at whatever rate you can pump data in or out of it. The FT232H has large (1KB) FIFOs for both receive and transmit.

The board decodes 4 I/O addresses on the ECB bus. The A2-A7 bits can be freely configured so it can be located anywhere in the I/O address space. One I/O address is read/written to transfer data to/from the FIFOs. One I/O address is a status register, with the important receive and transmit FIFO status bits at the top and bottom so RLA/RRA can shift these bits into the carry flag, permitting tight loops. A third I/O address can be written to signal "send immediate" to the FT232H, this causes any data in the transmit FIFO to be sent over USB at the earliest opportunity (data is also sent automatically after a 17ms timeout expires or when the FIFO reaches half full).

The board supports generating interrupts on either (or both) of two conditions: data waiting in receive FIFO, or space available in transmit FIFO. The interrupt can be routed to ECB lines NMI, INT, IR0--IR7. Interrupts are controlled by writing to the status register.

In addition to the 8-bit datapath through the FIFO, there are two general purpose I/O lines, one in each direction, connected to the FT232H. I have not tested these (or come up with any use for them!) yet, but they were "free" to add to the design. They are controlled by reading/writing the status register.

To keep PCB size (and cost) down, the board is smaller than a normal ECB board. It is exactly 100mm wide (0.076mm narrower than a normal board, only 3 thousandths of an inch, you won't notice) and only 87mm high (about half as tall as a normal board). This means it fits within the 100x100mm envelope where some PCB manufacturing services offer a cheaper "prototyping" service.

The FT232H chip's FIFO mode is slightly odd (arguably designed incorrectly) in that it clocks in data on the falling edge of its /WR input, instead of the standard rising edge. ECB-USB-FIFO handles this by delaying the /WR signal by approx 32ns which easily meets the 5ns setup and 5ns hold time requirements for the FT232H. There is provision on the board to allow for longer or shorter delays if required, although I doubt adjusting this should be required.

The lack of configuration parameters means the board is very easy to program. I have a working interrupt-driven TTY driver for FUZIX written up, it's just a few lines of code and worked on the first try. It was also very quick to write a fast file transfer program called FIFOPIPE based on my earlier FATPIPE program.

I am planning to write a driver for FUZIX to enable remote disk and network access using the DriveWire protocol. I also plan to write a driver for Linux on KISS-68030 to use this as a TTY for a fast PPP link.

I am going to do a manufacturing run of these boards. If you are interested please post here or PM me to register your interest. Note that the production run boards will be made with green soldermask, not red as shown in the photos. I'm not sure how much the boards will cost, depends on volume, probably about $10.

The schematic for the board is attached. Photos of the bare and assembled board are below.

Feedback welcomed. My thanks to John and to Wayne for their advice on the design.

http://sowerbutts.com/retro/ecb-usb-fifo/photos/IMG_20170304_122659-1024.jpg
http://sowerbutts.com/retro/ecb-usb-fifo/photos/IMG_20170304_104853-1024.jpg
http://sowerbutts.com/retro/ecb-usb-fifo/photos/IMG_20170304_104902-1024.jpg
Re: ECB-USB-FIFO: Fast USB interface for ECB machines [message #1914 is a reply to message #1907] Sun, 05 March 2017 12:05 Go to previous messageGo to next message
denis2342 is currently offline  denis2342
Messages: 6
Registered: February 2017
Junior Member
Hi will,

if these boards are working on the KISS68030 I'm in for four boards ;) Maybe you can send them together.

What else are you planning? You very active now with the ECB stuff.

btw, what is the 0-ohm resistor for?

[Updated on: Sun, 05 March 2017 12:37]

Report message to a moderator

Re: ECB-USB-FIFO: Fast USB interface for ECB machines [message #1916 is a reply to message #1914] Sun, 05 March 2017 14:39 Go to previous messageGo to next message
will is currently offline  will
Messages: 144
Registered: October 2015
Senior Member
I've noted your order. I am planning to post out all FIFO and Backplane boards together.

The boards appear to work fine with the KISS-68030 -- it's I/O cycles have to be slower than my Z180 to suit the the NS32202. Poking at card from the monitor works fine; I have not written a driver for Linux yet. This means interrupts on the 68030 are untested, but in principle they should work fine.

>btw, what is the 0-ohm resistor for?

If you look at the schematic, lower left corner, you'll find C12 and R3. They form an LC circuit which can be used to further delay the /WR signal to the FT232H if required. I don't anticipate it will be needed so the builder should omit C12 (hence "0uF" value) and fit a wire jumper in place of R3 (0 ohms). The silkscreen on the final boards will have a little text to inform the builder to read the notes before populating those components.

It's also possible to bypass some of the gate delays by running a patch from R3 to pins 5 or 7 on U3 to reduce the delay to the /WR signal should the builder require this -- again I don't anticipate this will be needed, but this way we have the option without needing to cut any traces.

>What else are you planning? You very active now with the ECB stuff.

I'm not working on any more ECB boards at this time, but open to suggestions!
Re: ECB-USB-FIFO: Fast USB interface for ECB machines [message #1918 is a reply to message #1907] Sun, 05 March 2017 16:16 Go to previous messageGo to next message
ab0tj is currently offline  ab0tj
Messages: 43
Registered: October 2015
Location: Colorado
Member
Hi Will,

I would be interested in one of these boards. A high speed PPP link on the kiss system without messing with custom baud rates definitely interests me.

Thanks,
Alex
Re: ECB-USB-FIFO: Fast USB interface for ECB machines [message #1919 is a reply to message #1918] Sun, 05 March 2017 17:05 Go to previous messageGo to next message
will is currently offline  will
Messages: 144
Registered: October 2015
Senior Member
Thanks, I have noted your order.
Re: ECB-USB-FIFO: Fast USB interface for ECB machines [message #1925 is a reply to message #1919] Mon, 06 March 2017 06:07 Go to previous messageGo to next message
denis2342 is currently offline  denis2342
Messages: 6
Registered: February 2017
Junior Member
I assume that the Z180 is slower than the 68030 and that the 68030 would get a higher throughput rate with the FTDI chip?
Re: ECB-USB-FIFO: Fast USB interface for ECB machines [message #1933 is a reply to message #1925] Mon, 06 March 2017 12:11 Go to previous messageGo to next message
will is currently offline  will
Messages: 144
Registered: October 2015
Senior Member
Just did a quick transmit speed test on the 68030. I let gcc generate the code. To make it comparable I had it read data out of memory (I used the full text of Alice in Wonderland, about 73KB) and sent that repeatedly. I measured time to transmit 1MB as 1.595sec which is 642KByte/sec. I can probably improve on this a bit by hand-tuning the transmit loop, but I wouldn't expect to get too far above 700KB/sec.

700KB/sec is about twice the speed we can read data off the IDE interface on the MF/PIC.

[Updated on: Mon, 06 March 2017 13:02]

Report message to a moderator

Re: ECB-USB-FIFO: Fast USB interface for ECB machines [message #1986 is a reply to message #1907] Fri, 10 March 2017 12:37 Go to previous messageGo to next message
pbirkel is currently offline  pbirkel
Messages: 42
Registered: October 2015
Member
Will: Please sign-me-up for three boards. THX!

will wrote on Sat, 04 March 2017 13:36
Hi everyone

I am pleased to announce a new ECB expansion board that I have been working on for the last few weeks. It provides a nice fast interface to a PC over USB. I am measuring sustained receive and transmit rates of 690KB/sec (5.65Mbit/sec) using this board with my Mark-IV SBC (Z180 at 2x18.432MHz, 2 I/O wait states).

To keep PCB size (and cost) down, the board is smaller than a normal ECB board. It is exactly 100mm wide (0.076mm narrower than a normal board, only 3 thousandths of an inch, you won't notice) and only 87mm high (about half as tall as a normal board). This means it fits within the 100x100mm envelope where some PCB manufacturing services offer a cheaper "prototyping" service.

I am going to do a manufacturing run of these boards. If you are interested please post here or PM me to register your interest. Note that the production run boards will be made with green soldermask, not red as shown in the photos. I'm not sure how much the boards will cost, depends on volume, probably about $10.

Re: ECB-USB-FIFO: Fast USB interface for ECB machines [message #2024 is a reply to message #1986] Wed, 15 March 2017 14:36 Go to previous messageGo to next message
ajacocks is currently offline  ajacocks
Messages: 6
Registered: November 2015
Junior Member
I'm interested in a board, as well.

- Alex
Re: ECB-USB-FIFO: Fast USB interface for ECB machines [message #2026 is a reply to message #1907] Wed, 15 March 2017 17:10 Go to previous messageGo to next message
davetypeguy is currently offline  davetypeguy
Messages: 41
Registered: November 2015
Location: Chapin, SC
Member
Will,

I'd like two boards.

Thanks!

Dave
Re: ECB-USB-FIFO: Fast USB interface for ECB machines [message #2036 is a reply to message #2026] Fri, 17 March 2017 08:09 Go to previous messageGo to next message
will is currently offline  will
Messages: 144
Registered: October 2015
Senior Member
PCBs have arrived, I've assembled one and it works well.

I will wait for the Mini Backplane boards to arrive (expected any day now) before I get in touch with everyone who has ordered boards.

I have sufficient stock to meet all orders placed to date, plus a few spares.

Edit: Well the postman just dropped off the Backplane boards, and they work too, so I'll be writing to everyone over the weekend to get details for shipping!

http://sowerbutts.com/retro/ecb-usb-fifo/photos/green.jpg

[Updated on: Fri, 17 March 2017 09:06]

Report message to a moderator

Re: ECB-USB-FIFO: Fast USB interface for ECB machines [message #2050 is a reply to message #2036] Sun, 19 March 2017 16:59 Go to previous messageGo to next message
will is currently offline  will
Messages: 144
Registered: October 2015
Senior Member
Hi everyone

The schematic, Bill of Materials, notes on construction, documentation of the I/O Registers and some sample code have now been posted to the Wiki. The first boards will be shipped tomorrow. I have some stock of boards left over for future orders.

Hopefully everyone will find the construction straightforward. I anticipate most problems will be with programming the serial EEPROM on the FT232H board. I've written a short program to do this under Linux, and the FT_PROG program is available for Windows (although I found it to be not exactly straightforward to use). Do post here if you have any problems with the construction.

Thanks

Will
Re: ECB-USB-FIFO: Fast USB interface for ECB machines [message #2057 is a reply to message #2050] Tue, 21 March 2017 15:56 Go to previous messageGo to next message
will is currently offline  will
Messages: 144
Registered: October 2015
Senior Member
Hi everyone

Quick update:

Fitting 74AHCT139 at U6 and 74AHCT244 at U9 gives a worthwhile improvement in FIFO read timing. This change has allowed me to reduce the I/O wait states from 2 to 1 on my Mark IV SBC (Z180 @ 2x18.432=36.864MHz).

This has been tested reasonably thoroughly -- 4GB of data transferred both in and out without any error.

My recommendation is therefore to fit 74AHCT139 at U6 and 74AHCT244 at U9. I am currently using 74LS everywhere else.

Thanks

Will

Update: Now transferred 32GB data in both directions (64GB total) without problems. I think we can say it's working reliably!

[Updated on: Thu, 23 March 2017 01:05]

Report message to a moderator

Re: ECB-USB-FIFO: Fast USB interface for ECB machines [message #2059 is a reply to message #2057] Thu, 23 March 2017 06:07 Go to previous messageGo to next message
ewout is currently offline  ewout
Messages: 30
Registered: October 2015
Member
Very nice!
Re: ECB-USB-FIFO: Fast USB interface for ECB machines [message #2061 is a reply to message #2059] Thu, 23 March 2017 12:53 Go to previous messageGo to next message
will is currently offline  will
Messages: 144
Registered: October 2015
Senior Member
I've made some measurements with my oscilloscope to see how the timing changes as I replace 74LS with CMOS parts.

Channel 1 (Yellow): board select from 74LS688 ("/SELECT", U4 pin 19)
Channel 2 (Cyan): output enable on FIFO status line driver (U9 pin 1)
Channel 3 (Magenta): ECB bus line D0 (U3 pin 2, in retrospect this was not an interesting signal!)

After /SELECT (channel 1) falls the signal passes through a '139 and a '32 before ending up at U9 (channel 2).

Firstly here's the board using only 74LS parts throughout. The delay from /SELECT to U9's output enable is about 21.4ns.
http://sowerbutts.com/retro/ecb-usb-fifo/photos/scope-74ls-only.png

I then replaced U6 and U9 with 74AHCT. The delay is reduced by 8.4ns to 13ns (-39% versus 74LS).
http://sowerbutts.com/retro/ecb-usb-fifo/photos/scope-74ls32s-cmos-u9-u6.png

I then additionally replaced U7 and U11 with 74ACT32. The delay is reduced by a further 4.8ns, to 8.2ns (-62% versus 74LS). You can really see how much noise the fast CMOS introduces!
http://sowerbutts.com/retro/ecb-usb-fifo/photos/scope-74-mostly-cmos.png

I was surprised how much ringing the CMOS introduced, I had really tried to reduce induction by using short wires, soldering them the board and wrapping around the tip and ground of my scope probe. Does anyone know of a better way to connect and ground the probes? Or is this ringing actually in the circuit and not an artefact of my poor probe technique?
http://sowerbutts.com/retro/ecb-usb-fifo/photos/probing.jpg

Upshot is that replacing the 74LS32 with 74ACT32 is probably not necessary but does give a bit more safety margin. While my testing suggests it is not required, I am going to keep the 74ACT32 parts installed.

[Updated on: Thu, 23 March 2017 17:58]

Report message to a moderator

Re: ECB-USB-FIFO: Fast USB interface for ECB machines [message #2074 is a reply to message #2061] Fri, 24 March 2017 13:06 Go to previous message
etchedpixels is currently offline  etchedpixels
Messages: 72
Registered: October 2015
Member
If you have a real serial link I would avoid drivewire like the plague. Drivewire is a gloriously clever hack but it's got some really deep seated design problems
- No windowing
- Client has to poll server regularly for traffic
- No fast way to avoid a full poll if nothing is pending
- Each client poll is basically a busy wait for the latency of response of the server
- Server does not guarantee if you choose to let a given channel block (eg to wait for one of your processes) it won't bung up the entire DriveWire server.

It's also seriously lacking in error detection and recovery, despite being more complex than protocols that do handle it Cool

Given you've got a FIFO and a slow host that I suspect needs to poll to hit the full data rate you might want to look at the link level for localtalk. This pulls a wonderful dirty trick where the header for a packet fits into the FIFO and is then followed by a small delay and the data, so the process is

Header burst
{ IRQ
{ inspect fifo - decide what to do

these two fit into the latency of the FIFO filling plus any delay you need to add on the fast PC end

poll if need for data block.


Even for disk I/O it's probably worth something like that so you don't keep locking the box up waiting fior the other end to service the request, but get to do IRQ handling until the block
arrives back.

[Updated on: Fri, 24 March 2017 13:07]

Report message to a moderator

Previous Topic: SBC6120 BOM for Farnell
Next Topic: 10 & 40-way shrouded RA connectors for SBC6120


Current Time: Fri Dec 15 10:05:51 PST 2017

Total time taken to generate the page: 0.03150 seconds