Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
boards:ecb:usb-fifo:start [2017/03/21 13:26]
will [Notes on Construction]
boards:ecb:usb-fifo:start [2017/03/26 16:59] (current)
will [Example Code]
Line 7: Line 7:
 On the PC the interface is presented as a standard USB serial interface (a "​Virtual COM port" on Windows, /​dev/​ttyUSB* on Linux) and can be used by any application normally used with standard serial ports. Note that although it presents as a 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. On the PC the interface is presented as a standard USB serial interface (a "​Virtual COM port" on Windows, /​dev/​ttyUSB* on Linux) and can be used by any application normally used with standard serial ports. Note that although it presents as a 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 a separate FIFO (first-in-first-out queue) for the receive and transmit directions. Each FIFO is 1KB in size. In the receive direction (PC to ECB) the operating system decides when to transmit data and can send up to 512 bytes in a single USB transferIn the transmit ​direction (ECB to PC) the FT232H ​will accumulate data until 512 bytes has been received, or some period of time (believed to be around 17ms) has passed since the last byte was queued, or when "send immediate"​ signal is given.+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,​ otherwise ​the FT232H ​may wait a short while to accumulate ​more data before performing ​transfer over the USB link.
  
 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. 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.
Line 44: Line 44:
  
 When the ECB machine is reset, the **INT_ENABLE**,​ **INT_TX**, **INT_RX** and **GPIO_IN** bits are all reset to 0. The USB connection is **not** reset (ie the virtual serial device will remain connected). When the ECB machine is reset, the **INT_ENABLE**,​ **INT_TX**, **INT_RX** and **GPIO_IN** bits are all reset to 0. The USB connection is **not** reset (ie the virtual serial device will remain connected).
- 
 ===== ECB Card Jumpers ===== ===== ECB Card Jumpers =====
  
Line 74: Line 73:
 |U5|74LS38|TI SN74LS38N (Farnell order code 1470758)| |U5|74LS38|TI SN74LS38N (Farnell order code 1470758)|
 |U6|74AHCT139 (preferred) or 74LS139A|TI SN74AHCT139N (Farnell order code 1741539)| |U6|74AHCT139 (preferred) or 74LS139A|TI SN74AHCT139N (Farnell order code 1741539)|
-|U7, U11|74LS32|TI SN74LS32N (Farnell order code 1740030)|+|U7, U11|74ACT32 (preferred),​ 74AHCT32 (untested but should work) or 74LS32|TI SN74ACT32N (Farnell order code 1739969), TI SN74AHCT32N (Farnell order code 1749941) or TI SN74LS32N (Farnell order code 1740030)|
 |U8|74LS175|TI SN74LS175N (Farnell order code 1607731)| |U8|74LS175|TI SN74LS175N (Farnell order code 1607731)|
 |U10|Adafruit FT232H Breakout (product 2264)|Mouser order code 485-2264, Digikey order code 1528-1449-ND| |U10|Adafruit FT232H Breakout (product 2264)|Mouser order code 485-2264, Digikey order code 1528-1449-ND|
Line 81: Line 80:
 |(qty 2)|16 pin DIP IC socket|TE Connectivity 1-2199298-4 (Farnell order code 2445622)| |(qty 2)|16 pin DIP IC socket|TE Connectivity 1-2199298-4 (Farnell order code 2445622)|
 |(qty 3)|14 pin DIP IC socket|TE Connectivity 1-2199298-3 (Farnell order code 2445621)| |(qty 3)|14 pin DIP IC socket|TE Connectivity 1-2199298-3 (Farnell order code 2445621)|
 +
 +\\
 +
  
 ===== Notes on Construction ===== ===== Notes on Construction =====
Line 89: Line 91:
  
 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 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.
- 
-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. 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. Substituting other parts for 74AHCT or similar has not been tested but should be generally okay, however U1, U2 and U3 should use 74LS as the bus interface benefits from having hysteresis on the inputs; the 74LS244 and 74LS245 parts have Schmitt trigger inputs. 
  
 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. 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.
Line 99: Line 99:
  
 **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. **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 [[https://​www.retrobrewcomputers.org/​forum/​index.php?​t=msg&​th=142&​goto=2061&#​msg_2061|forum thread]] has more information on how the timing improves with CMOS parts. Note that U1, U2 and U3 should always use 74LS as the bus interface benefits from having hysteresis on the inputs to improve noise rejection; the 74LS244 and 74LS245 parts have Schmitt trigger inputs.
  
  
Line 159: Line 161:
 </​code>​ </​code>​
  
-Untested idea: For writes up to 512 bytes in length, ​believe you could signal ​Send Immediate, then poll for the RX_EMPTY bitand then proceed to load up to 512 bytes into the transmit FIFO without checking the RX_EMPTY bit again (using the OTIR instruction,​ or an unrolled loop of OUTIs). I believe the 1KB FIFO in the FT232H is divided into two 512-byte buffers and one is loaded with data while the other is transferred over USB, so once any space in the buffer becomes available ​you can be confident there is at least 512 bytes of space available. Again, this is untested, but could allow for very fast transmission. +also have file transfer application ​for CP/MFIFOPIPE. Drop me an email (will /at/ sowerbutts.comif you'd like to try it out.
- +
-\\+
  
  
boards/ecb/usb-fifo/start.1490117202.txt.gz · Last modified: 2017/03/21 13:26 by will
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0