Changes

FPGAmstrad

2,062 bytes added, 12:03, 28 February 2012
/* Why NEXYS2 500kgates starter kit */
It is the way I used in order to induce JavaCPC, comparing it with my project.
=== USB joystick ===
==== Sniffing USB frames ====
USB use two wires in order to transmit frames, green and white, each with two logical values : 0v and 5v.
Let's plug a joystick on PC, if you listen at this two wires, you can snif a USB transmission. Saving it for example on RAM.
Theses two wires can be traduce into one with four states : 00 01 10 11.
One of this state is sleep state, in fact it depends on USB mode you use.
===== USB mode : USB1 or USB2 ; low speed, full speed or high speed =====
For sampling, I speed up five times the saving speed on RAM. I succeed sampling an USB1 transmission : "Logitech dual action USB joystick", and an USB2 : "Sony PS3 USB joystick". PS3 joystick is not stable enough with my FPGA, but Logitech joystick is correct.
===== pull up and pull down =====
If you respect USB protocol, you have to plug some pull-up and pull-down resistors and some capacitor. But as I am a bad electrician, I just simulate then in VHDL, they are important because they cause USB speed negotiations. You also have an electronic mechanism in order to detect presence of joystick plug, I don't care about it.
==== Synchronize, decode and check USB frames ====
One time sample is done, it is not readable. In fact USB frames are synchronized (they started with a certain synchronization pattern), encoded (NRZI), and checked (CRC). CRC type depends on frame length. Encoding is done for synchronization optimization.
Then using USB HID manual, you can understand type of frames, and author of them, and remark that the author alternate : USB master (PC) or USB slave (joystick)
==== Build a minimum USB master frames state-machine ====
Objective here is to build a minimum state-machine graph, having for transaction between state a "frame transmission". It is normal on USB protocol to have error of transmission, so you have also to put "error frame transmission" on the graph.
At stabilisation, you finally switch between two states, one sending a certain frame that contains at different offset simply certain values of joystick button.
=== Why NEXYS2 500kgates starter kit ===
==== Xilinx schematics ====
1,200
edits