Author Topic: STM32 USB  (Read 6913 times)

0 Members and 1 Guest are viewing this topic.

Offline pyrohazTopic starter

  • Regular Contributor
  • *
  • Posts: 186
  • Country: gb
    • Harris' Electronics!
STM32 USB
« on: May 27, 2014, 03:35:27 am »
Hey all,

I'm designing a system based on the STM32L1 chip which supports USB. I'm using a standard 8MHz crystal so the PLL will have a stable frequency to create the USB clock from.

What I'm wondering is how I actually connect the USB port to the IC. After looking at the schematic for the STM32F4 discovery kit, it seems that the USB port is connected to the MCU through two 22Ohm resistors (http://www.st.com/st-web-ui/static/active/en/resource/technical/document/user_manual/DM00039084.pdf Page 39) along with an ESD protection IC. I won't be including this IC because I can't solder BGA packaged just yet!

I've included these two 22Ohm resistors and a 1.5k pullup resistor to 3.3v that the internet seems to suggest I need. The 5v from the bus goes directly to my MCU regulator. In the image I've attached, USBD- goes to PA11 and USBD+ goes to PA12 (these are the respective pins on the MCU from the datasheet).

Is this all I need to be able to program my system through DFU? I have included the ability to set BOOT0 high (required for DFU mode) and I can reset the MCU once BOOT0 is high.

Cheers,
Harris
 

Offline theatrus

  • Frequent Contributor
  • **
  • Posts: 352
  • Country: us
Re: STM32 USB
« Reply #1 on: May 27, 2014, 06:18:16 am »
From what I can see, the STM32L only has a USART bootloader, and doesn't have any DFU capability
Software by day, hardware by night; blueAcro.com
 


Offline pyrohazTopic starter

  • Regular Contributor
  • *
  • Posts: 186
  • Country: gb
    • Harris' Electronics!
Re: STM32 USB
« Reply #3 on: May 27, 2014, 08:17:36 pm »
Yeh, as said by Lizerd, i'll be using one of the USB enabled STM32L series! Is there anything else I need to add for this to work?
 

Offline andyturk

  • Frequent Contributor
  • **
  • Posts: 895
  • Country: us
Re: STM32 USB
« Reply #4 on: May 28, 2014, 02:22:44 am »
You don't actually need the pull-up resistor as there's one built in already. The pull-up is activated by setting the USB_PU bit in the SYSCFG register. See section 8.5.2 of RM0038.

Edit: Oh, and regarding the bootloader, make sure you have pull ups or pull downs on all the other I/O lines that the bootloader will try (CAN, USART, etc.).
« Last Edit: May 28, 2014, 02:27:59 am by andyturk »
 

Offline pyrohazTopic starter

  • Regular Contributor
  • *
  • Posts: 186
  • Country: gb
    • Harris' Electronics!
Re: STM32 USB
« Reply #5 on: May 30, 2014, 02:51:30 pm »
Hi all,

I've finished the PCB routing for my system and have included the 22ohm resistors, along with the pads for the 1.5k resistor if required, I decided to include it just incase because if it isn't needed, I can just not populate it!

Thanks for the help :)
 

Offline gxti

  • Frequent Contributor
  • **
  • Posts: 507
  • Country: us
Re: STM32 USB
« Reply #6 on: May 30, 2014, 04:39:55 pm »
Good idea. Plan for the worst, because the pads are free. With STM32 it can be confusing exactly what's required because the different series have different USB controllers, and even within a part there can be a high speed controller and a OTG controller each with different capabilities in terms of pullup etc.

For the ESD protection, there's no need to use the exact part ST used. There are dozens of different ESD protection ICs qualified specifically for USB in friendlier packages. For example, here's the one I'm using in my current product for both USB and SDIO: http://www.digikey.com/product-detail/en/USBLC6-2SC6/497-5235-1-ND/1121688

That said, it's not strictly required to add extra ESD protection. The 22 ohm resistors plus the builtin ESD protection in the STM32 goes a long way.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf