All Projects → avakar → usbcorev

avakar / usbcorev

Licence: other
A full-speed device-side USB peripheral core written in Verilog.

Programming Languages

Verilog
626 projects
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to usbcorev

getting-started
List of ideas for getting started with TimVideos projects
Stars: ✭ 50 (-62.96%)
Mutual labels:  fpga, usb, verilog
FPGA-USB-Device
FPGA-based USB-device controller to implement USB-CDC, USB-HID, etc.
Stars: ✭ 29 (-78.52%)
Mutual labels:  fpga, usb, verilog
Cores
Various HDL (Verilog) IP Cores
Stars: ✭ 271 (+100.74%)
Mutual labels:  fpga, usb, verilog
eddr3
mirror of https://git.elphel.com/Elphel/eddr3
Stars: ✭ 33 (-75.56%)
Mutual labels:  fpga, verilog
FpOC
FPGA-based Field Oriented Control (FOC) for driving BLDC/PMSM motor.
Stars: ✭ 138 (+2.22%)
Mutual labels:  fpga, verilog
SpinalCrypto
SpinalHDL - Cryptography libraries
Stars: ✭ 36 (-73.33%)
Mutual labels:  fpga, verilog
verilog-sid-mos6581
MOS6581 SID chip emulator in SystemVerilog
Stars: ✭ 22 (-83.7%)
Mutual labels:  fpga, verilog
karuta
Karuta HLS Compiler: High level synthesis from prototype based object oriented script language to RTL (Verilog) aiming to be useful for FPGA development.
Stars: ✭ 89 (-34.07%)
Mutual labels:  fpga, verilog
Hard-JPEG-LS
FPGA-based JPEG-LS image compressor.
Stars: ✭ 52 (-61.48%)
Mutual labels:  fpga, verilog
fpga-nn
NN on FPGA
Stars: ✭ 16 (-88.15%)
Mutual labels:  fpga, verilog
FPGA RealTime and Static Sobel Edge Detection
Pipelined implementation of Sobel Edge Detection on OV7670 camera and on still images
Stars: ✭ 14 (-89.63%)
Mutual labels:  fpga, verilog
MobileNet-in-FPGA
Generator of verilog description for FPGA MobileNet implementation
Stars: ✭ 107 (-20.74%)
Mutual labels:  fpga, verilog
async fifo
A dual clock asynchronous FIFO written in verilog, tested with Icarus Verilog
Stars: ✭ 117 (-13.33%)
Mutual labels:  fpga, verilog
no2muacm
Drop In USB CDC ACM core for iCE40 FPGA
Stars: ✭ 26 (-80.74%)
Mutual labels:  fpga, usb
LVDS-7-to-1-Serializer
An Verilog implementation of 7-to-1 LVDS Serializer. Which can be used for comunicating FPGAs with LVDS TFT Screens.
Stars: ✭ 33 (-75.56%)
Mutual labels:  fpga, verilog
pdp6
PDP-6 Emulator
Stars: ✭ 47 (-65.19%)
Mutual labels:  fpga, verilog
yarvi
Yet Another RISC-V Implementation
Stars: ✭ 59 (-56.3%)
Mutual labels:  fpga, verilog
EDSAC
FPGA Verilog implementation of 1949 EDSAC Computer with animated tape reader, panel, teleprinter and CRT scope
Stars: ✭ 28 (-79.26%)
Mutual labels:  fpga, verilog
e-verest
EVEREST: e-Versatile Research Stick for peoples
Stars: ✭ 21 (-84.44%)
Mutual labels:  fpga, usb
spu32
Small Processing Unit 32: A compact RV32I CPU written in Verilog
Stars: ✭ 51 (-62.22%)
Mutual labels:  fpga, verilog

This core allows you to embed a full-speed (12Mbps) USB 2.0 device core into your FPGA design.

Clocks

The core requires a reasonably precise 48MHz clock. You'd better derive it from a crystal oscillator.

Physical interface

Since USB uses a bit of a weird signaling on its half-duplex (almost-)differential line, you'll, need to do a little bit of work to connect it to the core. The following five signals connect to D+ and D- USB signals.

  • input rx_j -- the differential value on D+/D- lines

  • input rx_se0 -- single-ended zero detected: should be set when both D+ and D- lines are zero

  • output tx_se0 -- transmit zeros on both USB lines; has priority over tx_j

  • output tx_j -- transmit tx_j to D+ and ~tx_j to D-

  • output tx_en -- enable the trasmitter

If your FPGA doesn't have a differential receiver, then you can simply use two pins and connect them as follows. However, without a differential receiver, you will be outside of the USB specs. Make sure the inputs are synchronized to the USB clock.

inout usb_dp;
inout usb_dn;

// ...

wire usb_tx_se0, usb_tx_j, usb_tx_en;
usb usb0(
    .rx_j(usb_dp),
    .rx_se0(!usb_dp && !usb_dn),

    .tx_se0(usb_tx_se0),
    .tx_j(usb_tx_j),
    .tx_en(usb_tx_en));

assign usb_dp = usb_tx_en? (usb_tx_se0? 1'b0: usb_tx_j): 1'bz;
assign usb_dn = usb_tx_en? (usb_tx_se0? 1'b0: !usb_tx_j): 1'bz;

However, if you have a differential receiver, you'd better use it. Configuring this is FPGA-specific. For Xilinx Spartan 6 family, I use four physical pins as follows.

// These pins are configured as differential inputs. Unfortunately,
// you can't use single-ended receivers nor transmitters on these pins.
input usb_sp;
input usb_sn;

// These pins are single-ended inouts.
inout usb_dp;
inout usb_dn'

// ...

IBUFDS usb_j_buf(.I(usb_sp), .IB(usb_sn), .O(usb_rx_j_presync));
synch usb_j_synch(clk_48, usb_rx_j_presync, usb_rx_j);
synch usb_se0_synch(clk_48, !usb_dp && !usb_dn, usb_rx_se0);

wire usb_tx_se0, usb_tx_j, usb_tx_en;
usb usb0(
    .rx_j(usb_rx_j),
    .rx_se0(usb_rx_se0),

    .tx_se0(usb_tx_se0),
    .tx_j(usb_tx_j),
    .tx_en(usb_tx_en));

assign usb_dp = usb_tx_en? (usb_tx_se0? 1'b0: usb_tx_j): 1'bz;
assign usb_dn = usb_tx_en? (usb_tx_se0? 1'b0: !usb_tx_j): 1'bz;

Note the synchronization after the receiver.

Whichever pins you transmit on need to have resistors after them. The exact values will depend on the internal resistance of the pins; usually something around 27 ohms will be ok.

You also need to pull the D+ line up to 3.3V via a 1.5k resistor. You can pull it directly, or via a pin on your FPGA, if you want to dynamically attach/detach to the bus. Make sure to never pull the line down, the only valid outputs of the pullup pin are 1'b1 and 1'bz.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].