HardwareCP210xTutorial » History » Revision 9
Revision 8 (laforge, 02/19/2016 10:49 PM) → Revision 9/13 (laforge, 02/21/2016 10:35 AM)
h2. CP210x High Baudrates Tutorial !{width:33%}cp2102.jpg! [[Image(cp2102.jpg, right, 33%)]] This page will describe the procedure of programming high, non-standard baudrate mappings to a SiLabs CP210x serial converter using Linux, needed by the burst_ind branch. Small adapter PCBs to which you have to solder your own cable + plug can be bought quite cheaply on eBay and AliExpress. Ready-made adapter cables with the CP2102 can be bought from "shop.sysmocom.de":http://shop.sysmocom.de/products/cp2102-25 So far this tutorial has only been tested with the CP2102, but this seems to be the most common chip anyway. h3. How it works Contrary to the FTDI converters, non-standard baudrates can't be directly requested when opening the port, but need to be stored in the EEPROM of the device, overwriting the default entries. So it works like this: You open the port with a standard baudrate, the converter performs a look-up in the baudrate-table of its EEPROM and uses the non-standard mapping you programmed. If you have a [[PirelliDPL10|Pirelli DP-L10]] you don't need to continue, the CP2102 in the phone has those mappings already preprogrammed. h3. Programming non-standard mappings First of all you need to download and unpack the lastest version of "cp210x-program":http://cp210x-program.sourceforge.net/, an open-source tool replacing the proprietary windows-only tool from SiLabs (see application note AN205 if you want to mess with that). To make sure cp210x-program will be the only one talking to the converter, unload the kernel module: <pre> sudo rmmod cp210x </pre> After that, perform a dry-run to see everything is okay: <pre> sudo ./cp210x-program </pre> The tool should output the device-string of the converter, some other information, and a baudrate table with the following default entries: <pre> [baudrate table] [...] 921600 = FFE6, FFF6, 1 # 923077 Baud, 20 us [...] 460800 = FFCC, FFEC, 1 # 461538 Baud, 40 us [...] 230400 = FF98, FFD9, 1 # 230769 Baud, 78 us [...] 115200 = FF30, FFB2, 1 # 115385 Baud, 156 us [...] </pre> Okay, now to the real thing: create a backup of the EEPROM: <pre> sudo ./cp210x-program -f eeprom.hex </pre> The next step is to program the modified, non-standard baudrates: <pre> sudo ./cp210x-program -p -F eeprom.hex -w --set-baudrate 812500:FFE2,FFF4,1 --set-baudrate 406250:FFC5,FFE9,1 --set-baudrate 203125:FF8A,FFD3,1 </pre> Check if the entries have been written successfully: <pre> sudo ./cp210x-program </pre> You should see the following entries: <pre> [baudrate table] [...] 812500 = FFE2, FFF4, 1 # 800000 Baud, 24 us [...] 406250 = FFC5, FFE9, 1 # 406780 Baud, 46 us [...] 203125 = FF8A, FFD3, 1 # 203390 Baud, 90 us [...] 115200 = FF30, FFB2, 1 # 115385 Baud, 156 us [...] </pre> Replug the converter and you're done. h3. Using burst_ind If you want to use the burst_ind branch with a CP210x converter, you need to add the following define in osmocon.c: <pre> #define I_HAVE_A_CP210x </pre>