USB => RS232 (-/8V serial) and USB => FBUS (3V serial) solutions
USB became very widespread in recent years. 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
- PL2303 is the most common (currently the only type in WebShop) and popular elsewhere too, either "USB to FBUS" (3 V asynchron serial) or "USB to RS232" [PL2303 datasheet]
- linux module name is pl2303
- windows driver: http://www.prolific.com.tw/support/files//IO%20Cable/PL-2303/Drivers%20-%20Generic/Windows/wd_pl2303h-hx-x_v20019v2021.zip
- [OLD driver] (md5sum checksum /cdrom/PL-2303X/Setup.exe = bb01cb5bd5d139cea620ad4e4276fffd )
- There was one USB to RS232 (-/+8V asynchron serial) cable sold earlier that is not PL2303, but ( USB ID="04b4:5500" ), that uses the "CONFIG_USB_SERIAL_CYPRESS_M8" (.config option in mainstreem linux kernel, tried with 2.6.10). Works with win32 as well. [old development info on driver before it was included in mainstream kernel] and [ CY7C63743 datasheet]
Besides the common pl2303 and cypress_m8, FTDI, etc..., there are about 20 drivers in linux 2.6 for similar purpose (usbserial) so there are many others too. We don't have information on which one supports 16 bit words (all supports 8 bit words, pf course), that would be useful to boot OtherTuningSoftware/NintendoGameBoy from PC (for running program, eg. for reflashing GBA flash).
Some (like the cypress) contain general purpose microcontroller with OTP or rewritable flash that could theoretically be tweaked to support anything.
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
- Motorola USB-FBUS cables use a nice 2.5mm stereo jack connection
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):\n
# lsusb Bus 001 Device 004: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
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:\nÿ2ÿ
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.
- most 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
- Nokia USB-FBUS service cable 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:
- [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).
However a small board that has CAN transceiver that attaches to FBUS would be nice.
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.