통신 > FX2 - an attempt with USB 2.0

TODAY691 TOTAL2,229,249
사이트 이용안내
Login▼/회원가입
최신글보기 질문게시판 기술자료 동영상강좌

아두이노 센서 ATMEGA128 PWM LED 초음파 AVR 블루투스 LCD UART 모터 적외선


BASIC4MCU | 통신 | USB | FX2 - an attempt with USB 2.0

페이지 정보

작성자 키트 작성일2017-09-01 11:15 조회1,888회 댓글0건

본문

 

FX2 - an attempt with USB 2.0

A PCB (160 mm x 100 mm) for experimenting with the Cypress EZ-USB FX2 USB 2.0 Chip

This IC contains a complete USB 2.0 interface with 480 Mbit/s throughput, a comfortable FIFO with a controller (state machine), but is hard to use due to its very small housing and pitch.
This chip, CY7C68013-128 TQFP, is used to have an option for external memory. Mostly, for debugging.

This PCB is only two-sided and hand-madeable vias, therefore, any hobbyist with UV lamp and etching fluid can make this.

Possible uses of this board are:

  • USB scope probe with extreme sample depth
  • IDE device adaptor (already works!)
  • Fast data transport from a 19" rack to PC and vice versa.
For accessing most drawings you need 3660040649_LtphlG6O_extern.gifGhostView and GhostScript.

The PCB foil is made for positive laquer.

Großenvergleich.jpg               04-Dez-2004 22:19   23K  PhotoHeiß aufs Loten.jpg               14-Feb-2004 02:49   39K  PhotoUSB-Festplatte.jpg                24-Aug-2004 10:54   52K  Photoadc2usb.zip                       18-Dez-2004 17:46   41K  [view]ads8402.png                       18-Dez-2004 17:08   33K  cypress.zip                       10-Dez-2004 23:04  324K  [view]fx2.zip                           19-Mar-2006 22:07  127K  Eagle [Einsicht]fx2.psz                           11-Feb-2005 21:33   91K  Als PDFoben.jpg                          17-Dez-2004 19:19   82K  Photounten.jpg                         17-Dez-2004 19:16   84K  Photo
Who want to make such a PCB too?
Answer since 1 year: one or two

 

The schematic

...was made in Eagle according to the Cypress reference design CY3681. Due to lack of FPGA/CPLD (??) there are no LEDs, but that's the only disadvantage I have found.
RAM, ATA connector, RS232, and port expander PCF8574 are compatible. All FX2 signals are available on an ERNI connector for 19" racks.
For the scope probe, an A/D converter is spared.

 

Schematic ICs 
Schematic Part 1: ICs

Please click onto images to view the schematics! Last change: The LM317LZ was not sufficient as linear regulator; instead, a simple solution with zener diode and transistor is used.

 

Schematic Connectors 
Schematic Part 2: Connectors

 

The PCB

...you should bring it to work step by step.

 

PCB 
Partial placed components, top side

You can place both 1206 and 0805 shaped SMD resistors and capacitors.

 

PCB 
Bottom view

 

IC CY7C68013-128AC 
Detail view: hand-soldered 128 pin chip

First placement

Please populate step by step and test the board!
  • Vias, check them
  • FX2 IC, check every pin for contact and no short circuit
  • USB receptacle, el.cap, transistor, res, zener diode
  • Crystal and 22 pF caps
  • 2 caps 100 nF and R?? (10 kΩ)
  • Reset circuitry (100 kΩ, 100 nF)
  • I²C pullups
No more!

Start-up

Plug this card on your PC. If it reports an error, check the following:
  • 3,3 V on every supply pin
  • 0 V on every ground pin
  • work of oscillator
  • connection of "important" wires for USB, crystal, reset, bus control, and I²C
Then you give the Windows popup dialog the EZUSBW2K.INF from Cypress development kit. Then start EzMr.exe and check if the device is found.

Recognition of high-speed mode is possible by inspecting pipe sizes of more than 64 Bytes for bulk transfer.

More components

You may now populate the PCB. I advise to place the IDE connector and some R/C and LED "DASP" (Drive Active / Slave Present) around to check connection to a hard disk.

Check it using following procedure:

  • Download CY4611_Mass-Storage_Ref_design_version_2-40.zip, decompress
  • Plug EEPROM-Jumper and then connect the PCB to your PC
  • Start of 3660040649_kZC2UJ9R_usb.gif "EZ-USB Control Panel", set to FX2,
  • press Button EEPROM, give the file "fx2_ata.iic", wait about. 30 seconds!
  • disconnect, connect, or let renumerate pressing another button
The firmware is active to the USB side ONLY if it detects a hard disk!! The HDD LED (≫DASP≪) must light on shortly, then you get an USB hard drive. In Windows 98 you need another driver:

 

