• AVR Freaks

Hot!How to power VBUS on PIC32 acting as USB host?

Author
gurksallad
New Member
  • Total Posts : 27
  • Reward points : 0
  • Joined: 2017/02/02 01:10:12
  • Location: Sweden
  • Status: offline
2020/05/25 12:16:58 (permalink)
0

How to power VBUS on PIC32 acting as USB host?

My USB host prototype is not working and I think I've pinned down the error to be a VBUS-issue so I've read up in some datasheets but I can't sort this out.
 
In DS61126F i find this under 27.3.4.2 VBUS control:
* Standard host typically supplies power to the bus at all times
Which should mean I can connect RB6/VBUS to USB pin 1, but later on the same page:
Note: The PIC32 device does not supply the VBUS power. Refer to the specific device data
sheet for VBUS electrical parameters.
Which means I cannot do this. Figure 27-7 in the same document shows the electrical connection for a USB host.
 
What I do not understand here is what the switch (see attached screenshot) is supposed to be. Relay? MOSFET? Transistor? What?
 
 

Attached Image(s)

#1

9 Replies Related Threads

    rjc101
    Super Member
    • Total Posts : 133
    • Reward points : 0
    • Joined: 2016/07/08 14:56:34
    • Location: 0
    • Status: offline
    Re: How to power VBUS on PIC32 acting as USB host? 2020/05/25 12:32:25 (permalink)
    5 (1)
    That switch can be a Mosfet, relay, or direct wired.  I've used something like a TPS2051BD power switch, which protects the 5v line from a short on the USB bus.
     
    I think they show it as a switch so you can turn the USB power off should you want to.
    #2
    gurksallad
    New Member
    • Total Posts : 27
    • Reward points : 0
    • Joined: 2017/02/02 01:10:12
    • Location: Sweden
    • Status: offline
    Re: How to power VBUS on PIC32 acting as USB host? 2020/05/25 13:53:05 (permalink)
    0
    So if I don't want to turn off USB I simply connect 5V - VBUS - pin 1 (with or without some protection in between)?
    #3
    rjc101
    Super Member
    • Total Posts : 133
    • Reward points : 0
    • Joined: 2016/07/08 14:56:34
    • Location: 0
    • Status: offline
    Re: How to power VBUS on PIC32 acting as USB host? 2020/05/25 13:55:26 (permalink)
    0
    I’ve done that before during development but I’ve always used some kind of switch/protection for production.
    #4
    ric
    Super Member
    • Total Posts : 28324
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: How to power VBUS on PIC32 acting as USB host? 2020/05/25 15:09:04 (permalink)
    5 (1)
    A host is nearly always going to need to cycle the Vbus output to be able to reset slave devices.
    +1 for using a TPS2051B style device to do it, which automatically gives current limiting and over current indication.
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #5
    RISC
    Super Member
    • Total Posts : 5776
    • Reward points : 0
    • Status: offline
    Re: How to power VBUS on PIC32 acting as USB host? 2020/05/25 17:06:05 (permalink)
    0
    Hi,
    Which PIC32 device do you use ?
    Your best friend is the user manual of any demoboard based on your device or a device from the same family.
    The demoboard User manuals aways contains schematics where you can see how USB hardware is implemented 
    Regards
     
    #6
    nigelwright7557
    Super Member
    • Total Posts : 471
    • Reward points : 0
    • Joined: 2006/11/06 08:15:51
    • Location: 0
    • Status: offline
    Re: How to power VBUS on PIC32 acting as USB host? 2020/05/25 21:04:49 (permalink)
    2 (1)
    I always use a resistor in series from 5v to VBUS.
    I don't think poking 5 volts straight into a 3v3 PIC will do it much good unless the pin is 5 volt tolerant.
     
     
     
    #7
    gurksallad
    New Member
    • Total Posts : 27
    • Reward points : 0
    • Joined: 2017/02/02 01:10:12
    • Location: Sweden
    • Status: offline
    Re: How to power VBUS on PIC32 acting as USB host? 2020/05/25 23:29:40 (permalink)
    5 (1)
    RISCHi, Which PIC32 device do you use ?



    PIC32MM0256GPM064
     
    I've got a USB Curiosity board and peeked the schematics but the information is rather scarce.
    #8
    vexorg
    Super Member
    • Total Posts : 83
    • Reward points : 0
    • Joined: 2019/09/27 10:59:40
    • Location: 0
    • Status: offline
    Re: How to power VBUS on PIC32 acting as USB host? 2020/05/26 04:11:57 (permalink)
    0
    I'd say it depends on your application, if you plan to plug things in and out then use some current limited part inbetween.
     
    A 500mA regulator is ideal as the basic. But there are other switches that flag if overcurrent.
     
    Personally I'm using it in a hardwired embedded set up so dont need the VBUS functions as such.
    #9
    RISC
    Super Member
    • Total Posts : 5776
    • Reward points : 0
    • Status: offline
    Re: How to power VBUS on PIC32 acting as USB host? 2020/05/26 06:19:48 (permalink)
    5 (1)
    Hi,
    gurksallad
    RISCHi, Which PIC32 device do you use ?
    PIC32MM0256GPM064
     I've got a USB Curiosity board and peeked the schematics but the information is rather scarce.

    OK I understand the issue : the curiosity board you use is meant to support only device role...but you want to implement HOST.
    The power supply associated to Vbus is quite different between device and Host...as the Host should be able to provide up to 500mA.
    For HOST mode evaluation, you can use the EXPLORER1632 demoboard + PIM MA320023.
    The EXPLORER1632 has hardware that supports device / OTG / HOST roles.
    The schematics is visible here : https://microchipdeveloper.com/boards:explorer1632
    Regards
     
    #10
    Jump to:
    © 2020 APG vNext Commercial Version 4.5