World’s Smallest Low-speed USB Analyzer ( Atapchi )

[Any] idea is dead without a good application for it. So “California Dreamin’” USB virtual peripheral could be a very nice sample of academic research, but hardly anybody is going to build a keyboard or mouse using it. I have been thinking for a while what to do with it as well. First project that came to my mind was building a hardware key logger for USB keyboards, something like www.keyghost.com, built for PS2 protocol using PIC16F877. It was quite simple to implement USB part using SX, serial EEPROM and a few switching IC’s. Furthermore I found out that built-in features of SX MCU would help to create a device able to work not only with pure low-speed USB keyboards, but also composite, built-in-hub, things, hence covering all existing systems (SUN, Mac, PC). Recording keystrokes is fun, but if we can do that, why not go further and try to record all low-speed USB traffic. No problem for SX again, problem for the memory. Serial EEPROM is just to slow to handle it. Solution was www.ramtron.com FRAM with 1MHz two-wire interface (let me pay credit here to www.svtehs.com, who happens to advertise it). Finally “California Dreamin’” found a real life application in the world’s smallest low-speed USB analyzer “Atapchi” (stands for a small fruit in Singapore, tastes like apricot). I hope you find this project interesting (mail your questions to chinook at pacific.net.sg)

Ataphchi Features

Atapchi Applications

  1. Development of HID class low-speed USB peripheral devices
  2. Development of small scale USB based networks

The list of MCUs you can use with Atapchi (not full)

Atapchi Architecture

  1. Ubicom SX48BD/TQ micro controller with 100% software implementation of USB (improved version of “California Dreamin”)
  2. Ramtron FM24C64-S 64Kb FRAM Serial Memory with 1MHz two wire interface
  3. Murata CSTCW5000MX03-T 50 MHz small footprint ceramic resonator
  4. Switching circuits (other manufacturers)
  5. No USB interface (Atapchi is to be used with USB repeaters)

Atapchi Modes of Operation

Input, recording low-speed USB traffic. Atapchi is plugged into a USB self-powered hub, a USB repeater is plugged into Atapchi, device under development is plugged into the repeater. All traffic from/to the device is recorded.

Output, downloading the data. Atapchi is plugged into a USB repeater, the repeater is plugged into a self-powered hub. Atapchi enumerates as a generic USB keyboard and types memory content into any text editor.

Device is the mouse you see on the picture above (Justy UMN-05 SG). MCU used is omnipresent Cypress CY7C63001A. Total listing length is 1083 lines.

reset
       eop 060   
0001   00 0 setup 
0002   data0 [ bb 29 ] 80 06 00 01 00 00 40 00   
0003   ack

       eop 001   
0004   00 0 in 
0005   data1 [ c8 e7 ] 12 01 00 01 00 00 00 08   
0006   ack

       eop 002   
0007   00 0 out 
0008   data1 [ 00 00 ] zero-length 
0009   ack reset 

       eop 043   
0010   00 0 setup 
0011   data0 [ 57 85 ] 00 05 05 00 00 00 00 00   
0012   ack

       eop 001   
0013   00 0 in 
0014   data1 [ 00 00 ] zero-length 
0015   ack

       eop 014   
0016   05 0 setup 
0017   data0 [ 07 2f ] 80 06 00 01 00 00 12 00   
0018   ack

       eop 001   
0019   05 0 in 
0020   data1 [ c8 e7 ] 12 01 00 01 00 00 00 08   
0021   ack

       eop 001   
0022   05 0 in 
0023   data0 [ 7e 33 ] 58 04 03 00 00 00 01 02   
0024   ack