USB High-speed project

Features:

Docs

Power

The board must be powered from USB. A jumper must be installed on the POWER pinheader (board bottom-left), to select powering from either the full-speed or high-speed USB connector.

USB high-speed PHY

The high-speed external USB PHY can be clocked in one of two ways:

  1. Refclk supplied from an STM32F2 PWM timer.
  2. Separate 24 MHz crystal.

The primary method is refclk from STM32F2. For this, R50 must be fitted while C24, C25, and X2 must be omitted. R6-8 can probably also be omitted. A 12 MHz refclk should work well when the MCU is running at 120 MHz, though there are other possibilities depending on the MCU clock frequency (see USB3320 datasheet for available frequencies).

The MCU must first program the correct refclk frequency on PC13-PC15 (3'b010 for 12 MHz) and start the refclk output on PB9 (TIM11_CH1). Then it should release the PHY from reset (PC5=1), and the PHY should hopefully come up when its PLL has locked.

To use the alternate option with separate 24 MHz PHY crystal, R50 should _not_ be fittet. R6-8 will program the refclk frequency at 24 MHz. So the PHY should come up when the MCU releases reset (PC5=1).

LEDs

Two (mutually exclusive) options are available for fitting LEDs:

  1. 2 0606 RGB LEDs. LD1 on PA0-2, LD2 on PA8-10.
  2. 6 0805 single LEDs. D1/D3/D5 on PA0-2, D2/D4/D6 on PA8-10.

The LED options can be combined, but only one LED should be connected to each GPIO (either RGB or single). The LED pins are also available on the GPIO headers, so if prefered an LED can be omitted (together with the relevant resistor R15-20) in favour of GPIO use.

The MCU pins that the LEDs are connected to have PWM available, TIM5_CH1-3 and TIM1_CH1-3. Note that the LEDs are connected with the cathode towards the MCU, so a pin must be pulled low to turn on an LED.

USART

USART1 is available on the board from PB6 and PB7. R1 is an optional pull-up on Tx, to prevent garbage on the line if the MCU is not driving it. The USART1 is available both on the GPIO pinheaders and on a separate 4-pin header at the top-left corner of the board.

User button

A user button is available on PB4. R5 can be fitted as a pull-up (so button is active-low); alternatively if R5 is omitted, an internal pull up/down can be enabled inside the MCU.

Programming with DFU or SWD

SW1 (to the right of the full-speed USB connector) can be used to enable the built-in STM32 bootloader. When this switch is in the leftmost position and the STM32 is reset, it will come up in the system bootloader instead of booting from flash, and can be programmed over DFU.

Alternatively, SWD programming / debugging is available from the SWD pinheader at the top of the board.

I2S

I2S3 is availble on the pinheader at the right of the board. To use I2S, the resistors R2-R4 must be fitted. Note that the micro-SD card SDIO and I2S share pins. If SD-card is desired and I2S is not, R2-R4 could be omitted to maybe improve high-speed SDIO signal integrity.

Resources

Github project.

Datasheet for Microchip USB3320 external PHY.

Close to final routed PCB. Size is 88 x 60 mm:

Schematics: (PDF schematics)