Creating USB interface from scratch.  - Page 1
Forum section: electronics / general

author: boingaon
author_rank: Newbie
timestamp: December 24, 2012, 02:31:30 am
content: Hello,The "high level" prototyping boards like the ChipKit and this guy :http://www.mikroe.com/ready/pic/make it real easy to connect the board to the PC for programming and serial communication.However, I'm creating a new product that will need to have a USB-to-computer connection. I need to know how to form this connection from scratch since the chips that will be in the product won't have the fancy add-ons that my high level board will have.How can I practice forming this connectivity on a high level board? Should I also buy a PicKit/handful of chips, and use them for this practice?Thank you-P

author: TheDirty
author_rank: Frequent Contributor
timestamp: December 24, 2012, 04:31:35 am
content: It looks like it uses a pretty common ftdi ft232rl usb->serial converter. If you want to test with them and don't want to create a prototype board of your own just yet, just search for "ft232rl breakout". There are plenty of breakout boards available for these. Some of them have the simple schematic that goes with them. You should be able to figure it out easily. It's not a complicated chip or interface.

author: boingaon
author_rank: Newbie
timestamp: December 24, 2012, 04:57:52 am
content: I could use the ft232rl breakout board in place of the development board's built-in USB interface?

author: Skimask
author_rank: Super Contributor
timestamp: December 24, 2012, 05:11:29 am
content: http://www.picbasic.co.uk/forum/showthread.php?t=5418

author: notsob
author_rank: Frequent Contributor
timestamp: December 24, 2012, 07:27:46 am
content: there is also Cypress CY7C63310 or SILABS CP210x series

author: andersm
author_rank: Super Contributor
timestamp: December 24, 2012, 09:59:06 am
content: And Microchip's MCP2200.

author: nctnico
author_rank: Super Contributor
timestamp: December 24, 2012, 11:30:44 am
content: Quote from: TheDirty on December 24, 2012, 04:31:35 amI strongly recommend using the CP2101 USB serial converters from Silabs. The ones from FTDI are really crappy. Even the smallest disturbance causes the connection to freeze. The CP2101 is much more robust to use. This is most likely a driver issue but still...

author: ptricks
author_rank: Frequent Contributor
timestamp: December 24, 2012, 01:14:40 pm
content: Get a pickit 2 or 3, The 2 has the option of being used as a serial interface but you can always do that with a separate part if you want to send data over a terminal. There are a lot of home made pic programmers , but the pickit will be the easiest to use.For chips, the 18F4550, 18F2550 are probably the best documented USB interface pic chips. There are newer ones like the pic32 line but they lack a lot of documentation.You can also install a usb boot loader so that the chips will update over USB.http://www.diolan.com/pic/bootloader.html

author: TheDirty
author_rank: Frequent Contributor
timestamp: December 24, 2012, 01:40:20 pm
content: Quote from: nctnico on December 24, 2012, 11:30:44 amI'm guessing this is an issue specifically with you? I've never heard of the FT232RL having reliability issues and they are an commonly used chip. It's also an old chip and the drivers are excellent with it now. There's even default drivers on many linux distributions.

author: McMonster
author_rank: Frequent Contributor
timestamp: December 24, 2012, 01:51:13 pm
content: Also the availability of CP2101 is rather poor, as per a quick search in FindChips.

author: nctnico
author_rank: Super Contributor
timestamp: December 24, 2012, 03:20:22 pm
content: Quote from: TheDirty on December 24, 2012, 01:40:20 pmI use them for programming NXP's LPC controllers. The programming board is a double sided board with a solid ground plane on one side. The wires to the target are about 10cm. There is a lot of switching on/off of the target board and also switching between a terminal program and a serial programming tool. The CP2101 handles such an environment perfectly while the FTDI does not at all. I have to unplug/plug it all the time to get it going again. Despite my excellent experiences with the CP2101 I decided to use an FTDI chip for my programming board because it is easier to solder.

