Differences
This shows you the differences between two versions of the page.
| boards:ecb:usb-fifo:start [2019/12/08 10:25] – Revision from 2019-12-08 | boards:ecb:usb-fifo:start [2026/06/15 12:12] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| /* Imported from Wayback Machine | /* Imported from Wayback Machine | ||
| - | | + | |
| - | | + | |
| | | ||
| */ | */ | ||
| - | ====== | + | ====== |
| - | This is a sitemap over all available pages ordered by [[https:// | + | ===== Introduction ===== |
| - | [[boards:ecb:usb-fifo:start|**boards**]] | + | The ECB-USB-FIFO board provides a high-speed interface for an EuroCard Bus machine to talk to a modern PC over USB. The board is based around the widely supported |
| - | [[boards: | + | On a KISS-68030 using an optimised transfer routine speeds in excess of 1MByte/sec (8Mbit/sec) can be achieved. |
| - | [[boards: | + | On the PC the interface is presented as a standard USB serial interface (a “Virtual COM port” on Windows, / |
| - | [[boards: | + | The FT232H has a separate FIFO (first-in-first-out queue) for the receive and transmit directions. Each FIFO is 1KB in size. Data is transferred to/from the FIFOs over the USB link in blocks of up to 512 bytes. A “send immediate” operation is supported which causes any queued data in the transmit FIFO to be sent over the USB link at the earliest opportunity, |
| - | [[boards:ecb: | + | 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. Enabling and masking of interrupts is under software control. |
| - | [[boards: | + | In addition to the 8-bit data path through the FIFO, there are two GPIO data lines (one input and one output) connected from the FT232H to the Status Register. These are not currently used but they were “free” to add to the design. To make use of them I believe you would need to use the FTDI MPSSE commands. |
| - | [[boards: | + | ===== ECB I/O Registers ===== |
| - | [[boards: | + | The ECB-USB-FIFO board decodes four adjacent I/O registers. The user can choose the top 6 bits (A2–A7) of the I/O address so it can be located anywhere in the I/O address space. The recommended base address is 0x0C (so the card occupies addresses 0x0C–0x0F). |
| - | [[boards:ecb: | + | The register use is as follows: |
| - | [[boards:ecb:usb-fifo:start|**playground**]] | + | ^I/O address |
| + | |BASE+0 (0x0C)|**Read:** Remove one byte of data from the receive FIFO\\ **Write:** Insert one byte of data into the transmit FIFO | | ||
| + | |BASE+1 (0x0D)|**Read:** Read the Status Register\\ **Write:** Write to the Status Register (note that not all bits are writable) | ||
| + | |BASE+2 (0x0E)|**Read:** No effect (junk value is returned)\\ **Write:** Send Immediate – any data queued in the transmit FIFO is sent over the USB at the earliest opportunity. Without this the data will be queued until a timeout (~17ms) expires. Note that the value written to the register is ignored, any value written to the register will trigger the Send Immediate signal.| | ||
| + | |BASE+3 (0x0F)|**Read: | ||
| - | [[boards:ecb: | + | The Status Register bits have the following meanings: |
| - | [[boards:ecb:usb-fifo:start|**wiki**]] | + | ^Bit (Value)^Meaning |
| + | |0 (0x01) | ||
| + | |1 (0x02) | ||
| + | |2 (0x04) | ||
| + | |3 (0x08) | ||
| + | |4 (0x10) | ||
| + | |5 (0x20) | ||
| + | |6 (0x40) | ||
| + | |7 (0x80) | ||
| - | [[boardinventory|Boardinventory]] | + | Interrupts: Interrupt requests are controlled in two stages. The first stage is controlled by the **INT_TX** and **INT_RX** bits in the Status Register. Setting these bits to 1 causes an interrupt to be requested when the transmit FIFO has space available (**INT_TX**), |
| - | sidebar | + | For example, software which wants to receive an interrupt when data arrives in the receive FIFO over USB should set both **INT_RX** and **INT_ENABLE**. If the interrupt line is shared with multiple devices the interrupt service routine can then check the **IRQ** bit to determine if the USB-FIFO card is requesting the interrupt before calling the USB-FIFO interrupt handler code. |
| - | start | + | When the USB cable is disconnected, |
| - | [[whatsnew|Whatsnew]] | + | When the ECB machine is reset, the **INT_ENABLE**, |
| + | |||
| + | ===== ECB Card Jumpers ===== | ||
| + | |||
| + | **J1: Reset input selector.** Jumper 1-2 for legacy (DIN pin C31), or jumper 2-3 for Kontron (DIN pin C26). Kontron style (2-3) is recommended. | ||
| + | |||
| + | **J2: I/O address selection.** The top 6 bits of the I/O address can be set here. Presence of a jumper indicates a 0 bit, absence of a jumper indicates a 1 bit. Recommended configuration is to fit jumpers on A4, A5, A6, A7 to select I/O addresses 000011xx, ie 0x0C–0x0F. | ||
| + | |||
| + | **J3: Interrupt line selection.** Install at most one jumper to select the bus line to which the interrupt request signal will be routed. Recommended configuration is “IRQ” on Z80/Z180 machines, and “IR1” on 68K machines. If interrupts are not required the jumper may be omitted. | ||
| + | |||
| + | ===== Schematic ===== | ||
| + | |||
| + | [[https:// | ||
| + | |||
| + | ===== Bill of Materials ===== | ||
| + | |||
| + | ^Component^Description | ||
| + | |C1 |47uF electrolytic capacitor, 0.2” lead spacing | ||
| + | |C2–C11 | ||
| + | |C12 |No component (see Notes on Construction) | ||
| + | |RR1 |22K bussed resistor network: 8 resistors, 9 pins |BOURNS 4609X-101-223LF (Farnell order code 9356924) | ||
| + | |R1, R2 |2.2K ohm 0.25W (or 0.125W) resistor | ||
| + | |R3 |Wire jumper (see Notes on Construction) | ||
| + | |J1 |1×3 0.1“ header | ||
| + | |J2 |2×6 0.1” header | ||
| + | |J3 | ||
| + | |U1, U3 | ||
| + | |U9 | ||
| + | |U2 | ||
| + | |U4 | ||
| + | |U5 | ||
| + | |U6 | ||
| + | |U7, U11 |74ACT32 (preferred), | ||
| + | |U8 | ||
| + | |U10 |Adafruit FT232H Breakout (product 2264) | ||
| + | |U12 |DIN 41612 Connector, Type C Plug, 96 pin |TE Connectivity 5650913-5 (Farnell order code 1557020) | ||
| + | |(qty 5) |20 pin DIP IC socket | ||
| + | |(qty 2) |16 pin DIP IC socket | ||
| + | |(qty 3) |14 pin DIP IC socket | ||
| + | |||
| + | ===== Notes on Construction ===== | ||
| + | |||
| + | **Important note on R3, C12:** Footprints are provided for these components but they should not normally be required. **No component** should be fitted at **C12**. A **wire jumper** should be fitted at **R3**. | ||
| + | |||
| + | The FT232H /WRITE signal is active on the falling edge of the signal, instead of the standard rising edge. To ensure the data lines are steady for long enough to meet its setup time requirements, | ||
| + | |||
| + | The Adafruit FT232H breakout board can be permanently mounted using either 0.1” breakaway header strips soldered to both boards, or it can be made removable using SIL pin strips and sockets (eg Harwin D01-9922046 and D01-9973246) which allows it to be re-used for other projects. | ||
| + | |||
| + | The FT232H breakout board contains a serial EEPROM which **must be programmed** to configure the FT232H to use the correct operating mode (“245 Asynchronous FIFO”). This can be done over USB from a PC. The EEPROM needs to be programmed one time only. | ||
| + | |||
| + | **For Windows** you need to use the [[http:// | ||
| + | |||
| + | **For Linux** I have written a [[https:// | ||
| + | |||
| + | **For MacOS** I had success running FT_PROG in a virtual Windows machine (using Parallels Desktop) using the USB passthrough feature. In principle it should also be possible to compile libusb, libftdi1 and use my C program to program the EEPROM but I have not tested this. | ||
| + | |||
| + | It is possible to build this board with entirely 74LS series logic, and this works well. However slightly higher performance can be achieved by substituting 74AHCT parts for U6 and U9, and 74ACT for U7 and U11. Testing on a Mark IV SBC at 36.864MHz, a board using only 74LS parts requires 2 I/O wait states, whereas with the 74AHCT parts at U6 and U9 the board operates correctly with only 1 I/O wait state. U7 and U11 can use 74ACT32 which also gives a further timing improvement. The [[forum: | ||
| + | |||
| + | FT232H boards produced after Feb 2020 (using a USB-C connector instead of Micro-USB) have two additional pins for 3V and GND at the end of the board closest to the USB connector. These should be left disconnected. | ||
| + | |||
| + | ===== Photographs ===== | ||
| + | |||
| + | [[https:// | ||
| + | |||
| + | ===== Example Code ===== | ||
| + | |||
| + | Note that this code has been optimised on a Z180. On Z80 it may be faster to replace the JR instructions with JP (untested). | ||
| + | |||
| + | <code code> | ||
| + | FIFO_BASE | ||
| + | FIFO_DATA | ||
| + | FIFO_STATUS | ||
| + | FIFO_SEND_IMM | ||
| + | |||
| + | ; Receive a block of length DE bytes from the FIFO to memory starting at address HL | ||
| + | fifo_receive: | ||
| + | ; Enter with: | ||
| + | ; HL = pointer to data buffer | ||
| + | ; DE = number of bytes to transmit | ||
| + | ld b, e ; setup loop counter | ||
| + | dec de | ||
| + | inc d | ||
| + | ld c, # | ||
| + | waitrx: | ||
| + | in a, (FIFO_STATUS) | ||
| + | rla ; RX_EMPTY bit into carry flag | ||
| + | jr c, waitrx | ||
| + | ini ; read from port C, write to HL, HL++, B-- | ||
| + | jr nz, waitrx | ||
| + | dec d | ||
| + | jr nz, waitrx | ||
| + | ret | ||
| + | |||
| + | ; Transmit a block of length DE bytes to the FIFO from memory starting at address HL | ||
| + | fifo_transmit: | ||
| + | ; Enter with: | ||
| + | ; HL = pointer to data buffer | ||
| + | ; DE = number of bytes to transmit | ||
| + | ld b, e ; setup loop counter | ||
| + | dec de | ||
| + | inc d | ||
| + | ld c, # | ||
| + | waittx: | ||
| + | in a, (FIFO_STATUS) | ||
| + | rra ; TX_FULL bit into carry flag | ||
| + | jr c, waittx | ||
| + | outi ; read from HL, write to port C, HL++, B-- | ||
| + | jr nz, waittx | ||
| + | dec d | ||
| + | jr nz, waittx | ||
| + | ret | ||
| + | |||
| + | ; Request transfer of transmitted data ASAP (without this it is delayed up to 17ms) | ||
| + | fifo_flush: | ||
| + | out (FIFO_SEND_IMM), | ||
| + | ret | ||
| + | </ | ||
| + | |||
| + | I also have a file transfer application for CP/M, FIFOPIPE. Drop me an email (will /at/ sowerbutts.com) if you'd like to try it out. | ||
| + | |||
| + | ===== Software support ===== | ||
| + | |||
| + | RomWBW included driver support for the ecb-usb-fifo board. The driver does not support interrupts. It has been confirmed working on the SBC-V2 and the MKIV. Performance is poor compared to normal serial communication but is dependent on processor speed. The driver can be enabled with the following assembly customization: | ||
| + | |||
| + | <code code> | ||
| + | UFENABLE | ||
| + | </ | ||
| + | |||
| + | Inclusion of the driver in RomWBW will result in the board appearing as SIO serial port. The port is virtual in nature and changing serial settings have no affect on it's operation. | ||
| + | |||
| + | <code code> | ||
| + | RetroBrew HBIOS v2.9.2-pre.3, | ||
| + | |||
| + | SBC Z80 @ 3.992MHz | ||
| + | 0 MEM W/S, 1 I/O W/S, INT MODE 2 | ||
| + | 512KB ROM, 512KB RAM | ||
| + | |||
| + | UART0: IO=0x68 16550A MODE=38400, | ||
| + | DSRTC: MODE=STD Thu 2019-08-08 17:42:23 CHARGE=ON | ||
| + | MD: UNITS=2 ROMDISK=384KB RAMDISK=384KB | ||
| + | USB-FIFO: IO=0x0C | ||
| + | |||
| + | Unit Device | ||
| + | ---------- | ||
| + | Disk 0 MD1: RAM Disk 384KB,LBA | ||
| + | Disk 1 MD0: ROM Disk 384KB,LBA | ||
| + | Char 0 UART0: | ||
| + | Char 1 SIO0: | ||
| + | </ | ||
| + | |||
| + | Depending on how many character based ports are in your system, you may be able to use CP/M redirection to access the USB-Fifo port. In order for the the USB-fifo board to be used as the console device it must be set as the first RomWBW CIO device through the FORCECON option. | ||
| + | |||
| + | <code code> | ||
| + | FORCECON .SET 2 | ||
| + | </ | ||
| + | |||
| + | Serial File transfer using the USB-Fifo can be accomplished using Willl Sowerbutts fifo-pipe program or using XModem. | ||
| + | |||
| + | ====== Windows Driver Configuration ====== | ||
| + | |||
| + | The Windows FTDI drivers allows the capability of the FT232H device to be configured through the device manager. | ||
| + | |||
| + | Recommended changes from the default setting are: | ||
| + | |||
| + | Serial Enumerator - unchecked | ||
| + | |||
| + | Disable Modem Ctrl At Startup - checked | ||
| + | |||
| + | Detailed driver setting information can be seen in this [[http:// | ||
