Debunking The USB Port

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
romero126
Posts: 200
Joined: Sat Dec 24, 2005 2:42 pm

Debunking The USB Port

Post by romero126 »

Some people say that the USB port on the PSP can only run in Client Mode. However with the PSP multitude of devices that are out that use USB in client mode one must realize that you can unlock the PSP to run USB in client mode.

Now you may think that my comments are crazy. However its not. Think about it fiscally. Would you rather as a large company run a USB Perferial as a Client or a Host? Its fiscally irresponsible to load a USB host processor onto a PSP Acessory when the software developers can merely work arround it by accessing physical hardware located on the device itself. (Software or Hardware), We should totally do a doubletake on the USB port on the PSP.

If you havnt been programming long this might be a pipe dream for you, however I find that it is essential to the growth of the homebrew community, Adapters that change a PSP into a keyboard or a touch screen capable device. ETC.

The PSP has 2 connectors directly to the PSP main CPU core. These are Data Lines. Leaving 3 other lines,

1. A Power line which supplies 0.24v of electricity - Question why would this exist unless it had a OTG host protocol located in the firmware itself.

This power line that supplies voltage should not exist if it was only a client based USB port since the Ground line which recv's power triggers the USB Client Protocol

2. A Ground line - Which recv's power and triggers the USB Client Protocol (Provided software is loaded as USB Client)

3. A Dummy line - Which could also be a dummy line however I would mainly assume its a line that recv's the 0.24v and triggers the USB Host Protocol and enables USB OTG Technology that is only enabled through software.



Now with Hardware Conectivity is always Controlled by Software modules that are exploited or not exploited only to access direct control over the PSP, Coders are simply put off by any direct access to the physical enviroment of the PSP and so they use SDK's and modules mainly to access lines physically in the language. Its a set path for most developers which is seldom strayed from.

To an electronics major, it seems a bit more gray area. Yes there will be limitations in the PSP's Hardware access located in the EEPROM (processor's instruction set) however the most basic elements exists such as direct access to the PSP's Video Controller, or Direct/Indirect access to the IO System to access the memory stick.

With the PSP theres always direct access to Hardware as well as indirect access to hardware depending on how you have access to the kernel. Since the kernel is not necissarly an interpreter of each instruction set and has elements that can directly access each element in the PSP such as keyinputs and battery access. Its fairly easy to say that the PSP should have access to the USB Port located on the device itself.

With any new idea there will be people to disprove your theories until you make working theories that show what you mean and how it is done. Until then its magic or implausable.

Due to the direct nature of the device the PSP there will however be limitations to device controlled access, such as 1-1 ratio of the USB Controller. Which would mean that the USB Port could only handle direct access to the device which would mean you could not use a USB HUB or support more than one device. But thats also a theory which means I could be wrong.

But dont debunk this theory. Work on modules yourself to directly access the device. You might be surprised and stumble onto direct access to the USB Device and be able to build your own drivers for anything that your heart desires!
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

If you think it definitely has OTG capabilities then go ahead and write that driver and build that interface which proves beyond doubt that it does. Have you proved that the camera etc are devices and not hosts? Anyway the theories against it supporting OTG are:

1) Cost isn't an issue, it might cost more to engineer a OTG setup than not, this reduces the cost of the base unit but yes increases the cost of accessories which can absorb such things. In the end Sony would be looking at it like this, for every 10 PSPs we sell we might only sell one camera therefore it makes more sense to not increase the cost of the base unit unnecessarily. The OTG part would have to be less than 10 times the extra cost per unit than make a single host on an accessory and as said if someone is going to buy a camera what does it matter if you stick on an extra couple of dollars they will buy it anyway.

2) OTG specifies a dual A/B port which the PSP does not have, The bus enumeration relies on the 5th pin of that connector being pulled to GND when connected to a mini-A port. Now this doesn't completely rule out OTG support but it makes it less likely. The USB org have been known for being sticklers for stupid requirements such as requiring gray or white usb cables.

