Quantcast

Maximum PC

It is currently Thu Aug 28, 2014 8:41 am

All times are UTC - 8 hours




Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: writing a usb driver
PostPosted: Tue Jan 13, 2009 5:36 pm 
Team Member Top 50
Team Member Top 50

Joined: Sat Jun 25, 2005 11:04 am
Posts: 1026
I need a driver, or instructions on how to make one, that enables power output on a usb port. I need this so I can charge my phone using my computer. It works in linux without anything else, so it should be doable.


Top
  Profile  
 
 Post subject: Re: writing a usb driver
PostPosted: Tue Jan 13, 2009 5:50 pm 
Million Club
Million Club

Joined: Tue Oct 23, 2007 4:37 pm
Posts: 639
There is 5v on pin 1 see http://en.wikipedia.org/wiki/Usb the question is what does the phone need?

Some external hard drive enclosures use a second USB plug for extra power, but ....if the phone needs more than 5v, does the phone have a USB charger cable available if you Google for it?


Top
  Profile  
 
 Post subject:
PostPosted: Tue Jan 13, 2009 6:34 pm 
Team Member Top 50
Team Member Top 50

Joined: Sat Jun 25, 2005 11:04 am
Posts: 1026
A usb cable works from the usb port under linux. I just need it to work under windows. Windows detects it, tries to find a driver, doesn't find one, and I'm guessing disables the port, which makes it unable to charge.


Top
  Profile  
 
 Post subject:
PostPosted: Tue Jan 13, 2009 6:58 pm 
Million Club
Million Club

Joined: Tue Oct 23, 2007 4:37 pm
Posts: 639
Do you have a link to the cable you are using?

If the same port works with Linux and fails with Windows, then there must be a circuit and/or chip in the cable or phone to control the charging that Windows does not have a built in driver for. If you check device manager with the cable connected, does it show a yellow or red mark?

If you plug in a flash drive on that port after you try the cable, does it work?

Just to make sure the USB drivers are not getting messed up by the cable.


Top
  Profile  
 
 Post subject:
PostPosted: Tue Jan 13, 2009 7:05 pm 
Team Member Top 50
Team Member Top 50

Joined: Sat Jun 25, 2005 11:04 am
Posts: 1026
It uses a normal usb cable.

A yellow question mark shows up next to it in device manager.

Yes, a flash drive works on that port after I tried the cable.


Top
  Profile  
 
 Post subject:
PostPosted: Wed Jan 14, 2009 4:59 am 
Java Junkie
Java Junkie
User avatar

Joined: Mon Jun 14, 2004 10:23 am
Posts: 24222
Location: Granite Heaven
You don't need to write a driver. This is a very good thing because the fact that you're asking us how to write one indicates that this is well beyond your abilities.

It is also beyond me, without a lot of research, so don't think I'm insulting you. Writing a driver is not a trivial exercise.

However, you don't need to write one. You need to find the correct driver for your motherboard. Linux recognizes the USB controller fine and provides a USB 2.0 driver for you ... hence, power. Windows does not identify the controller and so it gives you a generic USB 1.1 driver ... hence, no power.

You need to find chipset drivers for your motherboard or a driver specific to your USB controller. Thankfully, your linux install knows what you are running .. go find out what you've got and then find the drivers online.


Top
  Profile  
 
 Post subject:
PostPosted: Wed Jan 14, 2009 5:13 am 
Million Club - 5 Plus
Million Club - 5 Plus
User avatar

Joined: Fri Apr 25, 2008 6:35 am
Posts: 1998
from what I understand (could very well be wrong) unless a device specifically requests more power, a usb port will only provide 100 ma. once the device requests more, the port will give 500 ma.

my phone also will not charge when plugged into my computers USB port. and it uses a 5v 500 ma wall charger with a USB connector on the end.

all other devices that need the full 500 ma work and can draw the full 500 ma (GPS, EVDO modem, external USB drive, and they show as drawing 500 ma under device manager) plugged into the same port so I know the computers port and USB drivers are OK.