author: TheDirty
author_rank: Frequent Contributor
timestamp: December 24, 2012, 04:04:11 pm
content: Quote from: nctnico on December 24, 2012, 03:20:22 pmSo this is a issue you've had personally and not something that's generally considered a problem.I've used them even on single sided boards without a hitch and never heard of anyone having any recent problems with the drivers (meaning sometime within the last few years).

author: boingaon
author_rank: Newbie
timestamp: December 24, 2012, 07:44:25 pm
content: Lots of great information here. By the way, what are the legalities in using code like that mentioned below:http://www.diolan.com/pic/bootloader.htmlinside a final product that would be sold? I can't imagine that every company creates a brand new communication interface from scratch every time they make a new product. Likely the desktop GUI... But I could be wrong.

author: Unknown
author_rank: Unknown
timestamp: December 24, 2012, 08:30:30 pm
content: According the documentation it's licensed under GPL v3. This allows commercial use, but requires you to release the source code with any modifications you made. Not exactly a big deal for a bootloader, unless you are trying to prevent customers from uploading their own firmware. I would expect Microchip to offer a bootloader with their USB stack, although I remember the license for some of their software (eg. USB stack) to be somewhat painful.

author: nctnico
author_rank: Super Contributor
timestamp: December 25, 2012, 02:07:36 am
content: Quote from: TheDirty on December 24, 2012, 04:04:11 pmMaybe or I'm just kicking it around harder revealing problems others don't notice... Lots of products seem to work fine at first glance until you kick it in the nuts and you get a view of the real nature of the product. BTW I've had similar problems with FTDI based USB serial dongles on different computers. Its not just my board.

author: andersm
author_rank: Super Contributor
timestamp: December 25, 2012, 04:39:17 pm
content: Quote from: alm on December 24, 2012, 08:30:30 pmMicrochip do have their own USB bootloader, but IIRC it is a lot larger than what the Diolan bootloader documentation claims about theirs.Quote from: nctnico on December 25, 2012, 02:07:36 amI've seen the odd complaint about FTDI's Windows driver. I don't remember running into the issues you describe, but I've mostly used their devices under OS X or Linux.

author: boingaon
author_rank: Newbie
timestamp: December 26, 2012, 11:09:18 am
content: In response to ALM,To abide by the GPL v3, where to I need to put my source code? Inside the device, on the product's website, or in the product's manual?

author: nctnico
author_rank: Super Contributor
timestamp: December 26, 2012, 01:26:37 pm
content: AFAIK you need to make the sourcecode available. That includes asking money to send it by mail on a medium.

author: Unknown
author_rank: Unknown
timestamp: December 26, 2012, 01:54:28 pm
content: The easiest solution is usually to either ship it with the product if you're distributing something like a CD, or offer it for download on the product website.

author: amyk
author_rank: Super Contributor
timestamp: December 26, 2012, 02:23:11 pm
content: From thread title I thought you wanted to make your own USB serialiser/deserialiser... can be done for low speed and full speed with a fast enough MCU bitbanging the pins, but not high speed. (And forget about super speed...)

author: poorchava
author_rank: Super Contributor
timestamp: January 03, 2013, 12:45:51 pm
content: One thing is for sure: you definitely DO NOT want to write mcu stack or windoze driver for USD. You actually want USB to be as transparent to you as possible because otherwise it's entirely likely that you're gonna get a mental condition.

author: boingaon
author_rank: Newbie
timestamp: January 05, 2013, 07:02:47 am
content: Thanks all for the helpful insight.

author: free_electron
author_rank: Super Contributor
timestamp: January 05, 2013, 09:54:27 pm
content: Quote from: amyk on December 26, 2012, 02:23:11 pmand it is compliant as a baboons ass with a rock...if you are going to make a USB phy form scratch you'll need to submit it to certification and that is VERY hard !