3) Power for the device comes from the holes next to the port, if it was OTG these would not be required. Of course without the A/B connector it can not know whether it is a A or B device anyway so it makes sense that it would not be able to supply the 5v line but then would it not have been simpler to just put on the A/B connector and be done with it. Otherwise it is some conspiracy theory that they did it to make it harder for 3rd parties to make arbitrary accessories but as you would need to have a driver on the system then the best you will get is clone devices where it matters little how the device connects. And if you think that it could have been exploited by homebrew, I am sure that was not even a consideration in Sony's mind that it could end up being used that way.

You call 0.24V a voltage, you couldn't power much with 0.24V nor sense alot above the noise floor anyway. If it was a signaling line it would likely be pulled to ground when not in use.

The simplest way of 100% determining whether it supports OTG would be to take an accessory device, wire up a simple USB device connector onto it, power up the pins with 5V from a bench and see if it enumerates on the PC. At least try that before spouting off...
romero126
Posts: 200
Joined: Sat Dec 24, 2005 2:42 pm

Post by romero126 »

I agree with everything except for one argument.

Cost is always an issue. Regardless of this fact I find that USB Support Can be a possibility if we can bypass direct checks for the USB Controller, which would enable the 3.5v to come out of the rail on the seperate holes arround the USB. Regardless it should be able to operate simple input devices such as keyboards once the capability is unlocked.
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

Trust me, it is amazing what lengths a company will go to to knock a few cents off their hardware.

Anyway your argument is a bit of a straw man if you think about it. Without the proper connector it is probably a bad idea to drive any wire on the USB connector at any point. OTG is designed to work in a fashion which at least ensures at the point of connection it will only work one way. It might later negotiate who should really be host once the connection has been made but it shouldn't do something unexpected otherwise. This is most certainly the case with the PSP. If it was to assert its hostness trouble "might" ensue.
romero126
Posts: 200
Joined: Sat Dec 24, 2005 2:42 pm

Post by romero126 »

Absolutly agreed, however there is always some failsafe that can be put in to make shure hardware is the way it is supposed to be. Like a volage limitor that waits 1 sec before providing any power and any data connectivity to the device. So the PSP knows that this is a OTG device.

Also if you havnt noticed by playing with the USB Port on the PSP OTG has a 5 wire option. One of which is a signifier that this device is using the HOST Stack, Which is why the 0.24v on the dummy wire is distributed across the line. Because it always is supposed to ground out. Now if it doesnt ground it.. It signifies that the USB Device is in Host Mode so that there is always a way to differentiate between the two options.

Now if the rail recv's power in an incorrect way the PSP Shuts off as a failsafe to not destroy the main processors transisters resulting in a power strike on the PSP.

Such failsafe is also on the CPU if Attached incorrectly will shut down the USB PORT. Only one drawback to this method is that if you cross a data wire with a voltage supply wire you WILL DESTROY THINGS!

As a result there should be some sort of leway between the hardware portion and the software portion of the PSP, Im not saying we should bypass such failsafes but leave them intact and use the data ports to negotiate between the Host protocol and the Client Side.
User avatar
dot_blank
Posts: 498
Joined: Wed Sep 28, 2005 8:47 am
Location: Brasil

Post by dot_blank »

I Take it you have a proper oscilloscope and logic tool :)
cuz arent you worried of BURNING your psp into FLAMES

trust it has happened to me :)
10011011 00101010 11010111 10001001 10111010
romero126
Posts: 200
Joined: Sat Dec 24, 2005 2:42 pm

Post by romero126 »

As long as your not directly crossing wires deliberatly you can always use a voltimeter with the fuzed function on it so it never sends out voltage to the wrong port.

Now if your silly you can burn your PSP into flames however im not really worried about it since I plan on using controlled access from the PSP to watch how voltage is flowing as well as an option to test resistance by using the amperage option on the voltimeter.

