2
\$\begingroup\$

I'm designing a board with a STM32F103CBT6 chip and I've been trying to figure out how USB works so I can have that extended out. Reading some specifications online has just left me with more questions. From another stack overflow question I got these 2 documents which I'll be referencing in my questions.

  1. Fairchild Specifications
  2. Semtech Specifications

Questions:

  1. Can 2 USB devices talk to each other if both of them are designated as "Downstream" or "Upstream" devices? 2
  2. Rpd and Rpu from 2, are they independent of of Vdd or will they change if your device is running off a different supply voltage?
  3. If I'm understanding the Termination resistance correctly, one side of the system has to have 45ohms and the other side equally has to have 45ohms for a total series of 90ohms as specified in 1. What happens if a long cable is involved between the 2 systems and added more resistance? Would USB communication stop working?
  4. How do I actually calculate Rs needed to add on the D lines? Are they specified somewhere in the STM32F103 manuals? I've been working from the hardware design guide, reference manual and datasheet for the chip but haven't seen anything on it.
  5. The reference manual for my chip specifies it's USB2.0 full speed, which 2 says is 12Mbps communication, however the STM32Cubef1 setup program says 48Mhz is required for the USB clock, why the discrepancy between clock speed and data transmission?
\$\endgroup\$
3
\$\begingroup\$
  1. Not unless one side is an OTG type port that can serve either role. This is usually an "AB" type connector only.

  2. The pull up is apparently attached to a 3.3V supply.

  3. Long cables can be a problem, especially in marginal USB implementations. It's not strictly cable resistance that is the enemy though. Loss is a function of several factors, but the characteristic impedance of the cable should be \$90\Omega\$ differential. The terminator matches this value to prevent reflections in the cable.

  4. Here is an example schematic of the Discovery board. They use \$22\Omega\$ resistors. The Rs termination is occasionally internal to the chip, but that doesn't appear to be the case here. Sometimes it's best to just copy what you find, especially when you know it works!

  5. USB hardware seems to always be clocked at 48MHz. Perhaps something in the transceiver needs to happen 4x faster than the data lines, but it is very common. It is also common to derive this from a PLL from a lower speed clock, but I don't know if that's an option here. You need to pay attention to the accuracy and drift specifications of the oscillator to make sure that it will work well under all operating conditions.

\$\endgroup\$
  • \$\begingroup\$ 1: Is USB-OTG compatible with normal USB? 2: So should all USB devices have a 3V3 regulator or can the resistors be changed accordingly? 3: So the usb cable is 90ohms and the ingoing and outgoing terminals just use Rs to match that cable resistance? What is meant by 90ohms differential? 4: Thanks, I'll just go with 22 then. \$\endgroup\$ – NathanielJPerkins Dec 15 '15 at 7:44
  • \$\begingroup\$ 1. Uh, I guess so.. that's something I haven't encountered a lot. 2. I believe they all do. D+ and D- are 3.3v signals. Often you don't need to worry about these pullups. Read the app notes and examples carefully. 3. I think Rs is used to help damp signal reflection. Not totally sure. The spec calls for 90 ohm impedance from D+ to D-. This ends up being 45 mutual to ground. 4. sounds like a good plan! \$\endgroup\$ – Daniel Dec 15 '15 at 7:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.