Board with IDE hard disk 
Connection with IDE hard drive(It works! Really!)

 

My own A51 example

The example firmware stated above Eye controls following peripherals:
  • 2 channel A/D converter 16bit ADS8402 with 1 MSa/s as "oscilloscope" or "transient recorder" with direct data transfer to PC, see schematic.
  • 1 channel D/A converter 16bit TDA1543 with 48 kSa/s as fine-tuneable sine generator (both frequency and amplitude)
That example firmware polls for USB "interrupts" in its main loop. (Much better than writing interrupt service routines!) All requests, inclusive String Descriptors, are handled, inclusive two Alternate Settings. Following settings:

 

Alternate SettingFull Speed (12 Mbit/s)High Speed (480 Mbit/s)
0, EP2:Bulk, 64 Byte PacketsBulk, 512 Byte Packets
1, EP2:Isochronous, 1020 Byte per frameIsochronous, 512 Byte per microframe
2, EP2:not availableInterrupt, 512 Byte per microframe
Sample rate250 kSa/s (USB maximum)1 MSa/s (about ADU maximum)
Netto data rate1000 kByte/s (1000 Byte per frame)4000 kByte/s (500 Byte per microframe)

 

The GPIF (General Purpose InterFace), a programable state machine, works without decision points, but in "long transfer mode", whereby count of bytes to transfer are kept permanently to 4 GB. FX2 throttles automatically when FIFO is full. The FIFO is 4x buffered. The block size is a tad large than necessary, to prevent sample jitter. From time to time there are not-acknowledged transfers (NAK). The Bulk transfer is available for USB compatibility reasons. In high-speed mode, a large interrupt transfer ist implemented too.

There is one multi-function yellow LED. It lights permanently while USB is configured and not sleeping. It flashes slowly while EP0 transfer and faster while EP2 (main data) transfer. An additional (blue or green) LED lights up when operating in high-speed mode and flashes on USB errors.

When viewing the source code, you will wonder about missing interrupt service routines. This ist intended and the same as Cypress does. Cypress simply sets a bit in its ISR and polls that bit in a main loop. For such stupid operation, you need no ISR at all!

Simple macros LD and ST, defined in MAKROS.I51 make the source code more readable when accessing XRAM. Register R0 (not DPTR!) will be used for adressing; MPAGE is fixed to 7Eh. Two symbolic parameters NEXT und PREV allow faster access to adjanced bytes in XRAM.

Snare

When you program the EEPROM, and your system crashes meanwhile, you may result in a crashing 8051 firmware. Then, you cannot start the board with plugged jumper, and for accessing the EEPROM with EzMr.EXE, you need a 2-byte-adressed EEPROM on FX2 startup! (Bit ID1 in I2CS @0xE678 set). How you can delete at least the first Byte of EEPROM without pulling the chip out and into an external programmer? The right way:
  • Pull jumper JP1,
  • Plug board to PC,
  • Start USB Logo "EZ-USB Control Panel", set to FX2,
  • Plug jumper JP1,
  • Press button Download, load "vend_ax\vend_ax.hex" (this is a Cypress firmware, enabling some other Vendor Requests),
  • Fill the line Line with Vend Req:
    • Req: 0xA9 (undocumented Read/Write access to 2-Byte EEPROM),
    • Value: 0 (= start address),
    • Index: 0xBEEF (= ignore that value),
    • Length: 1 (= length of data to write),
    • Dir: 0 OUT (data writing Vendor Request; you may read with 1 IN your EEPROM content),
    • Hex Bytes: FF (= data, delete first byte C0 or C2),
  • Press button Vend Req,
  • Check your board by pulling and plugging to PC.

Size comparison

Unfortunalely, all FX2 chips are about same in size:

Three
Size comparison of packages on 5 mm grid paper




https://www-user.tu-chemnitz.de/~heha/bastelecke/Rund%20um%20den%20PC/fx2/ 

댓글 0

조회수 1,888

등록된 댓글이 없습니다.

통신HOME > 통신 > USB 목록

게시물 검색

2022년 1월 2월 3월 4월 5월 6월 7월 8월 9월 10월 11월 12월
2021년 1월 2월 3월 4월 5월 6월 7월 8월 9월 10월 11월 12월
2020년 1월 2월 3월 4월 5월 6월 7월 8월 9월 10월 11월 12월
2019년 1월 2월 3월 4월 5월 6월 7월 8월 9월 10월 11월 12월
2018년 1월 2월 3월 4월 5월 6월 7월 8월 9월 10월 11월 12월
Privacy Policy
MCU BASIC ⓒ 2020
모바일버전으로보기