my guess is the phone wont charge with 100 ma and its not requesting the full 500 ma for some reason (not fully USB complient?). linux may treat the ports different and just set them at full power all the time.


Top
  Profile  
 
 Post subject:
PostPosted: Wed Jan 14, 2009 1:56 pm 
Team Member Top 500
Team Member Top 500
User avatar

Joined: Mon Jan 08, 2007 1:41 pm
Posts: 2033
CharBroiled wrote:
from what I understand (could very well be wrong) unless a device specifically requests more power, a usb port will only provide 100 ma. once the device requests more, the port will give 500 ma.

my phone also will not charge when plugged into my computers USB port. and it uses a 5v 500 ma wall charger with a USB connector on the end.

all other devices that need the full 500 ma work and can draw the full 500 ma (GPS, EVDO modem, external USB drive, and they show as drawing 500 ma under device manager) plugged into the same port so I know the computers port and USB drivers are OK.

my guess is the phone wont charge with 100 ma and its not requesting the full 500 ma for some reason (not fully USB complient?). linux may treat the ports different and just set them at full power all the time.


I myself have never heard of the 100ma/500ma variation in USB current allotment, although I doubt this is the reason your phone can't be charged through your computer's usb connection.

Even though your wall charger can provide up to 500mA, it certainly doesn't draw that much current during use. Theoretically if you just wired the pos and neg wires from two usb ports together you would get 5v @ 1A.


Top
  Profile  
 
 Post subject:
PostPosted: Wed Jan 14, 2009 6:56 pm 
Million Club - 5 Plus
Million Club - 5 Plus
User avatar

Joined: Fri Apr 25, 2008 6:35 am
Posts: 1998
just checked the spec (go to usb.org, download usb_20_122208.zip, open usb_20.pdf and look in section 7.2.1) it states that all usb devices are considered to default to 100 ma unless they request more (in chunks of 100 ma, which is considered a "unit load"). its up to the USB device to ask for this extra power, and confirm that its available before switching to a higher power mode..

also check section 10. this is where the USB host rations power out. again its done through software (drivers). the way I read it is it can limit power to devices in "unit loads" of 100 ma. it also will let a device that requests more power know if it has the extra power to give it. if the host does not have the extra power it will let the device know and the device will not (if its polite) switch to a higher power mode.

as to how well the various mobo, driver writers and device manufactures implement this, who knows?

let me say Im no engineer so read it for yourself. I may have it wrong.

as for 100 ma charging a phone, maybe.. but mine does not and I know my ports can give the full 500 ma when they want to as my high power usb devices work fine.. they are even listed as drawing 500 ma in the device manager under the usb power section. something is preventing them when the phone is plugged in and the spec seems to point at the phone not requesting the full 500 ma so the port isnt giving it.

Mag, what happens if you plug your phone into a powered hub instead of the computer. powered hubs may act different.


Top
  Profile  
 
 Post subject:
PostPosted: Fri Jan 16, 2009 5:57 am 
Team Member Top 50
Team Member Top 50

Joined: Sat Jun 25, 2005 11:04 am
Posts: 1026
I got it working, thanks all for your help.

I tried reinstalling the chipset drivers, but that didn't work. I then tried letting windows do it's search thing for a driver which did work (ha Jip, it was a driver :D ).


Top
  Profile  
 
 Post subject:
PostPosted: Fri Jan 16, 2009 6:12 am 
Java Junkie
Java Junkie
User avatar

Joined: Mon Jun 14, 2004 10:23 am
Posts: 24222
Location: Granite Heaven
mag wrote:
(ha Jip, it was a driver :D ).


Of course it was .. that's what I told you and I'm always right. :P


Top
  Profile  
 
 Post subject:
PostPosted: Fri Jan 16, 2009 6:18 am 
SON OF A GUN
SON OF A GUN
User avatar

Joined: Mon Nov 01, 2004 5:41 am
Posts: 11605
Jipstyle wrote:
mag wrote:
(ha Jip, it was a driver :D ).


Of course it was .. that's what I told you and I'm always right. :P
Oh shut up.... lol


Top
  Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group