02-28-2012, 12:07 PM | #1 |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
LV Serial Cable
As a supplement to the things on this subject already posted...
This thread will cover how I am hooking up my own cable. First, the cable doc sheet (FTDI Chip adapter cable): http://drpbox.knetconnect.com/serial...2RG_CABLES.pdf The Kindle uses the 1.8 volt (1V8) model cable. Second, the chip doc sheet for the chip inside the cable: http://drpbox.knetconnect.com/serial/DS_FT232R.pdf Gives a full description of the tricks the USB-serial chip can do. Windows, Linux, Mac OSx all have drivers for this cable. Some may also support the "bit banging" interface to the chip. For those who want to read ahead... This is how I did it for one of my media players: http://minimodding.com/tiki-view_blo....php?postId=81 Only the physical details (and voltage of the cable) will differ on the Kindle. The prior thread on this subject here seems to have died off a couple of years ago: https://www.mobileread.com/forums/sho...60&postcount=1 Which gives me a chance to re-invent a way of my own. The information available on Linux about the adapter cable and its drivers is down here: https://www.mobileread.com/forums/sho...80&postcount=5 The cover light connector and pads reported in the original thread as the serial port connections on the Kindle3 (here, a 3g, Keyboard model) is down here: https://www.mobileread.com/forums/sho...6&postcount=17 The pad signal assignments are found in this post: https://www.mobileread.com/forums/sho...3&postcount=23 The internal details of the J14 socket here: https://www.mobileread.com/forums/sho...1&postcount=24 A dimensioned sketch of the internal contacts here (as a png image): https://www.mobileread.com/forums/sho...9&postcount=30 The cad file of the sketch (as dxf): https://www.mobileread.com/forums/sho...5&postcount=31 Last edited by knc1; 10-20-2012 at 10:04 AM. |
02-28-2012, 01:04 PM | #2 |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Something odd about the kindle touch (and k4nt). It seems that the third pin that we have been calling "GND" (ground) does not make a good ground. The kindle serial i/o seems to work better when another ground is used, like a metal shield. Or, you can leave off the ground connection and keep the kindle USB connected to the same computer as the serial adapter, so it uses the USB cable ground as the serial ground.
Perhaps that third pin is CTS or DTR (hardware handshake)??? |
02-28-2012, 02:00 PM | #3 | |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
Flow control is nice to have at those speeds. Anything that is a "driven ground" (signal output in low state, this is CMOS) might act like a not-so-good ground point. Do you have access to an O'Scope to check it with? Hmm... Maybe we should get someone with a lot of "Google Credits" to look up how to use the PC Audio Mic-In (or Line-in, in this case) jack as a quick-and-dirty O'Scope. Hello, Volunteers???? Last edited by knc1; 02-28-2012 at 02:04 PM. |
|
02-28-2012, 07:26 PM | #4 | |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Quote:
But even AC coupled has its uses for changing signals, but not good for measuring static DC voltage levels. I have Rigol (hacked, of course)... and a somewhat bulkier analog scope for when a DSO is not the right tool for the job. I think I was maybe 12 when I bought my first scope (AC coupled vacuum tube, back in the day)... ;-) Last edited by geekmaster; 02-28-2012 at 07:29 PM. |
|
02-29-2012, 08:30 AM | #5 | |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Kernel Serial Modules
Since this serial i/o adapter interfaces to the host computer as a USB device, a quick HowTo find out about a USB device that was just connected.
While written about the USB-serial adapter cable to be used, the details of learning information about a kernel module here is general in nature. Note: Shown while logged in as 'root' (su -l) but only this first command requires root privledge level (dmesg -c). You can do these commands as a regular user, using the form: 'sudo dmesg -c' for this first command. Clear the kernel message buffer: Code:
core2quad ~ # dmesg -c - - - big snip - - - Code:
core2quad ~ # dmesg [ 7087.268150] usb 2-3.5: new full speed USB device number 5 using ehci_hcd [ 7087.843883] usbcore: registered new interface driver usbserial [ 7087.843895] USB Serial support registered for generic [ 7087.843930] usbcore: registered new interface driver usbserial_generic [ 7087.843932] usbserial: USB Serial Driver core [ 7087.850645] USB Serial support registered for FTDI USB Serial Device [ 7087.850758] ftdi_sio 2-3.5:1.0: FTDI USB Serial Device converter detected [ 7087.850789] usb 2-3.5: Detected FT232RL [ 7087.850791] usb 2-3.5: Number of endpoints 2 [ 7087.850793] usb 2-3.5: Endpoint 1 MaxPacketSize 64 [ 7087.850795] usb 2-3.5: Endpoint 2 MaxPacketSize 64 [ 7087.850797] usb 2-3.5: Setting MaxPacketSize 64 [ 7087.851096] usb 2-3.5: FTDI USB Serial Device converter now attached to ttyUSB0 [ 7087.851111] usbcore: registered new interface driver ftdi_sio [ 7087.851112] ftdi_sio: v1.6.0:USB FTDI Serial Converters Driver Quote:
This device name was assigned (or could have been assigned) by either the kernel's module autoloader or a udev event rule. In this specific case, that looks like the kernel's default name, not been re-named by the udev event rules, although you could do that if desired. Additional information in the kernel message buffer above is the announcement of two new driver modules that where autoloaded. Code:
core2quad ~ # lsmod Module Size Used by ftdi_sio 35827 0 usbserial 37203 1 ftdi_sio - - - snip - - - These parameter values can be passed to the module from the kernel command line or on the command line of the manual module loader command. Code:
core2quad ~ # modinfo ftdi_sio filename: /lib/modules/3.0.0-16-generic/kernel/drivers/usb/serial/ftdi_sio.ko license: GPL description: USB FTDI Serial Converters Driver author: Greg Kroah-Hartman <greg@kroah.com>, Bill Ryder <bryder@sgi.com>, Kuba Ober <kuba@mareimbrium.org>, Andreas Mohr, Johan Hovold <jhovold@gmail.com> srcversion: 1719192F096E98EA81E5982 alias: usb:v0483p3747d*dc*dsc*dp*ic*isc*ip* - - - snip about 640 devices - - - alias: usb:v0403pF7C0d*dc*dsc*dp*ic*isc*ip* depends: usbserial vermagic: 3.0.0-16-generic SMP mod_unload modversions 686 parm: debug:Debug enabled or not (bool) parm: vendor:User specified vendor ID (default=0x0403) (ushort) parm: product:User specified product ID (ushort) parm: ndi_latency_timer:NDI device latency timer override (int) The values and their effect should be in the Documentation tree of the kernel source. Although just asking your favorite web-search engine sometimes works also. Notice in the above that this driver depends on (requires) the usbserial driver. Learning a bit about that driver: Code:
core2quad ~ # modinfo usbserial filename: /lib/modules/3.0.0-16-generic/kernel/drivers/usb/serial/usbserial.ko license: GPL description: USB Serial Driver core author: Greg Kroah-Hartman, greg@kroah.com, http://www.kroah.com/linux/ srcversion: 8451423FD3B5DEEE801B6DB depends: vermagic: 3.0.0-16-generic SMP mod_unload modversions 686 parm: vendor:User specified USB idVendor (ushort) parm: product:User specified USB idProduct (ushort) parm: debug:Debug enabled or not (bool) Although from the dmesg you can see that it depends on the usbcore system, which is usually built-in to the kernel rather than being a module. Note also that this kernel was built with the module unloader enabled. You can unload these modules (rmmod, remove module) and then re-load them manually, perhaps with different parameters. Such as with debug enabled or changed latency timer values. Consider these drivers as a "stack" (they are) and use the dependency information to get the manual un-load and load command order correct. Unload top-down: rmmod ftdi_sio rmmod usbserial (if changing something about it) Load bottom-up: insmod usbserial insmod ftdi_sio ndi_latency_timer=some.number There is both summary and detail information available about devices on the USB bus, the quick summary: Code:
core2quad ~ # lsusb - - - snip - - - Bus 002 Device 005: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC Code:
core2quad ~ # lsusb -vvv -d 0403:6001 Bus 002 Device 005: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.00 bDeviceClass 0 (Defined at Interface level) bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 8 idVendor 0x0403 Future Technology Devices International, Ltd idProduct 0x6001 FT232 USB-Serial (UART) IC bcdDevice 6.00 iManufacturer 1 FTDI iProduct 2 TTL232RG-VREG1V8 iSerial 3 FTUU8UJ7 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 32 bNumInterfaces 1 bConfigurationValue 1 iConfiguration 0 bmAttributes 0x80 (Bus Powered) MaxPower 500mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 2 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 255 Vendor Specific Subclass bInterfaceProtocol 255 Vendor Specific Protocol iInterface 2 TTL232RG-VREG1V8 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x02 EP 2 OUT bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 0 Device Status: 0x0000 (Bus Powered) Code:
/var/lib/usbutils/usb.ids Or query it using grep: Code:
core2quad ~ # grep -B1 'Amazon' /var/lib/usbutils/usb.ids 1949 Lab126 0002 Amazon Kindle 0004 Amazon Kindle 3 Of possible interest in the above, the comment about the udev rules and the info shown in the detailed listing. From reading the chip documentation manual, you know there is a unique serial number burned into each chip and it could be seen here: Code:
iSerial 3 FTUU8UJ7 Handy if you have more than one adapter cable plugged into your machine. FTDI Chip has a version of this cable with all leads on a bit-banging interface, for use as interesting things like an eJTAG adapter cable. Uses this same driver, so assigning distinctive names to the cables can become a very usefull feature. Last edited by knc1; 02-29-2012 at 10:37 AM. |
|
02-29-2012, 10:27 AM | #6 |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
More than you ever wanted to know about that driver:
http://lxr.free-electrons.com/source...ial/ftdi_sio.c @GeekMaster: Yes, it does support 460800 (directions, lines: 1080++) And it looks to me as if that latency timer is set in units of milliseconds, but I did not study, only scaned the driver code. |
02-29-2012, 10:33 AM | #7 |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
@GeekMaster: If you insmod usb_mon, then you can attach Wireshark to it and Wireshark will capture/decode USB packets, just like it does network packets.
|
02-29-2012, 12:12 PM | #8 |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
I am already grabbing USB packets in my windows VM (MfgTool and sb_loader are windows apps), and I have software to replay them (as USB macros). I used wireshark a lot when it was still Ethereal. I actually paid big $ for a commercial ethernet packet sniffer back in the 90's. It came on a floppy disk... wireshark is "more better".
In my linux proggies, I just use printf() to display the USB traffic that I am interested in. Thanks for the tip. It will be easier than writing built-in debugging instrumentation. Last edited by geekmaster; 02-29-2012 at 12:17 PM. |
02-29-2012, 12:20 PM | #9 | |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Quote:
|
|
02-29-2012, 12:40 PM | #10 | |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
And a bit of probing with my $10 O'Scope (if it works, it was only $10). Having a higher speed than 115,200 would be nice when re-writing a 4G flash drive. But I agree with you, that is going to take some flow-control signals. If I can find them.... |
|
02-29-2012, 12:53 PM | #11 | |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Quote:
One time, on a tiny device, I had to suck a firmware image out over a blinking LED, because that was all that I could control. It took many days. Last edited by geekmaster; 02-29-2012 at 12:55 PM. |
|
02-29-2012, 01:02 PM | #12 | |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
People pay "per hour of bench time" when restoring their Kindles, so let us reflash these devices at 9,600. |
|
02-29-2012, 01:11 PM | #13 |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
When I started hacking computers, 300bps was a huge luxury. You needed a "glass teletype" to support those awesome speeds. I could read ASCII directly off the punched paper tape. Teachers would not give you the login password -- you had to borrow their short punched paper tape "login key" to login, so being able to read paper tape was one of my "leet hacker skillz". Of course, it took an entire hour to download a tiny low-res picture of a naked lady at 300bps off a BBS back in the day. Kidz these days don't know how good they have it. We couldn't just google "naughty words" back when I was a kid. You had to have real determination and dedication just to get a little taste of what is a "torrent" of media content these days.
9600bps is WAY too fast. When I want to see IF there is data traffic (with no other tools than a blinking LED), I set the interface to 110bps so I can see the bits. Last edited by geekmaster; 02-29-2012 at 01:18 PM. |
02-29-2012, 02:14 PM | #14 | |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
And everything just went better when the fingers stayed in sync with the clutches. So my hands have only one fixed speed, they never learned a different one. |
|
02-29-2012, 04:31 PM | #15 | |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Quote:
And those ASR-33s were much faster than the old 5-bit Murray-code (Baudot) teletypes popular in Ham radio back then -- remember those? (Yes, I have an FCC radio license... and SCUBA diving certificate, certified life-guard, first-aid, CPR, airpane pilot training, motorcycle license, firearms safety certificate, and training and certification in electronics, computer science, human relations, and human-restraint training, including some martial arts training as well!). And while talking about experience, I was "Director of Software Development", "Senior Technical Support Analyst", "Senior Systems Software Engineer", and other things, and I owned my own corporation at one time, and I studied Constitutional Law too (I even represented myself in court several times -- and won my cases!). Now I just sit at home in front of my "wall of video" and telecommute all the time... P.S. Much too easy to reminisce about old things, when new things are much more powerful and fun! I love my tech toys and tools. Last edited by geekmaster; 02-29-2012 at 04:47 PM. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Serial number. | MadChipmunk | Kindle Developer's Corner | 25 | 04-08-2016 11:47 AM |
Serial Numbers | kasra5004 | Amazon Kindle | 2 | 08-18-2012 01:20 PM |
Serial Killers | WillieMcIntyre | General Discussions | 27 | 05-01-2012 04:53 AM |
Kindle 3 serial cable | Frenko | Kindle Developer's Corner | 8 | 11-08-2011 09:07 AM |
New Novel as Serial | plumboz | Writers' Corner | 7 | 06-25-2010 10:04 PM |