USB D+ and D- - Page 1
Forum section: electronics / beginners

author: nicksydney
author_rank: Regular Contributor
timestamp: January 06, 2014, 10:04:45 pm
content: Hi,New to electronics and reading on few schematics as interested in designing something with USB. Noticed from this 2 linkshttp://www.instructables.com/id/USB-Wii-Classic-Controller/?ALLSTEPSandhttp://arduino.cc/en/uploads/Main/arduino-leonardo-schematic_3b.pdfthat the resistors used to connect the D+ and D- pins are different. My question is how do we go about determining the resistor value to use for those pins ?Thanks

author: c4757p
author_rank: Super Contributor
timestamp: January 06, 2014, 10:11:59 pm
content: Eeny, meeny, miny, moe, most likely. Alternatively they are forming a low pass filter with the parasitic capacitance, to round off sharp waveform edges so they don't have to worry about RF emissions - assuming about 15pF, that would be at 1/(2*pi*22*15pF) = 482 MHz - not really very useful unless they're doing USB 2.0, which I doubt. I'll go with eeny meeny.They probably selected them with the same care with which they drew the schematic. (Sorry. Pet peeve.)

author: AlfBaz
author_rank: Super Contributor
timestamp: January 06, 2014, 10:21:37 pm
content: They're trying to match impedances, haphazardly by the looks of it. Section 7.1.1 of the USB 2.0 spec talks about this at length

author: nicksydney
author_rank: Regular Contributor
timestamp: January 06, 2014, 10:24:53 pm
content: Hi c4757p,Quote from: c4757p on January 06, 2014, 10:11:59 pmYou mean when we want to design with USB it's not standard as per say ? bit lost hereQuote from: c4757p on January 06, 2014, 10:11:59 pmYou mean for both schematics ?Thanks

author: c4757p
author_rank: Super Contributor
timestamp: January 06, 2014, 10:35:28 pm
content: I don't think the Arduino one had any thought at all put into the selection. The other one may be correct, actually. USB characteristic impedance is supposed to be 90 ohms differential, and they used 68 ohm resistors. From the datasheet for the ATmega48-328 series, the output impedance is about 30 ohms, so 30 + 68 = not ridiculously far from 90. (They'd have been better off using 56 ohm, I think.)

author: Zbig
author_rank: Frequent Contributor
timestamp: January 06, 2014, 10:38:04 pm
content: Since, as you said, you're new to electronics, you really don't want to "design something with USB" first thing.

author: nicksydney
author_rank: Regular Contributor
timestamp: January 06, 2014, 10:40:25 pm
content: Quote from: Zbig on January 06, 2014, 10:38:04 pmI'm learning as doing it that's the best way to learn and will learn from my mistakes too

author: Zbig
author_rank: Frequent Contributor
timestamp: January 06, 2014, 10:48:58 pm
content: Quote from: nicksydney on January 06, 2014, 10:40:25 pmI probably didn't phrase it right (non-native English speaker here). What I meant is you really shouldn't attempt talking USB at the very beginning of your electronics hobby. You know, learning to walk before you learn to run, etc.

author: romantronixlab
author_rank: Regular Contributor
timestamp: January 06, 2014, 10:50:06 pm
content: Quote from: nicksydney on January 06, 2014, 10:40:25 pmLike zbig said it good to first try(start) with simple easy projects to understand better the design aspect of a circuit and the inner workings.But at the same time I must say I have done the opposite of starting with the simple stuff first but takes more time and resources (parts and money)

author: nicksydney
author_rank: Regular Contributor
timestamp: January 06, 2014, 10:57:48 pm
content: Hi Alfbaz,Thanks will download and have a read in that section.Quote from: AlfBaz on January 06, 2014, 10:21:37 pm

author: nicksydney
author_rank: Regular Contributor
timestamp: January 06, 2014, 10:58:20 pm
content: Thanks for the explanation now it make bit more sense to me, will do more reading on the USB spec.Quote from: c4757p on January 06, 2014, 10:35:28 pm

author: gxti
author_rank: Frequent Contributor
timestamp: January 07, 2014, 04:49:16 am
content: The series resistors, if any, will be specified in the microcontroller's datasheet. STM32 and FTDI both specify 22 ohms, so I think it's quite likely the Arduino designers at least copied people who knew what they were doing, if they didn't know themselves.If you're bitbanging USB, you're on your own.

author: c4757p
author_rank: Super Contributor
timestamp: January 07, 2014, 04:52:02 am
content: You are correct, gxti. The 32U4 datasheet does indeed specify 22 ohm resistors, so now I have egg on my face.

author: nicksydney
author_rank: Regular Contributor
timestamp: January 07, 2014, 05:52:44 am
content: Quote from: gxti on January 07, 2014, 04:49:16 amIs this the standard way from the MCU vendor to specify the resistor or it could be that depending how good the vendors are with their datasheet ?