Plus rule number 1. NEVER RUN POWER DIRECTLY TO THE LEADS THAT RUN DIRECTLY INTO THE PSP. I would rather blow a Fuse than to damage the processor directly.
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

Show me the code! Show me the code! etc.... ;)
romero126
Posts: 200
Joined: Sat Dec 24, 2005 2:42 pm

Post by romero126 »

Since I dont want to tear up my PSP Right away What im going to have to do is a hardware hack. Once thats completed Ill definatly have some code.
hlide
Posts: 739
Joined: Sun Sep 10, 2006 2:31 am

Post by hlide »

TyRaNiD wrote:Trust me, it is amazing what lengths a company will go to to knock a few cents off their hardware.
I totally agree with this comment, I worked at a company which would try to reduce the cost even it is only for 0.5 $.
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

hlide wrote:
TyRaNiD wrote:Trust me, it is amazing what lengths a company will go to to knock a few cents off their hardware.
I totally agree with this comment, I worked at a company which would try to reduce the cost even it is only for 0.5 $.
And then the execs are so happy they give themselves million dollar bonuses that completely obliterate whatever money they saved.
cory1492
Posts: 216
Joined: Fri Dec 10, 2004 1:49 pm

Post by cory1492 »

Just something trivial to add to the initial topic, but may be useful if someone here knows much more about USB than me and intends to pursue investigation - if the usb signal between the camera and psp is passed through a USB bus switch (here) the camera (or GPS I'd assume) no longer functions properly with the PSP (the PSP says to insert a compatible camera after the cam's power light flashes a few times). This is with the bus set always on, and signal forced through a particular line pair. PSP USB disk on PC works fine through the same connect.

I am not entirely sure the accessories are even working on a "regular" USB signal, but perhaps some other 2 line serial method that is lower than the threshold of the switch's ability? It indeed might be a good first step to see if a PC can see a PSP device at all if no one has done that yet.
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

Why would you need a hardware hack anyway? Surely if as you claim the the USB port can go into host mode then it must be accessible from the outside (otherwise what would be the point) therefore can you not just cut up a usb cable and wire off that?
romero126
Posts: 200
Joined: Sat Dec 24, 2005 2:42 pm

Post by romero126 »

Regardless You would have to have a combination of Hardware Hacking and USB Hacking to take full advange of this combination. Since the MINI usb is set up differently you would have to build at bare minimum a crossover USB Mini cable. Otherwise you could cross a wire incorrectly and destroy the verry thing you wish to exploit. Just because you can possibly put it into host mode doesnt necissarly mean it will run without the proper hardware.

Becides Tyranid its not like im going to hardware hack the PSP But more along the lines of exploiting the USB on the PSP to give me optimum gain in this matter.

Chopping up a USB cable is technically a Hardware Hack. Just FYI :P
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

WTF!!! I think you have completely lost the plot. If the PSP uses OTG then you get a pure host controller which will mean the cable is straight through, you can probably buy a non-standard usb cable with two B plug on its and use that. You might have to switch on OTG mode in software (assuming it exists at all).

And really? Cutting up a USB cable is a hardware hack. Sure in its purest sense, but considering you said you were not going to do this just now cause you didn't want to cut up your PSP I think you know what I meant.

You have yet to provide any proof of anything, nothing but pure speculation and meaningless probing of some random wires.
everlasting
Posts: 41
Joined: Mon Mar 19, 2007 6:27 pm

Post by everlasting »

I don't know if what i am going to say is of some help as long as i don't even know how usb protocols are.
The thing is that about a week ago i was testing the skype app in the new firmware for the psp slim and i didn't realized that i had the psp connected to the computer with the usb, so all of a sudden the computer showed a message saying that it needed to continue under low graphics mode, i accept it, and then it started to search for three drivers:
-one that i can't remember,
-other that was like "usb mic"
-the last that was "usb accesory"
it installed them except the last one which the computer wasn't able to find a proper driver.
That was all, i don't know if this is useful but i was quite surprised.
Post Reply