##### ## #### ## #####
#### ## ## ###### ## ####
____ / __ \ | | | | | | | | | |__| | \____/
__ __ \ \ / / \ V / / \ / /^\ \ \/ \/
#### ## # ## ##### ## ## ####
IMPORTANT: enter the case-INsensitive alphabetic (no numbers) code AND WRITE SOME SHORT summary of changes (below) if you are saving changes. (not required for previewing changes). Wiki-spamming is not tolerated, will be removed, so it does NOT even show up in history. Spammers go away now. Visit Preferences to set your user name Summary of change: '''USB => RS232 (-/8V serial) and USB => FBUS (3V serial) solutions''' USB, although a - technologically speaking - bad protocol (designed for intel's profit, not for the industry's benefit) became very widespread. '''We want good and cost efficient solutions''' (in WebShop) to '''talk to GenBoard and our other computers from USB hosts''' (PC, notebook ...). This requirement is not special, most mobile phones have been doing that for ages. ---- '''Types of USB => serial cables''' * '''USB to FBUS''' (3 V asynchron serial) or * '''USB to RS232''' (-/+8V asynchron serial) cables available off-the-shelf. The cable in the webshop with lsusb ID=04b4:5500 is not pl2303, it uses the "CONFIG_USB_SERIAL_CYPRESS_M8" (.config option in linux kernel, tried with 2.6.10). Works with win32 as well. The [http://www.prolific.com.tw/eng/Products-2.ASP?ID=10 PL2303] is a very common chip for this purpose, cypress_m8, FTDI, etc..., there are about 20 drivers in linux 2.6 for similar purpose (usbserial) so there are many others too. ---- '''Samples under evaluation''' I just received some reasonably priced USB => mobile-phone cables so we can sample, if it can be used for GenBoard/CommToPC (and finally stock in the WebShop if useful). Some are not useful: * Palm m125 has USB internally, so it's really just a cable * Nokia5510 seems like a standard USB cable (I only had time to look into it after ordering some "blindly") But this one looked promising and looks like a real winner now: * '''Nokia1100 has FBUS''' (google: "Nokia 1100 connector serial" or "M2BUS FBUS specifications" ) so it was a good candidate. ---- '''Yes, the Nokia1100 maintenance cable will be our best friend''' Look what the chip says (standard ''lsusb'' command on linux): <code> # lsusb Bus 001 Device 004: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port </code> This means that it has the (most common) PL2303 chip inside. ---- '''Use under Linux - takes just 2 lines''' There is standard driver in linux and for win32 that drives this, so it shows up as a standard serial port: <code> # modprobe pl2303 you will see in the syslog (dmesg, or less /var/log/syslog): ... kernel: pl2303 1-2:1.0: PL-2303 converter detected ... kernel: usb 1-2: PL-2303 converter now attached to ttyUSB0 you just make the devices: # cd /dev # mknod ttyUSB0 c 188 0 and if you plug in more similar devices, just continue to add ports: # mknod ttyUSB1 c 188 1 </code> It's that simple (effectively 2 lines to paste!!!). ---- '''Use under windows''' - it's a bit harder but still simple. In winblows it's more work, install a(n available for download) driver and reboot (and also pray, as there is less indication of what's going on - as usual for winblows). Fortunately it's working OK in win too, as long as I don't use the parallel port at the same time - together they often bluescreen, but I should update to a new PL2303 driver to see if it's fixed - admittedly I have an old version. Also it becomes COM5, and many windows programs are too lame: you can only choose COM1..4 (rarely just COM1..2). ---- '''Notes:''' * the Nokia1100 cable serial side is not -/+ 8V compatible; so the max232 should NOT be in the path when trying communications. * my old USB - RS232 cable has the very same PL2303 chip and the very same instructions were needed to put it into use. The only difference is that it has a max232 (or similar) gizmo inside to convert voltage levels) ---- '''Pinout''' * It has 4 (male) terminals (close, in diamond arrangement) with a ball at the end of the pins. There are small springs inside, so you can push the pins in a little. * TODO: photo of the phone-side connector. It obviously attaches to the backside of the phone with the 4 pins near the corner. I don't have a nokia1100 phone, so the phone orientation might be wrong (unlikely though). Here it is drawn as if the phone was transparent (looking onto the connector, the pins pointing out of the screen). +............................................. | | | |... NC .. Green |White Blue +............................................. The connector ends here ^ the rest is just phone :-) || wire color|| function|| || green || GND || || blue || data to the Phone - AVR RX || || white || data from the Phone - AVR TX || || NC || not connected || ---- '''Links:''' * [http://www.panuworld.net/nuukiaworld/hardware/cables/old.htm simple circuits] for FBUS (good, 3V 2wire async serial) and MBUS (==M2BUS bad, using shared wire for RX and TX, ugly multiplexing of in/out, maybe I2C-like ? ) * http://lists.gnu.org/archive/html/gnokii-users/ * http://www.instoresa.com/tech.htm * http://archive.nokiafree.org/index.php/f-27-Nokia_NFREE_DCT3_Developers.html ---- '''TODO''' * speed test (115200 baud should work, but 230000 baud? Not that we care :-) * put nokia1100 cable in shop: for 17 Euro ---- '''Real test of the nokia1100 cable''' Before buying up the world stock of leftover Nokia1100 cable, I wanted to be sure that it works for us. * I plugged the cable (remember, PL2303 inside) into my linux box. * waited for solderer to heat up * prepared an old GenBoard/VerTwo board so only the max is used (and the supply regulator) * removed the jumper (that connects max232's output (pin12) to AVR's RX. This is there so ISP surely works with unknown impedance PC parallel ports) * removed a via (yes, no holeplates :-) that connects AVR's TX to max232's input (pin11) * soldered the FBUS (cut nokia 1100 cable :-) to the freed max pins * applied a cable to connect to my PC's ttyS0 (you never get this right for first try). ttyS1 didn't work, maybe because I had booted with console=ttyS1,9600n8 kernel command line option (I didn't test this too far, I moved on to ttyS0. This only required some more soldering, as my ttyS1 connector is flying while ttyS0 is soldered on the motherboard.) * fired up 2 minicoms. You usually get this right immediately, but I didn't. I almost became disappointed, when I checked what ports I'm using (fuser). Both were * what you type in one comes on the other * tried different speeds: 230400 did not work. Only 115200 baud and below (perfect. Actually I don't know if my motherboard ttyS0 works at 230400 baud). * I also tried to move large amount of data with cat. (note: after setting up com parameters with minicom. stty would have worked too). I used text files so I can easily diff. Besides the few bytes at start and end of the files (this is normal) there were only error in one case (a '/' was inserted midword). I could not reproduce this, though I moved several megabytes. At 115200 there might be rare data corruption in the raw stream (that's why we use checksums, eg. in the bootloader; and read back config) even a simple cable. If devlopers wants to experiment with it (and report!) please ask in WebShop. ---- '''small max232 board design dropped''' - we don't need to design the max232 board into the DB9 housing since we have both RS232=>FBUS and USB=>FBUS (also USB => RS232) in stock (off-the-shelf price is similar to what it would cost to manufacture: DB9 + max232 chip + PCB + PNP soldering + cables + assembly + testing). ---- '''See also''' * CommMatrix * there is a '''link cable''' (for appr. 15 Euro) for '''interconnecting 4''' Nintento gameboy '''computers''': called "Chili Game link" and "Sunflex Gamelink" (other cables only connect 2 computers). I wonder how that works (addressing, collision ?) and if it's usable for tuning or even production network between GenBoard boxes. 2 such cables could connect max 3 boards redundantly (using both serial ports of each genboard) and on top of that max 2 tuning devices. Optional: Add document to category: Wiki formatting: * is Bullet list ** Bullet list subentry ... '''Bold''', ---- is horizontal ruler, <code> preformatted text... </code> See wiki editing HELP for tables and other formatting tips and tricks.